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
@@ -0,0 +1,187 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.EVALS_HELP = void 0;
37
+ exports.runEvals = runEvals;
38
+ const fs = __importStar(require("fs"));
39
+ const path = __importStar(require("path"));
40
+ const shared_1 = require("./shared");
41
+ exports.EVALS_HELP = `
42
+ codiedev evals — experiments and their runs, shared with the team
43
+
44
+ codiedev evals report <run.json> [--harness name]
45
+ File one variant's scores under an
46
+ experiment (created on first use)
47
+ codiedev evals last <subject> [--json] The latest experiment on a subject,
48
+ its runs, and the current champion
49
+
50
+ run.json:
51
+ {
52
+ "subject": "session-summaries", // agent name or workload
53
+ "question": "Is Terra medium as good as GLM high?",
54
+ "experimentId": "…", // optional, instead of subject + question
55
+ "dataset": "30 Signal & Code sessions", // optional
56
+ "run": {
57
+ "label": "terra-med-v2", "model": "openai/gpt-6.1-terra",
58
+ "provider": "openai", "reasoningEffort": "medium", "prompt": "summary_extract_v2",
59
+ "gitSha": "…", "isControl": false, "judgeModel": "anthropic/claude-sonnet-5.5",
60
+ "casesTotal": 30, "casesScored": 30, "errors": 0,
61
+ "scoringRevision": 1, // required once experiment scoring rules are defined
62
+ "score": 3.85, "metrics": { "fidelity": 3.6 },
63
+ "costPerCaseUsd": 0.026, "latencyMsAvg": 21000,
64
+ "wins": 20, "losses": 8, "ties": 2, "note": "…",
65
+ "cases": [{ "key": "case-1", "score": 4, "note": "…" }]
66
+ }
67
+ }
68
+
69
+ Read scoring rules and their current revision with: codiedev evals last <subject> --json
70
+
71
+ Scores and notes only: never put prompts, transcripts or outputs in it.
72
+ `.trim();
73
+ function flag(args, i, name) {
74
+ const a = args[i];
75
+ if (a === name && i + 1 < args.length)
76
+ return { value: args[i + 1], skip: 1 };
77
+ if (a.startsWith(`${name}=`))
78
+ return { value: a.slice(name.length + 1), skip: 0 };
79
+ return { skip: -1 };
80
+ }
81
+ function variant(run) {
82
+ return [run.model, run.reasoningEffort, run.prompt].filter(Boolean).join(" · ");
83
+ }
84
+ function fmtScore(n) {
85
+ return n === null ? "–" : n.toFixed(2);
86
+ }
87
+ function fmtCost(n) {
88
+ return n === null ? "–" : `$${n.toFixed(4)}`;
89
+ }
90
+ async function runReport(args, config) {
91
+ let file;
92
+ let harness;
93
+ for (let i = 0; i < args.length; i++) {
94
+ const f = flag(args, i, "--harness");
95
+ if (f.skip >= 0) {
96
+ harness = f.value;
97
+ i += f.skip;
98
+ continue;
99
+ }
100
+ if (!args[i].startsWith("-") && !file)
101
+ file = args[i];
102
+ }
103
+ if (!file) {
104
+ console.error("Usage: codiedev evals report <run.json> [--harness name]");
105
+ process.exit(1);
106
+ }
107
+ let body;
108
+ try {
109
+ body = JSON.parse(fs.readFileSync(path.resolve(process.cwd(), file), "utf8"));
110
+ }
111
+ catch (err) {
112
+ console.error(`Couldn't read ${file}: ${err.message}`);
113
+ process.exit(1);
114
+ }
115
+ if (!body.subject || !body.question || !body.run?.label || !body.run?.model || typeof body.run?.casesTotal !== "number") {
116
+ console.error(`${file} needs subject, question, and run.label, run.model, run.casesTotal. See: codiedev evals help`);
117
+ process.exit(1);
118
+ }
119
+ const start = Date.now();
120
+ try {
121
+ const res = await (0, shared_1.apiRequest)("POST", "/api/cli/evals/runs", {
122
+ config,
123
+ body: { ...body, run: { ...body.run, harness: harness ?? body.run.harness ?? undefined } },
124
+ });
125
+ (0, shared_1.recordAgentEvent)(config, { tool: "codiedev_evals_report", ok: true, latencyMs: Date.now() - start });
126
+ console.log(`✓ Reported ${body.run.label} on ${body.subject}${res.created ? " (new experiment)" : ""}: "${body.question}"`);
127
+ console.log(` experiment ${res.experimentId}. See it in Codiedev → Traces → Evals.`);
128
+ }
129
+ catch (err) {
130
+ const e = err;
131
+ (0, shared_1.recordAgentEvent)(config, { tool: "codiedev_evals_report", ok: false, latencyMs: Date.now() - start, error: e.message });
132
+ console.error(`Couldn't report: ${e.message}`);
133
+ process.exit(1);
134
+ }
135
+ }
136
+ async function runLast(args, config) {
137
+ const json = args.includes("--json");
138
+ const subject = args.find((a) => !a.startsWith("-"));
139
+ if (!subject) {
140
+ console.error("Usage: codiedev evals last <subject> [--json]");
141
+ process.exit(1);
142
+ }
143
+ let res;
144
+ try {
145
+ res = await (0, shared_1.apiRequest)("GET", `/api/cli/evals/last?subject=${encodeURIComponent(subject)}`, { config });
146
+ }
147
+ catch (err) {
148
+ const e = err;
149
+ console.error(e.status === 404 ? `No evals on ${subject} yet.` : `Couldn't load evals: ${e.message}`);
150
+ process.exit(1);
151
+ }
152
+ if (json) {
153
+ console.log(JSON.stringify(res, null, 2));
154
+ return;
155
+ }
156
+ const { experiment, runs, champion } = res;
157
+ if (champion) {
158
+ console.log(`Champion: ${champion.run.label} (${variant(champion.run)}), score ${fmtScore(champion.run.score)}, ${fmtCost(champion.run.costPerCaseUsd)}/case`);
159
+ if (champion.decisionNote)
160
+ console.log(` Why: ${champion.decisionNote}`);
161
+ }
162
+ else {
163
+ console.log("Champion: none picked yet");
164
+ }
165
+ console.log("");
166
+ console.log(`Latest experiment (${res.experiments} on ${experiment.subject}): ${experiment.question}`);
167
+ if (experiment.dataset)
168
+ console.log(` Dataset: ${experiment.dataset}`);
169
+ console.log(` id ${experiment.id}, by ${experiment.createdBy}, updated ${new Date(experiment.updatedAt).toISOString().slice(0, 16).replace("T", " ")}`);
170
+ console.log("");
171
+ for (const run of [...runs].sort((a, b) => a.ranAt - b.ranAt)) {
172
+ const h2h = run.wins !== null ? ` · ${run.wins}W/${run.losses ?? 0}L/${run.ties ?? 0}T` : "";
173
+ console.log(` ${run.isControl ? "[control] " : ""}${run.label.padEnd(24)} ${fmtScore(run.score).padStart(5)} ${fmtCost(run.costPerCaseUsd).padStart(8)}/case${h2h} ${variant(run)}`);
174
+ }
175
+ console.log("");
176
+ console.log(`Next run on this experiment: put "experimentId": "${experiment.id}" in run.json, then codiedev evals report run.json`);
177
+ }
178
+ async function runEvals(args, configOverride) {
179
+ const [sub, ...rest] = args;
180
+ if (sub === "report")
181
+ return runReport(rest, configOverride ?? (0, shared_1.requireConfig)());
182
+ if (sub === "last")
183
+ return runLast(rest, configOverride ?? (0, shared_1.requireConfig)());
184
+ console.log(exports.EVALS_HELP);
185
+ if (sub && sub !== "help")
186
+ process.exit(1);
187
+ }
@@ -70,8 +70,6 @@ async function runRead(args) {
70
70
  const config = (0, shared_1.requireConfig)();
71
71
  const start = Date.now();
72
72
  try {
73
- // First, fetch inbox so we can show the full body (markRead endpoint
74
- // doesn't return content).
75
73
  const listRes = await (0, shared_1.apiRequest)("GET", "/api/cli/inbox", {
76
74
  config,
77
75
  query: { limit: 100 },
@@ -1,7 +1,4 @@
1
1
  "use strict";
2
- // `codiedev library [--scope mine|shared|all] [--kind doc|skill] [--tag X]
3
- // [--type spec|...] [--limit N]` — list artifacts in your Codiedev workspace.
4
- // Server applies companyId scoping; --scope filters within that.
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.runLibrary = runLibrary;
7
4
  const shared_1 = require("./shared");