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.
Files changed (155) hide show
  1. package/README.md +11 -5
  2. package/assets/opencode-plugin.mjs +6 -0
  3. package/assets/session-key.mjs +48 -0
  4. package/assets/tui-brand-plugin.tsx +73 -0
  5. package/dist/backup/cache.js +1 -5
  6. package/dist/backup/match.js +0 -6
  7. package/dist/backup/run.js +3 -35
  8. package/dist/captureExclusions.js +0 -12
  9. package/dist/captureLog.js +0 -28
  10. package/dist/captureReadiness.js +0 -58
  11. package/dist/captureSignals.js +184 -0
  12. package/dist/cli.js +135 -72
  13. package/dist/cliSession.js +456 -0
  14. package/dist/codexHookTrust.js +125 -6
  15. package/dist/codexLimitScan.js +359 -0
  16. package/dist/codie.js +77 -130
  17. package/dist/codieBrandInstall.js +80 -0
  18. package/dist/codieLauncher.js +76 -79
  19. package/dist/codieRuntime.js +19 -23
  20. package/dist/codieRuntimeInstall.js +108 -23
  21. package/dist/codieUsage.js +181 -0
  22. package/dist/commands/agentTemplates.generated.js +136 -0
  23. package/dist/commands/agents.js +1101 -0
  24. package/dist/commands/agentsSdk.generated.js +7 -0
  25. package/dist/commands/ask.js +0 -3
  26. package/dist/commands/capture.js +0 -2
  27. package/dist/commands/createTicket.js +0 -10
  28. package/dist/commands/doctor.js +53 -120
  29. package/dist/commands/evals.js +187 -0
  30. package/dist/commands/inbox.js +0 -2
  31. package/dist/commands/library.js +0 -3
  32. package/dist/commands/pack.js +573 -0
  33. package/dist/commands/ping.js +0 -2
  34. package/dist/commands/pull.js +6 -10
  35. package/dist/commands/push.js +2 -12
  36. package/dist/commands/search.js +0 -4
  37. package/dist/commands/send.js +0 -5
  38. package/dist/commands/share.js +0 -4
  39. package/dist/commands/shared.js +0 -35
  40. package/dist/commands/traces.js +344 -0
  41. package/dist/commands/tracesLabel.js +348 -0
  42. package/dist/configDir.js +18 -11
  43. package/dist/connect.js +55 -118
  44. package/dist/connectFlow.js +35 -9
  45. package/dist/copilotHooks.js +391 -0
  46. package/dist/copilotInstallation.js +64 -0
  47. package/dist/cursorHooks.js +38 -30
  48. package/dist/cursorLifecycle.js +109 -0
  49. package/dist/detection.js +0 -30
  50. package/dist/harnessDirs.js +77 -0
  51. package/dist/hook.js +256 -445
  52. package/dist/inboxFormat.js +0 -24
  53. package/dist/launchContext.js +150 -0
  54. package/dist/launcher.js +168 -0
  55. package/dist/limitEvent.js +44 -13
  56. package/dist/limitEventReporter.js +1 -1
  57. package/dist/managedPi.js +256 -0
  58. package/dist/mcp.js +5 -384
  59. package/dist/nativeSteering.js +24 -0
  60. package/dist/packs/codie.js +182 -0
  61. package/dist/packs/harnesses.js +411 -0
  62. package/dist/packs/hookGate.js +256 -0
  63. package/dist/packs/install.js +286 -0
  64. package/dist/packs/manifest.js +126 -0
  65. package/dist/packs/paths.js +81 -0
  66. package/dist/packs/shim.js +214 -0
  67. package/dist/packs/store.js +155 -0
  68. package/dist/packs/sync.js +170 -0
  69. package/dist/piHooks.js +216 -0
  70. package/dist/piRuntime.js +120 -0
  71. package/dist/repoResolver.js +0 -19
  72. package/dist/secret.js +0 -3
  73. package/dist/selfUpdate.js +376 -0
  74. package/dist/skillMarker.js +23 -0
  75. package/dist/subagents.js +135 -0
  76. package/dist/teamSkillContext.js +10 -0
  77. package/dist/transcriptModels.js +205 -0
  78. package/dist/upgradeNudge.js +0 -30
  79. package/dist/utils.js +502 -828
  80. package/dist/version.js +0 -10
  81. package/dist/versionCheck.js +0 -33
  82. package/package.json +8 -9
  83. package/dist/backup/cache.d.ts +0 -14
  84. package/dist/backup/match.d.ts +0 -2
  85. package/dist/backup/run.d.ts +0 -25
  86. package/dist/captureExclusions.d.ts +0 -30
  87. package/dist/captureLog.d.ts +0 -20
  88. package/dist/captureReadiness.d.ts +0 -65
  89. package/dist/cli.d.ts +0 -16
  90. package/dist/codexHookTrust.d.ts +0 -34
  91. package/dist/codie.d.ts +0 -2
  92. package/dist/codieLauncher.d.ts +0 -53
  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/commands/ask.d.ts +0 -1
  98. package/dist/commands/capture.d.ts +0 -14
  99. package/dist/commands/createTicket.d.ts +0 -27
  100. package/dist/commands/delete.d.ts +0 -1
  101. package/dist/commands/doctor.d.ts +0 -1
  102. package/dist/commands/inbox.d.ts +0 -3
  103. package/dist/commands/library.d.ts +0 -2
  104. package/dist/commands/note.d.ts +0 -1
  105. package/dist/commands/ping.d.ts +0 -1
  106. package/dist/commands/promote.d.ts +0 -1
  107. package/dist/commands/promote.js +0 -53
  108. package/dist/commands/pull.d.ts +0 -2
  109. package/dist/commands/push.d.ts +0 -33
  110. package/dist/commands/react.d.ts +0 -2
  111. package/dist/commands/react.js +0 -40
  112. package/dist/commands/reverseTicket.d.ts +0 -2
  113. package/dist/commands/reverseTicket.js +0 -477
  114. package/dist/commands/search.d.ts +0 -2
  115. package/dist/commands/security.d.ts +0 -1
  116. package/dist/commands/security.js +0 -156
  117. package/dist/commands/send.d.ts +0 -2
  118. package/dist/commands/share.d.ts +0 -2
  119. package/dist/commands/shared.d.ts +0 -64
  120. package/dist/configDir.d.ts +0 -1
  121. package/dist/connect.d.ts +0 -1
  122. package/dist/connectFlow.d.ts +0 -13
  123. package/dist/cursorHooks.d.ts +0 -23
  124. package/dist/detection.d.ts +0 -30
  125. package/dist/hook.d.ts +0 -6
  126. package/dist/inboxFormat.d.ts +0 -38
  127. package/dist/limitEvent.d.ts +0 -16
  128. package/dist/limitEventReporter.d.ts +0 -21
  129. package/dist/mcp.d.ts +0 -12
  130. package/dist/prUrl.d.ts +0 -9
  131. package/dist/prUrl.js +0 -33
  132. package/dist/repoResolver.d.ts +0 -17
  133. package/dist/secret.d.ts +0 -1
  134. package/dist/security.d.ts +0 -102
  135. package/dist/security.js +0 -437
  136. package/dist/securityDeepScan.d.ts +0 -41
  137. package/dist/securityDeepScan.js +0 -248
  138. package/dist/securityDoctor.d.ts +0 -32
  139. package/dist/securityDoctor.js +0 -63
  140. package/dist/securityFeature.d.ts +0 -5
  141. package/dist/securityFeature.js +0 -7
  142. package/dist/securityInstall.d.ts +0 -63
  143. package/dist/securityInstall.js +0 -239
  144. package/dist/securityInventory.d.ts +0 -54
  145. package/dist/securityInventory.js +0 -556
  146. package/dist/securityPilot.d.ts +0 -19
  147. package/dist/securityPilot.js +0 -61
  148. package/dist/securityPolicy.d.ts +0 -33
  149. package/dist/securityPolicy.js +0 -188
  150. package/dist/securitySession.d.ts +0 -6
  151. package/dist/securitySession.js +0 -72
  152. package/dist/upgradeNudge.d.ts +0 -25
  153. package/dist/utils.d.ts +0 -342
  154. package/dist/version.d.ts +0 -1
  155. 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,6 +1,6 @@
