sessionpipe-core 0.7.0 → 0.10.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 +1 -1
- package/dist/control.js +172 -12
- package/dist/control.js.map +2 -2
- package/dist/index.js +1508 -431
- package/dist/index.js.map +4 -4
- package/dist/schema/v1.d.ts +405 -104
- package/dist/schema/v1.d.ts.map +1 -1
- package/dist/schema.js +174 -28
- package/dist/schema.js.map +2 -2
- package/dist/service.js +155 -0
- package/dist/service.js.map +7 -0
- package/dist/src/adapters/acp-control.d.ts +87 -0
- package/dist/src/adapters/acp-control.d.ts.map +1 -0
- package/dist/src/adapters/antigravity-control.d.ts +15 -5
- package/dist/src/adapters/antigravity-control.d.ts.map +1 -1
- package/dist/src/adapters/antigravity.d.ts +1 -2
- package/dist/src/adapters/antigravity.d.ts.map +1 -1
- package/dist/src/adapters/claude-code-control.d.ts +41 -4
- package/dist/src/adapters/claude-code-control.d.ts.map +1 -1
- package/dist/src/adapters/claude-code.d.ts +10 -0
- package/dist/src/adapters/claude-code.d.ts.map +1 -1
- package/dist/src/adapters/claude-shaped.d.ts.map +1 -1
- package/dist/src/adapters/codex-config.d.ts +2 -2
- package/dist/src/adapters/codex-config.d.ts.map +1 -1
- package/dist/src/adapters/codex-control.d.ts +23 -7
- package/dist/src/adapters/codex-control.d.ts.map +1 -1
- package/dist/src/adapters/codex-rollout.d.ts +8 -0
- package/dist/src/adapters/codex-rollout.d.ts.map +1 -0
- package/dist/src/adapters/codex.d.ts +1 -1
- package/dist/src/adapters/codex.d.ts.map +1 -1
- package/dist/src/adapters/devin.d.ts +32 -0
- package/dist/src/adapters/devin.d.ts.map +1 -0
- package/dist/src/adapters/gemini-cli.d.ts.map +1 -1
- package/dist/src/adapters/headless.d.ts +4 -1
- package/dist/src/adapters/headless.d.ts.map +1 -1
- package/dist/src/adapters/index.d.ts +11 -3
- package/dist/src/adapters/index.d.ts.map +1 -1
- package/dist/src/adapters/types.d.ts +9 -1
- package/dist/src/adapters/types.d.ts.map +1 -1
- package/dist/src/control/verify.d.ts +96 -13
- package/dist/src/control/verify.d.ts.map +1 -1
- package/dist/src/index.d.ts +4 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/launched-by.d.ts +12 -0
- package/dist/src/launched-by.d.ts.map +1 -0
- package/dist/src/outbox.d.ts +13 -2
- package/dist/src/outbox.d.ts.map +1 -1
- package/dist/src/paths.d.ts +7 -1
- package/dist/src/paths.d.ts.map +1 -1
- package/dist/src/privacy/filter.d.ts +2 -0
- package/dist/src/privacy/filter.d.ts.map +1 -1
- package/dist/src/privacy/index.d.ts +1 -1
- package/dist/src/privacy/index.d.ts.map +1 -1
- package/dist/src/readers/files.d.ts.map +1 -1
- package/dist/src/readers/git.d.ts.map +1 -1
- package/dist/src/readers/sqlite.d.ts +23 -0
- package/dist/src/readers/sqlite.d.ts.map +1 -0
- package/dist/src/readers/transcripts.d.ts +5 -2
- package/dist/src/readers/transcripts.d.ts.map +1 -1
- package/dist/src/service/index.d.ts +83 -0
- package/dist/src/service/index.d.ts.map +1 -0
- package/dist/src/short-id.d.ts +2 -0
- package/dist/src/short-id.d.ts.map +1 -0
- package/dist/src/sinks/file.d.ts.map +1 -1
- package/dist/src/sinks/stdout.d.ts.map +1 -1
- package/dist/src/types.d.ts +1 -0
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/ulid.d.ts.map +1 -1
- package/dist/src/version.d.ts +39 -0
- package/dist/src/version.d.ts.map +1 -0
- package/dist/version.js +75 -0
- package/dist/version.js.map +7 -0
- package/package.json +11 -3
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Adapter, TranscriptRead } from "./types.js";
|
|
2
|
+
/** The eight event names Devin accepts. One it does not know makes it drop the whole
|
|
3
|
+
* hooks file, so this list is exact, not a superset — see devin.test.ts. */
|
|
4
|
+
export declare const DEVIN_EVENTS: readonly ["SessionStart", "UserPromptSubmit", "PreToolUse", "PostToolUse", "PermissionRequest", "Stop", "PostCompaction", "SessionEnd"];
|
|
5
|
+
/** The first `hooks` key in the file that Devin does not accept, if there is one.
|
|
6
|
+
* One such key disables every hook in the file, ours and any other tool's. */
|
|
7
|
+
export declare function foreignEvent(file: string): string | undefined;
|
|
8
|
+
/** `~/.config/devin`, `$XDG_CONFIG_HOME/devin`, or `%APPDATA%\devin`. */
|
|
9
|
+
export declare const devinConfigDir: (env?: NodeJS.ProcessEnv) => string;
|
|
10
|
+
/** `~/.local/share/devin/cli`, `$XDG_DATA_HOME/devin/cli`, or `%APPDATA%\devin\cli`. */
|
|
11
|
+
export declare const devinDataDir: (env?: NodeJS.ProcessEnv) => string;
|
|
12
|
+
export declare const devin: Adapter;
|
|
13
|
+
/** `<database>#<session id>`: readTranscript is given a file, and Devin keeps every
|
|
14
|
+
* session in one database, so the session has to ride in the string. */
|
|
15
|
+
export declare const transcriptRef: (db: string, session: string) => string;
|
|
16
|
+
export declare function splitRef(ref: string | undefined): {
|
|
17
|
+
db: string;
|
|
18
|
+
session: string;
|
|
19
|
+
} | null;
|
|
20
|
+
export declare const CHAIN_SQL = "WITH RECURSIVE chain(node_id, parent_node_id, chat_message, created_at) AS (\n SELECT node_id, parent_node_id, chat_message, created_at FROM message_nodes\n WHERE session_id = ? AND node_id = (SELECT main_chain_id FROM sessions WHERE id = ?)\n UNION ALL\n SELECT m.node_id, m.parent_node_id, m.chat_message, m.created_at FROM message_nodes m\n JOIN chain c ON m.node_id = c.parent_node_id AND m.session_id = ? AND m.node_id >= ?\n)\nSELECT node_id, chat_message, created_at FROM chain ORDER BY node_id DESC LIMIT 4000";
|
|
21
|
+
/** The canonical chain as turns. `node_id` is the cursor: it rises along the chain and
|
|
22
|
+
* is stable across a resume, so a later read starts where the last one stopped.
|
|
23
|
+
* `role: "system"` is Cognition's own prompt (and the skills manifest, and the
|
|
24
|
+
* generated system_info block), never the person's words — it is skipped at every
|
|
25
|
+
* tier, as is `role: "tool"`. */
|
|
26
|
+
export declare function readDevinChain(db: string, session: string, fromLine: number): TranscriptRead;
|
|
27
|
+
/** `<data dir>/_versions/current` is a symlink to the running version's folder. */
|
|
28
|
+
export declare function devinVersion(env?: NodeJS.ProcessEnv): string | undefined;
|
|
29
|
+
/** The organisation the CLI is signed in to, from the user config — the only account id
|
|
30
|
+
* Devin keeps in a plain local file. Never the email, and never credentials.toml. */
|
|
31
|
+
export declare function devinAccount(env?: NodeJS.ProcessEnv): string | undefined;
|
|
32
|
+
//# sourceMappingURL=devin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"devin.d.ts","sourceRoot":"","sources":["../../../src/adapters/devin.ts"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EACV,OAAO,EAMP,cAAc,EACf,MAAM,YAAY,CAAC;AAGpB;6EAC6E;AAC7E,eAAO,MAAM,YAAY,YACvB,cAAc,EACd,kBAAkB,EAClB,YAAY,EACZ,aAAa,EACb,mBAAmB,EACnB,MAAM,EACN,gBAAgB,EAChB,YAAY,CACJ,CAAC;AAWX;+EAC+E;AAC/E,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAK7D;AAID,yEAAyE;AACzE,eAAO,MAAM,cAAc,SAAS,MAAM,CAAC,UAAU,KAAiB,MAGY,CAAC;AAEnF,wFAAwF;AACxF,eAAO,MAAM,YAAY,SAAS,MAAM,CAAC,UAAU,KAAiB,MAG2B,CAAC;AAoBhG,eAAO,MAAM,KAAK,EAAE,OAmJnB,CAAC;AASF;yEACyE;AACzE,eAAO,MAAM,aAAa,OAAQ,MAAM,WAAW,MAAM,KAAG,MAA4B,CAAC;AACzF,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAOxF;AAYD,eAAO,MAAM,SAAS,khBAOyE,CAAC;AAyChG;;;;kCAIkC;AAClC,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,cAAc,CAwC5F;AAED,mFAAmF;AACnF,wBAAgB,YAAY,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,GAAG,SAAS,CAQrF;AAED;sFACsF;AACtF,wBAAgB,YAAY,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,GAAG,SAAS,CAIrF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gemini-cli.d.ts","sourceRoot":"","sources":["../../../src/adapters/gemini-cli.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,OAAO,EAAuD,MAAM,YAAY,CAAC;AAG/F,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"gemini-cli.d.ts","sourceRoot":"","sources":["../../../src/adapters/gemini-cli.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,OAAO,EAAuD,MAAM,YAAY,CAAC;AAG/F,eAAO,MAAM,aAAa,YACxB,cAAc,EACd,aAAa,EACb,YAAY,EACZ,WAAW,EACX,cAAc,EACd,YAAY,EACZ,aAAa,EACb,YAAY,CACJ,CAAC;AAOX,wFAAwF;AACxF,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,MAAM,GAAG;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CA2B1F;AAED,eAAO,MAAM,SAAS,EAAE,OAiJvB,CAAC"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
/** A headless turn still running after this is stopped. */
|
|
2
2
|
export declare const JOB_TIMEOUT_MS: number;
|
|
3
|
-
|
|
3
|
+
/** How a turn the daemon runs may act (spec/CONTROL.md §2), chosen at the machine's own
|
|
4
|
+
* terminal: safe, the harness's auto mode, or inherit (no permission flag, so the
|
|
5
|
+
* harness starts in its own default on this machine). */
|
|
6
|
+
export type Mode = "safe" | "auto" | "inherit";
|
|
4
7
|
export declare function isExe(p: string): boolean;
|
|
5
8
|
/** A harness's CLI: the override the person set (`SESSIONPIPE_<NAME>`), else the first
|
|
6
9
|
* of `names` on PATH, else the first of `dirs` that holds one. A launchd or systemd
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"headless.d.ts","sourceRoot":"","sources":["../../../src/adapters/headless.ts"],"names":[],"mappings":"AASA,2DAA2D;AAC3D,eAAO,MAAM,cAAc,QAAc,CAAC;AAG1C,MAAM,MAAM,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"headless.d.ts","sourceRoot":"","sources":["../../../src/adapters/headless.ts"],"names":[],"mappings":"AASA,2DAA2D;AAC3D,eAAO,MAAM,cAAc,QAAc,CAAC;AAG1C;;0DAE0D;AAC1D,MAAM,MAAM,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;AAE/C,wBAAgB,KAAK,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAQxC;AAED;;0FAE0F;AAC1F,wBAAgB,UAAU,CAAC,CAAC,EAAE;IAC5B,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;CACzB,GAAG,MAAM,GAAG,IAAI,CAQhB;AAED;;0CAE0C;AAC1C,wBAAgB,MAAM,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAAC,UAAU,CAE9E;AAED;oEACoE;AACpE,MAAM,WAAW,KAAK;IACpB,QAAQ,EAAE,OAAO,GAAG,IAAI,CAAC;IACzB,0EAA0E;IAC1E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,SAAS;IACxB,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,EAAE,CAAC,SAAI,GAAG,MAAM,CAOpE;AAED,iFAAiF;AACjF,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAGjE;AAED,oEAAoE;AACpE,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,GAAG,MAAM,GAAG,IAAI,CAIvE"}
|
|
@@ -1,19 +1,27 @@
|
|
|
1
1
|
import { antigravity } from "./antigravity.js";
|
|
2
2
|
import { claudeCode } from "./claude-code.js";
|
|
3
3
|
import { codex } from "./codex.js";
|
|
4
|
+
import { devin } from "./devin.js";
|
|
4
5
|
import { geminiCli } from "./gemini-cli.js";
|
|
5
6
|
import type { Adapter } from "./types.js";
|
|
6
7
|
export declare const ADAPTERS: readonly Adapter[];
|
|
7
8
|
export declare const adapterByName: (name: string) => Adapter | undefined;
|
|
9
|
+
export * as acpControl from "./acp-control.js";
|
|
8
10
|
export { AG_STALE_PRETOOL, antigravityAnswer } from "./antigravity.js";
|
|
9
11
|
export * as antigravityControl from "./antigravity-control.js";
|
|
10
|
-
export { claudeDirs } from "./claude-code.js";
|
|
12
|
+
export { claudeAccounts, claudeDirs, notClaudeCode } from "./claude-code.js";
|
|
11
13
|
export * as claudeControl from "./claude-code-control.js";
|
|
12
14
|
export * as codexControl from "./codex-control.js";
|
|
15
|
+
export { DEVIN_EVENTS, devinConfigDir, devinDataDir, readDevinChain } from "./devin.js";
|
|
13
16
|
export { deniedNote, JOB_TIMEOUT_MS, jobEnv, type Login, type Reading, type RunOptions, type RunResult, runHeadless, } from "./headless.js";
|
|
17
|
+
/** How many harnesses a pairing request or a hello lists at most (control-pair.json,
|
|
18
|
+
* control-hello.json). */
|
|
19
|
+
export declare const HELLO_HARNESSES_MAX = 20;
|
|
14
20
|
/** The harnesses a control daemon here can drive headlessly (CONTROL.md §6): each whose
|
|
15
|
-
* CLI is installed on this machine. What `control pair`
|
|
21
|
+
* CLI is installed on this machine, and every ACP agent that is. What `control pair`
|
|
22
|
+
* and every hello advertise: the three with their own drivers first, then the ACP
|
|
23
|
+
* agents in the registry's order, at most HELLO_HARNESSES_MAX of them. */
|
|
16
24
|
export declare function drivableHarnesses(env?: NodeJS.ProcessEnv): string[];
|
|
17
25
|
export type { Adapter, AdapterEvent, BackfillRow, FactsState, HookCommand, HookInput, HookResult, InstallReport, SessionFacts, TranscriptRead, Turn, } from "./types.js";
|
|
18
|
-
export { antigravity, claudeCode, codex, geminiCli };
|
|
26
|
+
export { antigravity, claudeCode, codex, devin, geminiCli };
|
|
19
27
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/adapters/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/adapters/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C,eAAO,MAAM,QAAQ,EAAE,SAAS,OAAO,EAAuD,CAAC;AAC/F,eAAO,MAAM,aAAa,SAAU,MAAM,KAAG,OAAO,GAAG,SAAkD,CAAC;AAC1G,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACvE,OAAO,KAAK,kBAAkB,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC7E,OAAO,KAAK,aAAa,MAAM,0BAA0B,CAAC;AAC1D,OAAO,KAAK,YAAY,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACxF,OAAO,EACL,UAAU,EACV,cAAc,EACd,MAAM,EACN,KAAK,KAAK,EACV,KAAK,OAAO,EACZ,KAAK,UAAU,EACf,KAAK,SAAS,EACd,WAAW,GACZ,MAAM,eAAe,CAAC;AAEvB;2BAC2B;AAC3B,eAAO,MAAM,mBAAmB,KAAK,CAAC;AAEtC;;;2EAG2E;AAC3E,wBAAgB,iBAAiB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,EAAE,CAOhF;AACD,YAAY,EACV,OAAO,EACP,YAAY,EACZ,WAAW,EACX,UAAU,EACV,WAAW,EACX,SAAS,EACT,UAAU,EACV,aAAa,EACb,YAAY,EACZ,cAAc,EACd,IAAI,GACL,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -35,6 +35,11 @@ export interface TranscriptRead {
|
|
|
35
35
|
turns: Turn[];
|
|
36
36
|
/** The line the cursor may advance to once every turn is delivered. */
|
|
37
37
|
line: number;
|
|
38
|
+
/** A prompt after the last turn with no reply yet (a turn that just began). */
|
|
39
|
+
open?: {
|
|
40
|
+
user: string;
|
|
41
|
+
at: number;
|
|
42
|
+
};
|
|
38
43
|
}
|
|
39
44
|
export interface SessionFacts extends Partial<Session> {
|
|
40
45
|
first_ask?: string;
|
|
@@ -93,9 +98,12 @@ export interface Adapter {
|
|
|
93
98
|
installed(cmd: HookCommand, env?: NodeJS.ProcessEnv, opts?: InstallOptions): InstalledReport[];
|
|
94
99
|
fromHook(input: HookInput): HookResult | null;
|
|
95
100
|
readTranscript(file: string, fromLine: number): TranscriptRead;
|
|
101
|
+
/** `env` is the hook's own environment, not necessarily this process's: a job swept
|
|
102
|
+
* by a worker that a different harness's hook spawned has to resolve the harness's
|
|
103
|
+
* home from the job, the way `install` and `backfill` already do. */
|
|
96
104
|
facts(session: {
|
|
97
105
|
id: string;
|
|
98
|
-
} & Partial<Session>, transcript: string | undefined, hints: Record<string, unknown>, state: FactsState): SessionFacts;
|
|
106
|
+
} & Partial<Session>, transcript: string | undefined, hints: Record<string, unknown>, state: FactsState, env?: NodeJS.ProcessEnv): SessionFacts;
|
|
99
107
|
backfill(sinceMs: number, env?: NodeJS.ProcessEnv): BackfillRow[];
|
|
100
108
|
}
|
|
101
109
|
/** Small per-session memory the facts pass keeps under <state>/facts/. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/adapters/types.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C,MAAM,WAAW,SAAS;IACxB,qDAAqD;IACrD,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IACxC,GAAG,EAAE,MAAM,CAAC;CACb;AAED,iFAAiF;AACjF,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,yDAAyD;IACzD,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC3C,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,qEAAqE;IACrE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,wDAAwD;IACxD,MAAM,CAAC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AAE,GAAG,OAAO,CAAC,OAAO,CAAC,EAC1C,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,KAAK,EAAE,UAAU,EACjB,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,GACtB,YAAY,CAAC;IAChB,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,GAAG,WAAW,EAAE,CAAC;CACnE;AAED,0EAA0E;AAC1E,MAAM,WAAW,UAAU;IACzB,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/D,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;CAC9E"}
|
|
@@ -18,6 +18,33 @@ export declare const TEXT_MAX = 20000;
|
|
|
18
18
|
export declare const NOTE_MAX = 2000;
|
|
19
19
|
/** A grant string. */
|
|
20
20
|
export declare const GRANT_STR_MAX = 2000;
|
|
21
|
+
/** Attachments on a `start` or a `prompt` (CONTROL.md §3.1): at most this many files, */
|
|
22
|
+
export declare const FILES_MAX = 10;
|
|
23
|
+
/** each at most this many bytes, */
|
|
24
|
+
export declare const FILE_SIZE_MAX = 26214400;
|
|
25
|
+
/** together at most this many, */
|
|
26
|
+
export declare const FILES_TOTAL_MAX = 52428800;
|
|
27
|
+
/** with a name of at most this many characters (after NFC) */
|
|
28
|
+
export declare const FILE_NAME_MAX = 200;
|
|
29
|
+
/** and a media type of at most this many. */
|
|
30
|
+
export declare const FILE_TYPE_MAX = 100;
|
|
31
|
+
/** A start's `model` (CONTROL.md §3.1): at most this many characters, */
|
|
32
|
+
export declare const MODEL_MAX = 100;
|
|
33
|
+
/** in this alphabet, never starting with a dash, so it can never read as a flag. */
|
|
34
|
+
export declare const MODEL_RE: RegExp;
|
|
35
|
+
/** The levels a start may ask for (CONTROL.md §3.1), narrowest first. Closed: no level
|
|
36
|
+
* is wider than `auto`, and none turns a harness's approval off. */
|
|
37
|
+
export declare const START_PERMISSIONS: readonly ["read", "safe", "edits", "auto"];
|
|
38
|
+
export type StartPermission = (typeof START_PERMISSIONS)[number];
|
|
39
|
+
/** What a run is started with: a level, or `inherit` (CONTROL.md §2) — no permission
|
|
40
|
+
* flag at all, so the harness starts in its own default on the machine. Only a machine
|
|
41
|
+
* the person put in inherit mode runs that way; a command never names it. */
|
|
42
|
+
export type RunLevel = StartPermission | "inherit";
|
|
43
|
+
/** Where a level sits, narrowest (0) to widest; -1 for anything that isn't one. */
|
|
44
|
+
export declare const levelRank: (l: unknown) => number;
|
|
45
|
+
/** The narrower of two levels: what a later run of a session gets, its recorded level
|
|
46
|
+
* against what the machine's mode allows now. */
|
|
47
|
+
export declare const narrower: (a: StartPermission, b: StartPermission) => StartPermission;
|
|
21
48
|
export declare const COMMAND_TYPE = "sessionpipe.control";
|
|
22
49
|
export declare const GRANT_TYPE = "sessionpipe.grant";
|
|
23
50
|
export declare const CONTROL_KINDS: readonly ["prompt", "permission.answer", "cancel", "start", "key.add"];
|
|
@@ -27,11 +54,21 @@ export type ControlKind = (typeof CONTROL_KINDS)[number];
|
|
|
27
54
|
/** COSE algorithm ids a trusted key may use. */
|
|
28
55
|
export declare const ES256 = -7;
|
|
29
56
|
export declare const RS256 = -257;
|
|
30
|
-
/**
|
|
57
|
+
/** The kinds of key a machine may trust (CONTROL.md §2): a WebAuthn passkey, or a
|
|
58
|
+
* device key an app holds in hardware where it has no passkey to offer. */
|
|
59
|
+
export declare const KEY_TYPES: readonly ["passkey", "device"];
|
|
60
|
+
export type KeyType = (typeof KEY_TYPES)[number];
|
|
61
|
+
/** A key enrolled on the machine: a passkey's credential id, COSE alg and SPKI
|
|
62
|
+
* (base64url); a device key also says so (`type`), and what its app declared about
|
|
63
|
+
* it (`store`, `uv`). The machine verifies by its own record, never by a message. */
|
|
31
64
|
export interface TrustedKey {
|
|
32
65
|
id: string;
|
|
33
66
|
alg: number;
|
|
34
67
|
spki: string;
|
|
68
|
+
/** Present only on a device key (CONTROL.md §2 "Device keys"). */
|
|
69
|
+
type?: "device";
|
|
70
|
+
store?: "hardware";
|
|
71
|
+
uv?: "each-use";
|
|
35
72
|
}
|
|
36
73
|
/** A WebAuthn assertion: credential id, authenticatorData, clientDataJSON, signature (base64url). */
|
|
37
74
|
export interface Assertion {
|
|
@@ -40,16 +77,25 @@ export interface Assertion {
|
|
|
40
77
|
cd: string;
|
|
41
78
|
sig: string;
|
|
42
79
|
}
|
|
80
|
+
/** A device key's signature (CONTROL.md §3.2): its id and 64 bytes r‖s over deviceMessage(). */
|
|
81
|
+
export interface DeviceSignature {
|
|
82
|
+
cred: string;
|
|
83
|
+
sig: string;
|
|
84
|
+
}
|
|
43
85
|
/** The day's grant: a passkey's assertion over sha256(str), where str names the day key. */
|
|
44
86
|
export interface GrantBundle extends Assertion {
|
|
45
87
|
str: string;
|
|
46
88
|
}
|
|
89
|
+
/** The day's grant from a device key: its signature over deviceMessage("grant", rp, sha256(str)). */
|
|
90
|
+
export interface DeviceGrant extends DeviceSignature {
|
|
91
|
+
str: string;
|
|
92
|
+
}
|
|
47
93
|
/** What a receiver carries for one command (control.json minus the receiver's envelope). */
|
|
48
94
|
export interface SignedCommand {
|
|
49
95
|
cmd: string;
|
|
50
96
|
csig?: string | null;
|
|
51
|
-
grant?: GrantBundle | null;
|
|
52
|
-
confirm?: Assertion | null;
|
|
97
|
+
grant?: GrantBundle | DeviceGrant | null;
|
|
98
|
+
confirm?: Assertion | DeviceSignature | null;
|
|
53
99
|
}
|
|
54
100
|
export interface Grant {
|
|
55
101
|
v: 1;
|
|
@@ -59,6 +105,17 @@ export interface Grant {
|
|
|
59
105
|
exp: number;
|
|
60
106
|
rp: string;
|
|
61
107
|
}
|
|
108
|
+
/** One file attached to a `start`: the bytes live on the receiver, named by their hash. */
|
|
109
|
+
export interface ControlFile {
|
|
110
|
+
/** The file name the machine writes (NFC). */
|
|
111
|
+
name: string;
|
|
112
|
+
/** Media type, `type/subtype`. */
|
|
113
|
+
type: string;
|
|
114
|
+
/** Bytes. */
|
|
115
|
+
size: number;
|
|
116
|
+
/** SHA-256 of the bytes, base64url without padding (43 characters). */
|
|
117
|
+
sha256: string;
|
|
118
|
+
}
|
|
62
119
|
export interface ControlCommand {
|
|
63
120
|
v: 1;
|
|
64
121
|
t: typeof COMMAND_TYPE;
|
|
@@ -71,14 +128,17 @@ export interface ControlCommand {
|
|
|
71
128
|
decision?: "allow" | "deny";
|
|
72
129
|
note?: string;
|
|
73
130
|
cwd?: string;
|
|
74
|
-
/** key.add only: the
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
alg: -7 | -257;
|
|
78
|
-
spki: string;
|
|
79
|
-
};
|
|
131
|
+
/** key.add only: the key to trust from now on, as the receiver holds it (a passkey,
|
|
132
|
+
* or a device key with its `type`, `store` and `uv`). */
|
|
133
|
+
key?: TrustedKey;
|
|
80
134
|
/** key.add only: what the person calls the device ("iPhone"), for `control keys`. */
|
|
81
135
|
name?: string;
|
|
136
|
+
/** start, prompt: files to download, verify and write into the session's folder. */
|
|
137
|
+
files?: ControlFile[];
|
|
138
|
+
/** start only: the level the new session runs at (never above the machine's mode). */
|
|
139
|
+
permission?: StartPermission;
|
|
140
|
+
/** start only: the model the harness runs, as the harness names it. */
|
|
141
|
+
model?: string;
|
|
82
142
|
nonce: string;
|
|
83
143
|
iat: number;
|
|
84
144
|
}
|
|
@@ -115,11 +175,20 @@ export declare function b64url(bytes: Uint8Array | ArrayBuffer): string;
|
|
|
115
175
|
/** base64url without padding, strictly; null for anything else. */
|
|
116
176
|
export declare function fromB64url(s: unknown): Uint8Array | null;
|
|
117
177
|
export declare function sha256(data: string | Uint8Array): Promise<Uint8Array>;
|
|
178
|
+
/** Equal, compared whole: a mismatch costs the same as a match. */
|
|
179
|
+
export declare function sameBytes(a: Uint8Array, b: Uint8Array): boolean;
|
|
118
180
|
/** A DER ECDSA signature (what WebAuthn returns) as the 64-byte r‖s WebCrypto verifies.
|
|
119
181
|
* Strict: every length must match the bytes, so one signature has one encoding (a
|
|
120
182
|
* P-256 signature is at most 72 bytes, so the short length form is the only one). */
|
|
121
183
|
export declare function derToRaw(der: Uint8Array): Uint8Array | null;
|
|
122
|
-
/**
|
|
184
|
+
/** The only fields a device signature has (`str` only in a grant). */
|
|
185
|
+
export declare const DEVICE_SIG_FIELDS: readonly ["cred", "sig", "str"];
|
|
186
|
+
/** A device key's id: the SHA-256 of its SPKI bytes, base64url without padding. */
|
|
187
|
+
export declare function deviceKeyId(spki: string): Promise<string>;
|
|
188
|
+
/** Can this key be enrolled at all? A machine refuses to trust a key it could never
|
|
189
|
+
* verify with. The key's fields are closed: a passkey is `id`, `alg`, `spki` and
|
|
190
|
+
* nothing else; a device key adds exactly `type`, `store` and `uv` (CONTROL.md §2),
|
|
191
|
+
* so a kind added later is refused by every machine that predates it. */
|
|
123
192
|
export declare function keyUsable(key: TrustedKey): Promise<boolean>;
|
|
124
193
|
/** A WebAuthn origin a key may have been used from: https on the rp id or a subdomain;
|
|
125
194
|
* for rp id `localhost`, plain http on any port too. A bare origin, as a browser writes it. */
|
|
@@ -130,8 +199,18 @@ type Check = {
|
|
|
130
199
|
ok: false;
|
|
131
200
|
why: string;
|
|
132
201
|
};
|
|
133
|
-
/**
|
|
134
|
-
export declare
|
|
202
|
+
/** The first line of every message a device key signs. */
|
|
203
|
+
export declare const DEVICE_CONTEXT = "sessionpipe.device.v1";
|
|
204
|
+
/** What a device signature is for: one use can never answer for another. */
|
|
205
|
+
export type DevicePurpose = "grant" | "confirm" | "pair";
|
|
206
|
+
/** The exact bytes a device key signs: the context, the purpose, the rp id as the
|
|
207
|
+
* machine recorded it, and the base64url (no padding) of the 32-byte challenge a
|
|
208
|
+
* passkey would sign for that purpose, joined by single line feeds, none at the end. */
|
|
209
|
+
export declare function deviceMessage(purpose: DevicePurpose, rpId: string, challenge: Uint8Array): Uint8Array;
|
|
210
|
+
/** One signature over `challenge` by `key`, chosen from the machine's own record of
|
|
211
|
+
* the key, never from the signature: a device key's signature for `purpose`
|
|
212
|
+
* (CONTROL.md §3.2), or a passkey assertion made by a verified person. */
|
|
213
|
+
export declare function verifyAssertion(challenge: Uint8Array, a: Assertion | DeviceSignature | null | undefined, key: TrustedKey, rpId: string, purpose: DevicePurpose): Promise<Check>;
|
|
135
214
|
/** What a passkey signs to enroll on a machine: bound to that machine and that pairing code. */
|
|
136
215
|
export declare function pairChallenge(machine: string, code: string): Promise<Uint8Array>;
|
|
137
216
|
/** The enrollment proof: the new key's assertion over pairChallenge(machine, code).
|
|
@@ -140,7 +219,7 @@ export declare function verifyEnrollment(o: {
|
|
|
140
219
|
machine: string;
|
|
141
220
|
code: string;
|
|
142
221
|
key: TrustedKey;
|
|
143
|
-
proof: Assertion;
|
|
222
|
+
proof: Assertion | DeviceSignature;
|
|
144
223
|
rpId: string;
|
|
145
224
|
}): Promise<Check>;
|
|
146
225
|
type Parsed = {
|
|
@@ -160,6 +239,10 @@ export declare function parseSessionRef(ref: unknown): {
|
|
|
160
239
|
} | null;
|
|
161
240
|
/** Read the command's fields from the exact string. Structure only; no clock, no keys. */
|
|
162
241
|
export declare function parseCommand(str: unknown): Parsed;
|
|
242
|
+
/** Why a start's or a prompt's `files` breaks the rules (CONTROL.md §3.1), or null when it doesn't. */
|
|
243
|
+
export declare function filesProblem(files: unknown): string | null;
|
|
244
|
+
/** A `start`'s `cwd` under the machine's home: `~` alone, or `~/…` (`~\…`). Never `~user`. */
|
|
245
|
+
export declare const HOME_RELATIVE_RE: RegExp;
|
|
163
246
|
/** The grant's fields, read from its exact string. */
|
|
164
247
|
export declare function parseGrant(str: unknown, rpId: string): {
|
|
165
248
|
ok: true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../../src/control/verify.ts"],"names":[],"mappings":"AAYA,mEAAmE;AACnE,eAAO,MAAM,YAAY,QAAgB,CAAC;AAC1C,4EAA4E;AAC5E,eAAO,MAAM,OAAO,QAAa,CAAC;AAClC;qEACqE;AACrE,eAAO,MAAM,kBAAkB,QAAgB,CAAC;AAChD;mCACmC;AACnC,eAAO,MAAM,mBAAmB,QAAc,CAAC;AAC/C,sFAAsF;AACtF,eAAO,MAAM,YAAY,QAAgB,CAAC;AAC1C,6EAA6E;AAC7E,eAAO,MAAM,OAAO,QAAS,CAAC;AAC9B,sCAAsC;AACtC,eAAO,MAAM,QAAQ,QAAS,CAAC;AAC/B,kCAAkC;AAClC,eAAO,MAAM,QAAQ,OAAQ,CAAC;AAC9B,sBAAsB;AACtB,eAAO,MAAM,aAAa,OAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../../src/control/verify.ts"],"names":[],"mappings":"AAYA,mEAAmE;AACnE,eAAO,MAAM,YAAY,QAAgB,CAAC;AAC1C,4EAA4E;AAC5E,eAAO,MAAM,OAAO,QAAa,CAAC;AAClC;qEACqE;AACrE,eAAO,MAAM,kBAAkB,QAAgB,CAAC;AAChD;mCACmC;AACnC,eAAO,MAAM,mBAAmB,QAAc,CAAC;AAC/C,sFAAsF;AACtF,eAAO,MAAM,YAAY,QAAgB,CAAC;AAC1C,6EAA6E;AAC7E,eAAO,MAAM,OAAO,QAAS,CAAC;AAC9B,sCAAsC;AACtC,eAAO,MAAM,QAAQ,QAAS,CAAC;AAC/B,kCAAkC;AAClC,eAAO,MAAM,QAAQ,OAAQ,CAAC;AAC9B,sBAAsB;AACtB,eAAO,MAAM,aAAa,OAAQ,CAAC;AACnC,yFAAyF;AACzF,eAAO,MAAM,SAAS,KAAK,CAAC;AAC5B,oCAAoC;AACpC,eAAO,MAAM,aAAa,WAAa,CAAC;AACxC,kCAAkC;AAClC,eAAO,MAAM,eAAe,WAAa,CAAC;AAC1C,8DAA8D;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AAA;CAAE,CAAC;AAQhG,gFAAgF;AAChF,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAIhE;AAED,qEAAqE;AACrE,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAOpF;AAED,0FAA0F;AAC1F,wBAAgB,YAAY,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAmGjD;AAED,uGAAuG;AACvG,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAsB1D;AAYD,8FAA8F;AAC9F,eAAO,MAAM,gBAAgB,QAAkB,CAAC;AAMhD,sDAAsD;AACtD,wBAAgB,UAAU,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,KAAK,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAiB9G;AAgBD;;;;;;;GAOG;AACH,wBAAsB,aAAa,CAAC,CAAC,EAAE,aAAa,GAAG,IAAI,GAAG,SAAS,EAAE,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC,CAgD3G"}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -3,11 +3,13 @@ export declare const PROTOCOL_VERSION: 1;
|
|
|
3
3
|
export * from "./adapters/index.js";
|
|
4
4
|
export { type Config, DEFAULT_CONFIG, machineName, readConfig, type SinkConfig, writeConfig } from "./config.js";
|
|
5
5
|
export { type EventContext, makeEvent } from "./events.js";
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
6
|
+
export { LAUNCHED_BY_ENV, launchedBy, readHook } from "./launched-by.js";
|
|
7
|
+
export { Cursors, Outbox, type OutboxRef, processAlive, takeLock, takeNamedLock } from "./outbox.js";
|
|
8
|
+
export { configFile, homeDir, safeId, stateDir, tilde, untilde } from "./paths.js";
|
|
8
9
|
export * from "./privacy/index.js";
|
|
9
10
|
export { gitFacts, stripCredentials } from "./readers/git.js";
|
|
10
11
|
export { isInjected, pairTurns, readAntigravity, readClaude, readCodex, readGemini } from "./readers/transcripts.js";
|
|
12
|
+
export { shortId } from "./short-id.js";
|
|
11
13
|
export * from "./sinks/index.js";
|
|
12
14
|
export type * from "./types.js";
|
|
13
15
|
export { isUlid, ulid } from "./ulid.js";
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,uGAAuG;AACvG,eAAO,MAAM,gBAAgB,EAAG,CAAU,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AACpC,OAAO,EAAE,KAAK,MAAM,EAAE,cAAc,EAAE,WAAW,EAAE,UAAU,EAAE,KAAK,UAAU,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACjH,OAAO,EAAE,KAAK,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,SAAS,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,uGAAuG;AACvG,eAAO,MAAM,gBAAgB,EAAG,CAAU,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AACpC,OAAO,EAAE,KAAK,MAAM,EAAE,cAAc,EAAE,WAAW,EAAE,UAAU,EAAE,KAAK,UAAU,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACjH,OAAO,EAAE,KAAK,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACzE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,SAAS,EAAE,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACrG,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACnF,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,eAAe,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACrH,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,mBAAmB,YAAY,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Adapter, HookInput, HookResult } from "./adapters/types.js";
|
|
2
|
+
/** PROTOCOL.md §3 `launched_by`: a launcher that starts a session for another one (a
|
|
3
|
+
* script running `claude -p`) names itself here as `<harness>:<id>`, and the hook
|
|
4
|
+
* carries it along. */
|
|
5
|
+
export declare const LAUNCHED_BY_ENV = "SESSIONPIPE_LAUNCHED_BY";
|
|
6
|
+
/** The launcher the environment names, or nothing when it is absent or malformed. */
|
|
7
|
+
export declare function launchedBy(env: Record<string, string | undefined>): string | undefined;
|
|
8
|
+
/** An adapter's reading of a hook, plus what every harness shares: the launcher, unless
|
|
9
|
+
* the harness gave the session a parent of its own (a subagent's launcher is its parent)
|
|
10
|
+
* or the value names the session itself (a launcher that forgot to reset it). */
|
|
11
|
+
export declare function readHook(adapter: Adapter, input: HookInput): HookResult | null;
|
|
12
|
+
//# sourceMappingURL=launched-by.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"launched-by.d.ts","sourceRoot":"","sources":["../../src/launched-by.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAE1E;;wBAEwB;AACxB,eAAO,MAAM,eAAe,4BAA4B,CAAC;AAGzD,qFAAqF;AACrF,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,GAAG,MAAM,GAAG,SAAS,CAGtF;AAED;;kFAEkF;AAClF,wBAAgB,QAAQ,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,GAAG,UAAU,GAAG,IAAI,CAO9E"}
|
package/dist/src/outbox.d.ts
CHANGED
|
@@ -17,7 +17,11 @@ export declare class Outbox {
|
|
|
17
17
|
/** Every session file, newest first. */
|
|
18
18
|
sessions(): OutboxRef[];
|
|
19
19
|
/** Read events after byte offset `from`; returns them and the new offset. Lines
|
|
20
|
-
* are read whole; a partial trailing line (a write in progress) is left.
|
|
20
|
+
* are read whole; a partial trailing line (a write in progress) is left. A read
|
|
21
|
+
* takes READ_CHUNK bytes at a time, not the rest of the file: a session file grows
|
|
22
|
+
* to tens of MB and a drain takes it in batches of 50. It reads on until the batch
|
|
23
|
+
* is full or the file ends, so lines that parse to nothing never stop a drain; one
|
|
24
|
+
* line longer than the chunk gets a larger one, up to READ_MAX. */
|
|
21
25
|
read(ref: OutboxRef, from: number, maxEvents?: number): {
|
|
22
26
|
events: Event[];
|
|
23
27
|
offset: number;
|
|
@@ -36,6 +40,13 @@ export declare class Cursors {
|
|
|
36
40
|
write(c: Record<string, number>): void;
|
|
37
41
|
key(ref: OutboxRef): string;
|
|
38
42
|
}
|
|
39
|
-
/** A lock per session so two workers never interleave. Stale
|
|
43
|
+
/** A lock per session so two workers never interleave. Stale once the worker that
|
|
44
|
+
* took it is gone (its 15 s deadline ends it without a release), or after 5 min. */
|
|
40
45
|
export declare function takeLock(root: string, ref: OutboxRef, staleMs?: number): (() => void) | null;
|
|
46
|
+
/** A named lock under <root>/locks, held by one process at a time: the file names
|
|
47
|
+
* its pid. Stale once that process is gone, or after `staleMs`. */
|
|
48
|
+
export declare function takeNamedLock(root: string, name: string, staleMs?: number): (() => void) | null;
|
|
49
|
+
/** Whether the process a lock or a claimed job names is still running. A pid that
|
|
50
|
+
* can't be read counts as running: the age rule decides then. */
|
|
51
|
+
export declare function processAlive(pid: number): boolean;
|
|
41
52
|
//# sourceMappingURL=outbox.d.ts.map
|
package/dist/src/outbox.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"outbox.d.ts","sourceRoot":"","sources":["../../src/outbox.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAExC,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB;
|
|
1
|
+
{"version":3,"file":"outbox.d.ts","sourceRoot":"","sources":["../../src/outbox.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAExC,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB;AAKD,qBAAa,MAAM;IACL,QAAQ,CAAC,IAAI,EAAE,MAAM;IAAjC,YAAqB,IAAI,EAAE,MAAM,EAAI;IAErC,GAAG,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE3B;IACD,IAAI,CAAC,GAAG,EAAE,SAAS,GAAG,MAAM,CAE3B;IACD,OAAO,CAAC,OAAO;IAIf;yEACqE;IACrE,OAAO,CAAC,GAAG,EAAE,SAAS,GAAG,MAAM,CAa9B;IAED,OAAO,CAAC,aAAa;IAarB,MAAM,CAAC,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EA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
|
|
1
|
-
|
|
1
|
+
/** The home directory, read when asked: a test that sets HOME after importing core
|
|
2
|
+
* (or a process whose HOME changes) gets the new one, never one cached at load. */
|
|
3
|
+
export declare const homeDir: () => string;
|
|
2
4
|
export declare function configFile(env?: NodeJS.ProcessEnv): string;
|
|
3
5
|
export declare function stateDir(env?: NodeJS.ProcessEnv): string;
|
|
4
6
|
/** `~` for the home directory, as the session block writes paths. */
|
|
5
7
|
export declare function tilde(p: string, home?: string): string;
|
|
8
|
+
/** The other way: `~`, `~/…` (or `~\…`) under the home directory, as a control `start`'s
|
|
9
|
+
* `cwd` may name a folder an event reported (CONTROL.md §3.1). Anything else, `~user`
|
|
10
|
+
* included, is returned as it is. */
|
|
11
|
+
export declare function untilde(p: string, home?: string): string;
|
|
6
12
|
/** A file-name-safe id. */
|
|
7
13
|
export declare const safeId: (s: string) => string;
|
|
8
14
|
//# sourceMappingURL=paths.d.ts.map
|
package/dist/src/paths.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/paths.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/paths.ts"],"names":[],"mappings":"AAQA;oFACoF;AACpF,eAAO,MAAM,OAAO,QAAO,MAAsB,CAAC;AAElD,wBAAgB,UAAU,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAKvE;AAED,wBAAgB,QAAQ,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAKrE;AAED,qEAAqE;AACrE,wBAAgB,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,GAAE,MAAkB,GAAG,MAAM,CAIjE;AAED;;sCAEsC;AACtC,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,GAAE,MAAkB,GAAG,MAAM,CAGnE;AAED,2BAA2B;AAC3B,eAAO,MAAM,MAAM,MAAO,MAAM,KAAG,MAGjB,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { Event, Tier } from "../types.js";
|
|
2
2
|
/** The lowest tier that carries each known type (kept in step with schema/v1.ts). */
|
|
3
3
|
export declare const TYPE_TIER: Record<string, Tier>;
|
|
4
|
+
/** At most `max` characters, keeping the end: an ellipsis, then the last max − 1. */
|
|
5
|
+
export declare function capTail(v: string, max: number): string;
|
|
4
6
|
export interface FilterOptions {
|
|
5
7
|
/** The person's home directory, for pii@1's `~` rewrite. */
|
|
6
8
|
home?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter.d.ts","sourceRoot":"","sources":["../../../src/privacy/filter.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAI/C,qFAAqF;AACrF,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,
|
|
1
|
+
{"version":3,"file":"filter.d.ts","sourceRoot":"","sources":["../../../src/privacy/filter.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAI/C,qFAAqF;AACrF,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAmB1C,CAAC;AA2DF,qFAAqF;AACrF,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAEtD;AAED,MAAM,WAAW,aAAa;IAC5B,4DAA4D;IAC5D,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,yFAAyF;AACzF,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,GAAE,aAAkB,GAAG,KAAK,GAAG,IAAI,CAqC1G"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { type FilterOptions, filterEvent, TYPE_TIER } from "./filter.js";
|
|
1
|
+
export { capTail, type FilterOptions, filterEvent, TYPE_TIER } from "./filter.js";
|
|
2
2
|
export { hashMachine, RULESET_PII, reducePii, reducePiiDeep } from "./pii.js";
|
|
3
3
|
export { hasSecret, isSecretName, REDACTED, RULESET_SECRETS, redactDeep, redactSecrets } from "./secrets.js";
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/privacy/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/privacy/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,KAAK,aAAa,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAClF,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9E,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,EAAE,eAAe,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../../src/readers/files.ts"],"names":[],"mappings":"AAKA,qFAAqF;AACrF,wBAAgB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IAAC,IAAI,EAAE,MAAM,EAAE,CAAA;CAAE,CAqB3G;AAED,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../../src/readers/files.ts"],"names":[],"mappings":"AAKA,qFAAqF;AACrF,wBAAgB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IAAC,IAAI,EAAE,MAAM,EAAE,CAAA;CAAE,CAqB3G;AAED,eAAO,MAAM,UAAU,UAAW,MAAM,EAAE,KAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EASf,CAAC;AAEtD,kFAAkF;AAClF,wBAAgB,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,CAAC,GAAG,IAAI,EAAE,GAAG,SAAmB,GAAG,CAAC,GAAG,IAAI,CA6B9G;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,GAAG,MAAM,EAAE,CAuBpH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../../src/readers/git.ts"],"names":[],"mappings":"AAOA,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAsBpF;AAED,mGAAmG;AACnG,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../../src/readers/git.ts"],"names":[],"mappings":"AAOA,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAsBpF;AAED,mGAAmG;AACnG,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAQpD"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export type SqliteParam = string | number;
|
|
2
|
+
export type SqliteRow = Record<string, unknown>;
|
|
3
|
+
export type SqliteEngine = "auto" | "node" | "child" | "cli";
|
|
4
|
+
export interface SqliteOptions {
|
|
5
|
+
/** Busy timeout and the child's wall clock, in ms (default 2000). */
|
|
6
|
+
timeoutMs?: number;
|
|
7
|
+
/** Force one way in; "auto" tries node, then child, then cli (default). */
|
|
8
|
+
engine?: SqliteEngine;
|
|
9
|
+
/** Largest reply a child or the CLI may print (default 32 MB). */
|
|
10
|
+
maxBuffer?: number;
|
|
11
|
+
}
|
|
12
|
+
/** `node:sqlite` is still experimental, and Node says so on stderr the first time it is
|
|
13
|
+
* used. A reader has no business writing to a harness's terminal, so that one warning
|
|
14
|
+
* is swallowed while the module is loaded and used — nothing else is, and the original
|
|
15
|
+
* emitter is back before this returns. (The child path passes --no-warnings instead.)
|
|
16
|
+
* Exported for its test: Node emits that warning once per process. */
|
|
17
|
+
export declare function quiet<T>(fn: () => T): T;
|
|
18
|
+
export declare function inlineParams(sql: string, params: SqliteParam[]): string | null;
|
|
19
|
+
/** One read-only query. Null means "could not read it", never an exception. */
|
|
20
|
+
export declare function querySqlite(file: string, sql: string, params?: SqliteParam[], opts?: SqliteOptions): SqliteRow[] | null;
|
|
21
|
+
/** Is `node:sqlite` in this process? (Tests skip what they cannot set up.) */
|
|
22
|
+
export declare const sqliteInProcess: () => boolean;
|
|
23
|
+
//# sourceMappingURL=sqlite.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sqlite.d.ts","sourceRoot":"","sources":["../../../src/readers/sqlite.ts"],"names":[],"mappings":"AAkBA,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,CAAC;AAC1C,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAChD,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,CAAC;AAE7D,MAAM,WAAW,aAAa;IAC5B,qEAAqE;IACrE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2EAA2E;IAC3E,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,kEAAkE;IAClE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAYD;;;;uEAIuE;AACvE,wBAAgB,KAAK,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAYvC;AAyFD,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,GAAG,IAAI,CAsB9E;AAoBD,+EAA+E;AAC/E,wBAAgB,WAAW,CACzB,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,EACX,MAAM,GAAE,WAAW,EAAO,EAC1B,IAAI,GAAE,aAAkB,GACvB,SAAS,EAAE,GAAG,IAAI,CAyBpB;AAED,8EAA8E;AAC9E,eAAO,MAAM,eAAe,QAAO,OAA4B,CAAC"}
|
|
@@ -6,9 +6,12 @@ interface Msg {
|
|
|
6
6
|
line: number;
|
|
7
7
|
}
|
|
8
8
|
export declare function pairTurns(msgs: Msg[], endLine: number): TranscriptRead;
|
|
9
|
-
/** Injected context the person never typed: <tag>…</tag> wrappers
|
|
9
|
+
/** Injected context the person never typed: <tag>…</tag> wrappers (the tag may carry
|
|
10
|
+
* attributes, as Claude Code's `<cross-session-message from="…">` does), HTML comments,
|
|
11
|
+
* slash-command expansions. */
|
|
10
12
|
export declare const isInjected: (text: string) => boolean;
|
|
11
|
-
/** Claude Code / Droid: {type:"user"|"assistant", message:{content}, timestamp, isMeta, isSidechain, origin}
|
|
13
|
+
/** Claude Code / Droid: {type:"user"|"assistant", message:{content}, timestamp, isMeta, isSidechain, origin},
|
|
14
|
+
* plus the person's mid-turn messages (queuedPrompt). */
|
|
12
15
|
export declare function readClaude(lines: string[], from: number): TranscriptRead;
|
|
13
16
|
/** What Codex writes into a session as a "user" message that the person never typed:
|
|
14
17
|
* `<environment_context>` and the like, and the AGENTS.md it read (`# AGENTS.md
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transcripts.d.ts","sourceRoot":"","sources":["../../../src/readers/transcripts.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"transcripts.d.ts","sourceRoot":"","sources":["../../../src/readers/transcripts.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D,UAAU,GAAG;IACX,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,OAAO,EAAE,MAAM,GAAG,cAAc,CA4BtE;AAED;;gCAEgC;AAChC,eAAO,MAAM,UAAU,SAAU,MAAM,KAAG,OAGjB,CAAC;AA6C1B;0DAC0D;AAC1D,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,cAAc,CA0BxE;AAED;;gEAEgE;AAChE,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEnD;AAED,gIAAgI;AAChI,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,cAAc,CAqBvE;AAED,oFAAoF;AACpF,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,cAAc,CAcxE;AAED,gHAAgH;AAChH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,cAAc,CAgB7E"}
|