codiedev 0.10.0-beta.4 → 0.10.0-beta.6

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.
Files changed (157) hide show
  1. package/README.md +11 -5
  2. package/assets/tui-brand-plugin.tsx +14 -2
  3. package/dist/backup/cache.js +1 -5
  4. package/dist/backup/match.js +0 -6
  5. package/dist/backup/run.js +3 -35
  6. package/dist/captureExclusions.js +0 -12
  7. package/dist/captureLog.js +0 -28
  8. package/dist/captureReadiness.js +0 -58
  9. package/dist/captureSignals.js +68 -3
  10. package/dist/cli.js +75 -64
  11. package/dist/codexHookTrust.js +125 -6
  12. package/dist/codexLimitScan.js +2 -109
  13. package/dist/codie.js +50 -114
  14. package/dist/codieBrandInstall.js +0 -18
  15. package/dist/codieLauncher.js +20 -92
  16. package/dist/codieRuntime.js +19 -23
  17. package/dist/codieRuntimeInstall.js +108 -23
  18. package/dist/codieUsage.js +38 -41
  19. package/dist/commands/agentTemplates.generated.js +136 -0
  20. package/dist/commands/agents.js +1066 -0
  21. package/dist/commands/agentsSdk.generated.js +7 -0
  22. package/dist/commands/ask.js +0 -3
  23. package/dist/commands/capture.js +0 -2
  24. package/dist/commands/createTicket.js +0 -10
  25. package/dist/commands/doctor.js +53 -120
  26. package/dist/commands/evals.js +187 -0
  27. package/dist/commands/inbox.js +0 -2
  28. package/dist/commands/library.js +0 -3
  29. package/dist/commands/pack.js +573 -0
  30. package/dist/commands/ping.js +0 -2
  31. package/dist/commands/pull.js +6 -10
  32. package/dist/commands/push.js +2 -12
  33. package/dist/commands/search.js +0 -4
  34. package/dist/commands/send.js +0 -5
  35. package/dist/commands/share.js +0 -4
  36. package/dist/commands/shared.js +0 -35
  37. package/dist/commands/traces.js +344 -0
  38. package/dist/commands/tracesLabel.js +348 -0
  39. package/dist/configDir.js +0 -10
  40. package/dist/connect.js +19 -116
  41. package/dist/connectFlow.js +0 -9
  42. package/dist/copilotHooks.js +391 -0
  43. package/dist/copilotInstallation.js +64 -0
  44. package/dist/cursorHooks.js +38 -30
  45. package/dist/cursorLifecycle.js +109 -0
  46. package/dist/detection.js +0 -30
  47. package/dist/harnessDirs.js +77 -0
  48. package/dist/hook.js +182 -469
  49. package/dist/inboxFormat.js +0 -24
  50. package/dist/launchContext.js +150 -0
  51. package/dist/launcher.js +140 -0
  52. package/dist/limitEvent.js +41 -35
  53. package/dist/limitEventReporter.js +1 -1
  54. package/dist/managedPi.js +240 -0
  55. package/dist/mcp.js +3 -384
  56. package/dist/nativeSteering.js +24 -0
  57. package/dist/packs/codie.js +182 -0
  58. package/dist/packs/harnesses.js +411 -0
  59. package/dist/packs/hookGate.js +256 -0
  60. package/dist/packs/install.js +286 -0
  61. package/dist/packs/manifest.js +126 -0
  62. package/dist/packs/paths.js +81 -0
  63. package/dist/packs/shim.js +214 -0
  64. package/dist/packs/store.js +155 -0
  65. package/dist/packs/sync.js +170 -0
  66. package/dist/piHooks.js +216 -0
  67. package/dist/piRuntime.js +120 -0
  68. package/dist/repoResolver.js +0 -19
  69. package/dist/secret.js +0 -3
  70. package/dist/selfUpdate.js +376 -0
  71. package/dist/skillMarker.js +23 -0
  72. package/dist/subagents.js +135 -0
  73. package/dist/teamSkillContext.js +10 -0
  74. package/dist/transcriptModels.js +6 -8
  75. package/dist/upgradeNudge.js +0 -30
  76. package/dist/utils.js +494 -824
  77. package/dist/version.js +0 -10
  78. package/dist/versionCheck.js +0 -33
  79. package/package.json +8 -9
  80. package/dist/backup/cache.d.ts +0 -14
  81. package/dist/backup/match.d.ts +0 -2
  82. package/dist/backup/run.d.ts +0 -25
  83. package/dist/captureExclusions.d.ts +0 -30
  84. package/dist/captureLog.d.ts +0 -20
  85. package/dist/captureReadiness.d.ts +0 -65
  86. package/dist/captureSignals.d.ts +0 -19
  87. package/dist/cli.d.ts +0 -16
  88. package/dist/codexHookTrust.d.ts +0 -34
  89. package/dist/codexLimitScan.d.ts +0 -64
  90. package/dist/codie.d.ts +0 -2
  91. package/dist/codieBrandInstall.d.ts +0 -11
  92. package/dist/codieLauncher.d.ts +0 -86
  93. package/dist/codieRuntime.d.ts +0 -29
  94. package/dist/codieRuntimeInstall.d.ts +0 -28
  95. package/dist/codieStartup.d.ts +0 -26
  96. package/dist/codieStartup.js +0 -30
  97. package/dist/codieUsage.d.ts +0 -57
  98. package/dist/commands/ask.d.ts +0 -1
  99. package/dist/commands/capture.d.ts +0 -14
  100. package/dist/commands/createTicket.d.ts +0 -27
  101. package/dist/commands/delete.d.ts +0 -1
  102. package/dist/commands/doctor.d.ts +0 -1
  103. package/dist/commands/inbox.d.ts +0 -3
  104. package/dist/commands/library.d.ts +0 -2
  105. package/dist/commands/note.d.ts +0 -1
  106. package/dist/commands/ping.d.ts +0 -1
  107. package/dist/commands/promote.d.ts +0 -1
  108. package/dist/commands/promote.js +0 -53
  109. package/dist/commands/pull.d.ts +0 -2
  110. package/dist/commands/push.d.ts +0 -33
  111. package/dist/commands/react.d.ts +0 -2
  112. package/dist/commands/react.js +0 -40
  113. package/dist/commands/reverseTicket.d.ts +0 -2
  114. package/dist/commands/reverseTicket.js +0 -477
  115. package/dist/commands/search.d.ts +0 -2
  116. package/dist/commands/security.d.ts +0 -1
  117. package/dist/commands/security.js +0 -156
  118. package/dist/commands/send.d.ts +0 -2
  119. package/dist/commands/share.d.ts +0 -2
  120. package/dist/commands/shared.d.ts +0 -64
  121. package/dist/configDir.d.ts +0 -1
  122. package/dist/connect.d.ts +0 -1
  123. package/dist/connectFlow.d.ts +0 -13
  124. package/dist/cursorHooks.d.ts +0 -23
  125. package/dist/detection.d.ts +0 -30
  126. package/dist/hook.d.ts +0 -6
  127. package/dist/inboxFormat.d.ts +0 -38
  128. package/dist/limitEvent.d.ts +0 -16
  129. package/dist/limitEventReporter.d.ts +0 -21
  130. package/dist/mcp.d.ts +0 -12
  131. package/dist/prUrl.d.ts +0 -9
  132. package/dist/prUrl.js +0 -33
  133. package/dist/repoResolver.d.ts +0 -17
  134. package/dist/secret.d.ts +0 -1
  135. package/dist/security.d.ts +0 -102
  136. package/dist/security.js +0 -437
  137. package/dist/securityDeepScan.d.ts +0 -41
  138. package/dist/securityDeepScan.js +0 -248
  139. package/dist/securityDoctor.d.ts +0 -32
  140. package/dist/securityDoctor.js +0 -63
  141. package/dist/securityFeature.d.ts +0 -5
  142. package/dist/securityFeature.js +0 -7
  143. package/dist/securityInstall.d.ts +0 -63
  144. package/dist/securityInstall.js +0 -239
  145. package/dist/securityInventory.d.ts +0 -54
  146. package/dist/securityInventory.js +0 -556
  147. package/dist/securityPilot.d.ts +0 -19
  148. package/dist/securityPilot.js +0 -61
  149. package/dist/securityPolicy.d.ts +0 -33
  150. package/dist/securityPolicy.js +0 -188
  151. package/dist/securitySession.d.ts +0 -6
  152. package/dist/securitySession.js +0 -72
  153. package/dist/transcriptModels.d.ts +0 -18
  154. package/dist/upgradeNudge.d.ts +0 -25
  155. package/dist/utils.d.ts +0 -346
  156. package/dist/version.d.ts +0 -1
  157. package/dist/versionCheck.d.ts +0 -68
