codiedev 0.9.80 → 0.10.0-beta.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. package/README.md +12 -5
  2. package/dist/backup/cache.js +1 -5
  3. package/dist/backup/match.js +0 -6
  4. package/dist/backup/run.js +3 -35
  5. package/dist/captureExclusions.js +0 -12
  6. package/dist/captureLog.js +0 -28
  7. package/dist/captureReadiness.js +0 -58
  8. package/dist/captureSignals.js +0 -11
  9. package/dist/cli.js +11 -33
  10. package/dist/cliSession.js +3 -60
  11. package/dist/codexHookTrust.js +0 -28
  12. package/dist/codexLimitScan.js +0 -107
  13. package/dist/codie.js +64 -57
  14. package/dist/codieBrandInstall.js +0 -18
  15. package/dist/codieLauncher.js +1 -72
  16. package/dist/codieRuntime.js +27 -32
  17. package/dist/codieRuntimeInstall.js +11 -43
  18. package/dist/codieUsage.js +0 -49
  19. package/dist/commands/agentTemplates.generated.js +136 -0
  20. package/dist/commands/agents.js +1088 -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 +2 -72
  26. package/dist/commands/evals.js +3 -9
  27. package/dist/commands/inbox.js +0 -2
  28. package/dist/commands/library.js +0 -3
  29. package/dist/commands/pack.js +0 -29
  30. package/dist/commands/ping.js +0 -2
  31. package/dist/commands/pull.js +0 -9
  32. package/dist/commands/push.js +0 -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 +0 -13
  38. package/dist/commands/tracesLabel.js +0 -8
  39. package/dist/configDir.js +1 -18
  40. package/dist/connect.js +3 -75
  41. package/dist/connectFlow.js +0 -15
  42. package/dist/copilotHooks.js +0 -67
  43. package/dist/copilotInstallation.js +0 -1
  44. package/dist/cursorHooks.js +1 -11
  45. package/dist/cursorLifecycle.js +1 -7
  46. package/dist/detection.js +0 -30
  47. package/dist/harnessDirs.js +0 -19
  48. package/dist/hook.js +43 -293
  49. package/dist/inboxFormat.js +0 -24
  50. package/dist/launchContext.js +0 -50
  51. package/dist/launcher.js +0 -33
  52. package/dist/limitEvent.js +2 -34
  53. package/dist/managedPi.js +2 -50
  54. package/dist/mcp.js +0 -48
  55. package/dist/nativeSteering.js +1 -4
  56. package/dist/packs/codie.js +0 -15
  57. package/dist/packs/harnesses.js +1 -38
  58. package/dist/packs/hookGate.js +0 -33
  59. package/dist/packs/install.js +0 -20
  60. package/dist/packs/manifest.js +1 -15
  61. package/dist/packs/paths.js +0 -8
  62. package/dist/packs/shim.js +0 -8
  63. package/dist/packs/store.js +0 -12
  64. package/dist/packs/sync.js +0 -20
  65. package/dist/piHooks.js +4 -45
  66. package/dist/piRuntime.js +0 -18
  67. package/dist/repoResolver.js +0 -19
  68. package/dist/secret.js +0 -3
  69. package/dist/selfUpdate.js +2 -77
  70. package/dist/skillMarker.js +0 -14
  71. package/dist/subagents.js +0 -18
  72. package/dist/teamSkillContext.js +0 -1
  73. package/dist/transcriptModels.js +0 -8
  74. package/dist/upgradeNudge.js +1 -30
  75. package/dist/utils.js +165 -768
  76. package/dist/version.js +0 -10
  77. package/dist/versionCheck.js +0 -33
  78. package/package.json +13 -8
  79. package/dist/backup/cache.d.ts +0 -14
  80. package/dist/backup/match.d.ts +0 -2
  81. package/dist/backup/run.d.ts +0 -25
  82. package/dist/captureExclusions.d.ts +0 -30
  83. package/dist/captureLog.d.ts +0 -20
  84. package/dist/captureReadiness.d.ts +0 -65
  85. package/dist/captureSignals.d.ts +0 -47
  86. package/dist/cli.d.ts +0 -15
  87. package/dist/cliSession.d.ts +0 -108
  88. package/dist/codexHookTrust.d.ts +0 -49
  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 -87
  93. package/dist/codieRuntime.d.ts +0 -35
  94. package/dist/codieRuntimeInstall.d.ts +0 -56
  95. package/dist/codieUsage.d.ts +0 -64
  96. package/dist/commands/ask.d.ts +0 -1
  97. package/dist/commands/capture.d.ts +0 -14
  98. package/dist/commands/createTicket.d.ts +0 -27
  99. package/dist/commands/delete.d.ts +0 -1
  100. package/dist/commands/doctor.d.ts +0 -9
  101. package/dist/commands/evals.d.ts +0 -3
  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/pack.d.ts +0 -54
  106. package/dist/commands/ping.d.ts +0 -1
  107. package/dist/commands/pull.d.ts +0 -2
  108. package/dist/commands/push.d.ts +0 -33
  109. package/dist/commands/search.d.ts +0 -2
  110. package/dist/commands/send.d.ts +0 -2
  111. package/dist/commands/share.d.ts +0 -2
  112. package/dist/commands/shared.d.ts +0 -64
  113. package/dist/commands/traces.d.ts +0 -72
  114. package/dist/commands/tracesLabel.d.ts +0 -24
  115. package/dist/configDir.d.ts +0 -10
  116. package/dist/connect.d.ts +0 -1
  117. package/dist/connectFlow.d.ts +0 -34
  118. package/dist/copilotHooks.d.ts +0 -85
  119. package/dist/copilotInstallation.d.ts +0 -10
  120. package/dist/cursorHooks.d.ts +0 -13
  121. package/dist/cursorLifecycle.d.ts +0 -2
  122. package/dist/detection.d.ts +0 -30
  123. package/dist/harnessDirs.d.ts +0 -15
  124. package/dist/hook.d.ts +0 -6
  125. package/dist/inboxFormat.d.ts +0 -38
  126. package/dist/launchContext.d.ts +0 -46
  127. package/dist/launcher.d.ts +0 -25
  128. package/dist/limitEvent.d.ts +0 -15
  129. package/dist/limitEventReporter.d.ts +0 -21
  130. package/dist/managedPi.d.ts +0 -48
  131. package/dist/mcp.d.ts +0 -12
  132. package/dist/nativeSteering.d.ts +0 -5
  133. package/dist/packs/codie.d.ts +0 -45
  134. package/dist/packs/harnesses.d.ts +0 -74
  135. package/dist/packs/hookGate.d.ts +0 -53
  136. package/dist/packs/install.d.ts +0 -46
  137. package/dist/packs/manifest.d.ts +0 -52
  138. package/dist/packs/paths.d.ts +0 -17
  139. package/dist/packs/shim.d.ts +0 -26
  140. package/dist/packs/store.d.ts +0 -42
  141. package/dist/packs/sync.d.ts +0 -40
  142. package/dist/piHooks.d.ts +0 -22
  143. package/dist/piRuntime.d.ts +0 -26
  144. package/dist/repoResolver.d.ts +0 -17
  145. package/dist/secret.d.ts +0 -1
  146. package/dist/selfUpdate.d.ts +0 -64
  147. package/dist/skillMarker.d.ts +0 -6
  148. package/dist/subagents.d.ts +0 -36
  149. package/dist/teamSkillContext.d.ts +0 -9
  150. package/dist/transcriptModels.d.ts +0 -20
  151. package/dist/upgradeNudge.d.ts +0 -24
  152. package/dist/utils.d.ts +0 -396
  153. package/dist/version.d.ts +0 -1
  154. package/dist/versionCheck.d.ts +0 -68
