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/utils.d.ts
DELETED
|
@@ -1,396 +0,0 @@
|
|
|
1
|
-
import * as fs from "fs";
|
|
2
|
-
import type { CaptureSignals } from "./captureSignals";
|
|
3
|
-
import { type TranscriptModelUsage } from "./transcriptModels";
|
|
4
|
-
import { spawn as nodeSpawn } from "child_process";
|
|
5
|
-
import type { CaptureLogEntry } from "./captureLog";
|
|
6
|
-
import { codiedevStateDir } from "./configDir";
|
|
7
|
-
export { inspectPiExtension, piExtensionPath } from "./piHooks";
|
|
8
|
-
export { codiedevStateDir };
|
|
9
|
-
import type { BrowserAuth } from "./cliSession";
|
|
10
|
-
export interface CodiedevConfig {
|
|
11
|
-
token: string;
|
|
12
|
-
companyId: string;
|
|
13
|
-
companyName: string;
|
|
14
|
-
repos: Array<{
|
|
15
|
-
repoId: string;
|
|
16
|
-
url: string;
|
|
17
|
-
fullName: string;
|
|
18
|
-
}>;
|
|
19
|
-
lastSynced: string;
|
|
20
|
-
backendUrl: string;
|
|
21
|
-
deviceId?: string;
|
|
22
|
-
deviceName?: string;
|
|
23
|
-
captureIgnoredPaths?: string[];
|
|
24
|
-
auth?: BrowserAuth;
|
|
25
|
-
}
|
|
26
|
-
export declare const CONFIG_PATH: string;
|
|
27
|
-
export declare function readConfig(): CodiedevConfig | null;
|
|
28
|
-
export declare function writeConfig(config: CodiedevConfig): void;
|
|
29
|
-
/** Exported for permission-focused tests; normal callers use writeConfig. */
|
|
30
|
-
export declare function writeConfigAtPath(config: CodiedevConfig, configDir: string, configPath: string): void;
|
|
31
|
-
export declare function parseGitRemoteFromConfig(configText: string): string | null;
|
|
32
|
-
export declare function readGitRemoteFromConfig(startDir: string): string | null;
|
|
33
|
-
export declare function getGitRemoteUrl(cwd: string): string | null;
|
|
34
|
-
export declare function resolveCaptureRemoteUrl(workspaceRoot: string, captureDirs: string[], getRemote?: (dir: string) => string | null): string | null;
|
|
35
|
-
export declare function normalizeRepoUrl(url: string): string;
|
|
36
|
-
export declare function matchRepo(remoteUrl: string, repos: Array<{
|
|
37
|
-
repoId: string;
|
|
38
|
-
url: string;
|
|
39
|
-
fullName: string;
|
|
40
|
-
}>): {
|
|
41
|
-
repoId: string;
|
|
42
|
-
url: string;
|
|
43
|
-
fullName: string;
|
|
44
|
-
} | null;
|
|
45
|
-
export declare function resolveCaptureDir(transcriptContent: string, workspaceRoot: string): string;
|
|
46
|
-
export declare function resolveCaptureDirs(transcriptContent: string, workspaceRoot: string): string[];
|
|
47
|
-
export declare function collectCaptureKeys(dirs: string[], getBranch?: (d: string) => string | null, getSha?: (d: string) => string | null): {
|
|
48
|
-
branch: string | null;
|
|
49
|
-
headSha: string | null;
|
|
50
|
-
branches: string[];
|
|
51
|
-
headShas: string[];
|
|
52
|
-
};
|
|
53
|
-
export type CaptureGitRef = {
|
|
54
|
-
repoUrl: string;
|
|
55
|
-
branch?: string;
|
|
56
|
-
headSha?: string;
|
|
57
|
-
};
|
|
58
|
-
export declare function collectCaptureGitRefs(dirs: string[], getRemote?: (d: string) => string | null, getBranch?: (d: string) => string | null, getSha?: (d: string) => string | null): CaptureGitRef[];
|
|
59
|
-
export declare function parsePullRequestUrls(transcriptContent: string): string[];
|
|
60
|
-
export declare function extractShaTokens(transcriptContent: string): string[];
|
|
61
|
-
export declare function parseAuthoredBranches(transcriptContent: string): string[];
|
|
62
|
-
export declare function parseAuthoredShas(transcriptContent: string, repoRoot: string, resolveFullBatch?: (shas: string[]) => Map<string, string>): string[];
|
|
63
|
-
export declare function getGitBranch(cwd: string): string | null;
|
|
64
|
-
export declare function getGitHeadSha(cwd: string): string | null;
|
|
65
|
-
export interface CapturePayloadInput {
|
|
66
|
-
modelUsage?: TranscriptModelUsage[];
|
|
67
|
-
captureSignals?: CaptureSignals;
|
|
68
|
-
sessionId?: string;
|
|
69
|
-
transcriptBase64: string;
|
|
70
|
-
remoteUrl: string | null;
|
|
71
|
-
matchedRepoId?: string;
|
|
72
|
-
companyId: string;
|
|
73
|
-
messageCount: number;
|
|
74
|
-
toolCallCount: number;
|
|
75
|
-
capturedAt: number;
|
|
76
|
-
source: string;
|
|
77
|
-
branch?: string | null;
|
|
78
|
-
headSha?: string | null;
|
|
79
|
-
branches?: string[];
|
|
80
|
-
headShas?: string[];
|
|
81
|
-
gitRefs?: CaptureGitRef[];
|
|
82
|
-
pullRequestUrls?: string[];
|
|
83
|
-
inputTokens?: number;
|
|
84
|
-
outputTokens?: number;
|
|
85
|
-
cacheTokens?: number;
|
|
86
|
-
cacheReadTokens?: number;
|
|
87
|
-
cacheCreationTokens?: number;
|
|
88
|
-
model?: string | null;
|
|
89
|
-
sessionStartedAt?: number | null;
|
|
90
|
-
interruptCount?: number;
|
|
91
|
-
rejectionCount?: number;
|
|
92
|
-
final?: boolean;
|
|
93
|
-
costUsd?: number;
|
|
94
|
-
}
|
|
95
|
-
export declare function stripRepoUrlCredentials(url: string): string;
|
|
96
|
-
export declare function buildCapturePayload(input: CapturePayloadInput): Record<string, unknown>;
|
|
97
|
-
export declare function hashToken(token: string): string;
|
|
98
|
-
export declare function extractHookNodePath(cmd: string | undefined): string | undefined;
|
|
99
|
-
export declare function resetStableNodeCacheForTests(): void;
|
|
100
|
-
export declare function claudeCodeInstalled(): boolean;
|
|
101
|
-
export declare function codexInstalled(): boolean;
|
|
102
|
-
export declare function cursorInstalled(): boolean;
|
|
103
|
-
/**
|
|
104
|
-
* GitHub Copilot: `$COPILOT_HOME` / ~/.copilot (either surface has run once),
|
|
105
|
-
* the `copilot` CLI on PATH, or VS Code's Copilot Chat extension. VS Code's
|
|
106
|
-
* agent and the CLI read the same user hooks, so one install covers both.
|
|
107
|
-
*/
|
|
108
|
-
export declare function copilotInstalled(): boolean;
|
|
109
|
-
export declare function openCodeInstalled(): boolean;
|
|
110
|
-
/** Install a dormant global OpenCode adapter. Installing it unconditionally
|
|
111
|
-
* keeps `codiedev connect` as the only setup step even when Codie/OpenCode is
|
|
112
|
-
* installed later. OpenCode loads this file from its documented plugin dir. */
|
|
113
|
-
export declare function installOpenCodeCapturePlugin(): void;
|
|
114
|
-
export declare function piInstalled(): boolean;
|
|
115
|
-
/** Subcommands the pi extension calls, in the order inspectPiExtension checks. */
|
|
116
|
-
export declare const PI_EXTENSION_SUBCOMMANDS: readonly ["session-start-pi", "backup-pi", "capture-pi-final", "discover-pi", "security-pre-pi", "security-post-pi", "security-failure-pi"];
|
|
117
|
-
/**
|
|
118
|
-
* pi has no hook config: it auto-loads TypeScript extensions from
|
|
119
|
-
* <agentDir>/extensions/. This one forwards pi's events to the same hook
|
|
120
|
-
* subcommands as every other harness. pi already writes the session JSONL, so
|
|
121
|
-
* capture just hands its path over (no transcript dump like OpenCode's).
|
|
122
|
-
*/
|
|
123
|
-
export declare function piExtensionSource(agentSecurityEnabled: boolean): string;
|
|
124
|
-
/** Install the pi extension. Unconditional like OpenCode's: pi installed
|
|
125
|
-
* later still gets captured without re-running `codiedev connect`. This
|
|
126
|
-
* release line has no Agent Security hooks, so security stays off. */
|
|
127
|
-
export declare function installPiExtension(agentSecurityEnabled?: boolean): void;
|
|
128
|
-
/** Self-heal after an upgrade or drift, like Copilot's hook file. */
|
|
129
|
-
export declare function ensurePiExtensionInstalled(agentSecurityEnabled?: boolean): void;
|
|
130
|
-
/**
|
|
131
|
-
* VS Code with the GitHub Copilot Chat extension installed. The extension
|
|
132
|
-
* directory pattern is `~/.vscode/extensions/github.copilot-chat-*`. We treat
|
|
133
|
-
* the presence of any `github.copilot*` directory as the Copilot fingerprint.
|
|
134
|
-
*/
|
|
135
|
-
export declare function vscodeCopilotInstalled(): boolean;
|
|
136
|
-
export declare function upsertCodiedevHook(hooks: Record<string, unknown>, eventName: string, subcommand: string, matcher?: string | null): void;
|
|
137
|
-
export declare function installHook(): void;
|
|
138
|
-
export declare function ensureDiscoveryHookInstalled(): void;
|
|
139
|
-
export declare function ensureBackupHookInstalled(): void;
|
|
140
|
-
export declare function ensureLimitHookInstalled(): void;
|
|
141
|
-
export declare function ensureAllCodiedevHooksInstalled(): void;
|
|
142
|
-
/** Exported for unit testing. */
|
|
143
|
-
export declare function hasDirectHookPath(configText: string): boolean;
|
|
144
|
-
export declare function migrateHooksToLauncher(): string[];
|
|
145
|
-
export declare function ensureSessionStartHookInstalled(): void;
|
|
146
|
-
export declare function installClaudeCodeInstructions(): void;
|
|
147
|
-
export declare function installCodexInstructions(): void;
|
|
148
|
-
export declare function copilotInstructionsPath(): string;
|
|
149
|
-
/** pi's global context file, loaded into every session's system prompt. */
|
|
150
|
-
export declare function piInstructionsPath(): string;
|
|
151
|
-
/** pi has no session-start output channel, so team skill context rides in
|
|
152
|
-
* AGENTS.md the way it does for Copilot. */
|
|
153
|
-
export declare function installPiInstructions(): void;
|
|
154
|
-
export declare function installCopilotInstructions(): void;
|
|
155
|
-
export declare function installCursorInstructions(): void;
|
|
156
|
-
export interface InstructionsTarget {
|
|
157
|
-
path: string;
|
|
158
|
-
body: string;
|
|
159
|
-
}
|
|
160
|
-
export declare function installedInstructionsTargets(): InstructionsTarget[];
|
|
161
|
-
/**
|
|
162
|
-
* Re-render the codiedev block in every instructions file that already has
|
|
163
|
-
* one, so an upgrade (background self-update or a manual `npm i`) stops
|
|
164
|
-
* teaching retired commands without the user re-running `connect`. Never
|
|
165
|
-
* creates a file or adds a block: a user who deleted it, or never connected
|
|
166
|
-
* that harness, is left alone. Returns the paths it rewrote.
|
|
167
|
-
*/
|
|
168
|
-
export declare function refreshInstalledInstructions(targets?: InstructionsTarget[]): string[];
|
|
169
|
-
/**
|
|
170
|
-
* Install the Codiedev MCP server into Claude Code's user-scope config.
|
|
171
|
-
* Safe to call multiple times — updates the existing entry if present.
|
|
172
|
-
*/
|
|
173
|
-
export declare function installClaudeCodeMcp(): void;
|
|
174
|
-
/**
|
|
175
|
-
* Install the Codiedev MCP server into Cursor's user-scope config.
|
|
176
|
-
* Cursor uses the same `mcpServers` schema as Claude Code; just a different
|
|
177
|
-
* file path (~/.cursor/mcp.json). Project-scoped servers can also live at
|
|
178
|
-
* <project>/.cursor/mcp.json — we only manage the user-scope one.
|
|
179
|
-
*/
|
|
180
|
-
export declare function installCursorMcp(): void;
|
|
181
|
-
/**
|
|
182
|
-
* Install the Codiedev MCP server into VS Code's user-scope MCP config so
|
|
183
|
-
* GitHub Copilot Chat picks it up. VS Code uses a different schema than
|
|
184
|
-
* Claude / Cursor: top-level key is `servers` (not `mcpServers`). On first
|
|
185
|
-
* Copilot Chat run after install, VS Code prompts the user to trust the
|
|
186
|
-
* server — that's expected and documented in the connect success message.
|
|
187
|
-
*/
|
|
188
|
-
export declare function installVSCodeMcp(): void;
|
|
189
|
-
/**
|
|
190
|
-
* Removes `mcpServers.codiedev` from `~/.claude.json` if present. Leaves
|
|
191
|
-
* other MCP servers and unrelated top-level settings untouched.
|
|
192
|
-
*/
|
|
193
|
-
export declare function cleanupClaudeCodeMcp(): void;
|
|
194
|
-
/**
|
|
195
|
-
* Removes `mcpServers.codiedev` from `~/.cursor/mcp.json` if present.
|
|
196
|
-
*/
|
|
197
|
-
export declare function cleanupCursorMcp(): void;
|
|
198
|
-
/**
|
|
199
|
-
* Removes `servers.codiedev` from VS Code's user-scope mcp.json. VS Code
|
|
200
|
-
* uses a different schema (`servers` not `mcpServers`), so this is a
|
|
201
|
-
* separate helper.
|
|
202
|
-
*/
|
|
203
|
-
export declare function cleanupVSCodeMcp(): void;
|
|
204
|
-
/**
|
|
205
|
-
* Removes the `# codiedev-mcp` block from `~/.codex/config.toml`. The
|
|
206
|
-
* install side appends a well-marked block; we strip it the same way —
|
|
207
|
-
* the marker line through the end of its TOML section. Whitespace-only
|
|
208
|
-
* gaps between sections are preserved.
|
|
209
|
-
*/
|
|
210
|
-
export declare function cleanupCodexMcp(): void;
|
|
211
|
-
/**
|
|
212
|
-
* Best-effort append of the Codiedev MCP server block to ~/.codex/config.toml.
|
|
213
|
-
*
|
|
214
|
-
* Codex uses TOML and we don't want a full parser for such a small addition,
|
|
215
|
-
* so we append a well-marked block if one isn't already present. Idempotent.
|
|
216
|
-
*/
|
|
217
|
-
export declare function installCodexMcp(): boolean;
|
|
218
|
-
export declare function installCodexHook(): void;
|
|
219
|
-
export declare function ensureCodexLimitHookInstalled(): void;
|
|
220
|
-
export declare function installCursorHook(): void;
|
|
221
|
-
export declare function copilotHooksPath(): string;
|
|
222
|
-
export declare function installCopilotHook(agentSecurityEnabled?: boolean): void;
|
|
223
|
-
/** Self-heal the Copilot hook file after upgrades or drift (like Cursor's). */
|
|
224
|
-
export declare function ensureCopilotCodiedevHooksInstalled(): void;
|
|
225
|
-
/** Repair Cursor's complete flat hook set after upgrades or configuration
|
|
226
|
-
* drift. This is deliberately separate from Claude Code's nested-hook healer:
|
|
227
|
-
* the schemas and event names differ, and mixing them risks corrupting both. */
|
|
228
|
-
export declare function ensureCursorCodiedevHooksInstalled(): void;
|
|
229
|
-
export interface ParsedStats {
|
|
230
|
-
messageCount: number;
|
|
231
|
-
toolCallCount: number;
|
|
232
|
-
}
|
|
233
|
-
export interface SteeringStats {
|
|
234
|
-
interrupts: number;
|
|
235
|
-
rejections: number;
|
|
236
|
-
}
|
|
237
|
-
export declare function parseClaudeSteering(content: string): SteeringStats;
|
|
238
|
-
export declare function parseCodexSteering(content: string): SteeringStats;
|
|
239
|
-
export declare function parseSteering(content: string, mode: "claude-code" | "codex" | "cursor" | "opencode" | "copilot" | "pi"): SteeringStats;
|
|
240
|
-
export interface UsageStats {
|
|
241
|
-
inputTokens: number;
|
|
242
|
-
outputTokens: number;
|
|
243
|
-
/** Legacy fold of read + creation — kept for older servers. */
|
|
244
|
-
cacheTokens: number;
|
|
245
|
-
cacheReadTokens: number;
|
|
246
|
-
cacheCreationTokens: number;
|
|
247
|
-
model: string | null;
|
|
248
|
-
/** Engine-reported spend (opencode SDK `info.cost`). Desktop mode only. */
|
|
249
|
-
costUsd?: number;
|
|
250
|
-
}
|
|
251
|
-
export declare function parseUsage(content: string, mode: "claude-code" | "codex" | "cursor" | "opencode" | "desktop" | "copilot" | "pi"): UsageStats;
|
|
252
|
-
export declare function parseSessionStart(content: string): number | null;
|
|
253
|
-
export declare function parseClaudeCodeStats(content: string): ParsedStats;
|
|
254
|
-
/** Convert OpenCode's SDK message array (`{info, parts}[]`) into the same
|
|
255
|
-
* newline-delimited shape used by Claude Code. The rest of capture—privacy
|
|
256
|
-
* exclusions, git keys, token parsing, scrubbing, storage, and merge joins—can
|
|
257
|
-
* therefore stay one shared pipeline instead of becoming a parallel product. */
|
|
258
|
-
export declare function normalizeOpenCodeTranscript(content: string): string;
|
|
259
|
-
export declare function parseCodexStats(content: string): ParsedStats;
|
|
260
|
-
export declare function extractCodexRepoUrl(content: string): string | null;
|
|
261
|
-
export interface CaptureUploadJob {
|
|
262
|
-
url: string;
|
|
263
|
-
token: string;
|
|
264
|
-
body: Record<string, unknown>;
|
|
265
|
-
attempts?: number;
|
|
266
|
-
queuedAt?: number;
|
|
267
|
-
scopePaths?: string[];
|
|
268
|
-
}
|
|
269
|
-
export declare const MAX_UPLOAD_ATTEMPTS = 5;
|
|
270
|
-
export declare const UPLOAD_TTL_MS: number;
|
|
271
|
-
interface DispatchDeps {
|
|
272
|
-
spawn: typeof nodeSpawn;
|
|
273
|
-
writeFileSync: typeof fs.writeFileSync;
|
|
274
|
-
tmpFile: string;
|
|
275
|
-
nodePath?: string;
|
|
276
|
-
openSync?: typeof fs.openSync;
|
|
277
|
-
closeSync?: typeof fs.closeSync;
|
|
278
|
-
}
|
|
279
|
-
export interface CaptureFinishInput {
|
|
280
|
-
mode: string;
|
|
281
|
-
session_id?: string;
|
|
282
|
-
transcript_path?: string;
|
|
283
|
-
cwd?: string;
|
|
284
|
-
workspace_roots?: string[];
|
|
285
|
-
final?: boolean;
|
|
286
|
-
/** How the harness was launched when its transcript does not record it
|
|
287
|
-
* (Cursor, Codie). See launchContext.ts. */
|
|
288
|
-
launch?: string;
|
|
289
|
-
}
|
|
290
|
-
export declare function dispatchCaptureFinish(input: CaptureFinishInput, hookScriptPath: string, deps: DispatchDeps): void;
|
|
291
|
-
export declare function dispatchCaptureDetached(job: CaptureUploadJob, hookScriptPath: string, deps: DispatchDeps): void;
|
|
292
|
-
export declare function dispatchDeferredUpload(job: CaptureUploadJob, hookScriptPath: string, deps: DispatchDeps, delayMs: number): void;
|
|
293
|
-
interface SweepDeps {
|
|
294
|
-
dir: string;
|
|
295
|
-
readdirSync: (dir: string) => string[];
|
|
296
|
-
renameSync: (from: string, to: string) => void;
|
|
297
|
-
statSync: (p: string) => {
|
|
298
|
-
mtimeMs: number;
|
|
299
|
-
};
|
|
300
|
-
spawn: typeof nodeSpawn;
|
|
301
|
-
hookScriptPath: string;
|
|
302
|
-
nodePath?: string;
|
|
303
|
-
exclude?: string;
|
|
304
|
-
max?: number;
|
|
305
|
-
now?: () => number;
|
|
306
|
-
openSync?: typeof fs.openSync;
|
|
307
|
-
closeSync?: typeof fs.closeSync;
|
|
308
|
-
pruneState?: () => void;
|
|
309
|
-
unlinkSync?: (p: string) => void;
|
|
310
|
-
reportOrphan?: (sessionId: string | undefined) => void;
|
|
311
|
-
}
|
|
312
|
-
export declare const CLAIM_STALE_MS: number;
|
|
313
|
-
export declare const FINISH_ORPHAN_AGE_MS: number;
|
|
314
|
-
export declare function sweepPendingCaptures(deps: SweepDeps): void;
|
|
315
|
-
export declare const CAPTURE_THROTTLE_MS: number;
|
|
316
|
-
export declare const SWEEP_MIN_AGE_MS: number;
|
|
317
|
-
export declare function resolveCaptureFinal(argv2: string | undefined): boolean | undefined;
|
|
318
|
-
export declare function finishInputTmpFile(sessionId: string | undefined): string;
|
|
319
|
-
export declare function captureUploadTmpFile(sessionId: string | undefined, mode: "immediate" | "deferred", pid?: number, now?: number): string;
|
|
320
|
-
export declare function cancelDeferredCaptureUpload(sessionId: string, deps?: Pick<typeof fs, "unlinkSync">): boolean;
|
|
321
|
-
export declare function decideDispatch(args: {
|
|
322
|
-
final: boolean;
|
|
323
|
-
lastUploadAt: number | null;
|
|
324
|
-
now: number;
|
|
325
|
-
}): {
|
|
326
|
-
mode: "immediate";
|
|
327
|
-
} | {
|
|
328
|
-
mode: "deferred";
|
|
329
|
-
delayMs: number;
|
|
330
|
-
};
|
|
331
|
-
export interface SessionUploadState {
|
|
332
|
-
lastUploadAt: number;
|
|
333
|
-
}
|
|
334
|
-
interface SessionStateDeps {
|
|
335
|
-
readFileSync: typeof fs.readFileSync;
|
|
336
|
-
existsSync: typeof fs.existsSync;
|
|
337
|
-
}
|
|
338
|
-
interface SessionStateWriteDeps {
|
|
339
|
-
writeFileSync: typeof fs.writeFileSync;
|
|
340
|
-
existsSync: typeof fs.existsSync;
|
|
341
|
-
mkdirSync: typeof fs.mkdirSync;
|
|
342
|
-
}
|
|
343
|
-
export declare function readSessionUploadState(sessionId: string, deps?: SessionStateDeps): SessionUploadState | null;
|
|
344
|
-
export declare function writeSessionUploadState(sessionId: string, state: SessionUploadState, deps?: SessionStateWriteDeps): void;
|
|
345
|
-
export declare function pruneCaptureStateDir(deps?: {
|
|
346
|
-
readdirSync: (d: string) => string[];
|
|
347
|
-
statSync: (p: string) => {
|
|
348
|
-
mtimeMs: number;
|
|
349
|
-
};
|
|
350
|
-
unlinkSync: (p: string) => void;
|
|
351
|
-
}, dir?: string, now?: number): void;
|
|
352
|
-
export declare const DIRECT_UPLOAD_THRESHOLD_CHARS = 2000000;
|
|
353
|
-
interface UploadDeps {
|
|
354
|
-
post: (url: string, body: Record<string, unknown>, token: string) => Promise<void>;
|
|
355
|
-
requestJson?: (url: string, body: Record<string, unknown>, token: string) => Promise<any>;
|
|
356
|
-
uploadBytes?: (url: string, bytes: Buffer, contentType: string) => Promise<any>;
|
|
357
|
-
readFileSync: typeof fs.readFileSync;
|
|
358
|
-
unlinkSync: typeof fs.unlinkSync;
|
|
359
|
-
writeFileSync?: typeof fs.writeFileSync;
|
|
360
|
-
now?: () => number;
|
|
361
|
-
recordSuccess?: (job: CaptureUploadJob) => void;
|
|
362
|
-
log?: (entry: CaptureLogEntry) => void;
|
|
363
|
-
writeSessionState?: (sessionId: string, state: SessionUploadState) => void;
|
|
364
|
-
shouldSkipJob?: (job: CaptureUploadJob) => boolean;
|
|
365
|
-
}
|
|
366
|
-
export interface LastCaptureRecord {
|
|
367
|
-
sessionId: string | undefined;
|
|
368
|
-
repoUrl: string;
|
|
369
|
-
matched: boolean;
|
|
370
|
-
branch: string;
|
|
371
|
-
headSha: string;
|
|
372
|
-
source: string;
|
|
373
|
-
capturedAt: number | undefined;
|
|
374
|
-
recordedAt: number;
|
|
375
|
-
}
|
|
376
|
-
export declare function buildLastCaptureRecord(job: CaptureUploadJob, now: number): LastCaptureRecord;
|
|
377
|
-
interface LastCaptureWriteDeps {
|
|
378
|
-
writeFileSync: typeof fs.writeFileSync;
|
|
379
|
-
existsSync: typeof fs.existsSync;
|
|
380
|
-
mkdirSync: typeof fs.mkdirSync;
|
|
381
|
-
}
|
|
382
|
-
export declare function writeLastCapture(record: LastCaptureRecord, deps?: LastCaptureWriteDeps, filePath?: string): void;
|
|
383
|
-
interface LastCaptureReadDeps {
|
|
384
|
-
readFileSync: typeof fs.readFileSync;
|
|
385
|
-
existsSync: typeof fs.existsSync;
|
|
386
|
-
}
|
|
387
|
-
export declare function readLastCapture(deps?: LastCaptureReadDeps, filePath?: string): LastCaptureRecord | null;
|
|
388
|
-
export declare function runCaptureUpload(jobFile: string, deps: UploadDeps): Promise<void>;
|
|
389
|
-
interface DeferredUploadDeps extends UploadDeps {
|
|
390
|
-
renameSync: typeof fs.renameSync;
|
|
391
|
-
sleep?: (ms: number) => Promise<void>;
|
|
392
|
-
}
|
|
393
|
-
export declare function runDeferredUpload(jobFile: string, delayMs: number, deps: DeferredUploadDeps): Promise<void>;
|
|
394
|
-
export declare function transcriptReadSkipReason(err: unknown): string;
|
|
395
|
-
export declare function isCodexRolloutPath(transcriptPath: string | undefined): boolean;
|
|
396
|
-
export declare function shouldReportCaptureSkip(final: boolean | undefined): boolean;
|
package/dist/version.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const CLI_VERSION: string;
|
package/dist/versionCheck.d.ts
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
export interface Semver {
|
|
2
|
-
major: number;
|
|
3
|
-
minor: number;
|
|
4
|
-
patch: number;
|
|
5
|
-
}
|
|
6
|
-
export declare function parseSemver(input: string): Semver | null;
|
|
7
|
-
/**
|
|
8
|
-
* Returns -1 if a < b, 0 if equal, 1 if a > b.
|
|
9
|
-
*
|
|
10
|
-
* Malformed input on either side returns 0 — we never want to nag a user
|
|
11
|
-
* because of garbage version strings (corrupt cache, registry returned
|
|
12
|
-
* something weird, prerelease format we don't recognize).
|
|
13
|
-
*/
|
|
14
|
-
export declare function compareSemver(a: string, b: string): -1 | 0 | 1;
|
|
15
|
-
export interface UpdateWarningInput {
|
|
16
|
-
current: string;
|
|
17
|
-
latest: string | null;
|
|
18
|
-
lastChecked: number;
|
|
19
|
-
nowMs: number;
|
|
20
|
-
cacheTtlMs: number;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Warning policy: only show when we have a known-newer `latest` from a
|
|
24
|
-
* recent-enough cache. Stale-cache freshness is enforced by the *caller*
|
|
25
|
-
* (which decides whether to refetch); this helper takes the cache state
|
|
26
|
-
* as-given and answers a single question — should the user see a nag?
|
|
27
|
-
*/
|
|
28
|
-
export declare function shouldShowUpdateWarning(input: UpdateWarningInput): boolean;
|
|
29
|
-
export type InstallKind = "npx" | "container" | "global" | "readonly";
|
|
30
|
-
export interface InstallKindDeps {
|
|
31
|
-
dirname: string;
|
|
32
|
-
env: NodeJS.ProcessEnv;
|
|
33
|
-
existsSync: (p: string) => boolean;
|
|
34
|
-
readFileSync: (p: string, enc: string) => string;
|
|
35
|
-
accessSync: (p: string, mode?: number) => void;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* npx — running from npm's _npx cache; nothing to upgrade in place.
|
|
39
|
-
* container — baked into an image; the honest fix is rebuilding it.
|
|
40
|
-
* global — a real install directory we can write to. Upgradable.
|
|
41
|
-
* readonly — a real install directory we cannot write to (root-owned global
|
|
42
|
-
* on a shared box, read-only mount). Needs sudo, so print rather
|
|
43
|
-
* than attempt an upgrade that would EACCES.
|
|
44
|
-
*/
|
|
45
|
-
export declare function resolveInstallKind(deps: InstallKindDeps): InstallKind;
|
|
46
|
-
export declare function upgradeCommand(kind: InstallKind, pkg?: string): string;
|
|
47
|
-
export type UpdateAction = "none" | "notify" | "prompt";
|
|
48
|
-
export interface UpdateActionInput {
|
|
49
|
-
current: string;
|
|
50
|
-
latest: string | null;
|
|
51
|
-
installKind: InstallKind;
|
|
52
|
-
isTty: boolean;
|
|
53
|
-
isCi: boolean;
|
|
54
|
-
promptedAt?: number;
|
|
55
|
-
nowMs: number;
|
|
56
|
-
cacheTtlMs?: number;
|
|
57
|
-
pkg?: string;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* `promptedAt` makes a decline stick until the next window instead of asking
|
|
61
|
-
* on every launch. It is deliberately not keyed to a dismissed version:
|
|
62
|
-
* somebody who says no today should be asked again tomorrow, not silently
|
|
63
|
-
* stranded on that version forever.
|
|
64
|
-
*/
|
|
65
|
-
export declare function decideUpdateAction(input: UpdateActionInput): {
|
|
66
|
-
action: UpdateAction;
|
|
67
|
-
command: string;
|
|
68
|
-
};
|