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
@@ -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,57 +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
- /**
43
- * What this session just cost. Returns "" when the session billed nothing,
44
- * because a developer who spent nothing does not need to be told a number.
45
- */
46
- export declare function formatSessionCostLine(usage: CodieUsage | null | undefined): string;
47
- /**
48
- * Read the developer's budget snapshot. Returns null on any refusal, network
49
- * failure, timeout, or malformed answer — a status poll is never worth an
50
- * error in front of a developer who asked for none.
51
- */
52
- export declare function fetchCodieUsage({ baseUrl, key, sinceMs, fetchImpl, }: {
53
- baseUrl?: string;
54
- key: string;
55
- sinceMs?: number;
56
- fetchImpl?: typeof fetch;
57
- }): 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 +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>;
@@ -1,53 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.runPromote = runPromote;
4
- const shared_1 = require("./shared");
5
- function parseArgs(args) {
6
- let artifactId;
7
- let keyOverride;
8
- for (let i = 0; i < args.length; i++) {
9
- const a = args[i];
10
- if ((a === "--key" || a === "-k") && i + 1 < args.length) {
11
- keyOverride = args[++i];
12
- }
13
- else if (a.startsWith("--key=")) {
14
- keyOverride = a.slice("--key=".length);
15
- }
16
- else if (!a.startsWith("--") && !artifactId) {
17
- artifactId = a;
18
- }
19
- }
20
- if (!artifactId) {
21
- console.error("Usage: codiedev promote <extracted-artifact-id> [--key spec-foo.md]");
22
- process.exit(1);
23
- }
24
- return { artifactId, keyOverride };
25
- }
26
- async function runPromote(args) {
27
- const { artifactId, keyOverride } = parseArgs(args);
28
- const config = (0, shared_1.requireConfig)();
29
- const start = Date.now();
30
- try {
31
- const res = await (0, shared_1.apiRequest)("POST", "/api/cli/promote", {
32
- config,
33
- body: { artifactId, keyOverride },
34
- });
35
- (0, shared_1.recordAgentEvent)(config, {
36
- tool: "codiedev_promote",
37
- ok: true,
38
- latencyMs: Date.now() - start,
39
- });
40
- console.log(`✓ Promoted to authored artifact ${res.key}`);
41
- console.log(` id: ${res.artifactId}`);
42
- }
43
- catch (err) {
44
- (0, shared_1.recordAgentEvent)(config, {
45
- tool: "codiedev_promote",
46
- ok: false,
47
- latencyMs: Date.now() - start,
48
- error: err.message,
49
- });
50
- console.error(`Promote failed: ${err.message}`);
51
- process.exit(1);
52
- }
53
- }
@@ -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 runReact(args: string[], configOverride?: CodiedevConfig): Promise<void>;
@@ -1,40 +0,0 @@
1
- "use strict";
2
- // `codiedev react <postId> <emoji>` — toggle a reaction on a feed post.
3
- // Calling twice with the same emoji removes it.
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.runReact = runReact;
6
- const shared_1 = require("./shared");
7
- async function runReact(args, configOverride) {
8
- const positionals = args.filter((a) => !a.startsWith("--"));
9
- const [postId, emoji] = positionals;
10
- if (!postId || !emoji) {
11
- console.error("Usage: codiedev react <postId> <emoji>");
12
- process.exit(1);
13
- }
14
- const config = configOverride ?? (0, shared_1.requireConfig)();
15
- const start = Date.now();
16
- try {
17
- const res = await (0, shared_1.apiRequest)("POST", "/api/cli/react", {
18
- config,
19
- body: { postId, emoji },
20
- });
21
- (0, shared_1.recordAgentEvent)(config, {
22
- tool: "codiedev_react",
23
- ok: true,
24
- latencyMs: Date.now() - start,
25
- });
26
- console.log(res.action === "removed"
27
- ? `Removed ${res.emoji ?? emoji} from post ${postId}.`
28
- : `Reacted to post ${postId} with ${res.emoji ?? emoji}.`);
29
- }
30
- catch (err) {
31
- (0, shared_1.recordAgentEvent)(config, {
32
- tool: "codiedev_react",
33
- ok: false,
34
- latencyMs: Date.now() - start,
35
- error: err.message,
36
- });
37
- console.error(`React failed: ${err.message}`);
38
- process.exit(1);
39
- }
40
- }
@@ -1,2 +0,0 @@
1
- export declare function isSafeRef(ref: string): boolean;
2
- export declare function runReverseTicket(args: string[]): Promise<void>;