package/dist/version.js CHANGED
@@ -1,10 +1,4 @@
1
1
  "use strict";
2
- // Resolves the running CLI version. Read once at startup so subsequent
3
- // auth calls don't pay an fs.readFile per request.
4
- //
5
- // We could `import packageJson from "../package.json"` but that requires
6
- // `resolveJsonModule` and emits the JSON into dist. Reading at runtime
7
- // keeps the bundle smaller and works regardless of tsconfig settings.
8
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
9
3
  if (k2 === undefined) k2 = k;
10
4
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -43,9 +37,6 @@ exports.CLI_VERSION = void 0;
43
37
  const fs = __importStar(require("fs"));
44
38
  const path = __importStar(require("path"));
45
39
  function resolveCliVersion() {
46
- // dist/version.js sits alongside dist/cli.js. The package.json is one
47
- // directory up from dist/, i.e. `../package.json` relative to this file.
48
- // In TS source we're at src/version.ts so the path is `../package.json`.
49
40
  const candidates = [
50
41
  path.join(__dirname, "..", "package.json"),
51
42
  path.join(__dirname, "..", "..", "package.json"),
@@ -59,7 +50,6 @@ function resolveCliVersion() {
59
50
  }
60
51
  }
61
52
  catch {
62
- // try next candidate
63
53
  }
64
54
  }
65
55
  return "0.0.0";
@@ -1,8 +1,4 @@
1
1
  "use strict";