1
1
  {
2
2
  "name": "codiedev",
3
- "version": "0.10.0-beta.1",
3
+ "version": "0.10.0-beta.11",
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",
5
5
  "bin": {
6
6
  "codiedev": "dist/cli.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",
@@ -57,14 +56,14 @@
57
56
  "devDependencies": {
58
57
  "@types/node": "^20.0.0",
59
58
  "typescript": "^5.4.0",
60
- "vitest": "^3.2.6"
59
+ "vitest": "^4.1.11"
61
60
  },
62
61
  "dependencies": {
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";
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;
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 {};
package/dist/codie.d.ts DELETED
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- export {};
@@ -1,53 +0,0 @@
1
- export interface CatalogModel {
2
- id: string;
3
- name?: string;
4
- }
5
- export declare const CODIE_SECURITY_BLOCK_MARKER = "__CODIEDEV_SECURITY_BLOCK__";
6
- /** Extract the private adapter marker used to carry a local block reason
7
- * across OpenCode's generic 500 boundary. The marker never contains prompt or
8
- * tool input — only the deterministic policy reason. */
9
- export declare function extractCodieSecurityBlock(stderr: string): string | undefined;
10
- /**
11
- * Pin non-interactive runs to the directory where `codie` was launched.
12
- * OpenCode can reuse a previously-known project instance; without an explicit
13
- * --dir, a real smoke run launched in a throwaway repo resumed the caller's
14
- * main checkout and executed there. TUI mode already owns its cwd directly.
15
- */
16
- export declare function withCodieWorkingDirectory(args: string[], cwd: string): string[];
17
- export declare function bareModel(value: unknown): string;
18
- export declare function buildCodieConfig({ existing, catalog, env, plugin, plugins, }: {
19
- existing?: Record<string, any>;
20
- catalog: CatalogModel[];
21
- env?: Record<string, string | undefined>;
22
- plugin?: string;
23
- plugins?: string[];
24
- }): Record<string, any>;
25
- export declare const BRAND_PLUGIN_SPEC = "./plugins/codiedev-brand.tsx";
26
- export declare function withBrandPlugin(existing: Record<string, any> | undefined): {
27
- config: Record<string, any>;
28
- changed: boolean;
29
- };
30
- export declare const STOCK_WORDMARK: string;
31
- export declare const LEGACY_CODIEDEV_WORDMARK: string;
32
- export declare const CODIEDEV_WORDMARK: string;
33
- export declare const HIDDEN_WORDMARK: string;
34
- export declare function patchBrandWordmark(binary: Buffer): {
35
- changed: boolean;
36
- offset: number;
37
- stock: Buffer;
38
- replacement: Buffer | null;
39
- };
40
- export declare function resolveCapturePlugin({ homeDir, existsSync, }: {
41
- homeDir: string;
42
- existsSync: (candidate: string) => boolean;
43
- }): string;
44
- export declare function fetchApprovedCatalog({ baseUrl, key, fetchImpl, }: {
45
- baseUrl?: string;
46
- key: string;
47
- fetchImpl?: typeof fetch;
48
- }): Promise<CatalogModel[]>;
49
- export declare function parseCodieArgs(argv: string[]): {
50
- args: string[];
51
- overrides: Record<string, string>;
52
- };
53
- 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>;
@@ -1,30 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.refreshCodieSecurityPolicy = refreshCodieSecurityPolicy;
4
- const securityFeature_1 = require("./securityFeature");
5
- const securityPolicy_1 = require("./securityPolicy");
6
- /** Refresh the endpoint policy before Codie hands the terminal to OpenCode.
7
- * Enforcement remains available offline because hooks keep using the last
8
- * verified company-scoped policy when this best-effort refresh cannot land. */
9
- async function refreshCodieSecurityPolicy(config, syncPolicy = securityPolicy_1.syncEndpointSecurityPolicy) {
10
- if (!(0, securityFeature_1.isAgentSecurityEnabled)(config))
11
- return { status: "disabled" };
12
- if (!config.backendUrl || !config.token || !config.companyId) {
13
- return { status: "cached", error: "connected account details are incomplete" };
14
- }
15
- try {
16
- const policy = await syncPolicy({
17
- backendUrl: config.backendUrl,
18
- token: config.token,
19
- companyId: config.companyId,
20
- ...(config.deviceId ? { deviceId: config.deviceId } : {}),
21
- }, "codie-harness");
22
- return { status: "synced", policy };
23
- }
24
- catch (error) {
25
- return {
26
- status: "cached",
27
- error: error instanceof Error ? error.message : String(error),
28
- };
29
- }
30
- }
@@ -1 +0,0 @@
1
- export declare function runAsk(args: string[]): Promise<void>;
@@ -1,14 +0,0 @@
1
- import { type CodiedevConfig } from "../utils";
2
- import { apiRequest } from "./shared";
3
- export interface CaptureCommandDeps {
4
- readConfig: () => CodiedevConfig | null;
5
- writeConfig: (config: CodiedevConfig) => void;
6
- apiRequest: typeof apiRequest;
7
- log: (line: string) => void;
8
- warn: (line: string) => void;
9
- randomUUID: () => string;
10
- hostname: () => string;
11
- normalizePath: (value: string) => string;
12
- configForRequest: (config: CodiedevConfig) => CodiedevConfig;
13
- }
14
- export declare function runCaptureCommand(args: string[], depsOverride?: Partial<CaptureCommandDeps>): Promise<void>;
@@ -1,27 +0,0 @@
1
- import type { CodiedevConfig } from "../utils";
2
- export declare function substitutePrompt(protocol: string, prompt: string | undefined): string;
3
- interface ConnectedRepo {
4
- repoId: string;
5
- fullName: string;
6
- }
7
- export declare function validatePlanHasRepo(parsedPlan: any): string | null;
8
- export declare function resolveRepoIds(fullNames: string[], repos: ConnectedRepo[]): string[];
9
- export interface CreateTicketArgs {
10
- mode: "bare" | "submit";
11
- prompt?: string;
12
- submitSource?: "stdin" | string;
13
- }
14
- export declare function parseCreateTicketArgs(args: string[]): CreateTicketArgs;
15
- export declare function runCreateTicket(args: string[]): Promise<void>;
16
- /**
17
- * Bare-mode entrypoint. Fetches the protocol body from the backend so we can
18
- * iterate on it without shipping a new CLI, substitutes the user's prompt,
19
- * and writes the result to stdout for the agent to follow. Hard-errors on
20
- * fetch failure rather than falling back to a stale local copy — the whole
21
- * point of moving the protocol server-side is that the freshest version is
22
- * the only version.
23
- */
24
- export declare function runBare(config: CodiedevConfig, prompt: string | undefined): Promise<void>;
25
- export declare function runSubmit(config: CodiedevConfig, rawJson: string): Promise<void>;
26
- export declare function readSubmitInput(source: "stdin" | string): string;
27
- export {};
@@ -1 +0,0 @@
1
- export declare function runDelete(args: string[]): Promise<void>;
@@ -1 +0,0 @@
1
- export declare function runDoctor(_args: string[]): Promise<void>;
@@ -1,3 +0,0 @@
1
- import type { CodiedevConfig } from "../utils";
2
- export declare function runInbox(args: string[], configOverride?: CodiedevConfig): Promise<void>;
3
- export declare function runRead(args: string[]): Promise<void>;
@@ -1,2 +0,0 @@
1
- import type { CodiedevConfig } from "../utils";
2
- export declare function runLibrary(args: string[], configOverride?: CodiedevConfig): Promise<void>;
@@ -1 +0,0 @@
1
- export declare function runNote(args: string[]): Promise<void>;
@@ -1 +0,0 @@
1
- export declare function runPing(args: string[]): Promise<void>;
@@ -1 +0,0 @@
1
- export declare function runPromote(args: string[]): Promise<void>;