codiedev 0.10.0-beta.1 → 0.10.0-beta.11
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 +11 -5
- package/assets/opencode-plugin.mjs +6 -0
- package/assets/session-key.mjs +48 -0
- package/assets/tui-brand-plugin.tsx +73 -0
- 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 +184 -0
- package/dist/cli.js +135 -72
- package/dist/cliSession.js +456 -0
- package/dist/codexHookTrust.js +125 -6
- package/dist/codexLimitScan.js +359 -0
- package/dist/codie.js +77 -130
- package/dist/codieBrandInstall.js +80 -0
- package/dist/codieLauncher.js +76 -79
- package/dist/codieRuntime.js +19 -23
- package/dist/codieRuntimeInstall.js +108 -23
- package/dist/codieUsage.js +181 -0
- package/dist/commands/agentTemplates.generated.js +136 -0
- package/dist/commands/agents.js +1101 -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 +53 -120
- package/dist/commands/evals.js +187 -0
- package/dist/commands/inbox.js +0 -2
- package/dist/commands/library.js +0 -3
- package/dist/commands/pack.js +573 -0
- package/dist/commands/ping.js +0 -2
- package/dist/commands/pull.js +6 -10
- package/dist/commands/push.js +2 -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 +344 -0
- package/dist/commands/tracesLabel.js +348 -0
- package/dist/configDir.js +18 -11
- package/dist/connect.js +55 -118
- package/dist/connectFlow.js +35 -9
- package/dist/copilotHooks.js +391 -0
- package/dist/copilotInstallation.js +64 -0
- package/dist/cursorHooks.js +38 -30
- package/dist/cursorLifecycle.js +109 -0
- package/dist/detection.js +0 -30
- package/dist/harnessDirs.js +77 -0
- package/dist/hook.js +256 -445
- package/dist/inboxFormat.js +0 -24
- package/dist/launchContext.js +150 -0
- package/dist/launcher.js +168 -0
- package/dist/limitEvent.js +44 -13
- package/dist/limitEventReporter.js +1 -1
- package/dist/managedPi.js +256 -0
- package/dist/mcp.js +5 -384
- package/dist/nativeSteering.js +24 -0
- package/dist/packs/codie.js +182 -0
- package/dist/packs/harnesses.js +411 -0
- package/dist/packs/hookGate.js +256 -0
- package/dist/packs/install.js +286 -0
- package/dist/packs/manifest.js +126 -0
- package/dist/packs/paths.js +81 -0
- package/dist/packs/shim.js +214 -0
- package/dist/packs/store.js +155 -0
- package/dist/packs/sync.js +170 -0
- package/dist/piHooks.js +216 -0
- package/dist/piRuntime.js +120 -0
- package/dist/repoResolver.js +0 -19
- package/dist/secret.js +0 -3
- package/dist/selfUpdate.js +376 -0
- package/dist/skillMarker.js +23 -0
- package/dist/subagents.js +135 -0
- package/dist/teamSkillContext.js +10 -0
- package/dist/transcriptModels.js +205 -0
- package/dist/upgradeNudge.js +0 -30
- package/dist/utils.js +502 -828
- package/dist/version.js +0 -10
- package/dist/versionCheck.js +0 -33
- package/package.json +8 -9
- 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/cli.d.ts +0 -16
- package/dist/codexHookTrust.d.ts +0 -34
- package/dist/codie.d.ts +0 -2
- package/dist/codieLauncher.d.ts +0 -53
- package/dist/codieRuntime.d.ts +0 -29
- package/dist/codieRuntimeInstall.d.ts +0 -28
- package/dist/codieStartup.d.ts +0 -26
- package/dist/codieStartup.js +0 -30
- 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 -1
- 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/ping.d.ts +0 -1
- package/dist/commands/promote.d.ts +0 -1
- package/dist/commands/promote.js +0 -53
- package/dist/commands/pull.d.ts +0 -2
- package/dist/commands/push.d.ts +0 -33
- package/dist/commands/react.d.ts +0 -2
- package/dist/commands/react.js +0 -40
- package/dist/commands/reverseTicket.d.ts +0 -2
- package/dist/commands/reverseTicket.js +0 -477
- package/dist/commands/search.d.ts +0 -2
- package/dist/commands/security.d.ts +0 -1
- package/dist/commands/security.js +0 -156
- 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/configDir.d.ts +0 -1
- package/dist/connect.d.ts +0 -1
- package/dist/connectFlow.d.ts +0 -13
- package/dist/cursorHooks.d.ts +0 -23
- package/dist/detection.d.ts +0 -30
- package/dist/hook.d.ts +0 -6
- package/dist/inboxFormat.d.ts +0 -38
- package/dist/limitEvent.d.ts +0 -16
- package/dist/limitEventReporter.d.ts +0 -21
- package/dist/mcp.d.ts +0 -12
- package/dist/prUrl.d.ts +0 -9
- package/dist/prUrl.js +0 -33
- package/dist/repoResolver.d.ts +0 -17
- package/dist/secret.d.ts +0 -1
- package/dist/security.d.ts +0 -102
- package/dist/security.js +0 -437
- package/dist/securityDeepScan.d.ts +0 -41
- package/dist/securityDeepScan.js +0 -248
- package/dist/securityDoctor.d.ts +0 -32
- package/dist/securityDoctor.js +0 -63
- package/dist/securityFeature.d.ts +0 -5
- package/dist/securityFeature.js +0 -7
- package/dist/securityInstall.d.ts +0 -63
- package/dist/securityInstall.js +0 -239
- package/dist/securityInventory.d.ts +0 -54
- package/dist/securityInventory.js +0 -556
- package/dist/securityPilot.d.ts +0 -19
- package/dist/securityPilot.js +0 -61
- package/dist/securityPolicy.d.ts +0 -33
- package/dist/securityPolicy.js +0 -188
- package/dist/securitySession.d.ts +0 -6
- package/dist/securitySession.js +0 -72
- package/dist/upgradeNudge.d.ts +0 -25
- package/dist/utils.d.ts +0 -342
- package/dist/version.d.ts +0 -1
- package/dist/versionCheck.d.ts +0 -68
package/dist/utils.d.ts
DELETED
|
@@ -1,342 +0,0 @@
|
|
|
1
|
-
import * as fs from "fs";
|
|
2
|
-
import { spawn as nodeSpawn } from "child_process";
|
|
3
|
-
import type { CaptureLogEntry } from "./captureLog";
|
|
4
|
-
import { codiedevStateDir } from "./configDir";
|
|
5
|
-
export { codiedevStateDir };
|
|
6
|
-
export interface CodiedevConfig {
|
|
7
|
-
token: string;
|
|
8
|
-
companyId: string;
|
|
9
|
-
companyName: string;
|
|
10
|
-
repos: Array<{
|
|
11
|
-
repoId: string;
|
|
12
|
-
url: string;
|
|
13
|
-
fullName: string;
|
|
14
|
-
}>;
|
|
15
|
-
lastSynced: string;
|
|
16
|
-
backendUrl: string;
|
|
17
|
-
agentSecurityEnabled?: boolean;
|
|
18
|
-
deviceId?: string;
|
|
19
|
-
deviceName?: string;
|
|
20
|
-
captureIgnoredPaths?: string[];
|
|
21
|
-
}
|
|
22
|
-
export declare const CONFIG_PATH: string;
|
|
23
|
-
export declare function readConfig(): CodiedevConfig | null;
|
|
24
|
-
export declare function writeConfig(config: CodiedevConfig): void;
|
|
25
|
-
/** Exported for permission-focused tests; normal callers use writeConfig. */
|
|
26
|
-
export declare function writeConfigAtPath(config: CodiedevConfig, configDir: string, configPath: string): void;
|
|
27
|
-
export declare function parseGitRemoteFromConfig(configText: string): string | null;
|
|
28
|
-
export declare function readGitRemoteFromConfig(startDir: string): string | null;
|
|
29
|
-
export declare function getGitRemoteUrl(cwd: string): string | null;
|
|
30
|
-
export declare function resolveCaptureRemoteUrl(workspaceRoot: string, captureDirs: string[], getRemote?: (dir: string) => string | null): string | null;
|
|
31
|
-
export declare function normalizeRepoUrl(url: string): string;
|
|
32
|
-
export declare function matchRepo(remoteUrl: string, repos: Array<{
|
|
33
|
-
repoId: string;
|
|
34
|
-
url: string;
|
|
35
|
-
fullName: string;
|
|
36
|
-
}>): {
|
|
37
|
-
repoId: string;
|
|
38
|
-
url: string;
|
|
39
|
-
fullName: string;
|
|
40
|
-
} | null;
|
|
41
|
-
export declare function resolveCaptureDir(transcriptContent: string, workspaceRoot: string): string;
|
|
42
|
-
export declare function resolveCaptureDirs(transcriptContent: string, workspaceRoot: string): string[];
|
|
43
|
-
export declare function collectCaptureKeys(dirs: string[], getBranch?: (d: string) => string | null, getSha?: (d: string) => string | null): {
|
|
44
|
-
branch: string | null;
|
|
45
|
-
headSha: string | null;
|
|
46
|
-
branches: string[];
|
|
47
|
-
headShas: string[];
|
|
48
|
-
};
|
|
49
|
-
export type CaptureGitRef = {
|
|
50
|
-
repoUrl: string;
|
|
51
|
-
branch?: string;
|
|
52
|
-
headSha?: string;
|
|
53
|
-
};
|
|
54
|
-
export declare function collectCaptureGitRefs(dirs: string[], getRemote?: (d: string) => string | null, getBranch?: (d: string) => string | null, getSha?: (d: string) => string | null): CaptureGitRef[];
|
|
55
|
-
export declare function parsePullRequestUrls(transcriptContent: string): string[];
|
|
56
|
-
export declare function extractShaTokens(transcriptContent: string): string[];
|
|
57
|
-
export declare function parseAuthoredBranches(transcriptContent: string): string[];
|
|
58
|
-
export declare function parseAuthoredShas(transcriptContent: string, repoRoot: string, resolveFullBatch?: (shas: string[]) => Map<string, string>): string[];
|
|
59
|
-
export declare function getGitBranch(cwd: string): string | null;
|
|
60
|
-
export declare function getGitHeadSha(cwd: string): string | null;
|
|
61
|
-
export interface CapturePayloadInput {
|
|
62
|
-
sessionId?: string;
|
|
63
|
-
transcriptBase64: string;
|
|
64
|
-
remoteUrl: string | null;
|
|
65
|
-
matchedRepoId?: string;
|
|
66
|
-
companyId: string;
|
|
67
|
-
messageCount: number;
|
|
68
|
-
toolCallCount: number;
|
|
69
|
-
capturedAt: number;
|
|
70
|
-
source: string;
|
|
71
|
-
branch?: string | null;
|
|
72
|
-
headSha?: string | null;
|
|
73
|
-
branches?: string[];
|
|
74
|
-
headShas?: string[];
|
|
75
|
-
gitRefs?: CaptureGitRef[];
|
|
76
|
-
pullRequestUrls?: string[];
|
|
77
|
-
inputTokens?: number;
|
|
78
|
-
outputTokens?: number;
|
|
79
|
-
cacheTokens?: number;
|
|
80
|
-
cacheReadTokens?: number;
|
|
81
|
-
cacheCreationTokens?: number;
|
|
82
|
-
model?: string | null;
|
|
83
|
-
sessionStartedAt?: number | null;
|
|
84
|
-
interruptCount?: number;
|
|
85
|
-
rejectionCount?: number;
|
|
86
|
-
final?: boolean;
|
|
87
|
-
costUsd?: number;
|
|
88
|
-
}
|
|
89
|
-
export declare function buildCapturePayload(input: CapturePayloadInput): Record<string, unknown>;
|
|
90
|
-
export declare function hashToken(token: string): string;
|
|
91
|
-
export declare function extractHookNodePath(cmd: string | undefined): string | undefined;
|
|
92
|
-
export declare function resetStableNodeCacheForTests(): void;
|
|
93
|
-
export declare function claudeCodeInstalled(): boolean;
|
|
94
|
-
export declare function codexInstalled(): boolean;
|
|
95
|
-
export declare function cursorInstalled(): boolean;
|
|
96
|
-
export declare function openCodeInstalled(): boolean;
|
|
97
|
-
/** Install a dormant global OpenCode adapter. Installing it unconditionally
|
|
98
|
-
* keeps `codiedev connect` as the only setup step even when Codie/OpenCode is
|
|
99
|
-
* installed later. OpenCode loads this file from its documented plugin dir. */
|
|
100
|
-
export declare function installOpenCodeCapturePlugin(agentSecurityEnabled?: boolean): void;
|
|
101
|
-
/**
|
|
102
|
-
* VS Code with the GitHub Copilot Chat extension installed. The extension
|
|
103
|
-
* directory pattern is `~/.vscode/extensions/github.copilot-chat-*`. We treat
|
|
104
|
-
* the presence of any `github.copilot*` directory as the Copilot fingerprint.
|
|
105
|
-
*/
|
|
106
|
-
export declare function vscodeCopilotInstalled(): boolean;
|
|
107
|
-
export declare function upsertCodiedevHook(hooks: Record<string, unknown>, eventName: string, subcommand: string, matcher?: string | null): void;
|
|
108
|
-
/** Remove Codiedev's entries for one event while preserving foreign hooks. */
|
|
109
|
-
export declare function removeCodiedevHook(hooks: Record<string, unknown>, eventName: string): boolean;
|
|
110
|
-
export declare function installHook(agentSecurityEnabled?: boolean): void;
|
|
111
|
-
export declare function ensureDiscoveryHookInstalled(): void;
|
|
112
|
-
export declare function ensureBackupHookInstalled(): void;
|
|
113
|
-
export declare function ensureLimitHookInstalled(): void;
|
|
114
|
-
export declare function ensureAllCodiedevHooksInstalled(agentSecurityEnabled?: boolean): void;
|
|
115
|
-
export declare function ensureSessionStartHookInstalled(): void;
|
|
116
|
-
export declare function installClaudeCodeInstructions(): void;
|
|
117
|
-
export declare function installCodexInstructions(): void;
|
|
118
|
-
export declare function installCursorInstructions(): void;
|
|
119
|
-
/**
|
|
120
|
-
* Install the Codiedev MCP server into Claude Code's user-scope config.
|
|
121
|
-
* Safe to call multiple times — updates the existing entry if present.
|
|
122
|
-
*/
|
|
123
|
-
export declare function installClaudeCodeMcp(): void;
|
|
124
|
-
/**
|
|
125
|
-
* Install the Codiedev MCP server into Cursor's user-scope config.
|
|
126
|
-
* Cursor uses the same `mcpServers` schema as Claude Code; just a different
|
|
127
|
-
* file path (~/.cursor/mcp.json). Project-scoped servers can also live at
|
|
128
|
-
* <project>/.cursor/mcp.json — we only manage the user-scope one.
|
|
129
|
-
*/
|
|
130
|
-
export declare function installCursorMcp(): void;
|
|
131
|
-
/**
|
|
132
|
-
* Install the Codiedev MCP server into VS Code's user-scope MCP config so
|
|
133
|
-
* GitHub Copilot Chat picks it up. VS Code uses a different schema than
|
|
134
|
-
* Claude / Cursor: top-level key is `servers` (not `mcpServers`). On first
|
|
135
|
-
* Copilot Chat run after install, VS Code prompts the user to trust the
|
|
136
|
-
* server — that's expected and documented in the connect success message.
|
|
137
|
-
*
|
|
138
|
-
* Reverse-ticket and the other on-demand verbs work in Copilot identically
|
|
139
|
-
* to Claude Code since the MCP server's reverse_ticket handler is already
|
|
140
|
-
* 100% diff-driven (no transcript dependency).
|
|
141
|
-
*/
|
|
142
|
-
export declare function installVSCodeMcp(): void;
|
|
143
|
-
/**
|
|
144
|
-
* Removes `mcpServers.codiedev` from `~/.claude.json` if present. Leaves
|
|
145
|
-
* other MCP servers and unrelated top-level settings untouched.
|
|
146
|
-
*/
|
|
147
|
-
export declare function cleanupClaudeCodeMcp(): void;
|
|
148
|
-
/**
|
|
149
|
-
* Removes `mcpServers.codiedev` from `~/.cursor/mcp.json` if present.
|
|
150
|
-
*/
|
|
151
|
-
export declare function cleanupCursorMcp(): void;
|
|
152
|
-
/**
|
|
153
|
-
* Removes `servers.codiedev` from VS Code's user-scope mcp.json. VS Code
|
|
154
|
-
* uses a different schema (`servers` not `mcpServers`), so this is a
|
|
155
|
-
* separate helper.
|
|
156
|
-
*/
|
|
157
|
-
export declare function cleanupVSCodeMcp(): void;
|
|
158
|
-
/**
|
|
159
|
-
* Removes the `# codiedev-mcp` block from `~/.codex/config.toml`. The
|
|
160
|
-
* install side appends a well-marked block; we strip it the same way —
|
|
161
|
-
* the marker line through the end of its TOML section. Whitespace-only
|
|
162
|
-
* gaps between sections are preserved.
|
|
163
|
-
*/
|
|
164
|
-
export declare function cleanupCodexMcp(): void;
|
|
165
|
-
/**
|
|
166
|
-
* Best-effort append of the Codiedev MCP server block to ~/.codex/config.toml.
|
|
167
|
-
*
|
|
168
|
-
* Codex uses TOML and we don't want a full parser for such a small addition,
|
|
169
|
-
* so we append a well-marked block if one isn't already present. Idempotent.
|
|
170
|
-
*/
|
|
171
|
-
export declare function installCodexMcp(): boolean;
|
|
172
|
-
export declare function installCodexHook(agentSecurityEnabled?: boolean): void;
|
|
173
|
-
export declare function ensureCodexLimitHookInstalled(): void;
|
|
174
|
-
export declare function installCursorHook(agentSecurityEnabled?: boolean): void;
|
|
175
|
-
/** Repair Cursor's complete flat hook set after upgrades or configuration
|
|
176
|
-
* drift. This is deliberately separate from Claude Code's nested-hook healer:
|
|
177
|
-
* the schemas and event names differ, and mixing them risks corrupting both. */
|
|
178
|
-
export declare function ensureCursorCodiedevHooksInstalled(agentSecurityEnabled?: boolean): void;
|
|
179
|
-
export interface ParsedStats {
|
|
180
|
-
messageCount: number;
|
|
181
|
-
toolCallCount: number;
|
|
182
|
-
}
|
|
183
|
-
export interface SteeringStats {
|
|
184
|
-
interrupts: number;
|
|
185
|
-
rejections: number;
|
|
186
|
-
}
|
|
187
|
-
export declare function parseClaudeSteering(content: string): SteeringStats;
|
|
188
|
-
export declare function parseCodexSteering(content: string): SteeringStats;
|
|
189
|
-
export declare function parseSteering(content: string, mode: "claude-code" | "codex" | "cursor" | "opencode"): SteeringStats;
|
|
190
|
-
export interface UsageStats {
|
|
191
|
-
inputTokens: number;
|
|
192
|
-
outputTokens: number;
|
|
193
|
-
/** Legacy fold of read + creation — kept for older servers. */
|
|
194
|
-
cacheTokens: number;
|
|
195
|
-
cacheReadTokens: number;
|
|
196
|
-
cacheCreationTokens: number;
|
|
197
|
-
model: string | null;
|
|
198
|
-
/** Engine-reported spend (opencode SDK `info.cost`). Desktop mode only. */
|
|
199
|
-
costUsd?: number;
|
|
200
|
-
}
|
|
201
|
-
export declare function parseUsage(content: string, mode: "claude-code" | "codex" | "cursor" | "opencode" | "desktop"): UsageStats;
|
|
202
|
-
export declare function parseSessionStart(content: string): number | null;
|
|
203
|
-
export declare function parseClaudeCodeStats(content: string): ParsedStats;
|
|
204
|
-
/** Convert OpenCode's SDK message array (`{info, parts}[]`) into the same
|
|
205
|
-
* newline-delimited shape used by Claude Code. The rest of capture—privacy
|
|
206
|
-
* exclusions, git keys, token parsing, scrubbing, storage, and merge joins—can
|
|
207
|
-
* therefore stay one shared pipeline instead of becoming a parallel product. */
|
|
208
|
-
export declare function normalizeOpenCodeTranscript(content: string): string;
|
|
209
|
-
export declare function parseCodexStats(content: string): ParsedStats;
|
|
210
|
-
export declare function extractCodexRepoUrl(content: string): string | null;
|
|
211
|
-
export interface CaptureUploadJob {
|
|
212
|
-
url: string;
|
|
213
|
-
token: string;
|
|
214
|
-
body: Record<string, unknown>;
|
|
215
|
-
attempts?: number;
|
|
216
|
-
queuedAt?: number;
|
|
217
|
-
scopePaths?: string[];
|
|
218
|
-
}
|
|
219
|
-
export declare const MAX_UPLOAD_ATTEMPTS = 5;
|
|
220
|
-
export declare const UPLOAD_TTL_MS: number;
|
|
221
|
-
interface DispatchDeps {
|
|
222
|
-
spawn: typeof nodeSpawn;
|
|
223
|
-
writeFileSync: typeof fs.writeFileSync;
|
|
224
|
-
tmpFile: string;
|
|
225
|
-
nodePath?: string;
|
|
226
|
-
openSync?: typeof fs.openSync;
|
|
227
|
-
closeSync?: typeof fs.closeSync;
|
|
228
|
-
}
|
|
229
|
-
export interface CaptureFinishInput {
|
|
230
|
-
mode: string;
|
|
231
|
-
session_id?: string;
|
|
232
|
-
transcript_path?: string;
|
|
233
|
-
cwd?: string;
|
|
234
|
-
workspace_roots?: string[];
|
|
235
|
-
final?: boolean;
|
|
236
|
-
}
|
|
237
|
-
export declare function dispatchCaptureFinish(input: CaptureFinishInput, hookScriptPath: string, deps: DispatchDeps): void;
|
|
238
|
-
export declare function dispatchCaptureDetached(job: CaptureUploadJob, hookScriptPath: string, deps: DispatchDeps): void;
|
|
239
|
-
export declare function dispatchDeferredUpload(job: CaptureUploadJob, hookScriptPath: string, deps: DispatchDeps, delayMs: number): void;
|
|
240
|
-
interface SweepDeps {
|
|
241
|
-
dir: string;
|
|
242
|
-
readdirSync: (dir: string) => string[];
|
|
243
|
-
renameSync: (from: string, to: string) => void;
|
|
244
|
-
statSync: (p: string) => {
|
|
245
|
-
mtimeMs: number;
|
|
246
|
-
};
|
|
247
|
-
spawn: typeof nodeSpawn;
|
|
248
|
-
hookScriptPath: string;
|
|
249
|
-
nodePath?: string;
|
|
250
|
-
exclude?: string;
|
|
251
|
-
max?: number;
|
|
252
|
-
now?: () => number;
|
|
253
|
-
openSync?: typeof fs.openSync;
|
|
254
|
-
closeSync?: typeof fs.closeSync;
|
|
255
|
-
pruneState?: () => void;
|
|
256
|
-
unlinkSync?: (p: string) => void;
|
|
257
|
-
reportOrphan?: (sessionId: string | undefined) => void;
|
|
258
|
-
}
|
|
259
|
-
export declare const CLAIM_STALE_MS: number;
|
|
260
|
-
export declare const FINISH_ORPHAN_AGE_MS: number;
|
|
261
|
-
export declare function sweepPendingCaptures(deps: SweepDeps): void;
|
|
262
|
-
export declare const CAPTURE_THROTTLE_MS: number;
|
|
263
|
-
export declare const SWEEP_MIN_AGE_MS: number;
|
|
264
|
-
export declare function resolveCaptureFinal(argv2: string | undefined): boolean | undefined;
|
|
265
|
-
export declare function finishInputTmpFile(sessionId: string | undefined): string;
|
|
266
|
-
export declare function captureUploadTmpFile(sessionId: string | undefined, mode: "immediate" | "deferred", pid?: number, now?: number): string;
|
|
267
|
-
export declare function cancelDeferredCaptureUpload(sessionId: string, deps?: Pick<typeof fs, "unlinkSync">): boolean;
|
|
268
|
-
export declare function decideDispatch(args: {
|
|
269
|
-
final: boolean;
|
|
270
|
-
lastUploadAt: number | null;
|
|
271
|
-
now: number;
|
|
272
|
-
}): {
|
|
273
|
-
mode: "immediate";
|
|
274
|
-
} | {
|
|
275
|
-
mode: "deferred";
|
|
276
|
-
delayMs: number;
|
|
277
|
-
};
|
|
278
|
-
export interface SessionUploadState {
|
|
279
|
-
lastUploadAt: number;
|
|
280
|
-
}
|
|
281
|
-
interface SessionStateDeps {
|
|
282
|
-
readFileSync: typeof fs.readFileSync;
|
|
283
|
-
existsSync: typeof fs.existsSync;
|
|
284
|
-
}
|
|
285
|
-
interface SessionStateWriteDeps {
|
|
286
|
-
writeFileSync: typeof fs.writeFileSync;
|
|
287
|
-
existsSync: typeof fs.existsSync;
|
|
288
|
-
mkdirSync: typeof fs.mkdirSync;
|
|
289
|
-
}
|
|
290
|
-
export declare function readSessionUploadState(sessionId: string, deps?: SessionStateDeps): SessionUploadState | null;
|
|
291
|
-
export declare function writeSessionUploadState(sessionId: string, state: SessionUploadState, deps?: SessionStateWriteDeps): void;
|
|
292
|
-
export declare function pruneCaptureStateDir(deps?: {
|
|
293
|
-
readdirSync: (d: string) => string[];
|
|
294
|
-
statSync: (p: string) => {
|
|
295
|
-
mtimeMs: number;
|
|
296
|
-
};
|
|
297
|
-
unlinkSync: (p: string) => void;
|
|
298
|
-
}, dir?: string, now?: number): void;
|
|
299
|
-
export declare const DIRECT_UPLOAD_THRESHOLD_CHARS = 2000000;
|
|
300
|
-
interface UploadDeps {
|
|
301
|
-
post: (url: string, body: Record<string, unknown>, token: string) => Promise<void>;
|
|
302
|
-
requestJson?: (url: string, body: Record<string, unknown>, token: string) => Promise<any>;
|
|
303
|
-
uploadBytes?: (url: string, bytes: Buffer, contentType: string) => Promise<any>;
|
|
304
|
-
readFileSync: typeof fs.readFileSync;
|
|
305
|
-
unlinkSync: typeof fs.unlinkSync;
|
|
306
|
-
writeFileSync?: typeof fs.writeFileSync;
|
|
307
|
-
now?: () => number;
|
|
308
|
-
recordSuccess?: (job: CaptureUploadJob) => void;
|
|
309
|
-
log?: (entry: CaptureLogEntry) => void;
|
|
310
|
-
writeSessionState?: (sessionId: string, state: SessionUploadState) => void;
|
|
311
|
-
shouldSkipJob?: (job: CaptureUploadJob) => boolean;
|
|
312
|
-
}
|
|
313
|
-
export interface LastCaptureRecord {
|
|
314
|
-
sessionId: string | undefined;
|
|
315
|
-
repoUrl: string;
|
|
316
|
-
matched: boolean;
|
|
317
|
-
branch: string;
|
|
318
|
-
headSha: string;
|
|
319
|
-
source: string;
|
|
320
|
-
capturedAt: number | undefined;
|
|
321
|
-
recordedAt: number;
|
|
322
|
-
}
|
|
323
|
-
export declare function buildLastCaptureRecord(job: CaptureUploadJob, now: number): LastCaptureRecord;
|
|
324
|
-
interface LastCaptureWriteDeps {
|
|
325
|
-
writeFileSync: typeof fs.writeFileSync;
|
|
326
|
-
existsSync: typeof fs.existsSync;
|
|
327
|
-
mkdirSync: typeof fs.mkdirSync;
|
|
328
|
-
}
|
|
329
|
-
export declare function writeLastCapture(record: LastCaptureRecord, deps?: LastCaptureWriteDeps, filePath?: string): void;
|
|
330
|
-
interface LastCaptureReadDeps {
|
|
331
|
-
readFileSync: typeof fs.readFileSync;
|
|
332
|
-
existsSync: typeof fs.existsSync;
|
|
333
|
-
}
|
|
334
|
-
export declare function readLastCapture(deps?: LastCaptureReadDeps, filePath?: string): LastCaptureRecord | null;
|
|
335
|
-
export declare function runCaptureUpload(jobFile: string, deps: UploadDeps): Promise<void>;
|
|
336
|
-
interface DeferredUploadDeps extends UploadDeps {
|
|
337
|
-
renameSync: typeof fs.renameSync;
|
|
338
|
-
sleep?: (ms: number) => Promise<void>;
|
|
339
|
-
}
|
|
340
|
-
export declare function runDeferredUpload(jobFile: string, delayMs: number, deps: DeferredUploadDeps): Promise<void>;
|
|
341
|
-
export declare function transcriptReadSkipReason(err: unknown): string;
|
|
342
|
-
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
|
-
};
|