2
- // Pure version-comparison helpers for the "is your CLI outdated" warning.
3
- // The IO (fetching npm registry, reading/writing the cache file) lives in
4
- // connect.ts/doctor.ts and is exercised by manual smoke. Keeping the policy
5
- // pure means the truth table is unit-testable without mocking fetch or fs.
6
2
  Object.defineProperty(exports, "__esModule", { value: true });
7
3
  exports.parseSemver = parseSemver;
8
4
  exports.compareSemver = compareSemver;
@@ -19,13 +15,6 @@ function parseSemver(input) {
19
15
  return null;
20
16
  return { major: Number(m[1]), minor: Number(m[2]), patch: Number(m[3]) };
21
17
  }
22
- /**
23
- * Returns -1 if a < b, 0 if equal, 1 if a > b.
24
- *
25
- * Malformed input on either side returns 0 — we never want to nag a user
26
- * because of garbage version strings (corrupt cache, registry returned
27
- * something weird, prerelease format we don't recognize).
28
- */
29
18
  function compareSemver(a, b) {
30
19
  const pa = parseSemver(a);
31
20
  const pb = parseSemver(b);
@@ -39,25 +28,11 @@ function compareSemver(a, b) {
39
28
  return pa.patch < pb.patch ? -1 : 1;
40
29
  return 0;
41
30
  }
42
- /**
43
- * Warning policy: only show when we have a known-newer `latest` from a
44
- * recent-enough cache. Stale-cache freshness is enforced by the *caller*
45
- * (which decides whether to refetch); this helper takes the cache state
46
- * as-given and answers a single question — should the user see a nag?
47
- */
48
31
  function shouldShowUpdateWarning(input) {
49
32
  if (!input.latest)
50
33
  return false;
51
34
  return compareSemver(input.current, input.latest) === -1;
52
35
  }
53
- /**
54
- * npx — running from npm's _npx cache; nothing to upgrade in place.
55
- * container — baked into an image; the honest fix is rebuilding it.
56
- * global — a real install directory we can write to. Upgradable.
57
- * readonly — a real install directory we cannot write to (root-owned global
58
- * on a shared box, read-only mount). Needs sudo, so print rather
59
- * than attempt an upgrade that would EACCES.
60
- */
61
36
  function resolveInstallKind(deps) {
62
37
  if (/[\\/](?:_npx|\.npm[\\/]_npx)[\\/]/.test(deps.dirname))
63
38
  return "npx";
@@ -71,10 +46,8 @@ function resolveInstallKind(deps) {
71
46
  }
72
47
  }
73
48
  catch {
74
- // not Linux, or no procfs — fall through to the writability probe
75
49
  }
76
50
  try {
77
- // 2 = fs.constants.W_OK, inlined so this module stays fs-free.
78
51
  deps.accessSync(deps.dirname, 2);
79
52
  return "global";
80
53
  }
@@ -94,12 +67,6 @@ function upgradeCommand(kind, pkg = "codiedev") {
94
67
  return `npm i -g ${pkg}@latest`;
95
68
  }
96
69
  }
