sessionpipe-core 0.9.0 → 0.11.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/dist/control.js +180 -13
- package/dist/control.js.map +2 -2
- package/dist/index.js +2133 -965
- package/dist/index.js.map +4 -4
- package/dist/schema/v1.d.ts +443 -34
- package/dist/schema/v1.d.ts.map +1 -1
- package/dist/schema.js +201 -34
- 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/claude-code-control.d.ts +39 -4
- package/dist/src/adapters/claude-code-control.d.ts.map +1 -1
- package/dist/src/adapters/claude-code-pool.d.ts +116 -0
- package/dist/src/adapters/claude-code-pool.d.ts.map +1 -0
- package/dist/src/adapters/claude-code.d.ts +20 -1
- package/dist/src/adapters/claude-code.d.ts.map +1 -1
- package/dist/src/adapters/claude-shaped.d.ts +3 -0
- package/dist/src/adapters/claude-shaped.d.ts.map +1 -1
- package/dist/src/adapters/codex-config.d.ts +2 -1
- 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.d.ts +9 -0
- package/dist/src/adapters/codex.d.ts.map +1 -1
- package/dist/src/adapters/gemini-cli.d.ts +3 -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 +7 -1
- package/dist/src/adapters/index.d.ts.map +1 -1
- package/dist/src/adapters/types.d.ts +18 -1
- package/dist/src/adapters/types.d.ts.map +1 -1
- package/dist/src/config.d.ts +6 -0
- package/dist/src/config.d.ts.map +1 -1
- package/dist/src/control/verify.d.ts +99 -17
- package/dist/src/control/verify.d.ts.map +1 -1
- package/dist/src/index.d.ts +3 -1
- 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/paths.d.ts +4 -0
- package/dist/src/paths.d.ts.map +1 -1
- package/dist/src/privacy/filter.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/types.d.ts +4 -0
- package/dist/src/types.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 +10 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codex-config.d.ts","sourceRoot":"","sources":["../../../src/adapters/codex-config.ts"],"names":[],"mappings":"AASA,gFAAgF;AAChF,eAAO,MAAM,IAAI,QAA0D,CAAC;AAoC5E,+CAA+C;AAC/C,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CASjD;AAOD,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,CAOtD;AAED,MAAM,WAAW,MAAM;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,8EAA8E;AAC9E,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CA0BtD;AAMD
|
|
1
|
+
{"version":3,"file":"codex-config.d.ts","sourceRoot":"","sources":["../../../src/adapters/codex-config.ts"],"names":[],"mappings":"AASA,gFAAgF;AAChF,eAA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AgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,CAGnE;AACD,eAAO,MAAM,aAAa,SAAU,MAAM,EAAE,GAAG,IAAI,KAAG,OAC6C,CAAC"}
|
|
@@ -1,21 +1,37 @@
|
|
|
1
|
+
import { type RunLevel, type StartPermission } from "../control/verify.js";
|
|
1
2
|
import { type Login, type Mode, type Reading, type RunResult } from "./headless.js";
|
|
2
3
|
export { codexFacts, findRollout } from "./codex.js";
|
|
3
4
|
/** The `codex` to run: SESSIONPIPE_CODEX, else on PATH, else beside the node running
|
|
4
5
|
* this (an `npm install -g` there) or where the installers put it. */
|
|
5
6
|
export declare function findCodex(env?: NodeJS.ProcessEnv, home?: string, nodeDir?: string): string | null;
|
|
6
|
-
/** Sandbox flags for
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
|
|
7
|
+
/** Sandbox flags for a level (a machine's mode is one: safe, auto, inherit). Read: the
|
|
8
|
+
* read-only sandbox. Safe: workspace-write, and nothing escalates unattended (exec never
|
|
9
|
+
* asks); that sandbox already edits inside the folder, so `edits` is never offered and
|
|
10
|
+
* means the same. Auto: approval requests go through Codex's own automatic review.
|
|
11
|
+
* Inherit: none, so `sandbox_mode` and `approval_policy` come from the person's own
|
|
12
|
+
* config.toml, a new session's and a resume's alike. Never
|
|
13
|
+
* `--dangerously-bypass-approvals-and-sandbox`, `--dangerously-bypass-hook-trust` or
|
|
14
|
+
* `danger-full-access`: no path here writes them. */
|
|
15
|
+
export declare function codexModeFlags(level: RunLevel, resume?: boolean): string[];
|
|
16
|
+
/** The levels a start may ask Codex for on a machine in `mode`: read and safe, and auto
|
|
17
|
+
* on an auto machine. */
|
|
18
|
+
export declare const offeredLevels: (mode: Mode) => StartPermission[];
|
|
19
|
+
/** What a start that names no level gets: what the machine's mode means for Codex. */
|
|
20
|
+
export declare const defaultLevel: (mode: Mode) => RunLevel;
|
|
11
21
|
/** One headless turn. A new session runs in `cwd` (`-C`); a resume names the thread.
|
|
12
|
-
* The
|
|
22
|
+
* The model is its own argument after `-m`. The prompt goes after `--`, so a message
|
|
23
|
+
* that starts with a dash is never a flag. */
|
|
13
24
|
export declare function codexArgs(o: {
|
|
14
|
-
|
|
25
|
+
permission: RunLevel;
|
|
15
26
|
prompt: string;
|
|
16
27
|
cwd?: string;
|
|
17
28
|
resume?: string;
|
|
29
|
+
model?: string;
|
|
18
30
|
}): string[];
|
|
31
|
+
/** The models a hello offers for Codex (CONTROL.md §2 `start`): the slugs Codex's own
|
|
32
|
+
* picker lists, from `$CODEX_HOME/models_cache.json` (visibility `list`; hidden ones,
|
|
33
|
+
* such as its review model, left out), at most 50. Empty when there is no cache. */
|
|
34
|
+
export declare function codexModels(env?: NodeJS.ProcessEnv, home?: string): string[];
|
|
19
35
|
/** The env a headless turn runs with. */
|
|
20
36
|
export declare const codexEnv: (env?: NodeJS.ProcessEnv) => NodeJS.ProcessEnv;
|
|
21
37
|
export declare const LOGIN_HINT = "Codex isn't signed in on this machine: run `codex login --device-auth` there.";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codex-control.d.ts","sourceRoot":"","sources":["../../../src/adapters/codex-control.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"codex-control.d.ts","sourceRoot":"","sources":["../../../src/adapters/codex-control.ts"],"names":[],"mappings":"AAYA,OAAO,EAAY,KAAK,QAAQ,EAAE,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACrF,OAAO,EAGL,KAAK,KAAK,EACV,KAAK,IAAI,EACT,KAAK,OAAO,EACZ,KAAK,SAAS,EAGf,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAIrD;uEACuE;AACvE,wBAAgB,SAAS,CACvB,GAAG,GAAE,MAAM,CAAC,UAAwB,EACpC,IAAI,SAAe,EACnB,OAAO,SAAiC,GACvC,MAAM,GAA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CAAC,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI,CAiCzD;AAED,iFAAiF;AACjF,qBAAa,YAAa,YAAW,OAAO;IAC1C,OAAO,EAAE,MAAM,GAAG,IAAI,CAAQ;IAC9B,KAAK,SAAK;IACV,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAM;IACjC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAgB;IACzC,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO,CAAC,MAAM,CAAuB;IACrC,OAAO,CAAC,IAAI,CAAuB;IAEnC,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAc1B;IAED;2EACuE;IACvE,OAAO,CAAC,GAAG,EAAE,SAAS,GAAG;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAQ9D;CACF;AAYD,eAAO,MAAM,OAAO,QAAO,YAAkC,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { DataOf } from "../types.js";
|
|
1
2
|
import type { Adapter, SessionFacts } from "./types.js";
|
|
2
3
|
export declare const CODEX_EVENTS: readonly ["SessionStart", "UserPromptSubmit", "PreToolUse", "PostToolUse", "PermissionRequest", "Stop", "Interrupt", "SubagentStart", "SubagentStop", "PreCompact", "PostCompact", "SessionEnd"];
|
|
3
4
|
/** The rollout file of one thread: `<CODEX_HOME>/sessions/YYYY/MM/DD/rollout-<time>-<thread
|
|
@@ -5,6 +6,14 @@ export declare const CODEX_EVENTS: readonly ["SessionStart", "UserPromptSubmit",
|
|
|
5
6
|
* short or odd one never matches some other session's file. */
|
|
6
7
|
export declare function findRollout(threadId: string, env?: NodeJS.ProcessEnv): string | null;
|
|
7
8
|
export declare const codex: Adapter;
|
|
9
|
+
/** The account's limits from the last `token_count` that carries them (recorded
|
|
10
|
+
* 2026-10-21, codex-cli 0.163): `rate_limits.primary` / `secondary`, each with
|
|
11
|
+
* `used_percent`, `window_minutes` and `resets_at` in epoch seconds, and `plan_type`.
|
|
12
|
+
* Every turn writes one, so the tail is enough. Codex keeps one snapshot and overwrites
|
|
13
|
+
* it with whichever bucket the server named last (`limit_id`: `codex`, or a model's own
|
|
14
|
+
* such as `codex_other`), so only the account's `codex` bucket is read, never another's
|
|
15
|
+
* windows under its names. */
|
|
16
|
+
export declare function codexLimits(file: string): DataOf<"limits.observed"> | null;
|
|
8
17
|
/** Codex keeps no title; its first real ask stands in. A fork's replay is not its ask. */
|
|
9
18
|
export declare function codexFacts(file: string): SessionFacts;
|
|
10
19
|
//# sourceMappingURL=codex.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codex.d.ts","sourceRoot":"","sources":["../../../src/adapters/codex.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"codex.d.ts","sourceRoot":"","sources":["../../../src/adapters/codex.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAI1C,OAAO,KAAK,EACV,OAAO,EAOP,YAAY,EACb,MAAM,YAAY,CAAC;AAGpB,eAAO,MAAM,YAAY,YACvB,cAAc,EACd,kBAAkB,EAClB,YAAY,EACZ,aAAa,EACb,mBAAmB,EACnB,MAAM,EACN,WAAW,EACX,eAAe,EACf,cAAc,EACd,YAAY,EACZ,aAAa,EACb,YAAY,CACJ,CAAC;AAmFX;;gEAEgE;AAChE,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,GAAG,IAAI,CAwBjG;AAeD,eAAO,MAAM,KAAK,EAAE,OA0MnB,CAAC;AAWF;;;;;;+BAM+B;AAC/B,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,iBAAiB,CAAC,GAAG,IAAI,CA0B1E;AAED,0FAA0F;AAC1F,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,CA2DrD"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { Adapter } from "./types.js";
|
|
2
2
|
export declare const GEMINI_EVENTS: readonly ["SessionStart", "BeforeAgent", "BeforeTool", "AfterTool", "Notification", "AfterAgent", "PreCompress", "SessionEnd"];
|
|
3
|
+
/** `gemini --version`. On Windows the CLI is npm's gemini.cmd shim, which only a shell runs
|
|
4
|
+
* (node refuses a bare spawn of a .cmd), so there it is looked up on PATH and run through one. */
|
|
5
|
+
export declare function geminiVersion(platform?: NodeJS.Platform, env?: NodeJS.ProcessEnv): string;
|
|
3
6
|
/** Before 0.46 the hooks system is off unless tools.enableHooks is true (issue #11). */
|
|
4
7
|
export declare function geminiHooksActive(settingsFile: string): {
|
|
5
8
|
active: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gemini-cli.d.ts","sourceRoot":"","sources":["../../../src/adapters/gemini-cli.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"gemini-cli.d.ts","sourceRoot":"","sources":["../../../src/adapters/gemini-cli.ts"],"names":[],"mappings":"AAaA,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;mGACmG;AACnG,wBAAgB,aAAa,CAC3B,QAAQ,GAAE,MAAM,CAAC,QAA2B,EAC5C,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,MAAM,CAiBR;AAED,wFAAwF;AACxF,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,MAAM,GAAG;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAoB1F;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;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gC;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,+BAA+B;IAC/B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,GAAG,EAAE,SAAS,GAAG;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;CACjE;AAED,iEAAiE;AACjE,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,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"}
|
|
@@ -6,6 +6,7 @@ import { geminiCli } from "./gemini-cli.js";
|
|
|
6
6
|
import type { Adapter } from "./types.js";
|
|
7
7
|
export declare const ADAPTERS: readonly Adapter[];
|
|
8
8
|
export declare const adapterByName: (name: string) => Adapter | undefined;
|
|
9
|
+
export * as acpControl from "./acp-control.js";
|
|
9
10
|
export { AG_STALE_PRETOOL, antigravityAnswer } from "./antigravity.js";
|
|
10
11
|
export * as antigravityControl from "./antigravity-control.js";
|
|
11
12
|
export { claudeAccounts, claudeDirs, notClaudeCode } from "./claude-code.js";
|
|
@@ -13,8 +14,13 @@ export * as claudeControl from "./claude-code-control.js";
|
|
|
13
14
|
export * as codexControl from "./codex-control.js";
|
|
14
15
|
export { DEVIN_EVENTS, devinConfigDir, devinDataDir, readDevinChain } from "./devin.js";
|
|
15
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;
|
|
16
20
|
/** The harnesses a control daemon here can drive headlessly (CONTROL.md §6): each whose
|
|
17
|
-
* 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. */
|
|
18
24
|
export declare function drivableHarnesses(env?: NodeJS.ProcessEnv): string[];
|
|
19
25
|
export type { Adapter, AdapterEvent, BackfillRow, FactsState, HookCommand, HookInput, HookResult, InstallReport, SessionFacts, TranscriptRead, Turn, } from "./types.js";
|
|
20
26
|
export { antigravity, claudeCode, codex, devin, geminiCli };
|
|
@@ -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"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Session } from "../types.js";
|
|
1
|
+
import type { DataOf, Session } from "../types.js";
|
|
2
2
|
export interface HookInput {
|
|
3
3
|
/** [harness, event, ...] as the hook was invoked. */
|
|
4
4
|
argv: string[];
|
|
@@ -54,6 +54,8 @@ export interface BackfillRow {
|
|
|
54
54
|
started_at: number;
|
|
55
55
|
last_at: number;
|
|
56
56
|
turns?: number;
|
|
57
|
+
/** The file the row was read from, for what `remoteFacts` asks about it. Never sent. */
|
|
58
|
+
transcript?: string;
|
|
57
59
|
}
|
|
58
60
|
/** The command a hook entry runs: absolute node, absolute script, then args. */
|
|
59
61
|
export type HookCommand = (args: string[]) => {
|
|
@@ -76,6 +78,9 @@ export interface InstallOptions {
|
|
|
76
78
|
/** Files sessionpipe created on an earlier install (from the config), so
|
|
77
79
|
* uninstall may delete them once they are empty again. */
|
|
78
80
|
created?: string[];
|
|
81
|
+
/** Claude Code: make sessionpipe its status line, the one place it reports the
|
|
82
|
+
* account's limits (`limits.observed`); false takes ours away again. */
|
|
83
|
+
statusLine?: boolean | undefined;
|
|
79
84
|
}
|
|
80
85
|
export type InstalledState = "current" | "stale" | "missing" | "misplaced" | "inactive";
|
|
81
86
|
export interface InstalledReport {
|
|
@@ -104,7 +109,19 @@ export interface Adapter {
|
|
|
104
109
|
facts(session: {
|
|
105
110
|
id: string;
|
|
106
111
|
} & Partial<Session>, transcript: string | undefined, hints: Record<string, unknown>, state: FactsState, env?: NodeJS.ProcessEnv): SessionFacts;
|
|
112
|
+
/** What only the harness's own service knows about a session (claude.ai's name for a
|
|
113
|
+
* Claude Code session), asked over the network with the person's own sign-in. The
|
|
114
|
+
* worker calls it after `facts`, and only when the person turned it on (config.json
|
|
115
|
+
* `remote_titles`); never on the hook path. What it returns replaces what `facts`
|
|
116
|
+
* found; an empty object leaves it. Never rejects: a service it can't ask, or a
|
|
117
|
+
* sign-in it can't read, is an empty object. */
|
|
118
|
+
remoteFacts?(session: {
|
|
119
|
+
id: string;
|
|
120
|
+
} & Partial<Session>, local: SessionFacts, transcript: string | undefined, state: FactsState, env?: NodeJS.ProcessEnv): Promise<Partial<SessionFacts>>;
|
|
107
121
|
backfill(sinceMs: number, env?: NodeJS.ProcessEnv): BackfillRow[];
|
|
122
|
+
/** The account's limits as the transcript last recorded them (`limits.observed` data),
|
|
123
|
+
* for a harness that writes them there; null when it holds none. */
|
|
124
|
+
limits?(transcript: string): DataOf<"limits.observed"> | null;
|
|
108
125
|
}
|
|
109
126
|
/** Small per-session memory the facts pass keeps under <state>/facts/. */
|
|
110
127
|
export interface FactsState {
|
|
@@ -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;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/adapters/types.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEnD,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,EAAE,MAAM,CAAC;IAChB,iEAAiE;IACjE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC;AAED,MAAM,WAAW,IAAI;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,uEAAuE;IACvE,IAAI,EAA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AE,OAAO,CAAC,EAC9B,KAAK,EAAE,UAAU,EACjB,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,GACtB,YAAY,CAAC;IAChB;;;;;qDAKiD;IACjD,WAAW,CAAC,CACV,OAAO,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,OAAO,CAAC,EAC1C,KAAK,EAAE,YAAY,EACnB,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,KAAK,EAAE,UAAU,EACjB,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,GACtB,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC;IAClC,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,GAAG,WAAW,EAAE,CAAC;IAClE;yEACqE;IACrE,MAAM,CAAC,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAAC,iBAAiB,CAAC,GAAG,IAAI,CAAC;CAC/D;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"}
|
package/dist/src/config.d.ts
CHANGED
|
@@ -22,12 +22,18 @@ export interface SinkConfig {
|
|
|
22
22
|
export interface Config {
|
|
23
23
|
machine?: string;
|
|
24
24
|
sinks: SinkConfig[];
|
|
25
|
+
/** `status_line`: Claude Code's status line is ours (install --status-line). */
|
|
25
26
|
harnesses: Record<string, {
|
|
26
27
|
enabled?: boolean;
|
|
27
28
|
created?: string[];
|
|
29
|
+
status_line?: boolean;
|
|
28
30
|
}>;
|
|
29
31
|
update_check?: boolean;
|
|
30
32
|
keep_days?: number;
|
|
33
|
+
/** Ask a harness's own service for a session's name (an adapter's `remoteFacts`):
|
|
34
|
+
* claude.ai's, for Claude Code. Off unless the person turns it on (`sessionpipe
|
|
35
|
+
* titles on`): it means reading the harness's sign-in token on this machine. */
|
|
36
|
+
remote_titles?: boolean;
|
|
31
37
|
}
|
|
32
38
|
export declare const DEFAULT_CONFIG: Config;
|
|
33
39
|
export declare function readConfig(file?: string): Config;
|
package/dist/src/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAEvC,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,6CAA6C;IAC7C,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,IAAI,CAAC;IACX,GAAG,CAAC,EAAE,OAAO,CAAC;IACd;oCACgC;IAChC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gDAAgD;IAChD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;4CACwC;IACxC,QAAQ,CAAC,EAAE,UAAU,GAAG,gBAAgB,CAAC;IACzC,kEAAkE;IAClE,QAAQ,CAAC,EAAE,IAAI,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,MAAM;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,OAAO,CAAC,EAAE,OAAO,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config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MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAG/D"}
|
|
@@ -18,7 +18,7 @@ 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` (CONTROL.md §3.1): at most this many files, */
|
|
21
|
+
/** Attachments on a `start` or a `prompt` (CONTROL.md §3.1): at most this many files, */
|
|
22
22
|
export declare const FILES_MAX = 10;
|
|
23
23
|
/** each at most this many bytes, */
|
|
24
24
|
export declare const FILE_SIZE_MAX = 26214400;
|
|
@@ -28,20 +28,59 @@ export declare const FILES_TOTAL_MAX = 52428800;
|
|
|
28
28
|
export declare const FILE_NAME_MAX = 200;
|
|
29
29
|
/** and a media type of at most this many. */
|
|
30
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;
|
|
31
48
|
export declare const COMMAND_TYPE = "sessionpipe.control";
|
|
32
49
|
export declare const GRANT_TYPE = "sessionpipe.grant";
|
|
33
|
-
export declare const CONTROL_KINDS: readonly ["prompt", "permission.answer", "cancel", "start", "key.add"];
|
|
50
|
+
export declare const CONTROL_KINDS: readonly ["prompt", "permission.answer", "cancel", "start", "key.add", "pool"];
|
|
34
51
|
/** The session a `key.add` names: the machine's own key store, not a coding session. */
|
|
35
52
|
export declare const KEY_STORE_SESSION = "sessionpipe:keys";
|
|
53
|
+
/** The session a `pool` names: the machine's account pool (CONTROL.md §6 `pool`). */
|
|
54
|
+
export declare const POOL_SESSION = "sessionpipe:pool";
|
|
36
55
|
export type ControlKind = (typeof CONTROL_KINDS)[number];
|
|
56
|
+
/** What a `pool` command may ask (CONTROL.md §6 `pool`). Closed: an action added later
|
|
57
|
+
* is refused by every machine that predates it. */
|
|
58
|
+
export declare const POOL_ACTIONS: readonly ["on", "off", "enable", "disable", "remove", "order", "refresh", "login.begin", "login.complete"];
|
|
59
|
+
export type PoolAction = (typeof POOL_ACTIONS)[number];
|
|
60
|
+
/** A pooled account's id (or a pending sign-in's): what `session.account_id` carries. */
|
|
61
|
+
export declare const POOL_ACCOUNT_RE: RegExp;
|
|
62
|
+
/** An `order` names at most this many accounts: the pool holds no more. */
|
|
63
|
+
export declare const POOL_ORDER_MAX = 20;
|
|
64
|
+
/** The pasted `code#state` of a sign-in, in characters, on one line. */
|
|
65
|
+
export declare const POOL_CODE_MAX = 512;
|
|
37
66
|
/** COSE algorithm ids a trusted key may use. */
|
|
38
67
|
export declare const ES256 = -7;
|
|
39
68
|
export declare const RS256 = -257;
|
|
40
|
-
/**
|
|
69
|
+
/** The kinds of key a machine may trust (CONTROL.md §2): a WebAuthn passkey, or a
|
|
70
|
+
* device key an app holds in hardware where it has no passkey to offer. */
|
|
71
|
+
export declare const KEY_TYPES: readonly ["passkey", "device"];
|
|
72
|
+
export type KeyType = (typeof KEY_TYPES)[number];
|
|
73
|
+
/** A key enrolled on the machine: a passkey's credential id, COSE alg and SPKI
|
|
74
|
+
* (base64url); a device key also says so (`type`), and what its app declared about
|
|
75
|
+
* it (`store`, `uv`). The machine verifies by its own record, never by a message. */
|
|
41
76
|
export interface TrustedKey {
|
|
42
77
|
id: string;
|
|
43
78
|
alg: number;
|
|
44
79
|
spki: string;
|
|
80
|
+
/** Present only on a device key (CONTROL.md §2 "Device keys"). */
|
|
81
|
+
type?: "device";
|
|
82
|
+
store?: "hardware";
|
|
83
|
+
uv?: "each-use";
|
|
45
84
|
}
|
|
46
85
|
/** A WebAuthn assertion: credential id, authenticatorData, clientDataJSON, signature (base64url). */
|
|
47
86
|
export interface Assertion {
|
|
@@ -50,16 +89,25 @@ export interface Assertion {
|
|
|
50
89
|
cd: string;
|
|
51
90
|
sig: string;
|
|
52
91
|
}
|
|
92
|
+
/** A device key's signature (CONTROL.md §3.2): its id and 64 bytes r‖s over deviceMessage(). */
|
|
93
|
+
export interface DeviceSignature {
|
|
94
|
+
cred: string;
|
|
95
|
+
sig: string;
|
|
96
|
+
}
|
|
53
97
|
/** The day's grant: a passkey's assertion over sha256(str), where str names the day key. */
|
|
54
98
|
export interface GrantBundle extends Assertion {
|
|
55
99
|
str: string;
|
|
56
100
|
}
|
|
101
|
+
/** The day's grant from a device key: its signature over deviceMessage("grant", rp, sha256(str)). */
|
|
102
|
+
export interface DeviceGrant extends DeviceSignature {
|
|
103
|
+
str: string;
|
|
104
|
+
}
|
|
57
105
|
/** What a receiver carries for one command (control.json minus the receiver's envelope). */
|
|
58
106
|
export interface SignedCommand {
|
|
59
107
|
cmd: string;
|
|
60
108
|
csig?: string | null;
|
|
61
|
-
grant?: GrantBundle | null;
|
|
62
|
-
confirm?: Assertion | null;
|
|
109
|
+
grant?: GrantBundle | DeviceGrant | null;
|
|
110
|
+
confirm?: Assertion | DeviceSignature | null;
|
|
63
111
|
}
|
|
64
112
|
export interface Grant {
|
|
65
113
|
v: 1;
|
|
@@ -92,16 +140,26 @@ export interface ControlCommand {
|
|
|
92
140
|
decision?: "allow" | "deny";
|
|
93
141
|
note?: string;
|
|
94
142
|
cwd?: string;
|
|
95
|
-
/** key.add only: the
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
alg: -7 | -257;
|
|
99
|
-
spki: string;
|
|
100
|
-
};
|
|
143
|
+
/** key.add only: the key to trust from now on, as the receiver holds it (a passkey,
|
|
144
|
+
* or a device key with its `type`, `store` and `uv`). */
|
|
145
|
+
key?: TrustedKey;
|
|
101
146
|
/** key.add only: what the person calls the device ("iPhone"), for `control keys`. */
|
|
102
147
|
name?: string;
|
|
103
|
-
/** start
|
|
148
|
+
/** start, prompt: files to download, verify and write into the session's folder. */
|
|
104
149
|
files?: ControlFile[];
|
|
150
|
+
/** start only: the level the new session runs at (never above the machine's mode). */
|
|
151
|
+
permission?: StartPermission;
|
|
152
|
+
/** start only: the model the harness runs, as the harness names it. */
|
|
153
|
+
model?: string;
|
|
154
|
+
/** pool only (session `sessionpipe:pool`): what to do with the account pool. */
|
|
155
|
+
pool_action?: PoolAction;
|
|
156
|
+
/** pool: the account (enable, disable, remove, refresh), or the pending sign-in's id
|
|
157
|
+
* (login.complete). */
|
|
158
|
+
pool_account?: string;
|
|
159
|
+
/** pool, order: every account of the pool once, in the order wanted. */
|
|
160
|
+
pool_order?: string[];
|
|
161
|
+
/** pool, login.complete: the `code#state` the person pasted back. */
|
|
162
|
+
pool_code?: string;
|
|
105
163
|
nonce: string;
|
|
106
164
|
iat: number;
|
|
107
165
|
}
|
|
@@ -144,7 +202,14 @@ export declare function sameBytes(a: Uint8Array, b: Uint8Array): boolean;
|
|
|
144
202
|
* Strict: every length must match the bytes, so one signature has one encoding (a
|
|
145
203
|
* P-256 signature is at most 72 bytes, so the short length form is the only one). */
|
|
146
204
|
export declare function derToRaw(der: Uint8Array): Uint8Array | null;
|
|
147
|
-
/**
|
|
205
|
+
/** The only fields a device signature has (`str` only in a grant). */
|
|
206
|
+
export declare const DEVICE_SIG_FIELDS: readonly ["cred", "sig", "str"];
|
|
207
|
+
/** A device key's id: the SHA-256 of its SPKI bytes, base64url without padding. */
|
|
208
|
+
export declare function deviceKeyId(spki: string): Promise<string>;
|
|
209
|
+
/** Can this key be enrolled at all? A machine refuses to trust a key it could never
|
|
210
|
+
* verify with. The key's fields are closed: a passkey is `id`, `alg`, `spki` and
|
|
211
|
+
* nothing else; a device key adds exactly `type`, `store` and `uv` (CONTROL.md §2),
|
|
212
|
+
* so a kind added later is refused by every machine that predates it. */
|
|
148
213
|
export declare function keyUsable(key: TrustedKey): Promise<boolean>;
|
|
149
214
|
/** A WebAuthn origin a key may have been used from: https on the rp id or a subdomain;
|
|
150
215
|
* for rp id `localhost`, plain http on any port too. A bare origin, as a browser writes it. */
|
|
@@ -155,8 +220,18 @@ type Check = {
|
|
|
155
220
|
ok: false;
|
|
156
221
|
why: string;
|
|
157
222
|
};
|
|
158
|
-
/**
|
|
159
|
-
export declare
|
|
223
|
+
/** The first line of every message a device key signs. */
|
|
224
|
+
export declare const DEVICE_CONTEXT = "sessionpipe.device.v1";
|
|
225
|
+
/** What a device signature is for: one use can never answer for another. */
|
|
226
|
+
export type DevicePurpose = "grant" | "confirm" | "pair";
|
|
227
|
+
/** The exact bytes a device key signs: the context, the purpose, the rp id as the
|
|
228
|
+
* machine recorded it, and the base64url (no padding) of the 32-byte challenge a
|
|
229
|
+
* passkey would sign for that purpose, joined by single line feeds, none at the end. */
|
|
230
|
+
export declare function deviceMessage(purpose: DevicePurpose, rpId: string, challenge: Uint8Array): Uint8Array;
|
|
231
|
+
/** One signature over `challenge` by `key`, chosen from the machine's own record of
|
|
232
|
+
* the key, never from the signature: a device key's signature for `purpose`
|
|
233
|
+
* (CONTROL.md §3.2), or a passkey assertion made by a verified person. */
|
|
234
|
+
export declare function verifyAssertion(challenge: Uint8Array, a: Assertion | DeviceSignature | null | undefined, key: TrustedKey, rpId: string, purpose: DevicePurpose): Promise<Check>;
|
|
160
235
|
/** What a passkey signs to enroll on a machine: bound to that machine and that pairing code. */
|
|
161
236
|
export declare function pairChallenge(machine: string, code: string): Promise<Uint8Array>;
|
|
162
237
|
/** The enrollment proof: the new key's assertion over pairChallenge(machine, code).
|
|
@@ -165,7 +240,7 @@ export declare function verifyEnrollment(o: {
|
|
|
165
240
|
machine: string;
|
|
166
241
|
code: string;
|
|
167
242
|
key: TrustedKey;
|
|
168
|
-
proof: Assertion;
|
|
243
|
+
proof: Assertion | DeviceSignature;
|
|
169
244
|
rpId: string;
|
|
170
245
|
}): Promise<Check>;
|
|
171
246
|
type Parsed = {
|
|
@@ -185,8 +260,15 @@ export declare function parseSessionRef(ref: unknown): {
|
|
|
185
260
|
} | null;
|
|
186
261
|
/** Read the command's fields from the exact string. Structure only; no clock, no keys. */
|
|
187
262
|
export declare function parseCommand(str: unknown): Parsed;
|
|
188
|
-
/** Why a
|
|
263
|
+
/** Why a `pool` command's fields break the rules (CONTROL.md §6 `pool`), or null when
|
|
264
|
+
* they don't. Each action takes exactly its own fields: an account where the action
|
|
265
|
+
* names one, the whole order for `order`, the pasted code for `login.complete`. The
|
|
266
|
+
* machine still checks the account exists and the order is complete (`refused`). */
|
|
267
|
+
export declare function poolProblem(c: Record<string, unknown>): string | null;
|
|
268
|
+
/** Why a start's or a prompt's `files` breaks the rules (CONTROL.md §3.1), or null when it doesn't. */
|
|
189
269
|
export declare function filesProblem(files: unknown): string | null;
|
|
270
|
+
/** A `start`'s `cwd` under the machine's home: `~` alone, or `~/…` (`~\…`). Never `~user`. */
|
|
271
|
+
export declare const HOME_RELATIVE_RE: RegExp;
|
|
190
272
|
/** The grant's fields, read from its exact string. */
|
|
191
273
|
export declare function parseGrant(str: unknown, rpId: string): {
|
|
192
274
|
ok: true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../../src/control/verify.ts"],"names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,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
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
/** @sessionpipe/core — protocol types, adapters, privacy, outbox, sinks. Zero runtime dependencies. */
|
|
2
2
|
export declare const PROTOCOL_VERSION: 1;
|
|
3
|
+
export * as claudePool from "./adapters/claude-code-pool.js";
|
|
3
4
|
export * from "./adapters/index.js";
|
|
4
5
|
export { type Config, DEFAULT_CONFIG, machineName, readConfig, type SinkConfig, writeConfig } from "./config.js";
|
|
5
6
|
export { type EventContext, makeEvent } from "./events.js";
|
|
7
|
+
export { LAUNCHED_BY_ENV, launchedBy, readHook } from "./launched-by.js";
|
|
6
8
|
export { Cursors, Outbox, type OutboxRef, processAlive, takeLock, takeNamedLock } from "./outbox.js";
|
|
7
|
-
export { configFile, homeDir, safeId, stateDir, tilde } from "./paths.js";
|
|
9
|
+
export { configFile, homeDir, safeId, stateDir, tilde, untilde } from "./paths.js";
|
|
8
10
|
export * from "./privacy/index.js";
|
|
9
11
|
export { gitFacts, stripCredentials } from "./readers/git.js";
|
|
10
12
|
export { isInjected, pairTurns, readAntigravity, readClaude, readCodex, readGemini } from "./readers/transcripts.js";
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../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ACnC,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/paths.d.ts
CHANGED
|
@@ -5,6 +5,10 @@ export declare function configFile(env?: NodeJS.ProcessEnv): string;
|
|
|
5
5
|
export declare function stateDir(env?: NodeJS.ProcessEnv): string;
|
|
6
6
|
/** `~` for the home directory, as the session block writes paths. */
|
|
7
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;
|
|
8
12
|
/** A file-name-safe id. */
|
|
9
13
|
export declare const safeId: (s: string) => string;
|
|
10
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;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,2BAA2B;AAC3B,eAAO,MAAM,MAAM,MAAO,MAAM,KAAG,MAGjB,CAAC"}
|
|
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 +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,CAoB1C,CAAC;AA4DF,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,CAyC1G"}
|