@cortexkit/pi-magic-context 0.47.0 → 0.49.0

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 (60) hide show
  1. package/dist/auto-search-worker.js +27 -22
  2. package/dist/embedding-activity-ew6dshfd.js +10 -0
  3. package/dist/embedding-backfill-b71dvfs8.js +20 -0
  4. package/dist/embedding-cache-7rp4gqzr.js +16 -0
  5. package/dist/embedding-worker.js +11 -8
  6. package/dist/harness-9872e0ym.js +10 -0
  7. package/dist/historian-calibration-extension.js +30 -4
  8. package/dist/index-041ex0cj.js +519 -0
  9. package/dist/index-0h2mkab2.js +17 -0
  10. package/dist/{index-2p1e8706.js → index-0vrkp1jq.js} +3 -3
  11. package/dist/index-135e8hvg.js +43 -0
  12. package/dist/{index-vgcemg0n.js → index-1evzceyw.js} +151 -2452
  13. package/dist/index-21v1kfs7.js +2309 -0
  14. package/dist/{index-n3g5mwa8.js → index-290tzwp1.js} +3 -3
  15. package/dist/{index-0qejsd7f.js → index-3cgbv47m.js} +289 -45
  16. package/dist/{index-xpbh1ypk.js → index-3mgf68pn.js} +38 -741
  17. package/dist/index-3rea6zd9.js +2396 -0
  18. package/dist/index-674f6qs2.js +16 -0
  19. package/dist/index-8976mezv.js +209 -0
  20. package/dist/index-904reqtg.js +152 -0
  21. package/dist/index-9p40dgkm.js +22 -0
  22. package/dist/index-9x1f96r8.js +11 -0
  23. package/dist/index-bejpsj10.js +1060 -0
  24. package/dist/{index-spk5vrhy.js → index-bgmv2kaf.js} +1 -16
  25. package/dist/{index-k3ezsjng.js → index-ehybv5nr.js} +14657 -13951
  26. package/dist/index-fapenpch.js +13 -0
  27. package/dist/index-hwqb3s7f.js +3804 -0
  28. package/dist/index-kjd1fj55.js +3106 -0
  29. package/dist/{index-td885aah.js → index-mcgehvgw.js} +181 -230
  30. package/dist/index-r024r8da.js +171 -0
  31. package/dist/{index-266qrgss.js → index-r56xgha8.js} +301 -27
  32. package/dist/{index-kztsbkqq.js → index-t7xfqtg6.js} +171 -168
  33. package/dist/index-vakawmbc.js +1262 -0
  34. package/dist/{index-7n8gb6j3.js → index-x3dcnxh0.js} +34 -33
  35. package/dist/index-xjqheg7a.js +931 -0
  36. package/dist/index-yarjn32j.js +3026 -0
  37. package/dist/index-yhzhdp3m.js +143 -0
  38. package/dist/index-yzcjxnt2.js +787 -0
  39. package/dist/{index-w76x3af7.js → index-zh1jw8qp.js} +107 -4
  40. package/dist/index.js +4926 -2437
  41. package/dist/logger-j6tecd1h.js +19 -0
  42. package/dist/message-index-bounded-qz5dz2se.js +120 -0
  43. package/dist/{message-time-backfill-d3db2etr.js → message-time-backfill-05ppypkz.js} +7 -6
  44. package/dist/migration-worker.js +20 -14
  45. package/dist/project-embedding-registry-ky7wrkr1.js +85 -0
  46. package/dist/raw-ordinal-warmup-worker.js +60 -0
  47. package/dist/{read-session-chunk-atxsyfqv.js → read-session-chunk-24sd89tf.js} +14 -6
  48. package/dist/read-session-raw-npx3920c.js +57 -0
  49. package/dist/{safe-notification-target-6cn3z99t.js → safe-notification-target-vn9kpmv4.js} +3 -2
  50. package/dist/search-jbh28nwy.js +40 -0
  51. package/dist/sqlite-3yye76ht.js +44 -0
  52. package/dist/sqlite-context-pragmas-gcgch6qz.js +6 -0
  53. package/dist/storage-memory-1z20y55x.js +71 -0
  54. package/dist/storage-tags-kjnsqbdb.js +127 -0
  55. package/dist/subagent-entry.js +35 -17
  56. package/dist/transformers-node-wasm.js +18415 -18415
  57. package/package.json +3 -3
  58. package/dist/index-7s8vw2y0.js +0 -5207
  59. package/dist/index-qaa5j277.js +0 -8544
  60. /package/dist/{index-en1k8h8m.js → index-5prbx026.js} +0 -0
@@ -1,6 +1,3 @@
1
- // src/subagent-telemetry.ts
2
- import { createHash } from "node:crypto";
3
-
4
1
  // ../plugin/src/agents/hidden-agent-registrations.ts
5
2
  var HIDDEN_AGENT_DESCRIPTION = "Internal Magic Context maintenance agent. Not for general tasks — do not select for user work.";
6
3
  function buildHiddenAgentRegistrations(args) {
@@ -137,7 +134,113 @@ function buildHiddenAgentRegistrations(args) {
137
134
  ];
138
135
  }
139
136
 