97
- /**
98
- * `promptedAt` makes a decline stick until the next window instead of asking
99
- * on every launch. It is deliberately not keyed to a dismissed version:
100
- * somebody who says no today should be asked again tomorrow, not silently
101
- * stranded on that version forever.
102
- */
103
70
  function decideUpdateAction(input) {
104
71
  const command = upgradeCommand(input.installKind, input.pkg);
105
72
  const ttl = input.cacheTtlMs ?? 24 * 60 * 60 * 1000;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "codiedev",
3
- "version": "0.10.0-beta.4",
4
- "description": "Connect Claude Code, Codex, Cursor, OpenCode, or VS Code Copilot to Codiedev for team session capture and artifact collaboration — and run the governed Codie harness",
3
+ "version": "0.10.0-beta.6",
4
+ "description": "Connect Claude Code, Codex, Cursor, OpenCode, or VS Code Copilot to Codiedev for team session capture and artifact collaboration \u2014 and run the governed Codie harness",
5
5
  "bin": {
6
6
  "codiedev": "dist/cli.js",
7
7
  "codiedev-hook": "dist/hook.js",
@@ -12,13 +12,12 @@
12
12
  "dev": "tsc --watch",
13
13
  "prepublishOnly": "tsc",
14
14
  "test": "vitest run",
15
- "test:functional": "vitest run src/__tests__/limitEvent.functional.test.ts src/__tests__/harnessParity.functional.test.ts src/__tests__/cursorParity.functional.test.ts",
16
- "test:harness-parity": "vitest run src/__tests__/harnessParity.functional.test.ts src/__tests__/cursorParity.functional.test.ts",
15
+ "test:functional": "vitest run src/__tests__/limitEvent.functional.test.ts src/__tests__/harnessParity.functional.test.ts src/__tests__/cursorParity.functional.test.ts src/__tests__/copilotCapture.functional.test.ts src/__tests__/piCapture.functional.test.ts",
16
+ "test:harness-parity": "vitest run src/__tests__/harnessParity.functional.test.ts src/__tests__/cursorParity.functional.test.ts src/__tests__/copilotCapture.functional.test.ts src/__tests__/piCapture.functional.test.ts",
17
17
  "test:harness-binaries": "node scripts/checkHarnessBinaries.mjs",
18
- "test:security-beta": "vitest run src/__tests__/security.test.ts src/__tests__/securityCommandEntitlement.test.ts src/__tests__/securityDeepScan.test.ts src/__tests__/securityDoctor.test.ts src/__tests__/securityEntitlementInstall.test.ts src/__tests__/securityFeature.test.ts src/__tests__/securityInstall.test.ts src/__tests__/securityInventory.test.ts src/__tests__/securityPilot.test.ts src/__tests__/securityPolicy.test.ts src/__tests__/securitySession.test.ts src/__tests__/codexHookTrust.test.ts src/__tests__/codieSecurityAdapterWiring.test.ts src/__tests__/limitEvent.functional.test.ts && tsc && node dist/cli.js security pilot --json",
19
- "test:security-pilot": "vitest run src/__tests__/security.test.ts src/__tests__/securityInstall.test.ts src/__tests__/securityPilot.test.ts src/__tests__/codieSecurityAdapterWiring.test.ts && tsc && node dist/cli.js security pilot --json",
20
18
  "test:opencode-attribution": "vitest run src/__tests__/repoResolver.test.ts src/__tests__/openCodeCapture.test.ts src/__tests__/openCodePluginGitRefs.test.ts src/__tests__/capturePayloadFinal.test.ts src/__tests__/captureDirectUpload.test.ts src/__tests__/resolveCaptureFinal.test.ts && tsc",
21
- "test:watch": "vitest"
19
+ "test:watch": "vitest",
20
+ "test:metadata-parity": "vitest run src/__tests__/sourceMetadataMatrix.test.ts src/__tests__/copilotCapture.functional.test.ts src/__tests__/copilotCapture.test.ts src/__tests__/piCapture.functional.test.ts src/__tests__/piHooks.test.ts src/__tests__/cursorParity.functional.test.ts src/__tests__/nativeSourceParity.test.ts src/__tests__/harnessParity.functional.test.ts src/__tests__/subagents.test.ts src/__tests__/transcriptModels.test.ts src/__tests__/captureRetry.test.ts src/__tests__/limitEvent.functional.test.ts src/__tests__/captureExclusions.test.ts"
22
21
  },
23
22
  "files": [
24
23
  "dist",
@@ -63,8 +62,8 @@
63
62
  "@modelcontextprotocol/sdk": "^1.30.0"
64
63
  },
65
64
  "overrides": {
66
- "@hono/node-server": "^2.0.12",
67
- "ip-address": "^10.4.0",
65
+ "@hono/node-server": "^2.1.5",
66
+ "ip-address": "^10.7.4",
68
67
  "esbuild": "^0.28.1"
69
68
  }
70
69
  }
