@openpond/evals 0.11.18 → 0.11.19
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/connected-evidence/contracts.js +14 -4
- package/dist/connected-evidence/imports.js +77 -17
- package/dist/connected-evidence/normalize.js +4 -3
- package/dist/connected-evidence/sources/claude-branches.js +52 -0
- package/dist/connected-evidence/sources/claude-code.js +7 -29
- package/dist/connected-evidence/sources/codex-authorization.js +40 -0
- package/dist/connected-evidence/sources/codex.js +7 -3
- package/dist/connected-evidence/sources/grok-build.js +137 -0
- package/dist/connected-evidence/sources/opencode.js +101 -0
- package/dist/connected-evidence/sources/pi.js +187 -0
- package/dist/graders.js +11 -1
- package/dist/learning/budgeted-reward-fixtures.js +1 -0
- package/dist/learning/contracts.js +10 -0
- package/dist/learning/index.js +1 -0
- package/dist/learning/model-judge.js +22 -5
- package/dist/learning/reward-calibration-closure.js +110 -0
- package/dist/learning/reward-calibration.js +20 -10
- package/dist/learning/reward-checks.js +1 -0
- package/dist/native-conversations/appimage-runtime.js +131 -0
- package/dist/native-conversations/collector-branches.js +79 -0
- package/dist/native-conversations/collector-contracts.js +9 -0
- package/dist/native-conversations/collector-destinations.js +27 -0
- package/dist/native-conversations/collector-errors.js +42 -0
- package/dist/native-conversations/collector-progress.js +114 -0
- package/dist/native-conversations/collector-store.js +247 -0
- package/dist/native-conversations/collector-sync-requests.js +52 -0
- package/dist/native-conversations/collector.js +322 -0
- package/dist/native-conversations/contracts.js +11 -0
- package/dist/native-conversations/database.js +149 -0
- package/dist/native-conversations/discovery.js +135 -0
- package/dist/native-conversations/history.js +298 -0
- package/dist/native-conversations/index.js +11 -0
- package/dist/native-conversations/location.js +29 -0
- package/dist/native-conversations/openclaw-cold-archive.js +91 -0
- package/dist/native-conversations/openclaw-database.js +130 -0
- package/dist/native-conversations/source-locations.js +112 -0
- package/dist/native-conversations/supervisor.js +208 -0
- package/dist/rewards.js +1 -1
- package/dist/types/connected-evidence/contracts.d.ts +15 -0
- package/dist/types/connected-evidence/contracts.d.ts.map +1 -1
- package/dist/types/connected-evidence/imports.d.ts +6 -0
- package/dist/types/connected-evidence/imports.d.ts.map +1 -1
- package/dist/types/connected-evidence/normalize.d.ts +4 -0
- package/dist/types/connected-evidence/normalize.d.ts.map +1 -1
- package/dist/types/connected-evidence/sources/claude-branches.d.ts +19 -0
- package/dist/types/connected-evidence/sources/claude-branches.d.ts.map +1 -0
- package/dist/types/connected-evidence/sources/claude-code.d.ts +5 -1
- package/dist/types/connected-evidence/sources/claude-code.d.ts.map +1 -1
- package/dist/types/connected-evidence/sources/codex-authorization.d.ts +18 -0
- package/dist/types/connected-evidence/sources/codex-authorization.d.ts.map +1 -0
- package/dist/types/connected-evidence/sources/codex.d.ts +5 -1
- package/dist/types/connected-evidence/sources/codex.d.ts.map +1 -1
- package/dist/types/connected-evidence/sources/grok-build.d.ts +79 -0
- package/dist/types/connected-evidence/sources/grok-build.d.ts.map +1 -0
- package/dist/types/connected-evidence/sources/history.d.ts +10 -2
- package/dist/types/connected-evidence/sources/history.d.ts.map +1 -1
- package/dist/types/connected-evidence/sources/opencode.d.ts +78 -0
- package/dist/types/connected-evidence/sources/opencode.d.ts.map +1 -0
- package/dist/types/connected-evidence/sources/pi.d.ts +79 -0
- package/dist/types/connected-evidence/sources/pi.d.ts.map +1 -0
- package/dist/types/graders.d.ts +81 -0
- package/dist/types/graders.d.ts.map +1 -1
- package/dist/types/learning/budgeted-reward-fixtures.d.ts +2 -1
- package/dist/types/learning/budgeted-reward-fixtures.d.ts.map +1 -1
- package/dist/types/learning/contracts.d.ts +167 -0
- package/dist/types/learning/contracts.d.ts.map +1 -1
- package/dist/types/learning/index.d.ts +1 -0
- package/dist/types/learning/index.d.ts.map +1 -1
- package/dist/types/learning/judge-budget.d.ts +3 -0
- package/dist/types/learning/judge-budget.d.ts.map +1 -1
- package/dist/types/learning/model-judge.d.ts +6 -1
- package/dist/types/learning/model-judge.d.ts.map +1 -1
- package/dist/types/learning/operations.d.ts +44 -0
- package/dist/types/learning/operations.d.ts.map +1 -1
- package/dist/types/learning/repository.d.ts +81 -0
- package/dist/types/learning/repository.d.ts.map +1 -1
- package/dist/types/learning/reward-calibration-closure.d.ts +2323 -0
- package/dist/types/learning/reward-calibration-closure.d.ts.map +1 -0
- package/dist/types/learning/reward-calibration.d.ts +1 -1
- package/dist/types/learning/reward-calibration.d.ts.map +1 -1
- package/dist/types/learning/reward-checks.d.ts +35 -0
- package/dist/types/learning/reward-checks.d.ts.map +1 -1
- package/dist/types/learning/transport.d.ts +103 -0
- package/dist/types/learning/transport.d.ts.map +1 -1
- package/dist/types/native-conversations/appimage-runtime.d.ts +12 -0
- package/dist/types/native-conversations/appimage-runtime.d.ts.map +1 -0
- package/dist/types/native-conversations/collector-branches.d.ts +22 -0
- package/dist/types/native-conversations/collector-branches.d.ts.map +1 -0
- package/dist/types/native-conversations/collector-contracts.d.ts +88 -0
- package/dist/types/native-conversations/collector-contracts.d.ts.map +1 -0
- package/dist/types/native-conversations/collector-destinations.d.ts +18 -0
- package/dist/types/native-conversations/collector-destinations.d.ts.map +1 -0
- package/dist/types/native-conversations/collector-errors.d.ts +13 -0
- package/dist/types/native-conversations/collector-errors.d.ts.map +1 -0
- package/dist/types/native-conversations/collector-progress.d.ts +24 -0
- package/dist/types/native-conversations/collector-progress.d.ts.map +1 -0
- package/dist/types/native-conversations/collector-store.d.ts +31 -0
- package/dist/types/native-conversations/collector-store.d.ts.map +1 -0
- package/dist/types/native-conversations/collector-sync-requests.d.ts +25 -0
- package/dist/types/native-conversations/collector-sync-requests.d.ts.map +1 -0
- package/dist/types/native-conversations/collector.d.ts +8 -0
- package/dist/types/native-conversations/collector.d.ts.map +1 -0
- package/dist/types/native-conversations/contracts.d.ts +47 -0
- package/dist/types/native-conversations/contracts.d.ts.map +1 -0
- package/dist/types/native-conversations/database.d.ts +14 -0
- package/dist/types/native-conversations/database.d.ts.map +1 -0
- package/dist/types/native-conversations/discovery.d.ts +9 -0
- package/dist/types/native-conversations/discovery.d.ts.map +1 -0
- package/dist/types/native-conversations/history.d.ts +23 -0
- package/dist/types/native-conversations/history.d.ts.map +1 -0
- package/dist/types/native-conversations/index.d.ts +12 -0
- package/dist/types/native-conversations/index.d.ts.map +1 -0
- package/dist/types/native-conversations/location.d.ts +3 -0
- package/dist/types/native-conversations/location.d.ts.map +1 -0
- package/dist/types/native-conversations/openclaw-cold-archive.d.ts +8 -0
- package/dist/types/native-conversations/openclaw-cold-archive.d.ts.map +1 -0
- package/dist/types/native-conversations/openclaw-database.d.ts +14 -0
- package/dist/types/native-conversations/openclaw-database.d.ts.map +1 -0
- package/dist/types/native-conversations/source-locations.d.ts +8 -0
- package/dist/types/native-conversations/source-locations.d.ts.map +1 -0
- package/dist/types/native-conversations/supervisor.d.ts +21 -0
- package/dist/types/native-conversations/supervisor.d.ts.map +1 -0
- package/dist/types/rewards.d.ts +50 -0
- package/dist/types/rewards.d.ts.map +1 -1
- package/dist/types/telemetry-analysis.d.ts +1 -1
- package/dist/types/telemetry-bundle.d.ts +2 -2
- package/dist/types/telemetry-catalog.d.ts +21 -21
- package/dist/types/telemetry.d.ts +2 -2
- package/package.json +11 -3
- package/schemas/learning/v1/command-request.schema.json +122 -91
- package/schemas/learning/v1/decision.schema.json +63 -0
- package/schemas/learning/v1/grade.schema.json +91 -0
- package/schemas/learning/v1/reward_check.schema.json +91 -0
- package/schemas/learning/v1/source.schema.json +28 -0
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { opendir, readFile, stat } from "node:fs/promises";
|
|
2
|
+
import { basename, dirname, join, resolve } from "node:path";
|
|
3
|
+
export function hermesHome(home, env) {
|
|
4
|
+
const configured = env.HERMES_HOME?.trim();
|
|
5
|
+
if (configured) {
|
|
6
|
+
const expanded = configured.replace(/\$(\w+)|\$\{([^}]+)\}/gu, (match, bare, braced) => env[bare || braced] ?? match);
|
|
7
|
+
return resolve(expanded === "~" ? home : expanded.startsWith("~/") ? join(home, expanded.slice(2)) : expanded);
|
|
8
|
+
}
|
|
9
|
+
const suffix = env.HERMES_DATA_DIR_SUFFIX || "";
|
|
10
|
+
return process.platform === "win32"
|
|
11
|
+
? join(env.LOCALAPPDATA?.trim() || join(home, "AppData", "Local"), `hermes${suffix}`)
|
|
12
|
+
: join(home, `.hermes${suffix}`);
|
|
13
|
+
}
|
|
14
|
+
const isDirectory = (path) => stat(path).then((s) => s.isDirectory()).catch(() => false);
|
|
15
|
+
const isFile = (path) => stat(path).then((s) => s.isFile()).catch(() => false);
|
|
16
|
+
/** A bounded metadata-only inventory. No profile config or credential files are read. */
|
|
17
|
+
async function profileNames(root, valid) {
|
|
18
|
+
const names = [];
|
|
19
|
+
const directory = await opendir(root).catch(() => null);
|
|
20
|
+
if (!directory)
|
|
21
|
+
return names;
|
|
22
|
+
let entries = 0;
|
|
23
|
+
for await (const entry of directory) {
|
|
24
|
+
if (++entries > 100)
|
|
25
|
+
throw new Error("More than 100 profile entries. Select the exact --source-path.");
|
|
26
|
+
if (entry.isDirectory() && !entry.isSymbolicLink() && valid(entry.name))
|
|
27
|
+
names.push(entry.name);
|
|
28
|
+
}
|
|
29
|
+
return names.sort();
|
|
30
|
+
}
|
|
31
|
+
export async function hermesLocations(root) {
|
|
32
|
+
// A launcher may already have selected a named profile. Never enumerate its siblings.
|
|
33
|
+
if (basename(dirname(root)) === "profiles")
|
|
34
|
+
return [{ root }];
|
|
35
|
+
const profiles = join(root, "profiles");
|
|
36
|
+
try {
|
|
37
|
+
const names = await profileNames(profiles, (name) => /^[a-z0-9][a-z0-9_-]{0,63}$/u.test(name));
|
|
38
|
+
const locations = [];
|
|
39
|
+
// Retained state.db is the only identity marker relevant to this history reader.
|
|
40
|
+
// Deleted profiles are deliberately excluded, even if their old DB remains.
|
|
41
|
+
for (const name of names) {
|
|
42
|
+
if (await stat(join(profiles, ".deleted", name)).then(() => true).catch(() => false))
|
|
43
|
+
continue;
|
|
44
|
+
if (await isFile(join(profiles, name, "state.db")))
|
|
45
|
+
locations.push({ root: join(profiles, name) });
|
|
46
|
+
}
|
|
47
|
+
let active = "";
|
|
48
|
+
const activeFile = join(root, "active_profile");
|
|
49
|
+
if (await stat(activeFile).then((s) => s.isFile() && s.size <= 1024).catch(() => false))
|
|
50
|
+
active = (await readFile(activeFile, "utf8")).replace(/^\uFEFF/u, "").trim().toLowerCase();
|
|
51
|
+
if (active && active !== "default") {
|
|
52
|
+
if (!/^[a-z0-9][a-z0-9_-]{0,63}$/u.test(active))
|
|
53
|
+
return [{ root, reason: "Hermes active profile is invalid. Select the exact --source-path." }];
|
|
54
|
+
const selected = locations.findIndex((location) => location.root === join(profiles, active));
|
|
55
|
+
if (selected < 0)
|
|
56
|
+
locations.unshift({ root: join(profiles, active), reason: "Hermes active profile has no retained live state database. Select a profile explicitly." });
|
|
57
|
+
else
|
|
58
|
+
locations.unshift(...locations.splice(selected, 1));
|
|
59
|
+
}
|
|
60
|
+
if (await isFile(join(root, "state.db")) || !locations.length)
|
|
61
|
+
locations.push({ root });
|
|
62
|
+
return locations;
|
|
63
|
+
}
|
|
64
|
+
catch (error) {
|
|
65
|
+
return [{ root, reason: error instanceof Error ? error.message : "Cannot inventory Hermes profiles. Select the exact --source-path." }];
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
function validOmpProfile(name) {
|
|
69
|
+
return /^[a-z0-9][a-z0-9._-]{0,63}$/u.test(name) && !name.endsWith(".") &&
|
|
70
|
+
!/^(?:con|prn|aux|nul|com[0-9]|lpt[0-9])(?:\.|$)/iu.test(name);
|
|
71
|
+
}
|
|
72
|
+
export async function ompLocations(home, env) {
|
|
73
|
+
const base = join(home, env.PI_CONFIG_DIR || ".omp");
|
|
74
|
+
const selected = (env.OMP_PROFILE !== undefined ? env.OMP_PROFILE : env.PI_PROFILE)?.trim();
|
|
75
|
+
if (selected && selected !== "default" && !validOmpProfile(selected))
|
|
76
|
+
return [{ root: base, reason: "Oh My Pi profile is invalid. Select the exact --source-path." }];
|
|
77
|
+
// Launch-time session override has higher priority than the agent directory.
|
|
78
|
+
if (env.PI_CODING_AGENT_SESSION_DIR)
|
|
79
|
+
return [{ root: resolve(env.PI_CODING_AGENT_SESSION_DIR) }];
|
|
80
|
+
const xdg = (process.platform === "linux" || process.platform === "darwin") && env.XDG_DATA_HOME
|
|
81
|
+
? join(env.XDG_DATA_HOME, "omp") : undefined;
|
|
82
|
+
async function location(profile) {
|
|
83
|
+
const standard = profile ? join(base, "profiles", profile, "agent") : join(base, "agent");
|
|
84
|
+
// Named profiles ignore the default-profile agent override. A native launch
|
|
85
|
+
// may export its own profile-derived value; explicit empty OMP_PROFILE clears it.
|
|
86
|
+
const inheritedProfile = env.PI_PROFILE?.trim();
|
|
87
|
+
const inherited = inheritedProfile && validOmpProfile(inheritedProfile)
|
|
88
|
+
? join(base, "profiles", inheritedProfile, "agent") : undefined;
|
|
89
|
+
const override = !profile && env.PI_CODING_AGENT_DIR && env.PI_CODING_AGENT_DIR !== inherited
|
|
90
|
+
? resolve(env.PI_CODING_AGENT_DIR) : undefined;
|
|
91
|
+
const candidate = xdg && (profile ? join(xdg, "profiles", profile) : xdg);
|
|
92
|
+
return { root: (!override || override === standard) && candidate && await isDirectory(candidate) ? candidate : override || standard };
|
|
93
|
+
}
|
|
94
|
+
if (selected || env.OMP_PROFILE !== undefined || env.PI_PROFILE !== undefined || env.PI_CODING_AGENT_DIR)
|
|
95
|
+
return [await location(selected && selected !== "default" ? selected : undefined)];
|
|
96
|
+
try {
|
|
97
|
+
const names = new Set(await profileNames(join(base, "profiles"), validOmpProfile));
|
|
98
|
+
if (xdg)
|
|
99
|
+
for (const name of await profileNames(join(xdg, "profiles"), validOmpProfile))
|
|
100
|
+
names.add(name);
|
|
101
|
+
const result = [await location()];
|
|
102
|
+
for (const name of [...names].sort()) {
|
|
103
|
+
const candidate = await location(name);
|
|
104
|
+
if (await isDirectory(join(candidate.root, "sessions")))
|
|
105
|
+
result.push(candidate);
|
|
106
|
+
}
|
|
107
|
+
return result;
|
|
108
|
+
}
|
|
109
|
+
catch (error) {
|
|
110
|
+
return [{ root: base, reason: error instanceof Error ? error.message : "Cannot inventory Oh My Pi profiles. Select the exact --source-path." }];
|
|
111
|
+
}
|
|
112
|
+
}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import { randomUUID } from "node:crypto";
|
|
2
|
+
import { retainAppImageRuntime, removeAppImageRuntimes } from "./appimage-runtime.js";
|
|
3
|
+
import { execFile } from "node:child_process";
|
|
4
|
+
import { promisify } from "node:util";
|
|
5
|
+
import { mkdir, writeFile, rm, rename } from "node:fs/promises";
|
|
6
|
+
import { homedir } from "node:os";
|
|
7
|
+
import { isAbsolute, join } from "node:path";
|
|
8
|
+
import { contentHash } from "@openpond/harness";
|
|
9
|
+
import { CollectorStore } from "./collector-store.js";
|
|
10
|
+
const execute = promisify(execFile);
|
|
11
|
+
const command = async (file, args) => {
|
|
12
|
+
await execute(file, args, {
|
|
13
|
+
timeout: 15000,
|
|
14
|
+
maxBuffer: 16384,
|
|
15
|
+
windowsHide: true,
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
const xml = (value) => value
|
|
19
|
+
.replace(/&/gu, "&")
|
|
20
|
+
.replace(/</gu, "<")
|
|
21
|
+
.replace(/>/gu, ">")
|
|
22
|
+
.replace(/"/gu, """);
|
|
23
|
+
const systemd = (value) => `"${value.replace(/\\/gu, "\\\\").replace(/"/gu, '\\"').replace(/%/gu, "%%").replace(/\$/gu, "$$")}"`;
|
|
24
|
+
function identity(directory) {
|
|
25
|
+
return `openpond-import-${contentHash(directory).slice(0, 16)}`;
|
|
26
|
+
}
|
|
27
|
+
export async function configureCollector(directory, connection) {
|
|
28
|
+
const store = await CollectorStore.open(directory);
|
|
29
|
+
try {
|
|
30
|
+
store.put(connection);
|
|
31
|
+
}
|
|
32
|
+
finally {
|
|
33
|
+
store.close();
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
export async function collectorStatus(directory) {
|
|
37
|
+
const store = await CollectorStore.open(directory);
|
|
38
|
+
try {
|
|
39
|
+
return store.status();
|
|
40
|
+
}
|
|
41
|
+
finally {
|
|
42
|
+
store.close();
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
export async function controlCollector(directory, action, connectionId) {
|
|
46
|
+
const store = await CollectorStore.open(directory);
|
|
47
|
+
try {
|
|
48
|
+
if (action === "start" || action === "stop")
|
|
49
|
+
store.set("desiredState", action === "start" ? "running" : "stopped");
|
|
50
|
+
else if (action === "sync")
|
|
51
|
+
store.set("syncNow", "yes");
|
|
52
|
+
else {
|
|
53
|
+
const connection = store
|
|
54
|
+
.connections()
|
|
55
|
+
.find((item) => item.id === connectionId);
|
|
56
|
+
if (!connection)
|
|
57
|
+
throw new Error("Select a retained connection.");
|
|
58
|
+
store.put({
|
|
59
|
+
...connection,
|
|
60
|
+
state: action === "pause"
|
|
61
|
+
? "paused"
|
|
62
|
+
: action === "resume"
|
|
63
|
+
? "active"
|
|
64
|
+
: "disconnected",
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
return store.status();
|
|
68
|
+
}
|
|
69
|
+
finally {
|
|
70
|
+
store.close();
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
/** Per-user logon supervision. Installing does not override the retained Stop intent. */
|
|
74
|
+
export async function installCollectorService(input) {
|
|
75
|
+
if (!isAbsolute(input.directory) ||
|
|
76
|
+
!isAbsolute(input.executable) ||
|
|
77
|
+
[input.directory, input.executable, ...input.args].some((value) => /[\r\n\0]/u.test(value)))
|
|
78
|
+
throw new Error("Collector service requires absolute paths and single-line arguments.");
|
|
79
|
+
const retainedRuntime = await retainAppImageRuntime(input);
|
|
80
|
+
if (retainedRuntime)
|
|
81
|
+
input = { ...input, ...retainedRuntime, environment: { ...input.environment, ELECTRON_RUN_AS_NODE: "1", APPIMAGE_EXTRACT_AND_RUN: "1" } };
|
|
82
|
+
const environment = Object.entries(input.environment ?? {});
|
|
83
|
+
if (environment.some(([key, value]) => !["OPENPOND_HOME", "ELECTRON_RUN_AS_NODE", "APPIMAGE_EXTRACT_AND_RUN"].includes(key) ||
|
|
84
|
+
typeof value !== "string" ||
|
|
85
|
+
/[\r\n\0]/u.test(value)))
|
|
86
|
+
throw new Error("Unsupported service environment setting.");
|
|
87
|
+
const home = input.home ?? homedir(), name = identity(input.directory);
|
|
88
|
+
const launch = [
|
|
89
|
+
...input.args,
|
|
90
|
+
"import",
|
|
91
|
+
"service",
|
|
92
|
+
"run",
|
|
93
|
+
"--collector-dir",
|
|
94
|
+
input.directory,
|
|
95
|
+
];
|
|
96
|
+
if (process.platform === "linux") {
|
|
97
|
+
const directory = join(home, ".config/systemd/user");
|
|
98
|
+
await mkdir(directory, { recursive: true, mode: 0o700 });
|
|
99
|
+
await atomicServiceFile(join(directory, `${name}.service`), `[Unit]\nDescription=OpenPond conversation importer\nAfter=network-online.target\n[Service]\nType=simple\n${environment.map(([key, value]) => `Environment=${systemd(`${key}=${value}`)}`).join("\n")}\nExecStart=${[input.executable, ...launch].map(systemd).join(" ")}\nRestart=on-failure\nRestartSec=5\nUMask=0077\nNoNewPrivileges=true\n[Install]\nWantedBy=default.target\n`, { mode: 0o600 });
|
|
100
|
+
await command("systemctl", ["--user", "daemon-reload"]);
|
|
101
|
+
await command("systemctl", ["--user", "enable", `${name}.service`]);
|
|
102
|
+
}
|
|
103
|
+
else if (process.platform === "darwin") {
|
|
104
|
+
const directory = join(home, "Library/LaunchAgents");
|
|
105
|
+
await mkdir(directory, { recursive: true, mode: 0o700 });
|
|
106
|
+
const file = join(directory, `${name}.plist`);
|
|
107
|
+
let loaded = false;
|
|
108
|
+
try {
|
|
109
|
+
await command("launchctl", ["print", `gui/${process.getuid()}/${name}`]);
|
|
110
|
+
loaded = true;
|
|
111
|
+
}
|
|
112
|
+
catch {
|
|
113
|
+
/* A first installation has no loaded job. Bootstrap below reports actual setup errors. */
|
|
114
|
+
}
|
|
115
|
+
if (loaded)
|
|
116
|
+
await command("launchctl", [
|
|
117
|
+
"bootout",
|
|
118
|
+
`gui/${process.getuid()}/${name}`,
|
|
119
|
+
]);
|
|
120
|
+
await writeFile(file, `<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0"><dict><key>Label</key><string>${name}</string><key>ProgramArguments</key><array>${[input.executable, ...launch].map((value) => `<string>${xml(value)}</string>`).join("")}</array><key>EnvironmentVariables</key><dict>${environment.map(([key, value]) => `<key>${xml(key)}</key><string>${xml(value)}</string>`).join("")}</dict><key>RunAtLoad</key><true/><key>KeepAlive</key><dict><key>SuccessfulExit</key><false/></dict><key>ThrottleInterval</key><integer>5</integer></dict></plist>`, { mode: 0o600 });
|
|
121
|
+
await command("launchctl", ["bootstrap", `gui/${process.getuid()}`, file]);
|
|
122
|
+
}
|
|
123
|
+
else if (process.platform === "win32") {
|
|
124
|
+
const user = (await execute("whoami", [], { timeout: 5000, maxBuffer: 1024 })).stdout.trim();
|
|
125
|
+
const file = join(input.directory, "scheduled-task.xml");
|
|
126
|
+
await mkdir(input.directory, { recursive: true });
|
|
127
|
+
const quoted = (value) => `"${value.replace(/(\\*)"/gu, '$1$1\\"').replace(/(\\+)$/u, "$1$1")}"`;
|
|
128
|
+
const script = join(input.directory, "start-collector.ps1");
|
|
129
|
+
const ps = (value) => `'${value.replace(/'/gu, "''")}'`;
|
|
130
|
+
await writeFile(script, `${environment.map(([key, value]) => `$env:${key} = ${ps(value)}`).join("\n")}\n& ${[input.executable, ...launch].map(ps).join(" ")}\nexit $LASTEXITCODE\n`, { mode: 0o600 });
|
|
131
|
+
await writeFile(file, `<?xml version="1.0"?><Task version="1.4" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task"><Triggers><LogonTrigger><Enabled>true</Enabled><UserId>${xml(user)}</UserId></LogonTrigger></Triggers><Principals><Principal id="Owner"><UserId>${xml(user)}</UserId><LogonType>InteractiveToken</LogonType><RunLevel>LeastPrivilege</RunLevel></Principal></Principals><Settings><MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy><DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries><StopIfGoingOnBatteries>false</StopIfGoingOnBatteries><ExecutionTimeLimit>PT0S</ExecutionTimeLimit><RestartOnFailure><Interval>PT1M</Interval><Count>999</Count></RestartOnFailure></Settings><Actions Context="Owner"><Exec><Command>powershell.exe</Command><Arguments>${xml(["-NoProfile", "-NonInteractive", "-File", script].map(quoted).join(" "))}</Arguments></Exec></Actions></Task>`, { mode: 0o600 });
|
|
132
|
+
await command("schtasks", ["/Create", "/TN", name, "/XML", file, "/F"]);
|
|
133
|
+
}
|
|
134
|
+
else
|
|
135
|
+
throw new Error("This OS has no qualified per-user supervisor. Run the collector in the foreground.");
|
|
136
|
+
return {
|
|
137
|
+
name,
|
|
138
|
+
platform: process.platform,
|
|
139
|
+
status: await collectorStatus(input.directory),
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
/** Removing supervision preserves receipts, pending uploads and retained datasets. */
|
|
143
|
+
export async function uninstallCollectorService(directory, home = homedir()) {
|
|
144
|
+
await controlCollector(directory, "stop");
|
|
145
|
+
const name = identity(directory);
|
|
146
|
+
if (process.platform === "linux") {
|
|
147
|
+
await command("systemctl", [
|
|
148
|
+
"--user",
|
|
149
|
+
"disable",
|
|
150
|
+
"--now",
|
|
151
|
+
`${name}.service`,
|
|
152
|
+
]);
|
|
153
|
+
await rm(join(home, ".config/systemd/user", `${name}.service`), {
|
|
154
|
+
force: true,
|
|
155
|
+
});
|
|
156
|
+
await command("systemctl", ["--user", "daemon-reload"]);
|
|
157
|
+
}
|
|
158
|
+
else if (process.platform === "darwin") {
|
|
159
|
+
await command("launchctl", ["bootout", `gui/${process.getuid()}/${name}`]);
|
|
160
|
+
await rm(join(home, "Library/LaunchAgents", `${name}.plist`), {
|
|
161
|
+
force: true,
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
else if (process.platform === "win32") {
|
|
165
|
+
await command("schtasks", ["/End", "/TN", name]);
|
|
166
|
+
await command("schtasks", ["/Delete", "/TN", name, "/F"]);
|
|
167
|
+
await rm(join(directory, "scheduled-task.xml"), { force: true });
|
|
168
|
+
await rm(join(directory, "start-collector.ps1"), { force: true });
|
|
169
|
+
}
|
|
170
|
+
else
|
|
171
|
+
throw new Error("No per-user supervisor is available.");
|
|
172
|
+
if (process.platform === "linux")
|
|
173
|
+
await removeAppImageRuntimes(directory);
|
|
174
|
+
return collectorStatus(directory);
|
|
175
|
+
}
|
|
176
|
+
export async function startCollectorService(directory) {
|
|
177
|
+
await controlCollector(directory, "start");
|
|
178
|
+
const name = identity(directory);
|
|
179
|
+
try {
|
|
180
|
+
if (process.platform === "linux")
|
|
181
|
+
await command("systemctl", ["--user", "restart", `${name}.service`]);
|
|
182
|
+
else if (process.platform === "darwin")
|
|
183
|
+
await command("launchctl", [
|
|
184
|
+
"kickstart",
|
|
185
|
+
"-k",
|
|
186
|
+
`gui/${process.getuid()}/${name}`,
|
|
187
|
+
]);
|
|
188
|
+
else if (process.platform === "win32")
|
|
189
|
+
await command("schtasks", ["/Run", "/TN", name]);
|
|
190
|
+
else
|
|
191
|
+
throw new Error("No per-user supervisor is available.");
|
|
192
|
+
}
|
|
193
|
+
catch (error) {
|
|
194
|
+
await controlCollector(directory, "stop");
|
|
195
|
+
throw error;
|
|
196
|
+
}
|
|
197
|
+
return collectorStatus(directory);
|
|
198
|
+
}
|
|
199
|
+
async function atomicServiceFile(file, text, options) {
|
|
200
|
+
const temporary = `${file}.${randomUUID()}.tmp`;
|
|
201
|
+
try {
|
|
202
|
+
await writeFile(temporary, text, { ...options, flag: "wx" });
|
|
203
|
+
await rename(temporary, file);
|
|
204
|
+
}
|
|
205
|
+
finally {
|
|
206
|
+
await rm(temporary, { force: true });
|
|
207
|
+
}
|
|
208
|
+
}
|
package/dist/rewards.js
CHANGED
|
@@ -163,7 +163,7 @@ export async function executeRewardBinding(input) {
|
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
165
|
else {
|
|
166
|
-
const [evidence] = await gradeEvidence({ task: input.task, evidence: input.evidence, graders: [compileSource(source, reward)], modelJudge: input.modelJudge, customVerifier: input.customVerifier, purpose: input.purpose, signal: input.signal });
|
|
166
|
+
const [evidence] = await gradeEvidence({ task: input.task, evidence: input.evidence, evaluatorContext: input.evaluatorContext, graders: [compileSource(source, reward)], modelJudge: input.modelJudge, customVerifier: input.customVerifier, purpose: input.purpose, signal: input.signal });
|
|
167
167
|
if (!evidence)
|
|
168
168
|
throw new LearningDomainError("reward_evidence_missing");
|
|
169
169
|
Object.assign(result, { status: evidence.score === null ? "unavailable" : "scored", rawScore: evidence.score, passed: evidence.score === null ? null : evidence.passed, evidenceHashes: [evidence.contentHash], graderEvidence: evidence, message: evidence.feedback.join("\n") });
|
|
@@ -18,6 +18,10 @@ export declare const ConnectedSourceKindSchema: z.ZodEnum<{
|
|
|
18
18
|
native_work: "native_work";
|
|
19
19
|
codex: "codex";
|
|
20
20
|
claude_code: "claude_code";
|
|
21
|
+
opencode: "opencode";
|
|
22
|
+
grok_build: "grok_build";
|
|
23
|
+
pi: "pi";
|
|
24
|
+
oh_my_pi: "oh_my_pi";
|
|
21
25
|
}>;
|
|
22
26
|
export declare const ConnectedUsageSchema: z.ZodObject<{
|
|
23
27
|
invocationId: z.ZodString;
|
|
@@ -117,11 +121,19 @@ export declare const ConnectedSessionSchema: z.ZodObject<{
|
|
|
117
121
|
native_work: "native_work";
|
|
118
122
|
codex: "codex";
|
|
119
123
|
claude_code: "claude_code";
|
|
124
|
+
opencode: "opencode";
|
|
125
|
+
grok_build: "grok_build";
|
|
126
|
+
pi: "pi";
|
|
127
|
+
oh_my_pi: "oh_my_pi";
|
|
120
128
|
}>;
|
|
121
129
|
sessionId: z.ZodString;
|
|
122
130
|
branchId: z.ZodNullable<z.ZodString>;
|
|
123
131
|
parentSessionId: z.ZodNullable<z.ZodString>;
|
|
124
132
|
exporterVersion: z.ZodNullable<z.ZodString>;
|
|
133
|
+
acquisition: z.ZodOptional<z.ZodObject<{
|
|
134
|
+
machineId: z.ZodString;
|
|
135
|
+
sourceInstanceId: z.ZodString;
|
|
136
|
+
}, z.core.$strict>>;
|
|
125
137
|
sourceFiles: z.ZodArray<z.ZodObject<{
|
|
126
138
|
path: z.ZodString;
|
|
127
139
|
contentHash: z.ZodString;
|
|
@@ -252,6 +264,9 @@ export type ConnectedFile = {
|
|
|
252
264
|
text: string;
|
|
253
265
|
};
|
|
254
266
|
export declare function hasRecordedConnectedAnswer(event: ConnectedEvent): boolean;
|
|
267
|
+
/** Status/discovery returns no evaluator payload. Large retained histories still
|
|
268
|
+
* require the exact session, input, observed-output and answer hashes to match. */
|
|
269
|
+
export declare function resolveConnectedBoundaryMetadata(sessionValue: unknown, boundaryId: string): ConnectedBoundary;
|
|
255
270
|
/** Bytes stay in one immutable snapshot; cases retain cutoffs, not copied history. */
|
|
256
271
|
export declare function resolveConnectedBoundary(sessionValue: unknown, boundaryId: string): {
|
|
257
272
|
input: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../../../../src/connected-evidence/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,0BAA0B,EAAG,+BAAwC,CAAC;AACnF,eAAO,MAAM,4BAA4B,EAAG,sBAA+B,CAAC;AAC5E,eAAO,MAAM,yBAAyB;;;;;;;;;CACuF,CAAC;AAK9H,eAAO,MAAM,yBAAyB
|
|
1
|
+
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../../../../src/connected-evidence/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,0BAA0B,EAAG,+BAAwC,CAAC;AACnF,eAAO,MAAM,4BAA4B,EAAG,sBAA+B,CAAC;AAC5E,eAAO,MAAM,yBAAyB;;;;;;;;;CACuF,CAAC;AAK9H,eAAO,MAAM,yBAAyB;;;;;;;;;;;EAAmI,CAAC;AAC1K,eAAO,MAAM,oBAAoB;;;;;;;;;;;kBAGtB,CAAC;AACZ,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAMtB,CAAC;AACZ,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAQzB,CAAC;AACZ,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAUxB,CAAC;AACZ,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACtE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACxE,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC5E,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,aAAa,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAC3D,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,cAAc,WAK/D;AAkBD;mFACmF;AACnF,wBAAgB,gCAAgC,CAAC,YAAY,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,GAAG,iBAAiB,CAE7G;AACD,sFAAsF;AACtF,wBAAgB,wBAAwB,CAAC,YAAY,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKjF"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { type ConnectedFile, type ConnectedSession, type ConnectedSourceKind } from "./contracts.js";
|
|
2
2
|
export type ExternalAgentSource = Exclude<ConnectedSourceKind, "native_chat" | "native_work">;
|
|
3
|
+
/** Cache identity includes source projection policy, independent of file mtimes. */
|
|
4
|
+
export declare function agentImportNormalizerRevision(source: ExternalAgentSource): string;
|
|
3
5
|
export type AgentImportPreview = {
|
|
4
6
|
schemaVersion: "openpond.agentImportPreview.v1";
|
|
5
7
|
source: ExternalAgentSource;
|
|
@@ -15,5 +17,9 @@ export declare function previewAgentImport(input: {
|
|
|
15
17
|
source: ExternalAgentSource;
|
|
16
18
|
files: ConnectedFile[];
|
|
17
19
|
branchLeafId?: string;
|
|
20
|
+
acquisition?: {
|
|
21
|
+
machineId: string;
|
|
22
|
+
sourceInstanceId: string;
|
|
23
|
+
};
|
|
18
24
|
}): AgentImportPreview;
|
|
19
25
|
//# sourceMappingURL=imports.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imports.d.ts","sourceRoot":"","sources":["../../../../../src/connected-evidence/imports.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"imports.d.ts","sourceRoot":"","sources":["../../../../../src/connected-evidence/imports.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACzB,MAAM,gBAAgB,CAAC;AAaxB,MAAM,MAAM,mBAAmB,GAAG,OAAO,CACvC,mBAAmB,EACnB,aAAa,GAAG,aAAa,CAC9B,CAAC;AACF,oFAAoF;AACpF,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,mBAAmB,UAExE;AACD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,aAAa,EAAE,gCAAgC,CAAC;IAChD,MAAM,EAAE,mBAAmB,CAAC;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAC7B,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC7C,CAAC;AAEF,iFAAiF;AACjF,wBAAgB,kBAAkB,CAAC,KAAK,EAAE;IACxC,MAAM,EAAE,mBAAmB,CAAC;IAC5B,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,gBAAgB,EAAE,MAAM,CAAA;KAAE,CAAC;CAC/D,GAAG,kBAAkB,CA+IrB"}
|
|
@@ -17,6 +17,10 @@ export declare function normalizeConnectedSession(input: {
|
|
|
17
17
|
contextComplete?: boolean;
|
|
18
18
|
includeConversation?: boolean;
|
|
19
19
|
unmappedEvents?: ConnectedEvent[];
|
|
20
|
+
acquisition?: {
|
|
21
|
+
machineId: string;
|
|
22
|
+
sourceInstanceId: string;
|
|
23
|
+
};
|
|
20
24
|
}): ConnectedSession;
|
|
21
25
|
export declare function connectedJsonLines(file: ConnectedFile): Record<string, unknown>[];
|
|
22
26
|
export declare function object(value: unknown): Record<string, unknown>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../../../../../src/connected-evidence/normalize.ts"],"names":[],"mappings":"AACA,OAAO,EACmB,KAAK,cAAc,EAAE,KAAK,aAAa,EAAE,KAAK,gBAAgB,EAAE,KAAK,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAE3I,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,GAAE,SAAS,GAAG,cAA+B,GAAG,MAAM,GAAG,IAAI,CAIpH;AACD,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,aAAa;;;;EAExD;AACD,wBAAgB,yBAAyB,CAAC,KAAK,EAAE;IAC/C,MAAM,EAAE,mBAAmB,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1G,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,KAAK,EAAE,aAAa,EAAE,CAAC;IAAC,MAAM,EAAE,cAAc,EAAE,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IAAC,eAAe,CAAC,EAAE,OAAO,CAAC;IAAC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IACjK,cAAc,CAAC,EAAE,cAAc,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../../../../../src/connected-evidence/normalize.ts"],"names":[],"mappings":"AACA,OAAO,EACmB,KAAK,cAAc,EAAE,KAAK,aAAa,EAAE,KAAK,gBAAgB,EAAE,KAAK,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAE3I,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,GAAE,SAAS,GAAG,cAA+B,GAAG,MAAM,GAAG,IAAI,CAIpH;AACD,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,aAAa;;;;EAExD;AACD,wBAAgB,yBAAyB,CAAC,KAAK,EAAE;IAC/C,MAAM,EAAE,mBAAmB,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1G,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,KAAK,EAAE,aAAa,EAAE,CAAC;IAAC,MAAM,EAAE,cAAc,EAAE,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IAAC,eAAe,CAAC,EAAE,OAAO,CAAC;IAAC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IACjK,cAAc,CAAC,EAAE,cAAc,EAAE,CAAC;IAAC,WAAW,CAAC,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,gBAAgB,EAAE,MAAM,CAAA;KAAE,CAAC;CAClG,GAAG,gBAAgB,CAqDnB;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAWjF;AACD,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAE9D;AACD,wBAAgB,KAAK,CAAC,KAAK,EAAE,OAAO,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC,cAAc,EAAE,IAAI,GAAG,MAAM,GAAG,SAAS,CAAC,GAAG,cAAc,CAEtH;AACD,wBAAgB,IAAI,CAAC,KAAK,EAAE,OAAO,GAAG,cAAc,CAAC,SAAS,CAAC,CAAsD"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type ClaudeBranch = {
|
|
2
|
+
leafId: string;
|
|
3
|
+
chainHash: string;
|
|
4
|
+
title: string;
|
|
5
|
+
updatedAt: string | null;
|
|
6
|
+
messages: number;
|
|
7
|
+
};
|
|
8
|
+
/** One native graph owns selection, import and Desktop inspection semantics. */
|
|
9
|
+
export declare function claudeGraph(rows: Record<string, unknown>[]): {
|
|
10
|
+
sessionId: string;
|
|
11
|
+
leaves: Record<string, unknown>[];
|
|
12
|
+
select: (leafId: string) => {
|
|
13
|
+
chain: Record<string, unknown>[];
|
|
14
|
+
missingParent: boolean;
|
|
15
|
+
chainHash: string;
|
|
16
|
+
};
|
|
17
|
+
branches: () => ClaudeBranch[];
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=claude-branches.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-branches.d.ts","sourceRoot":"","sources":["../../../../../../src/connected-evidence/sources/claude-branches.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,YAAY,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAE5H,gFAAgF;AAChF,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE;;;qBAWjC,MAAM;;;;;oBAeT,YAAY,EAAE;EAYpC"}
|
|
@@ -2,7 +2,7 @@ import type { ConnectedFile } from "../contracts.js";
|
|
|
2
2
|
export declare function parseClaudeSession(file: ConnectedFile, rows: Record<string, unknown>[], leafId?: string): {
|
|
3
3
|
schemaVersion: "openpond.connectedEvidence.v1";
|
|
4
4
|
normalizerVersion: "connected-evidence-1";
|
|
5
|
-
origin: "hermes" | "openclaw" | "native_chat" | "native_work" | "codex" | "claude_code";
|
|
5
|
+
origin: "hermes" | "openclaw" | "native_chat" | "native_work" | "codex" | "claude_code" | "opencode" | "grok_build" | "pi" | "oh_my_pi";
|
|
6
6
|
sessionId: string;
|
|
7
7
|
branchId: string | null;
|
|
8
8
|
parentSessionId: string | null;
|
|
@@ -70,5 +70,9 @@ export declare function parseClaudeSession(file: ConnectedFile, rows: Record<str
|
|
|
70
70
|
}[];
|
|
71
71
|
warnings: string[];
|
|
72
72
|
contentHash: string;
|
|
73
|
+
acquisition?: {
|
|
74
|
+
machineId: string;
|
|
75
|
+
sourceInstanceId: string;
|
|
76
|
+
} | undefined;
|
|
73
77
|
};
|
|
74
78
|
//# sourceMappingURL=claude-code.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-code.d.ts","sourceRoot":"","sources":["../../../../../../src/connected-evidence/sources/claude-code.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"claude-code.d.ts","sourceRoot":"","sources":["../../../../../../src/connected-evidence/sources/claude-code.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAkB,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAIrE,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EAAE,MAAM,CAAC,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkCvG"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const CODEX_AUTHORIZATION_PROJECTION_POLICY = "codex-native-authorization-v1";
|
|
2
|
+
declare const POLICY = "codex-native-authorization-v1";
|
|
3
|
+
type Omission = {
|
|
4
|
+
policy: typeof POLICY;
|
|
5
|
+
sourcePath: string;
|
|
6
|
+
sourceHash: string;
|
|
7
|
+
entries: number | null;
|
|
8
|
+
};
|
|
9
|
+
/** Native approved-command rules are account authority, not observed tool calls.
|
|
10
|
+
* Retain all other context and the original file/event identity. Unknown formats
|
|
11
|
+
* remain untouched for ordinary privacy admission; this is not secret scrubbing.
|
|
12
|
+
*/
|
|
13
|
+
export declare function projectCodexAuthorization(row: Record<string, unknown>): {
|
|
14
|
+
row: Record<string, unknown>;
|
|
15
|
+
omissions: Omission[];
|
|
16
|
+
};
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=codex-authorization.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codex-authorization.d.ts","sourceRoot":"","sources":["../../../../../../src/connected-evidence/sources/codex-authorization.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,qCAAqC,kCAAkC,CAAC;AACrF,QAAA,MAAM,MAAM,kCAAwC,CAAC;AACrD,KAAK,QAAQ,GAAG;IAAE,MAAM,EAAE,OAAO,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC;AAE1G;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;EAqCrE"}
|
|
@@ -2,7 +2,7 @@ import type { ConnectedFile } from "../contracts.js";
|
|
|
2
2
|
export declare function parseCodexSession(file: ConnectedFile, rows: Record<string, unknown>[]): {
|
|
3
3
|
schemaVersion: "openpond.connectedEvidence.v1";
|
|
4
4
|
normalizerVersion: "connected-evidence-1";
|
|
5
|
-
origin: "hermes" | "openclaw" | "native_chat" | "native_work" | "codex" | "claude_code";
|
|
5
|
+
origin: "hermes" | "openclaw" | "native_chat" | "native_work" | "codex" | "claude_code" | "opencode" | "grok_build" | "pi" | "oh_my_pi";
|
|
6
6
|
sessionId: string;
|
|
7
7
|
branchId: string | null;
|
|
8
8
|
parentSessionId: string | null;
|
|
@@ -70,5 +70,9 @@ export declare function parseCodexSession(file: ConnectedFile, rows: Record<stri
|
|
|
70
70
|
}[];
|
|
71
71
|
warnings: string[];
|
|
72
72
|
contentHash: string;
|
|
73
|
+
acquisition?: {
|
|
74
|
+
machineId: string;
|
|
75
|
+
sourceInstanceId: string;
|
|
76
|
+
} | undefined;
|
|
73
77
|
};
|
|
74
78
|
//# sourceMappingURL=codex.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codex.d.ts","sourceRoot":"","sources":["../../../../../../src/connected-evidence/sources/codex.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAkB,aAAa,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"codex.d.ts","sourceRoot":"","sources":["../../../../../../src/connected-evidence/sources/codex.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAkB,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAKrE,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmCrF"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { ConnectedFile } from "../contracts.js";
|
|
2
|
+
/** Retained ACP updates are native Grok history; Markdown exports are not accepted. */
|
|
3
|
+
export declare function parseGrokBuildSession(file: ConnectedFile, rows: Record<string, unknown>[]): {
|
|
4
|
+
schemaVersion: "openpond.connectedEvidence.v1";
|
|
5
|
+
normalizerVersion: "connected-evidence-1";
|
|
6
|
+
origin: "hermes" | "openclaw" | "native_chat" | "native_work" | "codex" | "claude_code" | "opencode" | "grok_build" | "pi" | "oh_my_pi";
|
|
7
|
+
sessionId: string;
|
|
8
|
+
branchId: string | null;
|
|
9
|
+
parentSessionId: string | null;
|
|
10
|
+
exporterVersion: string | null;
|
|
11
|
+
sourceFiles: {
|
|
12
|
+
path: string;
|
|
13
|
+
contentHash: string;
|
|
14
|
+
sizeBytes: number;
|
|
15
|
+
}[];
|
|
16
|
+
events: {
|
|
17
|
+
id: string;
|
|
18
|
+
sequence: number;
|
|
19
|
+
occurredAt: string | null;
|
|
20
|
+
kind: "message" | "unknown" | "artifact" | "terminal" | "usage" | "tool_call" | "tool_result" | "compaction";
|
|
21
|
+
role: "user" | "tool" | "assistant" | "system" | null;
|
|
22
|
+
callId: string | null;
|
|
23
|
+
parentId: string | null;
|
|
24
|
+
content: import("zod").JSONType;
|
|
25
|
+
usage: {
|
|
26
|
+
invocationId: string;
|
|
27
|
+
inputTokens: number | null;
|
|
28
|
+
outputTokens: number | null;
|
|
29
|
+
cachedInputTokens: number | null;
|
|
30
|
+
totalTokens: number | null;
|
|
31
|
+
provenance: "billed_invocation" | "reported_invocation" | "reported_cumulative";
|
|
32
|
+
} | null;
|
|
33
|
+
}[];
|
|
34
|
+
unmappedEvents: {
|
|
35
|
+
id: string;
|
|
36
|
+
sequence: number;
|
|
37
|
+
occurredAt: string | null;
|
|
38
|
+
kind: "message" | "unknown" | "artifact" | "terminal" | "usage" | "tool_call" | "tool_result" | "compaction";
|
|
39
|
+
role: "user" | "tool" | "assistant" | "system" | null;
|
|
40
|
+
callId: string | null;
|
|
41
|
+
parentId: string | null;
|
|
42
|
+
content: import("zod").JSONType;
|
|
43
|
+
usage: {
|
|
44
|
+
invocationId: string;
|
|
45
|
+
inputTokens: number | null;
|
|
46
|
+
outputTokens: number | null;
|
|
47
|
+
cachedInputTokens: number | null;
|
|
48
|
+
totalTokens: number | null;
|
|
49
|
+
provenance: "billed_invocation" | "reported_invocation" | "reported_cumulative";
|
|
50
|
+
} | null;
|
|
51
|
+
}[];
|
|
52
|
+
boundaries: {
|
|
53
|
+
id: string;
|
|
54
|
+
familyKey: string;
|
|
55
|
+
projection: "turn" | "conversation";
|
|
56
|
+
requestEventId: string;
|
|
57
|
+
start: number;
|
|
58
|
+
end: number;
|
|
59
|
+
inputHash: string;
|
|
60
|
+
outputHash: string | null;
|
|
61
|
+
revisionHash: string;
|
|
62
|
+
terminal: "unknown" | "cancelled" | "failed" | "completed";
|
|
63
|
+
coverage: {
|
|
64
|
+
answer: boolean;
|
|
65
|
+
context: "unknown" | "retained" | "compacted";
|
|
66
|
+
process: "absent" | "partial" | "retained";
|
|
67
|
+
artifacts: "absent" | "retained" | "references_only";
|
|
68
|
+
replay: "unavailable";
|
|
69
|
+
gaps: string[];
|
|
70
|
+
};
|
|
71
|
+
}[];
|
|
72
|
+
warnings: string[];
|
|
73
|
+
contentHash: string;
|
|
74
|
+
acquisition?: {
|
|
75
|
+
machineId: string;
|
|
76
|
+
sourceInstanceId: string;
|
|
77
|
+
} | undefined;
|
|
78
|
+
};
|
|
79
|
+
//# sourceMappingURL=grok-build.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grok-build.d.ts","sourceRoot":"","sources":["../../../../../../src/connected-evidence/sources/grok-build.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAkB,aAAa,EAAE,MAAM,iBAAiB,CAAC;AASrE,uFAAuF;AACvF,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,aAAa,EACnB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4JhC"}
|