codiedev 0.9.80 → 0.10.0-beta.10
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 +12 -5
- package/dist/backup/cache.js +1 -5
- package/dist/backup/match.js +0 -6
- package/dist/backup/run.js +3 -35
- package/dist/captureExclusions.js +0 -12
- package/dist/captureLog.js +0 -28
- package/dist/captureReadiness.js +0 -58
- package/dist/captureSignals.js +0 -11
- package/dist/cli.js +11 -33
- package/dist/cliSession.js +3 -60
- package/dist/codexHookTrust.js +0 -28
- package/dist/codexLimitScan.js +0 -107
- package/dist/codie.js +64 -57
- package/dist/codieBrandInstall.js +0 -18
- package/dist/codieLauncher.js +1 -72
- package/dist/codieRuntime.js +27 -32
- package/dist/codieRuntimeInstall.js +11 -43
- package/dist/codieUsage.js +0 -49
- package/dist/commands/agentTemplates.generated.js +136 -0
- package/dist/commands/agents.js +1088 -0
- package/dist/commands/agentsSdk.generated.js +7 -0
- package/dist/commands/ask.js +0 -3
- package/dist/commands/capture.js +0 -2
- package/dist/commands/createTicket.js +0 -10
- package/dist/commands/doctor.js +2 -72
- package/dist/commands/evals.js +3 -9
- package/dist/commands/inbox.js +0 -2
- package/dist/commands/library.js +0 -3
- package/dist/commands/pack.js +0 -29
- package/dist/commands/ping.js +0 -2
- package/dist/commands/pull.js +0 -9
- package/dist/commands/push.js +0 -12
- package/dist/commands/search.js +0 -4
- package/dist/commands/send.js +0 -5
- package/dist/commands/share.js +0 -4
- package/dist/commands/shared.js +0 -35
- package/dist/commands/traces.js +0 -13
- package/dist/commands/tracesLabel.js +0 -8
- package/dist/configDir.js +1 -18
- package/dist/connect.js +3 -75
- package/dist/connectFlow.js +0 -15
- package/dist/copilotHooks.js +0 -67
- package/dist/copilotInstallation.js +0 -1
- package/dist/cursorHooks.js +1 -11
- package/dist/cursorLifecycle.js +1 -7
- package/dist/detection.js +0 -30
- package/dist/harnessDirs.js +0 -19
- package/dist/hook.js +43 -293
- package/dist/inboxFormat.js +0 -24
- package/dist/launchContext.js +0 -50
- package/dist/launcher.js +0 -33
- package/dist/limitEvent.js +2 -34
- package/dist/managedPi.js +2 -50
- package/dist/mcp.js +0 -48
- package/dist/nativeSteering.js +1 -4
- package/dist/packs/codie.js +0 -15
- package/dist/packs/harnesses.js +1 -38
- package/dist/packs/hookGate.js +0 -33
- package/dist/packs/install.js +0 -20
- package/dist/packs/manifest.js +1 -15
- package/dist/packs/paths.js +0 -8
- package/dist/packs/shim.js +0 -8
- package/dist/packs/store.js +0 -12
- package/dist/packs/sync.js +0 -20
- package/dist/piHooks.js +4 -45
- package/dist/piRuntime.js +0 -18
- package/dist/repoResolver.js +0 -19
- package/dist/secret.js +0 -3
- package/dist/selfUpdate.js +2 -77
- package/dist/skillMarker.js +0 -14
- package/dist/subagents.js +0 -18
- package/dist/teamSkillContext.js +0 -1
- package/dist/transcriptModels.js +0 -8
- package/dist/upgradeNudge.js +1 -30
- package/dist/utils.js +165 -768
- package/dist/version.js +0 -10
- package/dist/versionCheck.js +0 -33
- package/package.json +13 -8
- package/dist/backup/cache.d.ts +0 -14
- package/dist/backup/match.d.ts +0 -2
- package/dist/backup/run.d.ts +0 -25
- package/dist/captureExclusions.d.ts +0 -30
- package/dist/captureLog.d.ts +0 -20
- package/dist/captureReadiness.d.ts +0 -65
- package/dist/captureSignals.d.ts +0 -47
- package/dist/cli.d.ts +0 -15
- package/dist/cliSession.d.ts +0 -108
- package/dist/codexHookTrust.d.ts +0 -49
- package/dist/codexLimitScan.d.ts +0 -64
- package/dist/codie.d.ts +0 -2
- package/dist/codieBrandInstall.d.ts +0 -11
- package/dist/codieLauncher.d.ts +0 -87
- package/dist/codieRuntime.d.ts +0 -35
- package/dist/codieRuntimeInstall.d.ts +0 -56
- package/dist/codieUsage.d.ts +0 -64
- package/dist/commands/ask.d.ts +0 -1
- package/dist/commands/capture.d.ts +0 -14
- package/dist/commands/createTicket.d.ts +0 -27
- package/dist/commands/delete.d.ts +0 -1
- package/dist/commands/doctor.d.ts +0 -9
- package/dist/commands/evals.d.ts +0 -3
- package/dist/commands/inbox.d.ts +0 -3
- package/dist/commands/library.d.ts +0 -2
- package/dist/commands/note.d.ts +0 -1
- package/dist/commands/pack.d.ts +0 -54
- package/dist/commands/ping.d.ts +0 -1
- package/dist/commands/pull.d.ts +0 -2
- package/dist/commands/push.d.ts +0 -33
- package/dist/commands/search.d.ts +0 -2
- package/dist/commands/send.d.ts +0 -2
- package/dist/commands/share.d.ts +0 -2
- package/dist/commands/shared.d.ts +0 -64
- package/dist/commands/traces.d.ts +0 -72
- package/dist/commands/tracesLabel.d.ts +0 -24
- package/dist/configDir.d.ts +0 -10
- package/dist/connect.d.ts +0 -1
- package/dist/connectFlow.d.ts +0 -34
- package/dist/copilotHooks.d.ts +0 -85
- package/dist/copilotInstallation.d.ts +0 -10
- package/dist/cursorHooks.d.ts +0 -13
- package/dist/cursorLifecycle.d.ts +0 -2
- package/dist/detection.d.ts +0 -30
- package/dist/harnessDirs.d.ts +0 -15
- package/dist/hook.d.ts +0 -6
- package/dist/inboxFormat.d.ts +0 -38
- package/dist/launchContext.d.ts +0 -46
- package/dist/launcher.d.ts +0 -25
- package/dist/limitEvent.d.ts +0 -15
- package/dist/limitEventReporter.d.ts +0 -21
- package/dist/managedPi.d.ts +0 -48
- package/dist/mcp.d.ts +0 -12
- package/dist/nativeSteering.d.ts +0 -5
- package/dist/packs/codie.d.ts +0 -45
- package/dist/packs/harnesses.d.ts +0 -74
- package/dist/packs/hookGate.d.ts +0 -53
- package/dist/packs/install.d.ts +0 -46
- package/dist/packs/manifest.d.ts +0 -52
- package/dist/packs/paths.d.ts +0 -17
- package/dist/packs/shim.d.ts +0 -26
- package/dist/packs/store.d.ts +0 -42
- package/dist/packs/sync.d.ts +0 -40
- package/dist/piHooks.d.ts +0 -22
- package/dist/piRuntime.d.ts +0 -26
- package/dist/repoResolver.d.ts +0 -17
- package/dist/secret.d.ts +0 -1
- package/dist/selfUpdate.d.ts +0 -64
- package/dist/skillMarker.d.ts +0 -6
- package/dist/subagents.d.ts +0 -36
- package/dist/teamSkillContext.d.ts +0 -9
- package/dist/transcriptModels.d.ts +0 -20
- package/dist/upgradeNudge.d.ts +0 -24
- package/dist/utils.d.ts +0 -396
- package/dist/version.d.ts +0 -1
- package/dist/versionCheck.d.ts +0 -68
package/dist/cursorHooks.js
CHANGED
|
@@ -5,7 +5,6 @@ exports.normalizeCursorTranscript = normalizeCursorTranscript;
|
|
|
5
5
|
exports.isCursorTranscriptEmpty = isCursorTranscriptEmpty;
|
|
6
6
|
exports.cursorTranscriptHasUsage = cursorTranscriptHasUsage;
|
|
7
7
|
exports.cursorObservedModel = cursorObservedModel;
|
|
8
|
-
/** Normalize Cursor's native hook payload into the shared capture shape. */
|
|
9
8
|
function normalizeCursorHookInput(input) {
|
|
10
9
|
const sessionId = firstString(input.session_id, input.sessionId, input.conversation_id);
|
|
11
10
|
const roots = Array.isArray(input.workspace_roots)
|
|
@@ -26,7 +25,6 @@ function normalizeCursorHookInput(input) {
|
|
|
26
25
|
...(duration !== undefined ? { duration_ms: duration } : {}),
|
|
27
26
|
};
|
|
28
27
|
}
|
|
29
|
-
/** Normalize Cursor message roles and native tools at the capture boundary. */
|
|
30
28
|
function normalizeCursorTranscript(content) {
|
|
31
29
|
return content
|
|
32
30
|
.split("\n")
|
|
@@ -51,17 +49,11 @@ function normalizeCursorTranscript(content) {
|
|
|
51
49
|
return JSON.stringify({ ...entry, type, ...(message ? { message: { ...message, content } } : {}) });
|
|
52
50
|
}
|
|
53
51
|
catch {
|
|
54
|
-
// Preserve malformed/non-JSON lines; tolerant downstream parsers skip
|
|
55
|
-
// anything they cannot consume.
|
|
56
52
|
}
|
|
57
53
|
return line;
|
|
58
54
|
})
|
|
59
55
|
.join("\n");
|
|
60
56
|
}
|
|
61
|
-
/** Cursor may change its private JSONL record shape independently of the hook
|
|
62
|
-
* contract. Only a byte-empty snapshot is safe to discard; a non-empty file
|
|
63
|
-
* that the current normalizer cannot parse must still be uploaded for backend
|
|
64
|
-
* recovery and diagnosis. */
|
|
65
57
|
function isCursorTranscriptEmpty(content) {
|
|
66
58
|
return content.trim().length === 0;
|
|
67
59
|
}
|
|
@@ -71,8 +63,6 @@ function firstString(...values) {
|
|
|
71
63
|
function firstNumber(...values) {
|
|
72
64
|
return values.find((value) => typeof value === "number" && Number.isFinite(value));
|
|
73
65
|
}
|
|
74
|
-
/** The IDE transcript often omits usage entirely; absence must not become
|
|
75
|
-
* measured zero. CLI records with explicit token fields retain their totals. */
|
|
76
66
|
function cursorTranscriptHasUsage(content) {
|
|
77
67
|
return content.split("\n").some((line) => {
|
|
78
68
|
try {
|
|
@@ -93,7 +83,7 @@ function cursorObservedModel(content) {
|
|
|
93
83
|
if (event.subtype === "cursor_model" && typeof event.model === "string")
|
|
94
84
|
model = event.model;
|
|
95
85
|
}
|
|
96
|
-
catch {
|
|
86
|
+
catch { }
|
|
97
87
|
}
|
|
98
88
|
return model;
|
|
99
89
|
}
|
package/dist/cursorLifecycle.js
CHANGED
|
@@ -40,7 +40,6 @@ const path = __importStar(require("path"));
|
|
|
40
40
|
const crypto = __importStar(require("crypto"));
|
|
41
41
|
const configDir_1 = require("./configDir");
|
|
42
42
|
const limitEvent_1 = require("./limitEvent");
|
|
43
|
-
/** Retain aborted-turn evidence across non-final captures, which are snapshots. */
|
|
44
43
|
function fileFor(sessionId) {
|
|
45
44
|
const key = crypto.createHash("sha256").update(sessionId).digest("hex");
|
|
46
45
|
return path.join((0, configDir_1.codiedevStateDir)(), "cursor-lifecycle", `${key}.json`);
|
|
@@ -54,15 +53,12 @@ function recordCursorLifecycle(input, final) {
|
|
|
54
53
|
try {
|
|
55
54
|
state = JSON.parse(fs.readFileSync(file, "utf8"));
|
|
56
55
|
}
|
|
57
|
-
catch {
|
|
56
|
+
catch { }
|
|
58
57
|
const model = typeof input.model_id === "string" && input.model_id.trim() ? input.model_id
|
|
59
58
|
: typeof input.model === "string" && input.model.trim() ? input.model : undefined;
|
|
60
59
|
if (model)
|
|
61
60
|
state.model = model;
|
|
62
61
|
const event = typeof input.hook_event_name === "string" ? input.hook_event_name : final ? "sessionEnd" : "stop";
|
|
63
|
-
// sessionEnd can arrive long after the agent stopped. Do not count that
|
|
64
|
-
// window-open time as active work. These are observed hook times, not
|
|
65
|
-
// invented per-message timestamps.
|
|
66
62
|
if (event !== "sessionEnd" || !state.observations?.length) {
|
|
67
63
|
const timestamp = new Date().toISOString();
|
|
68
64
|
state.observations = [...(state.observations ?? []), { event, timestamp, ...(model ? { model } : {}) }].slice(-1000);
|
|
@@ -84,8 +80,6 @@ function recordCursorLifecycle(input, final) {
|
|
|
84
80
|
state.rejections = [...new Set([...(state.rejections ?? []), rejectionId])].slice(-1000);
|
|
85
81
|
}
|
|
86
82
|
const aborted = status === "aborted" || input.is_interrupt === true;
|
|
87
|
-
// sessionEnd after an aborted stop is the same interruption. A repeated
|
|
88
|
-
// stop with the same generation_id is likewise a retry, not another turn.
|
|
89
83
|
const id = typeof input.generation_id === "string" ? input.generation_id
|
|
90
84
|
: `${Date.now()}-${state.ids.length}`;
|
|
91
85
|
if (aborted && !(final && state.lastStatus === "aborted") && !state.ids.includes(id))
|
package/dist/detection.js
CHANGED
|
@@ -1,44 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// Pure detection helpers — runtime probes (fs / PATH lookup) live in utils.ts
|
|
3
|
-
// and feed these. Splitting them out makes the truth-table testable without
|
|
4
|
-
// mocking fs or process.
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.detectClaudeCode = detectClaudeCode;
|
|
7
4
|
exports.isCodiedevHookCommand = isCodiedevHookCommand;
|
|
8
|
-
/**
|
|
9
|
-
* Claude Code is "installed" if either ~/.claude exists (the user has
|
|
10
|
-
* launched the app at least once) OR the `claude` binary is on PATH (the
|
|
11
|
-
* user installed via npm/brew but hasn't launched yet). Either signal is
|
|
12
|
-
* sufficient — we want to wire up the hook the moment the user has
|
|
13
|
-
* obviously committed to the tool.
|
|
14
|
-
*/
|
|
15
5
|
function detectClaudeCode(probe) {
|
|
16
6
|
return probe.dirExists || probe.binOnPath;
|
|
17
7
|
}
|
|
18
|
-
/**
|
|
19
|
-
* True iff `cmd` looks like a hook command codiedev itself wrote. Used
|
|
20
|
-
* both by the install filter (so `connect` replaces the existing entry
|
|
21
|
-
* instead of stacking another one) and by `codiedev doctor` (so it can
|
|
22
|
-
* grade whether the hook is wired up).
|
|
23
|
-
*
|
|
24
|
-
* Must match every form codiedev can write:
|
|
25
|
-
* - Legacy `npx codiedev-hook <subcommand>`
|
|
26
|
-
* - Absolute path from npm-registry install:
|
|
27
|
-
* `<node> /.../node_modules/codiedev/dist/hook.js <subcommand>`
|
|
28
|
-
* - Absolute path from `npm link` dev install (the monorepo folder
|
|
29
|
-
* is named `codiedev-cli`, not `codiedev`):
|
|
30
|
-
* `<node> /.../codiedev-cli/dist/hook.js <subcommand>`
|
|
31
|
-
*
|
|
32
|
-
* The `codiedev[^/\\]*` allows the trailing `-cli` (or any future suffix)
|
|
33
|
-
* without matching unrelated paths like `notcodiedev/dist/hook.js`.
|
|
34
|
-
*/
|
|
35
8
|
function isCodiedevHookCommand(cmd) {
|
|
36
9
|
if (!cmd)
|
|
37
10
|
return false;
|
|
38
11
|
if (cmd.includes("codiedev-hook"))
|
|
39
12
|
return true;
|
|
40
|
-
// Anchor at a path separator (or string start) so we don't match
|
|
41
|
-
// unrelated paths like `notcodiedev/dist/hook.js` that happen to contain
|
|
42
|
-
// the substring `codiedev`.
|
|
43
13
|
return /(?:^|[\\/])codiedev[^/\\]*[\\/]dist[\\/]hook/.test(cmd);
|
|
44
14
|
}
|
package/dist/harnessDirs.js
CHANGED
|
@@ -41,14 +41,6 @@ exports.piAgentDir = piAgentDir;
|
|
|
41
41
|
exports.displayPath = displayPath;
|
|
42
42
|
exports.claudeConfigDirInUse = claudeConfigDirInUse;
|
|
43
43
|
exports.codexHomeInUse = codexHomeInUse;
|
|
44
|
-
// Where each coding agent reads its user config from. Every harness lets the
|
|
45
|
-
// user relocate it with an env var; installing into the default dir when the
|
|
46
|
-
// var is set writes hooks the agent never loads (a container with
|
|
47
|
-
// CLAUDE_CONFIG_DIR=/home/node/.claude while HOME=/root captured nothing for
|
|
48
|
-
// two weeks while doctor reported ✓). Same shape as copilotHome().
|
|
49
|
-
//
|
|
50
|
-
// Imports only node built-ins so utils.ts, doctor.ts and the hook path
|
|
51
|
-
// can all import it without a cycle.
|
|
52
44
|
const fs = __importStar(require("fs"));
|
|
53
45
|
const os = __importStar(require("os"));
|
|
54
46
|
const path = __importStar(require("path"));
|
|
@@ -56,40 +48,29 @@ function override(value) {
|
|
|
56
48
|
const trimmed = value?.trim();
|
|
57
49
|
return trimmed ? path.resolve(trimmed) : undefined;
|
|
58
50
|
}
|
|
59
|
-
/** Claude Code: `$CLAUDE_CONFIG_DIR` or ~/.claude. */
|
|
60
51
|
function claudeConfigDir(env = process.env, home = os.homedir()) {
|
|
61
52
|
return override(env.CLAUDE_CONFIG_DIR) ?? path.join(home, ".claude");
|
|
62
53
|
}
|
|
63
|
-
/** Claude Code's user state file. Lives inside `$CLAUDE_CONFIG_DIR` when set, else ~/.claude.json. */
|
|
64
54
|
function claudeUserConfigPath(env = process.env, home = os.homedir()) {
|
|
65
55
|
const dir = override(env.CLAUDE_CONFIG_DIR);
|
|
66
56
|
return dir ? path.join(dir, ".claude.json") : path.join(home, ".claude.json");
|
|
67
57
|
}
|
|
68
|
-
/** Codex: `$CODEX_HOME` or ~/.codex. */
|
|
69
58
|
function codexHome(env = process.env, home = os.homedir()) {
|
|
70
59
|
return override(env.CODEX_HOME) ?? path.join(home, ".codex");
|
|
71
60
|
}
|
|
72
|
-
/** OpenCode: `$XDG_CONFIG_HOME/opencode` or ~/.config/opencode. */
|
|
73
61
|
function openCodeConfigDir(env = process.env, home = os.homedir()) {
|
|
74
62
|
return path.join(override(env.XDG_CONFIG_HOME) ?? path.join(home, ".config"), "opencode");
|
|
75
63
|
}
|
|
76
|
-
/** pi: `$PI_CODING_AGENT_DIR` or ~/.pi/agent. Holds extensions/, skills/,
|
|
77
|
-
* sessions/ and the global AGENTS.md. */
|
|
78
64
|
function piAgentDir(env = process.env, home = os.homedir()) {
|
|
79
65
|
return override(env.PI_CODING_AGENT_DIR) ?? path.join(home, ".pi", "agent");
|
|
80
66
|
}
|
|
81
|
-
/** `~`-abbreviated path for user-facing output. */
|
|
82
67
|
function displayPath(p, home = os.homedir()) {
|
|
83
68
|
return p === home || p.startsWith(home + path.sep) ? "~" + p.slice(home.length) : p;
|
|
84
69
|
}
|
|
85
|
-
// Files/dirs Claude Code writes on first real use. Our installer only writes
|
|
86
|
-
// settings.json + CLAUDE.md, so a dir holding nothing but those is one Claude
|
|
87
|
-
// Code has never run against — the hooks in it will never fire.
|
|
88
70
|
const CLAUDE_USAGE_MARKERS = ["projects", "history.jsonl", "sessions", "statsig", "todos", "shell-snapshots"];
|
|
89
71
|
function claudeConfigDirInUse(dir = claudeConfigDir(), exists = fs.existsSync) {
|
|
90
72
|
return CLAUDE_USAGE_MARKERS.some((m) => exists(path.join(dir, m)));
|
|
91
73
|
}
|
|
92
|
-
// Codex writes rollouts under sessions/ and keeps history.jsonl alongside.
|
|
93
74
|
const CODEX_USAGE_MARKERS = ["sessions", "history.jsonl", "auth.json"];
|
|
94
75
|
function codexHomeInUse(dir = codexHome(), exists = fs.existsSync) {
|
|
95
76
|
return CODEX_USAGE_MARKERS.some((m) => exists(path.join(dir, m)));
|