@@ -1,14 +0,0 @@
1
- import * as fs from "fs";
2
- export type HashCache = Record<string, string>;
3
- export interface Candidate {
4
- rel: string;
5
- hash: string;
6
- abs?: string;
7
- }
8
- export declare function cacheKey(repoKey: string, rel: string): string;
9
- export declare function loadCache(readFileSync?: typeof fs.readFileSync): HashCache;
10
- export declare function saveCache(cache: HashCache, deps?: typeof fs): void;
11
- export declare function applyCache(prev: HashCache, repoKey: string, candidates: Candidate[]): {
12
- changed: Candidate[];
13
- next: HashCache;
14
- };
@@ -1,2 +0,0 @@
1
- export declare function hasSkillFrontmatter(md: string): boolean;
2
- export declare function isArtifactPath(rel: string, getContent: () => string): boolean;
@@ -1,25 +0,0 @@
1
- import { type HashCache, type Candidate } from "./cache";
2
- export interface SelectDeps {
3
- readFile: (rel: string) => string;
4
- sha256: (content: string) => string;
5
- }
6
- export declare function unionPaths(a: string[], b: string[]): string[];
7
- export declare function selectBackupFiles(input: {
8
- repoKey: string;
9
- statusPaths: string[];
10
- prevCache: HashCache;
11
- deps: SelectDeps;
12
- }): {
13
- changed: Candidate[];
14
- next: HashCache;
15
- };
16
- import { readConfig } from "../utils";
17
- import { loadCache, saveCache } from "./cache";
18
- export declare function gitCandidatePaths(root: string): string[];
19
- export declare function runBackup(cwd: string, hookScriptPath: string): void;
20
- export interface BackupUploadDeps {
21
- readConfig: typeof readConfig;
22
- loadCache: typeof loadCache;
23
- saveCache: typeof saveCache;
24
- }
25
- export declare function runBackupUpload(jobFile: string, deps?: BackupUploadDeps): Promise<void>;
@@ -1,30 +0,0 @@
1
- import type { CodiedevConfig } from "./utils";
2
- export interface NormalizeCapturePathDeps {
3
- cwd?: () => string;
4
- homedir?: () => string;
5
- realpathSync?: (value: string) => string;
6
- }
7
- /**
8
- * Convert a user-entered path into the canonical absolute form persisted in
9
- * ~/.codiedev/config.json. Existing symlinks resolve to their real target so a
10
- * session cannot bypass an exclusion by entering the same folder through a
11
- * different alias. Non-existent paths still normalize deterministically.
12
- */
13
- export declare function normalizeCapturePath(input: string, deps?: NormalizeCapturePathDeps): string;
14
- export declare function findMatchingCaptureExclusion(candidate: string | string[] | undefined, ignoredPaths: string[] | undefined): string | null;
15
- export declare function isCaptureIgnored(candidate: string | string[] | undefined, ignoredPaths: string[] | undefined): boolean;
16
- export interface CaptureScopeInput {
17
- cwd?: string;
18
- workspace_roots?: string[];
19
- }
20
- /** Every local root associated with a hook event, deduped in stable order. */
21
- export declare function captureScopePaths(input: CaptureScopeInput, fallback?: string): string[];
22
- export declare function shouldIgnoreCaptureInput(config: Pick<CodiedevConfig, "captureIgnoredPaths"> | null | undefined, input: CaptureScopeInput, fallback?: string): boolean;
23
- /**
24
- * Final egress decision for queued transcript uploads. Jobs written by older
25
- * CLI versions have no scope metadata; once any exclusion exists, dropping
26
- * those legacy jobs is safer than guessing that they are public.
27
- */
28
- export declare function shouldSkipCaptureUploadJob(job: {
29
- scopePaths?: string[];
30
- }, config: Pick<CodiedevConfig, "captureIgnoredPaths"> | null | undefined): boolean;
@@ -1,20 +0,0 @@
1
- import * as fs from "fs";
2
- export declare const CAPTURE_LOG_MAX_BYTES: number;
3
- export declare const CAPTURE_LOG_PATH: string;
4
- export interface CaptureLogEntry {
5
- stage: "capture-finish" | "upload" | "upload-deferred" | "security" | "stderr" | "limit";
6
- sessionId: string | undefined;
7
- outcome: string;
8
- detail?: string;
9
- }
10
- interface LogDeps {
11
- readFileSync: typeof fs.readFileSync;
12
- writeFileSync: typeof fs.writeFileSync;
13
- appendFileSync: typeof fs.appendFileSync;
14
- existsSync: typeof fs.existsSync;
15
- mkdirSync: typeof fs.mkdirSync;
16
- statSync: typeof fs.statSync;
17
- }
18
- export declare function appendCaptureLog(entry: CaptureLogEntry, deps?: LogDeps, filePath?: string, now?: () => number): void;
19
- export declare function readCaptureLogTail(n: number, deps?: Pick<LogDeps, "readFileSync" | "existsSync">, filePath?: string): string[];
20
- export {};
@@ -1,65 +0,0 @@
1
- import type { LastCaptureRecord } from "./utils";
2
- export interface CaptureReadinessDeps<R = unknown> {
3
- exec: (cmd: string, cwd: string) => string;
4
- getRemoteUrl: (cwd: string) => string | null;
5
- matchRepo: (url: string, repos: R[]) => R | null;
6
- getBranch: (cwd: string) => string | null;
7
- getHeadSha: (cwd: string) => string | null;
8
- }
9
- export interface CaptureReadiness {
10
- gitOnPath: boolean;
11
- insideWorkTree: boolean;
12
- remoteUrl: string | null;
13
- matched: boolean;
14
- branch: string | null;
15
- headSha: string | null;
16
- }
17
- export declare function assessCaptureReadiness<R>(cwd: string, repos: R[], deps: CaptureReadinessDeps<R>): CaptureReadiness;
18
- export interface WorkspaceRepoScanDeps<R = unknown> {
19
- listChildDirs: (cwd: string) => string[];
20
- isRepo: (dir: string) => boolean;
21
- getRemoteUrl: (dir: string) => string | null;
22
- matchRepo: (url: string, repos: R[]) => R | null;
23
- }
24
- export interface WorkspaceRepoScan {
25
- repoCount: number;
26
- matchedCount: number;
27
- }
28
- export declare function assessWorkspaceRepos<R>(cwd: string, repos: R[], deps: WorkspaceRepoScanDeps<R>): WorkspaceRepoScan;
29
- export declare function formatRelativeAge(ms: number): string;
30
- export interface LastCaptureSummary {
31
- status: "pass" | "warn";
32
- detail: string;
33
- }
34
- export declare function summarizeLastCapture(record: LastCaptureRecord | null, nowMs: number): LastCaptureSummary;
35
- export interface CaptureActivitySummary {
36
- status: "pass" | "warn" | "fail";
37
- detail: string;
38
- }
39
- /**
40
- * When `text` (an error message, code, or capture.log detail) indicates a
41
- * TLS-trust failure from SSL inspection, return the remediation hint;
42
- * otherwise null.
43
- */
44
- export declare function tlsInterceptionHint(text: string, host: string): string | null;
45
- /**
46
- * Flatten a thrown fetch/network error to "<message> (<code>)". undici's
47
- * fetch wraps the real failure in TypeError("fetch failed") with the cause
48
- * chained on `.cause` — walk to the deepest cause so doctor reports the
49
- * actual TLS/socket error instead of "fetch failed".
50
- */
51
- export declare function describeFetchError(err: unknown): string;
52
- export declare function summarizeCaptureActivity(tailLines: string[], pendingJobCount: number, backendHost?: string): CaptureActivitySummary;
53
- export interface ServerCaptureResponse {
54
- found: boolean;
55
- latest: {
56
- sessionId: string;
57
- capturedAt: number;
58
- createdAt: number;
59
- repoMatched: boolean;
60
- branch: string | null;
61
- headSha: string | null;
62
- } | null;
63
- sessionFound?: boolean;
64
- }
65
- export declare function summarizeServerCapture(server: ServerCaptureResponse | null, local: LastCaptureRecord | null, nowMs: number): LastCaptureSummary;
@@ -1,19 +0,0 @@
1
- export declare const CAPTURE_SIGNALS_VERSION = 1;
2
- export type CaptureSignals = {
3
- version: 1;
4
- parsedRecords: number;
5
- timestampCount: number;
6
- firstAt?: number;
7
- lastAt?: number;
8
- activeMs: number;
9
- idleThresholdMs: number;
10
- skillInvocations: string[];
11
- skillPulls: string[];
12
- toolCalls: Array<{
13
- name: string;
14
- calls: number;
15
- }>;
16
- truncated: boolean;
17
- };
18
- /** Compact diagnostic inputs only: never persist prompts, commands or tool output. */
19
- export declare function parseCaptureSignals(content: string, source?: string): CaptureSignals;
package/dist/cli.d.ts DELETED
@@ -1,16 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * Codiedev CLI dispatcher.
4
- *
5
- * Subcommands:
6
- * codiedev connect — link agent CLIs to your org
7
- * codiedev push <file> — author/update a spec/review/decision/etc.
8
- * codiedev pull <key> — fetch an artifact by filename key
9
- * codiedev ping <user> "<msg>" — send a message (optionally --with <key>)
10
- * codiedev inbox — list pings (use --unread to filter)
11
- * codiedev read <ping-id> — mark read + show full message
12
- * codiedev note "<text>" — capture a thought
13
- * codiedev promote <artifact-id> — promote an extracted artifact to authored
14
- * codiedev help — show this help
15
- */
16
- export {};
@@ -1,34 +0,0 @@
1
- interface CommandHandler {
2
- type?: unknown;
3
- command?: unknown;
4
- commandWindows?: unknown;
5
- command_windows?: unknown;
6
- timeout?: unknown;
7
- async?: unknown;
8
- statusMessage?: unknown;
9
- additionalContextLimit?: unknown;
10
- }
11
- interface MatcherGroup {
12
- matcher?: unknown;
13
- hooks?: unknown;
14
- }
15
- export interface CodexHookTrustEntry {
16
- key: string;
17
- eventName: string;
18
- command: string;
19
- currentHash: string;
20
- }
21
- /** Codex hashes a canonical, normalized hook identity before it will execute a
22
- * user hook. Keep this compatible with codex_config::version_for_toml. */
23
- export declare function codexCommandHookHash(eventName: string, group: MatcherGroup, handler: CommandHandler): string;
24
- export declare function codiedevCodexHookTrustEntries(hooksPath: string, hooksFile: unknown): CodexHookTrustEntry[];
25
- /** `codiedev connect` is an explicit install action, so trust only the exact
26
- * Codiedev commands it just wrote. Any later command change produces a new
27
- * hash and Codex disables that hook until connect is run again. */
28
- export declare function writeCodexHookTrust(configPath: string, hooksPath: string, hooksFile: unknown): CodexHookTrustEntry[];
29
- export declare function inspectCodexHookTrust(configPath: string, hooksPath: string, hooksFile: unknown, requiredSubcommands?: string[]): {
30
- ok: boolean;
31
- total: number;
32
- trusted: number;
33
- };
34
- export {};
@@ -1,64 +0,0 @@
1
- import { type LimitEvent } from "./limitEvent";
2
- import type { LimitEventPayload } from "./limitEventReporter";
3
- export interface CodexLimitHit {
4
- event: LimitEvent;
5
- /** Byte offset just past the matched line — the tail ends here, not at EOF. */
6
- lineEnd: number;
7
- }
8
- export interface ScanOptions {
9
- chunkSize?: number;
10
- maxScanBytes?: number;
11
- }
12
- /**
13
- * Find the LAST rate-limit/credit block recorded in a Codex rollout file.
14
- * Returns null when the session was never blocked.
15
- */
16
- export declare function scanCodexRolloutForLimit(filePath: string, options?: ScanOptions): CodexLimitHit | null;
17
- /**
18
- * Read up to `maxBytes` of the rollout ENDING at `lineEnd` — the work the
19
- * developer was doing when the block hit, not whatever the session did after
20
- * the window reset. Resumes at a line boundary so every JSONL line parses.
21
- */
22
- export declare function readTailEndingAt(filePath: string, lineEnd: number, maxBytes?: number): string;
23
- export interface FindRolloutOptions {
24
- withinMs?: number;
25
- maxFiles?: number;
26
- now?: number;
27
- }
28
- /** Codex rollout files, newest first, limited by age and count. */
29
- export declare function findRecentCodexRollouts(sessionsDir: string, options?: FindRolloutOptions): string[];
30
- /** Codex names rollouts `rollout-<ISO local time>-<session id>.jsonl`. */
31
- export declare function sessionIdFromRolloutPath(filePath: string): string | undefined;
32
- /** Where Codex writes its rollout JSONL files. */
33
- export declare function codexSessionsDir(): string;
34
- export declare const CODEX_LIMIT_STATE_PATH: string;
35
- /**
36
- * Record a block reported outside the sweep (the Stop path), so the next
37
- * prompt sweep neither re-scans the rollout nor re-posts the event.
38
- */
39
- export declare function recordCodexLimitReported(filePath: string, at: number, statePath?: string): void;
40
- export interface SweepArgs {
41
- sessionsDir: string;
42
- statePath?: string;
43
- post: (payload: LimitEventPayload) => Promise<void>;
44
- findOptions?: FindRolloutOptions;
45
- scanOptions?: ScanOptions;
46
- /** How many rollouts may actually be READ in one sweep. */
47
- maxScans?: number;
48
- /** Stop starting new scans once this many ms have elapsed. */
49
- deadlineMs?: number;
50
- }
51
- /**
52
- * Report every Codex block this machine has not reported yet. Returns how many
53
- * events were posted. Never throws — it runs inside a hook.
54
- *
55
- * State is kept PER FILE, not as one newest-wins timestamp. A single global
56
- * watermark loses data: rollouts are capped per sweep, so a block in a file
57
- * outside the cap can be older than one already reported and would then be
58
- * suppressed forever. A per-file record can only ever cause a re-report, which
59
- * the server deduplicates on (companyId, userId, at).
60
- *
61
- * A file is recorded only after its POST succeeds, so a failed send is retried
62
- * on the next prompt.
63
- */
64
- export declare function sweepCodexLimits(args: SweepArgs): Promise<number>;
package/dist/codie.d.ts DELETED
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- export {};
@@ -1,11 +0,0 @@
1
- /**
2
- * The usage module this install should load. The shipped package has the
3
- * compiled file; a source checkout (and the test run) has the TypeScript one.
4
- * Naming a path that does not exist would cost the status line silently, so a
5
- * miss raises instead and the caller falls back to the plain plugin.
6
- */
7
- export declare function usageModulePath(): string;
8
- /** The engine resolves its config dir per the XDG spec, so a customized
9
- * XDG_CONFIG_HOME must be honored or tui.json lands where it never reads. */
10
- export declare function openCodeConfigDir(): string;
11
- export declare function installTuiPlugin(): void;
@@ -1,86 +0,0 @@
1
- export interface ModelCost {
2
- /** Dollars per million prompt tokens. */
3
- input: number;
4
- /** Dollars per million completion tokens. */
5
- output: number;
6
- }
7
- export interface ModelLimit {
8
- /** Maximum prompt tokens the model accepts. */
9
- context: number;
10
- /** Maximum completion tokens the model emits. */
11
- output: number;
12
- }
13
- export interface CatalogModel {
14
- id: string;
15
- name?: string;
16
- cost?: ModelCost;
17
- limit?: ModelLimit;
18
- }
19
- /** A rate card is usable only when both sides are real, finite and not
20
- * negative. Half a card prices a session wrong in a way nobody can see, so a
21
- * partial one is dropped and the model stays unpriced. */
22
- export declare function usableModelCost(value: unknown): ModelCost | undefined;
23
- /** A context/output window is usable only when both sides are real, finite and
24
- * positive. A partial window makes the engine's "% of context used" read wrong
25
- * in a way nobody can see, so a partial one is dropped and the model keeps the
26
- * engine's default. */
27
- export declare function usableModelLimit(value: unknown): ModelLimit | undefined;
28
- export declare const CODIE_SECURITY_BLOCK_MARKER = "__CODIEDEV_SECURITY_BLOCK__";
29
- /** Extract the private adapter marker used to carry a local block reason
30
- * across OpenCode's generic 500 boundary. The marker never contains prompt or
31
- * tool input — only the deterministic policy reason. */
32
- export declare function extractCodieSecurityBlock(stderr: string): string | undefined;
33
- /**
34
- * Pin non-interactive runs to the directory where `codie` was launched.
35
- * OpenCode can reuse a previously-known project instance; without an explicit
36
- * --dir, a real smoke run launched in a throwaway repo resumed the caller's
37
- * main checkout and executed there. TUI mode already owns its cwd directly.
38
- */
39
- export declare function withCodieWorkingDirectory(args: string[], cwd: string): string[];
40
- export declare function bareModel(value: unknown): string;
41
- export declare function buildCodieConfig({ existing, catalog, env, plugin, plugins, }: {
42
- existing?: Record<string, any>;
43
- catalog: CatalogModel[];
44
- env?: Record<string, string | undefined>;
45
- plugin?: string;
46
- plugins?: string[];
47
- }): Record<string, any>;
48
- export declare const USAGE_MODULE_PLACEHOLDER = "__CODIEDEV_USAGE_MODULE__";
49
- /**
50
- * Point the staged TUI plugin at this install's usage module.
51
- *
52
- * The plugin is copied into the engine's own config directory, so it cannot
53
- * reach the package by a relative path — the absolute path is baked in at
54
- * stage time. It goes in as a JSON literal so a Windows path keeps its
55
- * backslashes instead of turning into escape sequences.
56
- */
57
- export declare function stageUsageModule(source: string, modulePath: string): string;
58
- export declare const BRAND_PLUGIN_SPEC = "./plugins/codiedev-brand.tsx";
59
- export declare function withBrandPlugin(existing: Record<string, any> | undefined): {
60
- config: Record<string, any>;
61
- changed: boolean;
62
- };
63
- export declare const STOCK_WORDMARK: string;
64
- export declare const LEGACY_CODIEDEV_WORDMARK: string;
65
- export declare const CODIEDEV_WORDMARK: string;
66
- export declare const HIDDEN_WORDMARK: string;
67
- export declare function patchBrandWordmark(binary: Buffer): {
68
- changed: boolean;
69
- offset: number;
70
- stock: Buffer;
71
- replacement: Buffer | null;
72
- };
73
- export declare function resolveCapturePlugin({ homeDir, existsSync, }: {
74
- homeDir: string;
75
- existsSync: (candidate: string) => boolean;
76
- }): string;
77
- export declare function fetchApprovedCatalog({ baseUrl, key, fetchImpl, }: {
78
- baseUrl?: string;
79
- key: string;
80
- fetchImpl?: typeof fetch;
81
- }): Promise<CatalogModel[]>;
82
- export declare function parseCodieArgs(argv: string[]): {
83
- args: string[];
84
- overrides: Record<string, string>;
85
- };
86
- export declare function validateCodieArgs(args: string[], catalog: CatalogModel[]): void;
@@ -1,29 +0,0 @@
1
- export declare const OPENCODE_RUNTIME_SPEC = "opencode-ai@1.18.4";
2
- export declare const OPENCODE_RUNTIME_VERSION: string;
3
- export declare const CODIE_MIN_NODE_MAJOR = 20;
4
- export type CodieRuntime = {
5
- kind: "ready";
6
- binary: string;
7
- } | {
8
- kind: "missing";
9
- installDir: string;
10
- binary: string;
11
- spec: string;
12
- } | {
13
- kind: "outdated";
14
- installDir: string;
15
- binary: string;
16
- spec: string;
17
- currentVersion: string;
18
- expectedVersion: string;
19
- };
20
- export declare function codieRuntimeDir(stateDir: string): string;
21
- export declare function installedRuntimePackageJson(stateDir: string): string;
22
- export declare function resolveCodieRuntime({ env, stateDir, existsSync, readInstalledVersion, resolveBundled, }: {
23
- env: Record<string, string | undefined>;
24
- stateDir: string;
25
- existsSync: (candidate: string) => boolean;
26
- readInstalledVersion?: (packageJson: string) => string | null;
27
- resolveBundled: () => string | null;
28
- }): CodieRuntime;
29
- export declare function assertCodieNodeVersion(version: string): void;
@@ -1,28 +0,0 @@
1
- import { CodieRuntime } from "./codieRuntime";
2
- type InstallableCodieRuntime = Exclude<CodieRuntime, {
3
- kind: "ready";
4
- }>;
5
- export declare function buildRuntimeInstallArgs(stagingDir: string, spec: string): string[];
6
- export interface InstallDeps {
7
- runtime: InstallableCodieRuntime;
8
- makeStagingDir: () => string;
9
- run: (args: string[]) => {
10
- status: number | null;
11
- stderr: string;
12
- };
13
- exists: (candidate: string) => boolean;
14
- rename: (from: string, to: string) => void;
15
- remove: (target: string) => void;
16
- log: (message: string) => void;
17
- }
18
- export declare function installCodieRuntime(deps: InstallDeps): void;
19
- export declare function ensureCodieRuntimeBinary({ resolve, install, confirmUpdate, }: {
20
- resolve: () => CodieRuntime;
21
- install: (runtime: InstallableCodieRuntime) => void;
22
- confirmUpdate?: (runtime: Extract<CodieRuntime, {
23
- kind: "outdated";
24
- }>) => Promise<boolean>;
25
- }): Promise<string>;
26
- export declare function installCodieRuntimeOnDisk(runtime: InstallableCodieRuntime, stateDir: string): void;
27
- export declare function defaultStagingRoot(): string;
28
- export {};
@@ -1,26 +0,0 @@
1
- import type { AgentSurface, EndpointSecurityPolicy } from "./security";
2
- import type { AgentSecurityEntitlement } from "./securityFeature";
3
- export interface CodieStartupConfig extends AgentSecurityEntitlement {
4
- backendUrl?: string;
5
- token?: string;
6
- companyId?: string;
7
- deviceId?: string;
8
- }
9
- export type CodiePolicyRefreshResult = {
10
- status: "disabled";
11
- } | {
12
- status: "synced";
13
- policy: EndpointSecurityPolicy;
14
- } | {
15
- status: "cached";
16
- error: string;
17
- };
18
- /** Refresh the endpoint policy before Codie hands the terminal to OpenCode.
19
- * Enforcement remains available offline because hooks keep using the last
20
- * verified company-scoped policy when this best-effort refresh cannot land. */
21
- export declare function refreshCodieSecurityPolicy(config: CodieStartupConfig, syncPolicy?: (config: {
22
- backendUrl: string;
23
- token: string;
24
- companyId: string;
25
- deviceId?: string;
26
- }, source?: AgentSurface) => Promise<EndpointSecurityPolicy>): Promise<CodiePolicyRefreshResult>;