codiedev 0.10.0-beta.1 → 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 +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 +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 +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 +9 -10
- 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
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.runSecurityCommand = runSecurityCommand;
|
|
4
|
-
const securityInstall_1 = require("../securityInstall");
|
|
5
|
-
const securityPilot_1 = require("../securityPilot");
|
|
6
|
-
const securityPolicy_1 = require("../securityPolicy");
|
|
7
|
-
const securityInventory_1 = require("../securityInventory");
|
|
8
|
-
const securityDeepScan_1 = require("../securityDeepScan");
|
|
9
|
-
const utils_1 = require("../utils");
|
|
10
|
-
const securityDoctor_1 = require("../securityDoctor");
|
|
11
|
-
const securityFeature_1 = require("../securityFeature");
|
|
12
|
-
const SECURITY_USAGE = "Usage: codiedev security <doctor|pilot|inventory|scan|sync|rollback> [--json] [--deep] [--connect-mcp] [--supply-chain] [--no-upload] [--yes]";
|
|
13
|
-
function printPilot(json) {
|
|
14
|
-
const report = (0, securityPilot_1.runSyntheticSecurityPilot)();
|
|
15
|
-
if (json) {
|
|
16
|
-
console.log(JSON.stringify(report, null, 2));
|
|
17
|
-
return report.ok;
|
|
18
|
-
}
|
|
19
|
-
console.log("\nCodiedev security pilot — synthetic, side-effect-free validation\n");
|
|
20
|
-
for (const item of report.cases) {
|
|
21
|
-
console.log(`${item.passed ? "✓" : "✗"} ${item.surface}: ${item.name} (${item.actual})`);
|
|
22
|
-
}
|
|
23
|
-
console.log(`\n${report.ok ? "PASS" : "FAIL"}: ${report.cases.filter((item) => item.passed).length}/${report.cases.length} policy checks matched.`);
|
|
24
|
-
console.log("No commands were executed and no real credentials were used.\n");
|
|
25
|
-
return report.ok;
|
|
26
|
-
}
|
|
27
|
-
function printDoctor(json, companyId) {
|
|
28
|
-
const result = (0, securityDoctor_1.collectSecurityDoctorReport)(companyId);
|
|
29
|
-
if (json) {
|
|
30
|
-
console.log(JSON.stringify(result, null, 2));
|
|
31
|
-
return result.ok;
|
|
32
|
-
}
|
|
33
|
-
console.log("\nCodiedev doctor — Agent Security details\n");
|
|
34
|
-
for (const check of (0, securityDoctor_1.securityDoctorChecks)(result)) {
|
|
35
|
-
const mark = check.status === "pass" ? "✓" : check.status === "warn" ? "!" : "✗";
|
|
36
|
-
console.log(`${mark} ${check.name}: ${check.detail}`);
|
|
37
|
-
}
|
|
38
|
-
console.log(`\n${result.ok ? "PASS" : "FAIL"}: ${result.ok ? "endpoint security is healthy" : "run `codiedev connect`, then repeat this check"}.\n`);
|
|
39
|
-
return result.ok;
|
|
40
|
-
}
|
|
41
|
-
async function runSecurityCommand(args) {
|
|
42
|
-
const subcommand = args.find((arg) => !arg.startsWith("-")) ?? "doctor";
|
|
43
|
-
const json = args.includes("--json");
|
|
44
|
-
if (args.includes("--help") || args.includes("-h") || subcommand === "help") {
|
|
45
|
-
console.log(SECURITY_USAGE);
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
const connectedConfig = (0, utils_1.readConfig)();
|
|
49
|
-
const requiresEntitlement = !["pilot", "self-test"].includes(subcommand);
|
|
50
|
-
if (requiresEntitlement && (!connectedConfig || !(0, securityFeature_1.isAgentSecurityEnabled)(connectedConfig))) {
|
|
51
|
-
const detail = connectedConfig
|
|
52
|
-
? `Agent Security is not enabled for ${connectedConfig.companyName}.`
|
|
53
|
-
: "Not connected. Run `codiedev connect` first.";
|
|
54
|
-
if (json)
|
|
55
|
-
console.log(JSON.stringify({ schemaVersion: 1, enabled: false, detail }, null, 2));
|
|
56
|
-
else
|
|
57
|
-
console.log(`\n${detail}\n`);
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
if (subcommand === "inventory" || subcommand === "scan") {
|
|
61
|
-
const workspaceFlag = args.indexOf("--workspace");
|
|
62
|
-
const workspace = workspaceFlag >= 0 && args[workspaceFlag + 1]
|
|
63
|
-
? args[workspaceFlag + 1]
|
|
64
|
-
: process.cwd();
|
|
65
|
-
const inventory = (0, securityInventory_1.buildSecurityInventory)({ workspace });
|
|
66
|
-
const deep = subcommand === "scan" && args.includes("--deep")
|
|
67
|
-
? (0, securityDeepScan_1.runDeepSecurityScan)(inventory, {
|
|
68
|
-
workspace,
|
|
69
|
-
connectMcp: args.includes("--connect-mcp"),
|
|
70
|
-
supplyChain: args.includes("--supply-chain"),
|
|
71
|
-
})
|
|
72
|
-
: undefined;
|
|
73
|
-
const uploadableInventory = deep ? (0, securityDeepScan_1.mergeDeepScanFindings)(inventory, deep) : inventory;
|
|
74
|
-
let upload;
|
|
75
|
-
const config = (0, utils_1.readConfig)();
|
|
76
|
-
if (config && !args.includes("--no-upload")) {
|
|
77
|
-
try {
|
|
78
|
-
upload = await (0, securityInventory_1.uploadSecurityInventory)(uploadableInventory, config);
|
|
79
|
-
}
|
|
80
|
-
catch (error) {
|
|
81
|
-
if (!json)
|
|
82
|
-
console.warn(`Inventory upload failed; local scan is still valid: ${error.message}`);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
const output = { inventory: uploadableInventory, scanners: (0, securityInventory_1.scannerAvailability)(), ...(deep ? { deep } : {}), ...(upload ? { upload } : {}) };
|
|
86
|
-
if (json)
|
|
87
|
-
console.log(JSON.stringify(output, null, 2));
|
|
88
|
-
else {
|
|
89
|
-
const risky = inventory.components.filter((component) => component.findings.length > 0).length;
|
|
90
|
-
console.log(`\nCodiedev security inventory — ${inventory.components.length} components, ${risky} with local findings, ${inventory.drift.length} changed\n`);
|
|
91
|
-
const counts = new Map();
|
|
92
|
-
for (const component of inventory.components)
|
|
93
|
-
counts.set(component.kind, (counts.get(component.kind) ?? 0) + 1);
|
|
94
|
-
for (const [kind, count] of [...counts].sort())
|
|
95
|
-
console.log(` ${kind}: ${count}`);
|
|
96
|
-
if (deep)
|
|
97
|
-
for (const run of deep.runs)
|
|
98
|
-
console.log(` ${run.scanner}: ${run.status} — ${run.detail}`);
|
|
99
|
-
if (upload)
|
|
100
|
-
console.log(`\nUploaded ${upload.accepted} component records to the security workspace.`);
|
|
101
|
-
console.log("\nUse --json for machine-readable hashes and findings. Use scan --deep for installed OSS scanners; --connect-mcp and --supply-chain are explicit because they start or download third-party code.\n");
|
|
102
|
-
}
|
|
103
|
-
return;
|
|
104
|
-
}
|
|
105
|
-
if (subcommand === "sync") {
|
|
106
|
-
const config = (0, utils_1.readConfig)();
|
|
107
|
-
if (!config) {
|
|
108
|
-
console.error("Not connected. Run `codiedev connect` first.");
|
|
109
|
-
process.exitCode = 1;
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
try {
|
|
113
|
-
const policy = await (0, securityPolicy_1.syncEndpointSecurityPolicy)(config);
|
|
114
|
-
if (json)
|
|
115
|
-
console.log(JSON.stringify({ ok: true, policy }, null, 2));
|
|
116
|
-
else {
|
|
117
|
-
const verification = (0, securityPolicy_1.verifyEndpointSecurityPolicySignature)(policy);
|
|
118
|
-
console.log(`Security policy v${policy.policyVersion} synced (${policy.enforcementMode} mode; ${verification.detail}).`);
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
catch (error) {
|
|
122
|
-
console.error(`Security policy sync failed: ${error.message}`);
|
|
123
|
-
process.exitCode = 1;
|
|
124
|
-
}
|
|
125
|
-
return;
|
|
126
|
-
}
|
|
127
|
-
if (subcommand === "rollback") {
|
|
128
|
-
if (!args.includes("--yes")) {
|
|
129
|
-
console.error("Rollback overwrites the installed agent hook configurations. Re-run with `codiedev security rollback --yes` after confirming the snapshot shown by `codiedev doctor`.");
|
|
130
|
-
process.exitCode = 1;
|
|
131
|
-
return;
|
|
132
|
-
}
|
|
133
|
-
try {
|
|
134
|
-
const result = (0, securityInstall_1.restoreSecurityInstallSnapshot)((0, securityInstall_1.readSecurityInstallManifest)());
|
|
135
|
-
if (json)
|
|
136
|
-
console.log(JSON.stringify({ schemaVersion: 1, ok: true, ...result }, null, 2));
|
|
137
|
-
else
|
|
138
|
-
console.log(`Restored ${result.restored} hook configuration(s) from snapshot ${result.snapshotId}.`);
|
|
139
|
-
}
|
|
140
|
-
catch (error) {
|
|
141
|
-
console.error(`Rollback failed: ${error.message}`);
|
|
142
|
-
process.exitCode = 1;
|
|
143
|
-
}
|
|
144
|
-
return;
|
|
145
|
-
}
|
|
146
|
-
const ok = subcommand === "pilot" || subcommand === "self-test"
|
|
147
|
-
? printPilot(json)
|
|
148
|
-
: subcommand === "doctor" || subcommand === "status"
|
|
149
|
-
? printDoctor(json, connectedConfig.companyId)
|
|
150
|
-
: false;
|
|
151
|
-
if (!["pilot", "self-test", "doctor", "status"].includes(subcommand)) {
|
|
152
|
-
console.error(SECURITY_USAGE);
|
|
153
|
-
}
|
|
154
|
-
if (!ok)
|
|
155
|
-
process.exitCode = 1;
|
|
156
|
-
}
|
package/dist/commands/send.d.ts
DELETED
package/dist/commands/share.d.ts
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { CodiedevConfig } from "../utils";
|
|
2
|
-
/**
|
|
3
|
-
* Layer per-command env overrides on top of the on-disk config. Useful for
|
|
4
|
-
* ad-hoc testing — point a prod-connected CLI at a dev Convex deployment
|
|
5
|
-
* without re-running `codiedev connect`. Both CODIEDEV_URL and CODIEDEV_TOKEN
|
|
6
|
-
* must be set together (half-overrides would mismatch URL and auth realm).
|
|
7
|
-
* Other fields (companyId, repos[]) come from the file unchanged.
|
|
8
|
-
*/
|
|
9
|
-
export declare function applyConfigEnvOverrides(config: CodiedevConfig): CodiedevConfig;
|
|
10
|
-
/**
|
|
11
|
-
* Require a connected Codiedev config. Exits the process with a helpful
|
|
12
|
-
* message if the user hasn't run `codiedev connect` yet.
|
|
13
|
-
*/
|
|
14
|
-
export declare function requireConfig(): CodiedevConfig;
|
|
15
|
-
/**
|
|
16
|
-
* Perform an authenticated HTTP request against the Codiedev backend.
|
|
17
|
-
* Returns the parsed JSON response body. Throws on non-2xx.
|
|
18
|
-
*/
|
|
19
|
-
export declare function apiRequest<T = unknown>(method: "GET" | "POST", path: string, options: {
|
|
20
|
-
config: CodiedevConfig;
|
|
21
|
-
body?: Record<string, unknown>;
|
|
22
|
-
query?: Record<string, string | number | undefined>;
|
|
23
|
-
}): Promise<T>;
|
|
24
|
-
/**
|
|
25
|
-
* Fire-and-forget per-invocation telemetry from CLI subcommands. Mirrors
|
|
26
|
-
* the MCP server's emitTelemetry but stamps `source: "cli"` so adoption
|
|
27
|
-
* dashboards can distinguish between the two surfaces. Never blocks the
|
|
28
|
-
* user's command, never throws — telemetry must not change behavior.
|
|
29
|
-
*/
|
|
30
|
-
export declare function recordAgentEvent(config: CodiedevConfig, event: {
|
|
31
|
-
tool: string;
|
|
32
|
-
ok: boolean;
|
|
33
|
-
latencyMs: number;
|
|
34
|
-
error?: string;
|
|
35
|
-
}): void;
|
|
36
|
-
/**
|
|
37
|
-
* Per-step install telemetry for `npx codiedev connect`. One row per phase
|
|
38
|
-
* (started, detect, install_target, validate_token, completed, failed) so
|
|
39
|
-
* the admin company page can show a timeline when a customer says "it says
|
|
40
|
-
* connected but it doesn't work." Fire-and-forget, never throws. Auto-stamps
|
|
41
|
-
* platform + node + cli version so call sites only need step/target/ok/error.
|
|
42
|
-
*/
|
|
43
|
-
export type InstallTelemetryStep = "started" | "detect" | "install_target" | "validate_token" | "completed" | "failed";
|
|
44
|
-
export declare function recordInstallEvent(config: CodiedevConfig, event: {
|
|
45
|
-
step: InstallTelemetryStep;
|
|
46
|
-
target?: string;
|
|
47
|
-
ok: boolean;
|
|
48
|
-
error?: string;
|
|
49
|
-
}): void;
|
|
50
|
-
/**
|
|
51
|
-
* Wraps a CLI subcommand body so success and failure both record telemetry
|
|
52
|
-
* and the original error propagates after the event is queued. Use this in
|
|
53
|
-
* each `runXxx` command instead of inline timing + try/catch boilerplate.
|
|
54
|
-
*/
|
|
55
|
-
export declare function withTelemetry<T>(config: CodiedevConfig, tool: string, fn: () => Promise<T>): Promise<T>;
|
|
56
|
-
/**
|
|
57
|
-
* Relative-time formatter for inbox / listing output.
|
|
58
|
-
*/
|
|
59
|
-
export declare function timeAgo(ts: number): string;
|
|
60
|
-
/**
|
|
61
|
-
* Strip surrounding quotes from a CLI argument if the user wrapped it.
|
|
62
|
-
* `codiedev ping <name> "hey"` on some shells passes the quotes through.
|
|
63
|
-
*/
|
|
64
|
-
export declare function stripQuotes(s: string): string;
|
package/dist/configDir.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function codiedevStateDir(): string;
|
package/dist/connect.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function runConnect(args?: string[]): Promise<void>;
|
package/dist/connectFlow.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { CodiedevConfig } from "./utils";
|
|
2
|
-
export type ConnectTokenSource = "reused" | "prompt-required";
|
|
3
|
-
export interface ConnectTokenInput {
|
|
4
|
-
savedConfig: CodiedevConfig | null;
|
|
5
|
-
force: boolean;
|
|
6
|
-
}
|
|
7
|
-
export type ConnectTokenResult = {
|
|
8
|
-
source: "reused";
|
|
9
|
-
token: string;
|
|
10
|
-
} | {
|
|
11
|
-
source: "prompt-required";
|
|
12
|
-
};
|
|
13
|
-
export declare function resolveConnectToken(input: ConnectTokenInput): ConnectTokenResult;
|
package/dist/cursorHooks.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/** Cursor's native hook payload is close to Claude Code's, but its stable
|
|
2
|
-
* conversation identifier and several tool fields use different names. Keep
|
|
3
|
-
* the translation at the process boundary so the shared capture/security
|
|
4
|
-
* pipeline never has to guess which surface produced an event. */
|
|
5
|
-
export declare function normalizeCursorHookInput<T extends Record<string, unknown>>(input: T): T & Record<string, unknown>;
|
|
6
|
-
/** Cursor stores JSONL message roles in `role`; the shared capture pipeline
|
|
7
|
-
* uses Claude's top-level `type` discriminator. Preserve all original fields
|
|
8
|
-
* and add only that discriminator so the existing parsers see real messages. */
|
|
9
|
-
export declare function normalizeCursorTranscript(content: string): string;
|
|
10
|
-
/** Cursor may change its private JSONL record shape independently of the hook
|
|
11
|
-
* contract. Only a byte-empty snapshot is safe to discard; a non-empty file
|
|
12
|
-
* that the current normalizer cannot parse must still be uploaded for backend
|
|
13
|
-
* recovery and diagnosis. */
|
|
14
|
-
export declare function isCursorTranscriptEmpty(content: string): boolean;
|
|
15
|
-
export declare function cursorPreToolBlockResponse(reason: string): {
|
|
16
|
-
permission: "deny";
|
|
17
|
-
user_message: string;
|
|
18
|
-
agent_message: string;
|
|
19
|
-
};
|
|
20
|
-
export declare function cursorPromptBlockResponse(reason: string): {
|
|
21
|
-
continue: false;
|
|
22
|
-
user_message: string;
|
|
23
|
-
};
|
package/dist/detection.d.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
export interface ClaudeCodeProbe {
|
|
2
|
-
dirExists: boolean;
|
|
3
|
-
binOnPath: boolean;
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* Claude Code is "installed" if either ~/.claude exists (the user has
|
|
7
|
-
* launched the app at least once) OR the `claude` binary is on PATH (the
|
|
8
|
-
* user installed via npm/brew but hasn't launched yet). Either signal is
|
|
9
|
-
* sufficient — we want to wire up the hook the moment the user has
|
|
10
|
-
* obviously committed to the tool.
|
|
11
|
-
*/
|
|
12
|
-
export declare function detectClaudeCode(probe: ClaudeCodeProbe): boolean;
|
|
13
|
-
/**
|
|
14
|
-
* True iff `cmd` looks like a hook command codiedev itself wrote. Used
|
|
15
|
-
* both by the install filter (so `connect` replaces the existing entry
|
|
16
|
-
* instead of stacking another one) and by `codiedev doctor` (so it can
|
|
17
|
-
* grade whether the hook is wired up).
|
|
18
|
-
*
|
|
19
|
-
* Must match every form codiedev can write:
|
|
20
|
-
* - Legacy `npx codiedev-hook <subcommand>`
|
|
21
|
-
* - Absolute path from npm-registry install:
|
|
22
|
-
* `<node> /.../node_modules/codiedev/dist/hook.js <subcommand>`
|
|
23
|
-
* - Absolute path from `npm link` dev install (the monorepo folder
|
|
24
|
-
* is named `codiedev-cli`, not `codiedev`):
|
|
25
|
-
* `<node> /.../codiedev-cli/dist/hook.js <subcommand>`
|
|
26
|
-
*
|
|
27
|
-
* The `codiedev[^/\\]*` allows the trailing `-cli` (or any future suffix)
|
|
28
|
-
* without matching unrelated paths like `notcodiedev/dist/hook.js`.
|
|
29
|
-
*/
|
|
30
|
-
export declare function isCodiedevHookCommand(cmd: string | undefined): boolean;
|
package/dist/hook.d.ts
DELETED
package/dist/inboxFormat.d.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
export interface InboxPing {
|
|
2
|
-
pingId: string;
|
|
3
|
-
createdAt: number;
|
|
4
|
-
readAt?: number;
|
|
5
|
-
from: {
|
|
6
|
-
name: string;
|
|
7
|
-
email: string;
|
|
8
|
-
} | null;
|
|
9
|
-
subjectKey: string | null;
|
|
10
|
-
subject: {
|
|
11
|
-
title?: string;
|
|
12
|
-
} | null;
|
|
13
|
-
preview: string;
|
|
14
|
-
}
|
|
15
|
-
export interface InboxMention {
|
|
16
|
-
mentionId: string;
|
|
17
|
-
createdAt: number;
|
|
18
|
-
readAt?: number | null;
|
|
19
|
-
from: {
|
|
20
|
-
name: string;
|
|
21
|
-
email: string;
|
|
22
|
-
} | null;
|
|
23
|
-
postTitle: string | null;
|
|
24
|
-
preview: string | null;
|
|
25
|
-
url: string | null;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Render the inbox for BOTH surfaces — `codiedev inbox` and the MCP
|
|
29
|
-
* `codiedev_inbox` tool an agent calls for "any messages?". Shared so the
|
|
30
|
-
* agent path can never drift back to pings-only while the human path shows
|
|
31
|
-
* mentions.
|
|
32
|
-
*/
|
|
33
|
-
export declare function formatInbox(opts: {
|
|
34
|
-
pings: InboxPing[];
|
|
35
|
-
mentions?: InboxMention[];
|
|
36
|
-
unreadOnly: boolean;
|
|
37
|
-
limit?: number;
|
|
38
|
-
}): string[];
|
package/dist/limitEvent.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export type LimitKind = "session" | "user_spend" | "org_spend" | "other";
|
|
2
|
-
export interface LimitEvent {
|
|
3
|
-
kind: LimitKind;
|
|
4
|
-
at: number;
|
|
5
|
-
resetText: string | null;
|
|
6
|
-
reason?: string;
|
|
7
|
-
}
|
|
8
|
-
export declare function classifyLimitKind(text: string): LimitKind;
|
|
9
|
-
export declare function parseLimitEventFromTranscript(transcript: string): LimitEvent | null;
|
|
10
|
-
/**
|
|
11
|
-
* Codex writes a structured RateLimitSnapshot on token_count events. A normal
|
|
12
|
-
* turn has `rate_limit_reached_type: null`; a blocked turn names the exact
|
|
13
|
-
* boundary. Reading that field avoids locale-dependent terminal copy.
|
|
14
|
-
*/
|
|
15
|
-
export declare function parseCodexLimitEventFromTranscript(transcript: string): LimitEvent | null;
|
|
16
|
-
export declare function tailForLimitEvent(transcript: string, maxChars?: number): string;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { type LimitEvent } from "./limitEvent";
|
|
2
|
-
export type LimitEventSource = "claude-code" | "codex";
|
|
3
|
-
export type LimitEventPayload = LimitEvent & {
|
|
4
|
-
source: LimitEventSource;
|
|
5
|
-
sessionId?: string;
|
|
6
|
-
transcriptTail?: string;
|
|
7
|
-
};
|
|
8
|
-
export declare function postLimitEvent(config: {
|
|
9
|
-
backendUrl: string;
|
|
10
|
-
token: string;
|
|
11
|
-
}, payload: LimitEventPayload, timeoutMs?: number): Promise<void>;
|
|
12
|
-
export declare function reportTranscriptLimitEvent(args: {
|
|
13
|
-
config: {
|
|
14
|
-
backendUrl: string;
|
|
15
|
-
token: string;
|
|
16
|
-
};
|
|
17
|
-
source: LimitEventSource;
|
|
18
|
-
sessionId?: string;
|
|
19
|
-
transcript: string;
|
|
20
|
-
emitMinimalOnMiss?: boolean;
|
|
21
|
-
}): Promise<boolean>;
|
package/dist/mcp.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* Codiedev MCP server.
|
|
4
|
-
*
|
|
5
|
-
* Exposes the Codiedev artifact-collaboration surface as Model Context
|
|
6
|
-
* Protocol tools so Claude Code / Codex / any MCP-capable agent can invoke
|
|
7
|
-
* them natively from natural language (e.g. "push the spec we just worked on").
|
|
8
|
-
*
|
|
9
|
-
* Reads the same ~/.codiedev/config.json the CLI uses. Install + wire up by
|
|
10
|
-
* running `npx codiedev connect`.
|
|
11
|
-
*/
|
|
12
|
-
export {};
|
package/dist/prUrl.d.ts
DELETED
package/dist/prUrl.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// PR/MR URL parser. GitHub uses `/pull/<n>`, GitLab uses `/-/merge_requests/<n>`.
|
|
3
|
-
// Self-hosted GitLab keeps the same path shape on a different host (Sonifi
|
|
4
|
-
// runs git.sonifi.com behind a Cloudflare tunnel, for example). Nested groups
|
|
5
|
-
// land in `owner` as a slash-joined path so we can rebuild the full project
|
|
6
|
-
// path when calling the GitLab API.
|
|
7
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.parsePrOrMrUrl = parsePrOrMrUrl;
|
|
9
|
-
function parsePrOrMrUrl(url) {
|
|
10
|
-
if (!url)
|
|
11
|
-
return null;
|
|
12
|
-
const gh = url.match(/^https?:\/\/([^/]+)\/([^/]+)\/([^/]+)\/pull\/(\d+)(?:[/?#]|$)/);
|
|
13
|
-
if (gh && /github/i.test(gh[1])) {
|
|
14
|
-
return {
|
|
15
|
-
provider: "github",
|
|
16
|
-
host: gh[1],
|
|
17
|
-
owner: gh[2],
|
|
18
|
-
repo: gh[3],
|
|
19
|
-
number: Number(gh[4]),
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
const gl = url.match(/^https?:\/\/([^/]+)\/(.+)\/([^/]+)\/-\/merge_requests\/(\d+)(?:[/?#]|$)/);
|
|
23
|
-
if (gl) {
|
|
24
|
-
return {
|
|
25
|
-
provider: "gitlab",
|
|
26
|
-
host: gl[1],
|
|
27
|
-
owner: gl[2],
|
|
28
|
-
repo: gl[3],
|
|
29
|
-
number: Number(gl[4]),
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
return null;
|
|
33
|
-
}
|
package/dist/repoResolver.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export type ResolveSource = "provided" | "resolved" | "unmatched";
|
|
2
|
-
export interface RepoLite {
|
|
3
|
-
_id: string;
|
|
4
|
-
owner: string;
|
|
5
|
-
name: string;
|
|
6
|
-
gitProvider?: "github" | "gitlab";
|
|
7
|
-
}
|
|
8
|
-
export interface ResolveInput {
|
|
9
|
-
remoteUrl: string | null | undefined;
|
|
10
|
-
providedRepoId: string | null;
|
|
11
|
-
companyRepos: ReadonlyArray<RepoLite>;
|
|
12
|
-
}
|
|
13
|
-
export interface ResolveResult {
|
|
14
|
-
repoId: string | null;
|
|
15
|
-
source: ResolveSource;
|
|
16
|
-
}
|
|
17
|
-
export declare function resolveRepoForCapture(input: ResolveInput): ResolveResult;
|
package/dist/secret.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function maskToken(token: string | null | undefined): string;
|
package/dist/security.d.ts
DELETED
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
export type SecurityHookPhase = "pre" | "post" | "failure";
|
|
2
|
-
export type AgentSurface = "claude-code" | "codex" | "cursor" | "codie-harness";
|
|
3
|
-
export declare const SECURITY_RUNTIME_VERSION = 1;
|
|
4
|
-
export interface RawSecurityHookInput {
|
|
5
|
-
session_id?: string;
|
|
6
|
-
sessionId?: string;
|
|
7
|
-
cwd?: string;
|
|
8
|
-
hook_event_name?: string;
|
|
9
|
-
hookEventName?: string;
|
|
10
|
-
tool_name?: string;
|
|
11
|
-
toolName?: string;
|
|
12
|
-
tool_input?: unknown;
|
|
13
|
-
toolInput?: unknown;
|
|
14
|
-
tool_response?: unknown;
|
|
15
|
-
toolResponse?: unknown;
|
|
16
|
-
tool_use_id?: string;
|
|
17
|
-
toolUseId?: string;
|
|
18
|
-
duration_ms?: number;
|
|
19
|
-
durationMs?: number;
|
|
20
|
-
error?: unknown;
|
|
21
|
-
prompt?: string;
|
|
22
|
-
}
|
|
23
|
-
export interface SecurityWorkflowEvent {
|
|
24
|
-
schemaVersion: 1;
|
|
25
|
-
source: AgentSurface;
|
|
26
|
-
phase: SecurityHookPhase;
|
|
27
|
-
sessionId: string;
|
|
28
|
-
toolName: string;
|
|
29
|
-
toolUseId?: string;
|
|
30
|
-
cwd?: string;
|
|
31
|
-
observedAt: number;
|
|
32
|
-
toolDurationMs?: number;
|
|
33
|
-
payload: unknown;
|
|
34
|
-
redactionCount: number;
|
|
35
|
-
localDecision?: LocalSecurityAction;
|
|
36
|
-
localCategory?: LocalSecurityDecision["category"];
|
|
37
|
-
endpointId?: string;
|
|
38
|
-
endpointName?: string;
|
|
39
|
-
cliVersion?: string;
|
|
40
|
-
securityRuntimeVersion?: number;
|
|
41
|
-
securityPolicyVersion?: number;
|
|
42
|
-
}
|
|
43
|
-
export type LocalSecurityAction = "allow" | "alert" | "block";
|
|
44
|
-
export type SecurityCategory = "secret_in_prompt" | "secret_exfiltration" | "destructive_outside_workspace" | "sensitive_file_read" | "sensitive_file_write" | "protected_agent_config_write" | "unapproved_network_egress" | "untrusted_mcp_tool" | "unapproved_command" | "obfuscated_shell_command" | "package_install" | "sensitive_read_then_egress";
|
|
45
|
-
export interface EndpointSecurityPolicy {
|
|
46
|
-
schemaVersion: 1;
|
|
47
|
-
policyVersion: number;
|
|
48
|
-
enforcementMode: "alert" | "block";
|
|
49
|
-
rules: Partial<Record<SecurityCategory, LocalSecurityAction>>;
|
|
50
|
-
constraints?: {
|
|
51
|
-
allowedMcpServers?: string[];
|
|
52
|
-
allowedHosts?: string[];
|
|
53
|
-
allowedCommands?: string[];
|
|
54
|
-
};
|
|
55
|
-
exceptions: Array<{
|
|
56
|
-
scope: "company" | "user" | "source" | "repository" | "tool" | "category";
|
|
57
|
-
scopeValue: string;
|
|
58
|
-
}>;
|
|
59
|
-
fetchedAt: number;
|
|
60
|
-
signature?: {
|
|
61
|
-
algorithm: "Ed25519";
|
|
62
|
-
keyId: string;
|
|
63
|
-
signedAt: number;
|
|
64
|
-
value: string;
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
export interface LocalSecurityDecision {
|
|
68
|
-
action: LocalSecurityAction;
|
|
69
|
-
category?: SecurityCategory;
|
|
70
|
-
reason?: string;
|
|
71
|
-
}
|
|
72
|
-
export declare function withEndpointIdentity(event: SecurityWorkflowEvent, identity: {
|
|
73
|
-
endpointId?: string;
|
|
74
|
-
endpointName?: string;
|
|
75
|
-
cliVersion?: string;
|
|
76
|
-
securityRuntimeVersion?: number;
|
|
77
|
-
securityPolicyVersion?: number;
|
|
78
|
-
}): SecurityWorkflowEvent;
|
|
79
|
-
/**
|
|
80
|
-
* Runs before a user prompt reaches the model. This is intentionally narrow:
|
|
81
|
-
* block credential material, but allow safe references such as
|
|
82
|
-
* `$OPENAI_API_KEY` so developers can ask agents to use environment variables
|
|
83
|
-
* without pasting their values.
|
|
84
|
-
*/
|
|
85
|
-
export declare function evaluatePromptSecurity(prompt: string | undefined, policy?: EndpointSecurityPolicy, source?: AgentSurface): LocalSecurityDecision;
|
|
86
|
-
/** Runs synchronously before a tool executes. No network or model is involved. */
|
|
87
|
-
export declare function evaluateToolSecurity(input: RawSecurityHookInput, phase: SecurityHookPhase, policy?: EndpointSecurityPolicy, source?: AgentSurface, sessionContext?: {
|
|
88
|
-
sensitiveReadAt?: number;
|
|
89
|
-
now?: number;
|
|
90
|
-
}): LocalSecurityDecision;
|
|
91
|
-
export declare function securityInputHasSensitivePath(input: RawSecurityHookInput): boolean;
|
|
92
|
-
export declare function buildSecurityWorkflowEvent(input: RawSecurityHookInput, phase: SecurityHookPhase, source: AgentSurface, now?: () => number): SecurityWorkflowEvent | null;
|
|
93
|
-
/**
|
|
94
|
-
* Captures the intent side of the causal chain without weakening the local
|
|
95
|
-
* privacy boundary. A prompt that the deterministic policy blocks never
|
|
96
|
-
* becomes an uploadable event; allowed prompts are redacted and bounded using
|
|
97
|
-
* the same sanitizer as tool payloads.
|
|
98
|
-
*/
|
|
99
|
-
export declare function buildSecurityPromptEvent(input: Pick<RawSecurityHookInput, "session_id" | "sessionId" | "cwd" | "prompt">, source: AgentSurface, now?: () => number, policy?: EndpointSecurityPolicy): SecurityWorkflowEvent | null;
|
|
100
|
-
/** Audit-safe evidence for a blocked prompt. The secret-bearing prompt is
|
|
101
|
-
* intentionally omitted; administrators still see that prevention occurred. */
|
|
102
|
-
export declare function buildBlockedSecurityPromptEvent(input: Pick<RawSecurityHookInput, "session_id" | "sessionId" | "cwd">, source: AgentSurface, category: NonNullable<LocalSecurityDecision["category"]>, now?: () => number): SecurityWorkflowEvent | null;
|