@@ -1,87 +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
- /**
29
- * Pin non-interactive runs to the directory where `codie` was launched.
30
- * OpenCode can reuse a previously-known project instance; without an explicit
31
- * --dir, a real smoke run launched in a throwaway repo resumed the caller's
32
- * main checkout and executed there. TUI mode already owns its cwd directly.
33
- */
34
- export declare function withCodieWorkingDirectory(args: string[], cwd: string): string[];
35
- export declare function bareModel(value: unknown): string;
36
- export declare function buildCodieConfig({ existing, catalog, env, plugin, plugins, }: {
37
- existing?: Record<string, any>;
38
- catalog: CatalogModel[];
39
- env?: Record<string, string | undefined>;
40
- plugin?: string;
41
- plugins?: string[];
42
- }): Record<string, any>;
43
- export declare const USAGE_MODULE_PLACEHOLDER = "__CODIEDEV_USAGE_MODULE__";
44
- /**
45
- * Point the staged TUI plugin at this install's usage module.
46
- *
47
- * The plugin is copied into the engine's own config directory, so it cannot
48
- * reach the package by a relative path — the absolute path is baked in at
49
- * stage time. It goes in as a JSON literal so a Windows path keeps its
50
- * backslashes instead of turning into escape sequences.
51
- */
52
- export declare function stageUsageModule(source: string, modulePath: string): string;
53
- export declare const BRAND_PLUGIN_SPEC = "./plugins/codiedev-brand.tsx";
54
- export declare function withBrandPlugin(existing: Record<string, any> | undefined): {
55
- config: Record<string, any>;
56
- changed: boolean;
57
- };
58
- export declare const STOCK_WORDMARK: string;
59
- export declare const LEGACY_CODIEDEV_WORDMARK: string;
60
- export declare const CODIEDEV_WORDMARK: string;
61
- export declare const HIDDEN_WORDMARK: string;
62
- export declare function patchBrandWordmark(binary: Buffer): {
63
- changed: boolean;
64
- offset: number;
65
- stock: Buffer;
66
- replacement: Buffer | null;
67
- };
68
- export declare function resolveCapturePlugin({ homeDir, existsSync, }: {
69
- homeDir: string;
70
- existsSync: (candidate: string) => boolean;
71
- }): string;
72
- /**
73
- * The account's approved models. Every `codie` session starts here, so one
74
- * dropped connection or slow gateway reply would end the session before it
75
- * began; anything but a definite rejection is retried once.
76
- */
77
- export declare function fetchApprovedCatalog({ baseUrl, key, fetchImpl, retryDelayMs, }: {
78
- baseUrl?: string;
79
- key: string;
80
- fetchImpl?: typeof fetch;
81
- retryDelayMs?: number;
82
- }): Promise<CatalogModel[]>;
83
- export declare function parseCodieArgs(argv: string[]): {
84
- args: string[];
85
- overrides: Record<string, string>;
86
- };
87
- export declare function validateCodieArgs(args: string[], catalog: CatalogModel[]): void;
@@ -1,35 +0,0 @@
1
- export declare const OPENCODE_RUNTIME_SPEC = "opencode-ai@1.18.4";
2
- export declare const CODIE_MIN_NODE_MAJOR = 20;
3
- export type CodieRuntime = {
4
- kind: "ready";
5
- binary: string;
6
- } | {
7
- kind: "missing";
8
- installDir: string;
9
- binary: string;
10
- spec: string;
11
- } | {
12
- kind: "unlinked";
13
- installDir: string;
14
- binary: string;
15
- spec: string;
16
- packageDir: string;
17
- };
18
- export declare function codieRuntimeDir(stateDir: string): string;
19
- /**
20
- * The real engine is a ~132MB native executable. opencode-ai ships
21
- * bin/opencode.exe as a ~500-byte shell script that only prints "postinstall
22
- * was not run" until its postinstall swaps the binary in; anything this small
23
- * is that placeholder, not an engine. Pure.
24
- */
25
- export declare const ENGINE_MIN_BYTES = 1000000;
26
- export declare function isEngineSize(bytes: number): boolean;
27
- export declare function resolveCodieRuntime({ env, stateDir, existsSync, resolveBundled, isEngine, }: {
28
- env: Record<string, string | undefined>;
29
- stateDir: string;
30
- existsSync: (candidate: string) => boolean;
31
- resolveBundled: () => string | null;
32
- /** Whether a candidate is a real engine, not opencode-ai's placeholder. */
33
- isEngine?: (candidate: string) => boolean;
34
- }): CodieRuntime;
35
- export declare function assertCodieNodeVersion(version: string): void;
@@ -1,56 +0,0 @@
1
- import { CodieRuntime } from "./codieRuntime";
2
- type InstallableCodieRuntime = Exclude<CodieRuntime, {
3
- kind: "ready";
4
- }>;
5
- /** Outcome of running opencode-ai's own link step. `detail` is its error. */
6
- export type LinkResult = {
7
- ok: boolean;
8
- detail?: string;
9
- };
10
- /** linkEngine's detail when npm is explicitly set not to run install scripts. */
11
- export declare const IGNORE_SCRIPTS = "ignore-scripts";
12
- export declare function buildRuntimeInstallArgs(stagingDir: string, spec: string): string[];
13
- export interface InstallDeps {
14
- runtime: InstallableCodieRuntime;
15
- makeStagingDir: () => string;
16
- run: (args: string[]) => {
17
- status: number | null;
18
- stderr: string;
19
- };
20
- exists: (candidate: string) => boolean;
21
- rename: (from: string, to: string) => void;
22
- remove: (target: string) => void;
23
- log: (message: string) => void;
24
- /** Whether a file is a real engine, not opencode-ai's placeholder script. */
25
- isEngine?: (candidate: string) => boolean;
26
- /** Run opencode-ai's postinstall in a package dir. */
27
- linkEngine?: (packageDir: string) => LinkResult;
28
- }
29
- export declare function installCodieRuntime(deps: InstallDeps): void;
30
- export declare function ensureCodieRuntimeBinary({ resolve, install, repair, }: {
31
- resolve: () => CodieRuntime;
32
- install: (runtime: InstallableCodieRuntime) => void;
33
- /** Link an unlinked install in place (runs its postinstall); true if it's now an engine. */
34
- repair?: (runtime: Extract<CodieRuntime, {
35
- kind: "unlinked";
36
- }>) => boolean;
37
- }): string;
38
- /** Why an installed engine still isn't runnable, with opencode-ai's own error. Pure. */
39
- export declare function linkFailure(linked: LinkResult, packageDir?: string): string;
40
- /** A cmd.exe command line: each argument double-quoted when it has spaces or
41
- * shell metacharacters (paths like C:\Users\First Last\…). Pure. */
42
- export declare function windowsCommand(command: string, args: string[]): string;
43
- /** A real engine on disk (not opencode-ai's placeholder script). */
44
- export declare function isEngineOnDisk(candidate: string): boolean;
45
- /** Whether npm is explicitly configured not to run install scripts (an org
46
- * policy codie shouldn't bypass). npm 12's default script approval isn't this. */
47
- export declare function npmIgnoresScripts(env?: Record<string, string | undefined>): boolean;
48
- /** Run opencode-ai's own postinstall, which links the platform binary into
49
- * bin/opencode.exe (and picks the right build for this CPU/libc). The same
50
- * step npm would have run; skipped when npm is set to ignore scripts. */
51
- export declare function linkEngineOnDisk(packageDir: string, { ignoreScripts }?: {
52
- ignoreScripts?: () => boolean;
53
- }): LinkResult;
54
- export declare function installCodieRuntimeOnDisk(runtime: InstallableCodieRuntime, stateDir: string): void;
55
- export declare function defaultStagingRoot(): string;
56
- export {};
@@ -1,64 +0,0 @@
1
- export interface CodieUsageBudget {
2
- companyBudgetUsd: number | null;
3
- companySpentUsd: number;
4
- companyHeldUsd: number;
5
- userBudgetUsd: number | null;
6
- userSpentUsd: number;
7
- userHeldUsd: number;
8
- keyBudgetUsd: number | null;
9
- keySpentUsd: number;
10
- keyHeldUsd: number | null;
11
- }
12
- export interface CodieUsageInFlight {
13
- /** Reservations open inside the gateway's hold TTL: real work running now. */
14
- requests: number;
15
- heldUsd: number;
16
- /** Reservations past the TTL, waiting for the sweep. They hold budget
17
- * without doing work, so they are never counted as live work. */
18
- staleRequests: number;
19
- staleHeldUsd: number;
20
- }
21
- export interface CodieUsage {
22
- enabled: boolean;
23
- user: {
24
- name: string;
25
- email: string;
26
- role: string;
27
- } | null;
28
- budget: CodieUsageBudget;
29
- inFlight: CodieUsageInFlight;
30
- since?: {
31
- costUsd: number;
32
- promptTokens: number;
33
- completionTokens: number;
34
- requests: number;
35
- };
36
- }
37
- /**
38
- * One line: who is spending, how much, against what, and what is running.
39
- * Returns "" when there is nothing honest to say.
40
- */
41
- export declare function formatUsageLine(usage: CodieUsage | null | undefined): string;
42
- export type UsageTone = "normal" | "warn" | "critical";
43
- /**
44
- * How urgently the status line should read, from the limit that will stop
45
- * this developer first: their own cap, or the shared pool when they have no
46
- * cap or the pool runs out sooner. 75% warns, 90% is critical.
47
- */
48
- export declare function usageTone(usage: CodieUsage | null | undefined): UsageTone;
49
- /**
50
- * What this session just cost. Returns "" when the session billed nothing,
51
- * because a developer who spent nothing does not need to be told a number.
52
- */
53
- export declare function formatSessionCostLine(usage: CodieUsage | null | undefined): string;
54
- /**
55
- * Read the developer's budget snapshot. Returns null on any refusal, network
56
- * failure, timeout, or malformed answer — a status poll is never worth an
57
- * error in front of a developer who asked for none.
58
- */
59
- export declare function fetchCodieUsage({ baseUrl, key, sinceMs, fetchImpl, }: {
60
- baseUrl?: string;
61
- key: string;
62
- sinceMs?: number;
63
- fetchImpl?: typeof fetch;
64
- }): Promise<CodieUsage | null>;
@@ -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,9 +0,0 @@
1
- type CheckStatus = "pass" | "fail" | "warn";
2
- interface CheckResult {
3
- name: string;
4
- status: CheckStatus;
5
- detail?: string;
6
- }
7
- export declare function configDirInUseCheck(agent: string, dir: string, inUse: boolean, envVar: string): CheckResult;
8
- export declare function runDoctor(_args: string[]): Promise<void>;
9
- export {};
@@ -1,3 +0,0 @@
1
- import type { CodiedevConfig } from "../utils";
2
- export declare const EVALS_HELP: string;
3
- export declare function runEvals(args: string[], configOverride?: CodiedevConfig): 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,54 +0,0 @@
1
- import { CodiedevConfig } from "../utils";
2
- import { InstallOptions, PackInstallResult, PackUninstallResult } from "../packs/install";
3
- import { HarnessName } from "../packs/harnesses";
4
- import { PackManifest } from "../packs/manifest";
5
- export declare const DEFAULT_BACKEND_URL = "https://cli.codiedev.com";
6
- /** CODIEDEV_TOKEN alone is enough: no ~/.codiedev/config.json needed (CI).
7
- * CODIEDEV_URL defaults to production. Otherwise the connected config. */
8
- export declare function resolvePackConfig(env?: NodeJS.ProcessEnv): CodiedevConfig | null;
9
- /** In CI, `--harness` defaults to claude when it's on PATH; anything else is
10
- * ambiguous on a build box, so say what was found. */
11
- export declare function ciHarnesses(args: PackArgs, env: NodeJS.ProcessEnv, home?: string): HarnessName[];
12
- export interface PackArgs {
13
- sub?: string;
14
- slug?: string;
15
- harnesses?: HarnessName[];
16
- dryRun: boolean;
17
- json: boolean;
18
- quiet?: boolean;
19
- noPrune?: boolean;
20
- out?: string;
21
- git?: boolean;
22
- manifest?: boolean;
23
- }
24
- export declare function parsePackArgs(args: string[]): PackArgs;
25
- export declare function runList(config: CodiedevConfig, json: boolean, overrides?: Partial<InstallOptions>): Promise<void>;
26
- export interface InstallRun {
27
- installed: PackInstallResult[];
28
- removed: PackUninstallResult[];
29
- /** Installed slugs the server no longer serves (only populated by --dry-run). */
30
- wouldRemove: string[];
31
- }
32
- export declare function runInstall(config: CodiedevConfig, args: PackArgs, overrides?: Partial<InstallOptions>): Promise<InstallRun>;
33
- export declare function runStatus(config: CodiedevConfig, json: boolean, overrides?: Partial<InstallOptions>, options?: {
34
- prune?: boolean;
35
- }): Promise<{
36
- installed: Array<Record<string, unknown>>;
37
- removed: PackUninstallResult[];
38
- notInstalled: string[];
39
- offline: boolean;
40
- }>;
41
- export declare function runPack(args: string[]): Promise<void>;
42
- /** Init (if needed) and commit everything under `dir`. Uses the user's git
43
- * identity when configured, a neutral Codiedev one otherwise (fresh CI). */
44
- export declare function commitExport(dir: string, message: string): string;
45
- /** Write a CI-committable copy of the pack: `<out>/plugins/<slug>/…` plus
46
- * `<out>/.claude-plugin/marketplace.json` (existing entries for other packs
47
- * in the same folder are kept). */
48
- export declare function exportPluginFolder(out: string, manifest: PackManifest): string;
49
- export declare function runExport(config: CodiedevConfig, args: PackArgs): Promise<{
50
- written: string;
51
- commit?: string;
52
- }>;
53
- export declare function runApply(config: CodiedevConfig, args: PackArgs): Promise<Record<string, unknown>>;
54
- export declare const PACK_HELP = "Usage:\n codiedev pack list Packs assigned to your team\n codiedev pack install [slug] [--harness claude,codex,copilot,cursor,codie,pi] [--dry-run] [--json] [--quiet]\n Install one pack, or every pack that applies\n codiedev pack status [--json] Installed packs and whether they're up to date\n codiedev pack export <slug> --out <dir> [--git] [--manifest]\n Write the pack as a Claude-format plugin folder plus\n .claude-plugin/marketplace.json (commit it for CI).\n --git inits the folder and commits; --manifest writes\n an editable <slug>.pack.md instead\n codiedev pack apply <pack.md> Create or update a pack from a pack.md\n\nCursor: packs are copied to ~/.cursor/plugins/local/codiedev-<slug>/. A Cursor\nteam admin can disable \"user local plugin imports\"; then Cursor ignores them.\n\nAuto-update: session starts run `codiedev pack install --quiet` in the background\nabout once an hour. Opt out with CODIEDEV_PACK_AUTOSYNC=0.\n\nHooks for specific skills only: codiedev hook-gate --skills a,b --cmd-b64 <base64url of the command>\n(the pack editor writes this; the command runs via /bin/sh, or cmd.exe on Windows)\n\nCI: set CODIEDEV_TOKEN to a pack CI key (cdvci_\u2026, from the pack's page in the portal).\nNo `codiedev connect` or config file is needed. CI mode (a cdvci_ key, or CI=true)\nnever auto-syncs, reports or prunes, installs the one pack the key can see, defaults\n--harness to claude when it's on PATH, and exits non-zero unless every requested tool\ngot the pack. Skills from a pack are /<pack-slug>:<skill> in Claude Code.\n\n GitLab CI (.gitlab-ci.yml; add CODIEDEV_TOKEN and ANTHROPIC_API_KEY as masked\n CI/CD variables):\n pack-scan:\n image: node:22\n script:\n - npm i -g codiedev @anthropic-ai/claude-code\n - codiedev pack install --harness claude\n - claude -p \"/platform-starter:healthcare-scan\" --output-format text\n\n GitHub Actions (repository secrets CODIEDEV_TOKEN and ANTHROPIC_API_KEY):\n - uses: actions/setup-node@v4\n with: { node-version: 22 }\n - run: npm i -g codiedev @anthropic-ai/claude-code\n - run: codiedev pack install --harness claude\n env:\n CODIEDEV_TOKEN: ${{ secrets.CODIEDEV_TOKEN }}\n - run: claude -p \"/platform-starter:healthcare-scan\" --output-format text\n env:\n ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}\n\n Or vendor the plugin into the repo instead of installing at build time:\n codiedev pack export <slug> --out .codiedev/packs";
@@ -1 +0,0 @@
1
- export declare function runPing(args: string[]): Promise<void>;
@@ -1,2 +0,0 @@
1
- export declare function candidateKeys(key: string): string[];
2
- export declare function runPull(args: string[]): Promise<void>;
@@ -1,33 +0,0 @@
1
- import { requireConfig } from "./shared";
2
- interface PushResponse {
3
- ok: boolean;
4
- artifactId: string;
5
- key: string;
6
- version: number;
7
- type: string;
8
- kind: "doc" | "skill";
9
- tags: string[];
10
- destination: string;
11
- }
12
- export interface ParsedArgs {
13
- file: string;
14
- type?: string;
15
- kind?: string;
16
- tags: string[];
17
- force: boolean;
18
- as?: string;
19
- private?: boolean;
20
- }
21
- export declare function parseArgs(args: string[]): ParsedArgs;
22
- export declare function pushFile(config: ReturnType<typeof requireConfig>, opts: {
23
- absPath: string;
24
- key: string;
25
- visibility?: "private" | "team";
26
- contentHash?: string;
27
- type?: string;
28
- kind?: string;
29
- tags?: string[];
30
- force?: boolean;
31
- }): Promise<PushResponse>;
32
- export declare function runPush(args: string[]): Promise<void>;
33
- export {};
@@ -1,2 +0,0 @@
1
- import type { CodiedevConfig } from "../utils";
2
- export declare function runSearch(args: string[], configOverride?: CodiedevConfig): Promise<void>;
@@ -1,2 +0,0 @@
1
- import type { CodiedevConfig } from "../utils";
2
- export declare function runSend(args: string[], configOverride?: CodiedevConfig): Promise<void>;
@@ -1,2 +0,0 @@
1
- import type { CodiedevConfig } from "../utils";
2
- export declare function runShare(args: string[], configOverride?: CodiedevConfig): Promise<void>;
@@ -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;
@@ -1,72 +0,0 @@
1
- import type { CodiedevConfig } from "../utils";
2
- export declare const TRACES_HELP: string;
3
- interface CaseStep {
4
- model: string;
5
- finishReason?: string;
6
- statusCode: number;
7
- request?: string;
8
- reply?: string;
9
- toolCalls?: Array<{
10
- name: string;
11
- arguments: string;
12
- }>;
13
- }
14
- interface CaseRow {
15
- id: string;
16
- name: string;
17
- suite: string | null;
18
- runId: string;
19
- kind: "fix" | "keep";
20
- flags: string[];
21
- note: string | null;
22
- expected: string | null;
23
- createdAt: string;
24
- steps: CaseStep[];
25
- }
26
- interface CasesResponse {
27
- ok: boolean;
28
- /** The suite pulled, when --suite was given. */
29
- suite: string | null;
30
- /** The saved dataset version pulled, when --version was given; cases deleted since are counted in `missing`. */
31
- version?: number | null;
32
- missing?: number;
33
- /** How the suite is judged, when it has settings. */
34
- judge: {
35
- model: string | null;
36
- rubric: string | null;
37
- } | null;
38
- agent: {
39
- id: string;
40
- name: string;
41
- description: string | null;
42
- promptDays: number | null;
43
- };
44
- cases: CaseRow[];
45
- }
46
- /** What `report` sends, and what `cases` writes for the coding agent to fill in. */
47
- export interface ResultsFile {
48
- agent: string;
49
- suite: string | null;
50
- version?: number | null;
51
- model: string;
52
- judgeModel: string | null;
53
- harness: string | null;
54
- results: Array<{
55
- caseId: string;
56
- name: string;
57
- passes: number | null;
58
- tries: number;
59
- note: string | null;
60
- output: string | null;
61
- }>;
62
- }
63
- export declare function slugify(name: string): string;
64
- /** The brief a coding agent follows to run the cases and report back. */
65
- export declare function casesBrief(res: CasesResponse, casesFile: string, opts?: {
66
- model?: string;
67
- resultsFile?: string;
68
- }): string;
69
- /** The results.json a run starts from: every case, passes to be filled in. */
70
- export declare function resultsTemplate(res: CasesResponse, model: string | undefined): ResultsFile;
71
- export declare function runTraces(args: string[], configOverride?: CodiedevConfig): Promise<void>;
72
- export {};
@@ -1,24 +0,0 @@
1
- import type { CodiedevConfig } from "../utils";
2
- type Parsed = {
3
- positional: string[];
4
- flags: Record<string, string>;
5
- bools: Set<string>;
6
- runs: string[];
7
- };
8
- export declare function parseArgs(args: string[]): Parsed;
9
- /** "4" → 4, "true" → true, anything else as text (a category). */
10
- export declare function scoreValue(raw: string): number | boolean | string;
11
- export declare function runScore(args: string[], config: CodiedevConfig): Promise<void>;
12
- export declare function runScores(args: string[], config: CodiedevConfig): Promise<void>;
13
- export declare function runQueue(args: string[], config: CodiedevConfig): Promise<void>;
14
- export declare function runJudge(args: string[], config: CodiedevConfig): Promise<void>;
15
- export declare function runImport(args: string[], config: CodiedevConfig): Promise<void>;
16
- export declare function runAddExample(args: string[], config: CodiedevConfig): Promise<void>;
17
- export declare function runVersions(args: string[], config: CodiedevConfig): Promise<void>;
18
- export declare function runSaveVersion(args: string[], config: CodiedevConfig): Promise<void>;
19
- export declare function runOverview(args: string[], config: CodiedevConfig): Promise<void>;
20
- export declare function runRuns(args: string[], config: CodiedevConfig): Promise<void>;
21
- export declare function runRun(args: string[], config: CodiedevConfig): Promise<void>;
22
- export declare function runScoreKinds(args: string[], config: CodiedevConfig): Promise<void>;
23
- export declare function runQueueCreate(args: string[], config: CodiedevConfig): Promise<void>;
24
- export {};
@@ -1,10 +0,0 @@
1
- /**
2
- * The user's home, always absolute. $HOME can arrive relative or unexpanded ("~", ".", "") from a
3
- * sandboxed shell or a wrapper; trusting it once wrote hook commands like ".codiedev/bin/…" into
4
- * ~/.claude/settings.json, which only resolve when Claude Code starts in the home folder, so
5
- * capture silently failed in every project. Fall back to the account's home from the OS.
6
- */
7
- export declare function realHome(): string;
8
- /** $HOME when it's a real absolute path, else the OS account's home, else resolved against cwd. */
9
- export declare function pickHome(fromEnv: string | undefined, fromOs: string | undefined): string;
10
- export declare function codiedevStateDir(): string;
package/dist/connect.d.ts DELETED
@@ -1 +0,0 @@
1
- export declare function runConnect(args?: string[]): Promise<void>;
@@ -1,34 +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;
14
- export interface SignInResult {
15
- token: string;
16
- auth?: import("./cliSession").BrowserAuth;
17
- }
18
- export interface SignInDeps {
19
- /** Browser (loopback) or device-code sign-in; throws on failure. */
20
- signIn: () => Promise<import("./cliSession").TokenSet>;
21
- /** A person at a terminal who can answer prompts. */
22
- interactive: boolean;
23
- askYesNo: (question: string) => Promise<boolean>;
24
- askToken: (question: string) => Promise<string>;
25
- log: (line: string) => void;
26
- error: (line: string) => void;
27
- }
28
- /**
29
- * Browser sign-in, with the API-token paste as the way out: if the browser
30
- * flow fails (blocked page, expired code, proxy) an interactive user is asked
31
- * whether to paste a token instead, rather than being sent to rerun connect.
32
- * Returns null when there's nothing to continue with (caller exits 1).
33
- */
34
- export declare function signInWithTokenFallback(deps: SignInDeps): Promise<SignInResult | null>;