137
+ // ../plugin/src/shared/models-dev-temperature.ts
138
+ import { readFileSync, statSync } from "node:fs";
139
+ import { homedir } from "node:os";
140
+ import { join } from "node:path";
141
+ var CATALOG_PROVIDER_ALIASES = {
142
+ "google-antigravity": "google",
143
+ "opencode-zen": "opencode"
144
+ };
145
+ var ANTIGRAVITY_MODEL_PREFIX = "antigravity-";
146
+ var cached;
147
+ function modelsDevCatalogPath(env = process.env) {
148
+ if (env.OPENCODE_MODELS_PATH)
149
+ return env.OPENCODE_MODELS_PATH;
150
+ return join(env.XDG_CACHE_HOME || join(homedir(), ".cache"), "opencode", "models.json");
151
+ }
152
+ function buildIndex(raw) {
153
+ const index = new Map;
154
+ if (!raw || typeof raw !== "object" || Array.isArray(raw))
155
+ return index;
156
+ for (const [providerID, provider] of Object.entries(raw)) {
157
+ const models = provider?.models;
158
+ if (!models || typeof models !== "object")
159
+ continue;
160
+ for (const [modelID, model] of Object.entries(models)) {
161
+ const temperature = model?.temperature;
162
+ if (typeof temperature === "boolean")
163
+ index.set(`${providerID}/${modelID}`, temperature);
164
+ }
165
+ }
166
+ return index;
167
+ }
168
+ function loadIndex() {
169
+ const path = modelsDevCatalogPath();
170
+ try {
171
+ const stat = statSync(path);
172
+ if (cached?.path === path && cached.mtimeMs === stat.mtimeMs && cached.size === stat.size)
173
+ return cached.index;
174
+ const index = buildIndex(JSON.parse(readFileSync(path, "utf8")));
175
+ cached = { path, mtimeMs: stat.mtimeMs, size: stat.size, index };
176
+ return index;
177
+ } catch {
178
+ return;
179
+ }
180
+ }
181
+ function catalogCandidates(providerID, modelID) {
182
+ const provider = Object.hasOwn(CATALOG_PROVIDER_ALIASES, providerID) ? CATALOG_PROVIDER_ALIASES[providerID] : providerID;
183
+ const candidates = [`${provider}/${modelID}`];
184
+ if (provider === "google" && modelID.startsWith(ANTIGRAVITY_MODEL_PREFIX))
185
+ candidates.push(`google/${modelID.slice(ANTIGRAVITY_MODEL_PREFIX.length)}`);
186
+ return candidates;
187
+ }
188
+ function catalogTemperature(model) {
189
+ const slash = model.indexOf("/");
190
+ if (slash <= 0 || slash === model.length - 1)
191
+ return;
192
+ const index = loadIndex();
193
+ if (!index)
194
+ return;
195
+ for (const entry of catalogCandidates(model.slice(0, slash), model.slice(slash + 1))) {
196
+ const temperature = index.get(entry);
197
+ if (temperature !== undefined)
198
+ return { temperature, entry };
199
+ }
200
+ return;
201
+ }
202
+
203
+ // ../plugin/src/shared/subagent-temperature.ts
204
+ var loggedDecisions = new Set;
205
+ function temperatureCapability(metadata) {
206
+ if (!metadata || typeof metadata !== "object")
207
+ return;
208
+ const model = metadata;
209
+ const supported = model.capabilities?.temperature ?? model.temperature ?? model.compat?.supportsTemperature ?? model.compat?.supportsSamplingParams;
210
+ return typeof supported === "boolean" ? supported : undefined;
211
+ }
212
+ function resolveTemperatureCapability(model, metadata) {
213
+ const host = temperatureCapability(metadata);
214
+ if (host !== undefined)
215
+ return { supported: host, source: "host" };
216
+ const catalog = catalogTemperature(model);
217
+ if (catalog)
218
+ return { supported: catalog.temperature, source: "catalog", entry: catalog.entry };
219
+ return { supported: undefined, source: "none" };
220
+ }
221
+ function describeTemperatureDecision(model, decision) {
222
+ const verdict = decision.supported === true ? "sent" : "omitted";
223
+ const answer = decision.supported === true ? "yes" : "no";
224
+ const reason = decision.source === "host" ? `host model metadata says ${answer}` : decision.source === "catalog" ? `models.dev cache entry ${decision.entry ?? "unknown"} says ${answer}` : "no host or models.dev metadata";
225
+ return `Subagent temperature ${verdict} for ${model}: ${reason}`;
226
+ }
227
+ function logTemperatureDecision(model, decision, log) {
228
+ const key = `${model}\x00${decision.source}\x00${decision.supported}\x00${decision.entry ?? ""}`;
229
+ if (loggedDecisions.has(key))
230
+ return;
231
+ loggedDecisions.add(key);
232
+ log(describeTemperatureDecision(model, decision), decision);
233
+ }
234
+ function subagentTemperature(model, metadata, temperature, log) {
235
+ if (temperature === undefined)
236
+ return;
237
+ const decision = resolveTemperatureCapability(model, metadata);
238
+ logTemperatureDecision(model, decision, log);
239
+ return decision.supported === true ? temperature : undefined;
240
+ }
241
+
140
242
  // src/subagent-telemetry.ts
243
+ import { createHash } from "node:crypto";
141
244
  var stepCaps = new Map(buildHiddenAgentRegistrations({
142
245
  dreamerPrompt: undefined,
143
246
  historianPrompt: undefined,
@@ -252,4 +355,4 @@ function readHostSystemPrompt(ctx) {
252
355
  return;
253
356
  }
254
357
 
255
- export { buildHiddenAgentRegistrations, subagentStepCap, promptFingerprint, SubagentTelemetry, readHostSystemPrompt };
358
+ export { buildHiddenAgentRegistrations, logTemperatureDecision, subagentTemperature, subagentStepCap, promptFingerprint, SubagentTelemetry, readHostSystemPrompt };