@cortexkit/opencode-magic-context 0.39.0 → 0.40.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 (58) hide show
  1. package/README.md +20 -0
  2. package/dist/config/index.d.ts.map +1 -1
  3. package/dist/config/profiles.d.ts +22 -0
  4. package/dist/config/profiles.d.ts.map +1 -0
  5. package/dist/config/project-security.d.ts +3 -0
  6. package/dist/config/project-security.d.ts.map +1 -1
  7. package/dist/config/schema/magic-context.d.ts +400 -0
  8. package/dist/config/schema/magic-context.d.ts.map +1 -1
  9. package/dist/features/magic-context/fail-closed-block.d.ts +11 -1
  10. package/dist/features/magic-context/fail-closed-block.d.ts.map +1 -1
  11. package/dist/features/magic-context/memory/embedding-failure.d.ts +11 -0
  12. package/dist/features/magic-context/memory/embedding-failure.d.ts.map +1 -0
  13. package/dist/features/magic-context/memory/embedding-openai.d.ts +5 -0
  14. package/dist/features/magic-context/memory/embedding-openai.d.ts.map +1 -1
  15. package/dist/features/magic-context/memory/embedding-provider.d.ts +3 -0
  16. package/dist/features/magic-context/memory/embedding-provider.d.ts.map +1 -1
  17. package/dist/features/magic-context/project-embedding-registry.d.ts +2 -0
  18. package/dist/features/magic-context/project-embedding-registry.d.ts.map +1 -1
  19. package/dist/features/magic-context/storage-db.d.ts +1 -1
  20. package/dist/features/magic-context/storage-db.d.ts.map +1 -1
  21. package/dist/features/magic-context/transform-decision-log.d.ts.map +1 -1
  22. package/dist/hooks/magic-context/format-embed-failure.d.ts +3 -0
  23. package/dist/hooks/magic-context/format-embed-failure.d.ts.map +1 -0
  24. package/dist/hooks/magic-context/inject-compartments.d.ts +4 -3
  25. package/dist/hooks/magic-context/inject-compartments.d.ts.map +1 -1
  26. package/dist/hooks/magic-context/strip-content.d.ts +6 -0
  27. package/dist/hooks/magic-context/strip-content.d.ts.map +1 -1
  28. package/dist/hooks/magic-context/transform-postprocess-phase.d.ts +1 -0
  29. package/dist/hooks/magic-context/transform-postprocess-phase.d.ts.map +1 -1
  30. package/dist/{index-k2ts0wk1.js → index-axpym70t.js} +395 -66
  31. package/dist/index.js +119 -163
  32. package/dist/plugin/hooks/create-session-hooks.d.ts +2 -0
  33. package/dist/plugin/hooks/create-session-hooks.d.ts.map +1 -1
  34. package/dist/plugin/rpc-handlers.d.ts.map +1 -1
  35. package/dist/{recomp-orchestrator-2pncxee7.js → recomp-orchestrator-dmyvqekw.js} +1 -1
  36. package/dist/shared/rpc-types.d.ts +2 -0
  37. package/dist/shared/rpc-types.d.ts.map +1 -1
  38. package/dist/shared/rpc-utils.d.ts +12 -1
  39. package/dist/shared/rpc-utils.d.ts.map +1 -1
  40. package/dist/shared/status-detail-text.d.ts.map +1 -1
  41. package/dist/tui/data/context-db.d.ts.map +1 -1
  42. package/dist/tui-compiled/data/context-db.d.ts.map +1 -1
  43. package/package.json +1 -1
  44. package/src/config/index.test.ts +361 -2
  45. package/src/config/index.ts +29 -10
  46. package/src/config/profiles.ts +106 -0
  47. package/src/config/project-security.hostile-matrix.test.ts +9 -0
  48. package/src/config/project-security.test.ts +17 -0
  49. package/src/config/project-security.ts +10 -0
  50. package/src/config/schema/magic-context.test.ts +128 -0
  51. package/src/config/schema/magic-context.ts +89 -0
  52. package/src/shared/rpc-types.ts +2 -0
  53. package/src/shared/rpc-utils.test.ts +32 -0
  54. package/src/shared/rpc-utils.ts +38 -13
  55. package/src/shared/status-detail-text.test.ts +2 -0
  56. package/src/shared/status-detail-text.ts +1 -0
  57. package/src/tui/data/context-db.ts +1 -0
  58. package/src/tui-compiled/data/context-db.ts +1 -0
package/README.md CHANGED
@@ -333,6 +333,26 @@ Settings live in `magic-context.jsonc`. Most settings have sensible defaults, bu
333
333
 
334
334
  Upgrading from an earlier version? Your existing config is moved here automatically on first run (a `.MOVED_READPLEASE` breadcrumb is left at the old path).
335
335
 
336
+ ### Work and personal repository model profiles
337
+
338
+ If your personal repositories use one hidden-agent model set and work repositories use another, define the profiles in user config and let each work repository select its name:
339
+
340
+ ```jsonc
341
+ // ~/.config/cortexkit/magic-context.jsonc
342
+ {
343
+ "profile": "personal",
344
+ "profiles": {
345
+ "personal": { "historian": { "opencode": { "model": "anthropic/claude-sonnet-4-6" } } },
346
+ "work": { "historian": { "opencode": { "model": "openai/gpt-5.2-codex" } } }
347
+ }
348
+ }
349
+
350
+ // <work-repo>/.cortexkit/magic-context.jsonc
351
+ { "profile": "work" }
352
+ ```
353
+
354
+ This is the work-repositories-versus-personal-repositories setup requested by kagbodji. Profiles overlay only hidden-agent model selection, preserve base settings that they do not mention, and are defined only in user config. A project can select a known user profile but cannot supply its contents. See [CONFIGURATION.md](./CONFIGURATION.md#per-repository-model-profiles) for the full OpenCode/Pi example, fallback behavior, and trust boundary.
355
+
336
356
  ---
337
357
 
338
358
  ## Storage
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAmBpE,OAAO,EAAE,KAAK,kBAAkB,EAA4B,MAAM,wBAAwB,CAAC;AAI3F,MAAM,WAAW,wBAAyB,SAAQ,kBAAkB;IAChE,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CACZ,MAAM,EACN;QACI,QAAQ,EAAE,MAAM,CAAC;QACjB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,OAAO,CAAC,EAAE,OAAO,CAAC;KACrB,CACJ,CAAC;CACL;AAsCD,MAAM,MAAM,WAAW,GACjB,IAAI,GACJ,0BAA0B,GAC1B,uBAAuB,GACvB,0BAA0B,GAC1B,iBAAiB,GACjB,sBAAsB,CAAC;AAE7B,MAAM,WAAW,kBAAkB;IAC/B,MAAM,EAAE,wBAAwB,GAAG;QAAE,cAAc,CAAC,EAAE,MA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;AAE7B,MAAM,WAAW,kBAAkB;IAC/B,MAAM,EAAE,wBAAwB,GAAG;QAAE,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IACjE,6EAA6E;IAC7E,yBAAyB,EAAE,mBAAmB,CAAC;IAC/C,WAAW,EAAE,WAAW,CAAC;IACzB,OAAO,EAAE;QACL,UAAU,EAAE,WAAW,CAAC;QACxB,aAAa,EAAE,WAAW,CAAC;KAC9B,CAAC;IACF,oBAAoB,EAAE,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC9F,qBAAqB,EAAE,MAAM,EAAE,CAAC;CACnC;AA+UD,wBAAgB,gBAAgB,CAC5B,SAAS,EAAE,MAAM,GAClB,wBAAwB,GAAG;IAAE,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,CAY1D;AAwDD,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,MAAM,GAAG,kBAAkB,CA0K9E"}
@@ -0,0 +1,22 @@
1
+ export interface ProfileResolution {
2
+ /** User config minus the profile declarations and selector. */
3
+ userBase: Record<string, unknown>;
4
+ /** Project config minus the profile declarations and selector. */
5
+ projectBase: Record<string, unknown>;
6
+ /** The validated user-owned overlay for the active profile, if any. */
7
+ overlay: Record<string, unknown>;
8
+ /** The selected profile name, absent when no valid profile is active. */
9
+ activeProfile?: string;
10
+ warnings: string[];
11
+ }
12
+ /**
13
+ * Resolve the user-owned profile overlay without retaining any process-global
14
+ * selection state. Callers merge `userBase`, `overlay`, then `projectBase` for
15
+ * every project load, so a Pi /cd or OpenCode multi-root session cannot borrow
16
+ * another repository's selected profile.
17
+ */
18
+ export declare function resolveConfigProfile(args: {
19
+ userRaw: Record<string, unknown>;
20
+ projectRaw: Record<string, unknown>;
21
+ }): ProfileResolution;
22
+ //# sourceMappingURL=profiles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profiles.d.ts","sourceRoot":"","sources":["../../src/config/profiles.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,iBAAiB;IAC9B,+DAA+D;IAC/D,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,kEAAkE;IAClE,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,uEAAuE;IACvE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,yEAAyE;IACzE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACtB;AAsBD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE;IACvC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACvC,GAAG,iBAAiB,CA8DpB"}
@@ -3,6 +3,9 @@
3
3
  * over the user config. Returns warnings describing what was ignored.
4
4
  *
5
5
  * Closes:
6
+ * - `profiles` — profile definitions choose hidden-agent models and must stay
7
+ * in trusted user config; a repository may select a named profile but cannot
8
+ * supply its contents.
6
9
  * - `auto_update` — a repo must not suppress plugin self-updates (which can
7
10
  * carry security fixes).
8
11
  * - `fail_closed_blocking` — a repo must not un-block (or force-block) the
@@ -1 +1 @@
1
- {"version":3,"file":"project-security.d.ts","sourceRoot":"","sources":["../../src/config/project-security.ts"],"names":[],"mappings":"AA6PA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,wBAAgB,8BAA8B,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,EAAE,CA2O5F;AAED;;;;;GAKG;AACH,wBAAgB,kCAAkC,CAAC,IAAI,EAAE;IACrD,SAAS,EAAE,MAAM,C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V"}
@@ -285,6 +285,232 @@ export declare const DreamerPiHarnessBlockSchema: z.ZodObject<{
285
285
  }, z.core.$strict>>>;
286
286
  }, z.core.$strict>;
287
287
  export type DreamerPiHarnessBlock = z.infer<typeof DreamerPiHarnessBlockSchema>;
288
+ export declare const ConfigProfileSchema: z.ZodObject<{
289
+ historian: z.ZodOptional<z.ZodObject<{
290
+ opencode: z.ZodOptional<z.ZodObject<{
291
+ model: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
292
+ model: z.ZodString;
293
+ variant: z.ZodOptional<z.ZodString>;
294
+ }, z.core.$strict>]>>;
295
+ fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
296
+ model: z.ZodString;
297
+ variant: z.ZodOptional<z.ZodString>;
298
+ }, z.core.$strict>]>>>;
299
+ variant: z.ZodOptional<z.ZodString>;
300
+ }, z.core.$strict>>;
301
+ pi: z.ZodOptional<z.ZodObject<{
302
+ model: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
303
+ model: z.ZodString;
304
+ thinking_level: z.ZodOptional<z.ZodEnum<{
305
+ off: "off";
306
+ minimal: "minimal";
307
+ low: "low";
308
+ medium: "medium";
309
+ high: "high";
310
+ xhigh: "xhigh";
311
+ max: "max";
312
+ }>>;
313
+ }, z.core.$strict>]>>;
314
+ fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
315
+ model: z.ZodString;
316
+ thinking_level: z.ZodOptional<z.ZodEnum<{
317
+ off: "off";
318
+ minimal: "minimal";
319
+ low: "low";
320
+ medium: "medium";
321
+ high: "high";
322
+ xhigh: "xhigh";
323
+ max: "max";
324
+ }>>;
325
+ }, z.core.$strict>]>>>;
326
+ thinking_level: z.ZodOptional<z.ZodEnum<{
327
+ off: "off";
328
+ minimal: "minimal";
329
+ low: "low";
330
+ medium: "medium";
331
+ high: "high";
332
+ xhigh: "xhigh";
333
+ max: "max";
334
+ }>>;
335
+ }, z.core.$strict>>;
336
+ }, z.core.$strict>>;
337
+ dreamer: z.ZodOptional<z.ZodObject<{
338
+ opencode: z.ZodOptional<z.ZodObject<{
339
+ model: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
340
+ model: z.ZodString;
341
+ variant: z.ZodOptional<z.ZodString>;
342
+ }, z.core.$strict>]>>;
343
+ fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
344
+ model: z.ZodString;
345
+ variant: z.ZodOptional<z.ZodString>;
346
+ }, z.core.$strict>]>>>;
347
+ variant: z.ZodOptional<z.ZodString>;
348
+ }, z.core.$strict>>;
349
+ pi: z.ZodOptional<z.ZodObject<{
350
+ model: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
351
+ model: z.ZodString;
352
+ thinking_level: z.ZodOptional<z.ZodEnum<{
353
+ off: "off";
354
+ minimal: "minimal";
355
+ low: "low";
356
+ medium: "medium";
357
+ high: "high";
358
+ xhigh: "xhigh";
359
+ max: "max";
360
+ }>>;
361
+ }, z.core.$strict>]>>;
362
+ fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
363
+ model: z.ZodString;
364
+ thinking_level: z.ZodOptional<z.ZodEnum<{
365
+ off: "off";
366
+ minimal: "minimal";
367
+ low: "low";
368
+ medium: "medium";
369
+ high: "high";
370
+ xhigh: "xhigh";
371
+ max: "max";
372
+ }>>;
373
+ }, z.core.$strict>]>>>;
374
+ thinking_level: z.ZodOptional<z.ZodEnum<{
375
+ off: "off";
376
+ minimal: "minimal";
377
+ low: "low";
378
+ medium: "medium";
379
+ high: "high";
380
+ xhigh: "xhigh";
381
+ max: "max";
382
+ }>>;
383
+ }, z.core.$strict>>;
384
+ }, z.core.$strict>>;
385
+ sidekick: z.ZodOptional<z.ZodObject<{
386
+ model: z.ZodOptional<z.ZodString>;
387
+ variant: z.ZodOptional<z.ZodString>;
388
+ fallback_models: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
389
+ thinking_level: z.ZodOptional<z.ZodEnum<{
390
+ off: "off";
391
+ minimal: "minimal";
392
+ low: "low";
393
+ medium: "medium";
394
+ high: "high";
395
+ xhigh: "xhigh";
396
+ max: "max";
397
+ }>>;
398
+ }, z.core.$strict>>;
399
+ }, z.core.$strict>;
400
+ export type ConfigProfile = z.infer<typeof ConfigProfileSchema>;
401
+ export declare const ConfigProfilesSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
402
+ historian: z.ZodOptional<z.ZodObject<{
403
+ opencode: z.ZodOptional<z.ZodObject<{
404
+ model: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
405
+ model: z.ZodString;
406
+ variant: z.ZodOptional<z.ZodString>;
407
+ }, z.core.$strict>]>>;
408
+ fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
409
+ model: z.ZodString;
410
+ variant: z.ZodOptional<z.ZodString>;
411
+ }, z.core.$strict>]>>>;
412
+ variant: z.ZodOptional<z.ZodString>;
413
+ }, z.core.$strict>>;
414
+ pi: z.ZodOptional<z.ZodObject<{
415
+ model: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
416
+ model: z.ZodString;
417
+ thinking_level: z.ZodOptional<z.ZodEnum<{
418
+ off: "off";
419
+ minimal: "minimal";
420
+ low: "low";
421
+ medium: "medium";
422
+ high: "high";
423
+ xhigh: "xhigh";
424
+ max: "max";
425
+ }>>;
426
+ }, z.core.$strict>]>>;
427
+ fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
428
+ model: z.ZodString;
429
+ thinking_level: z.ZodOptional<z.ZodEnum<{
430
+ off: "off";
431
+ minimal: "minimal";
432
+ low: "low";
433
+ medium: "medium";
434
+ high: "high";
435
+ xhigh: "xhigh";
436
+ max: "max";
437
+ }>>;
438
+ }, z.core.$strict>]>>>;
439
+ thinking_level: z.ZodOptional<z.ZodEnum<{
440
+ off: "off";
441
+ minimal: "minimal";
442
+ low: "low";
443
+ medium: "medium";
444
+ high: "high";
445
+ xhigh: "xhigh";
446
+ max: "max";
447
+ }>>;
448
+ }, z.core.$strict>>;
449
+ }, z.core.$strict>>;
450
+ dreamer: z.ZodOptional<z.ZodObject<{
451
+ opencode: z.ZodOptional<z.ZodObject<{
452
+ model: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
453
+ model: z.ZodString;
454
+ variant: z.ZodOptional<z.ZodString>;
455
+ }, z.core.$strict>]>>;
456
+ fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
457
+ model: z.ZodString;
458
+ variant: z.ZodOptional<z.ZodString>;
459
+ }, z.core.$strict>]>>>;
460
+ variant: z.ZodOptional<z.ZodString>;
461
+ }, z.core.$strict>>;
462
+ pi: z.ZodOptional<z.ZodObject<{
463
+ model: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
464
+ model: z.ZodString;
465
+ thinking_level: z.ZodOptional<z.ZodEnum<{
466
+ off: "off";
467
+ minimal: "minimal";
468
+ low: "low";
469
+ medium: "medium";
470
+ high: "high";
471
+ xhigh: "xhigh";
472
+ max: "max";
473
+ }>>;
474
+ }, z.core.$strict>]>>;
475
+ fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
476
+ model: z.ZodString;
477
+ thinking_level: z.ZodOptional<z.ZodEnum<{
478
+ off: "off";
479
+ minimal: "minimal";
480
+ low: "low";
481
+ medium: "medium";
482
+ high: "high";
483
+ xhigh: "xhigh";
484
+ max: "max";
485
+ }>>;
486
+ }, z.core.$strict>]>>>;
487
+ thinking_level: z.ZodOptional<z.ZodEnum<{
488
+ off: "off";
489
+ minimal: "minimal";
490
+ low: "low";
491
+ medium: "medium";
492
+ high: "high";
493
+ xhigh: "xhigh";
494
+ max: "max";
495
+ }>>;
496
+ }, z.core.$strict>>;
497
+ }, z.core.$strict>>;
498
+ sidekick: z.ZodOptional<z.ZodObject<{
499
+ model: z.ZodOptional<z.ZodString>;
500
+ variant: z.ZodOptional<z.ZodString>;
501
+ fallback_models: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
502
+ thinking_level: z.ZodOptional<z.ZodEnum<{
503
+ off: "off";
504
+ minimal: "minimal";
505
+ low: "low";
506
+ medium: "medium";
507
+ high: "high";
508
+ xhigh: "xhigh";
509
+ max: "max";
510
+ }>>;
511
+ }, z.core.$strict>>;
512
+ }, z.core.$strict>>;
513
+ export type ConfigProfiles = z.infer<typeof ConfigProfilesSchema>;
288
514
  export declare const DreamTaskConfigSchema: z.ZodObject<{
289
515
  schedule: z.ZodDefault<z.ZodString>;
290
516
  promotion_threshold: z.ZodOptional<z.ZodNumber>;
@@ -787,6 +1013,10 @@ export interface MagicContextConfig {
787
1013
  auto_update?: boolean;
788
1014
  /** Output language for generated Magic Context prose. USER config only. */
789
1015
  language?: string;
1016
+ /** Active user-owned model profile after user/project resolution. */
1017
+ profile?: string;
1018
+ /** Named user-owned model profiles. Declarations are consumed during resolution. */
1019
+ profiles?: ConfigProfiles;
790
1020
  historian?: HistorianConfig;
791
1021
  dreamer?: DreamerConfig;
792
1022
  smart_notes: {
@@ -976,6 +1206,119 @@ export declare const MagicContextConfigSchema: z.ZodPipe<z.ZodObject<{
976
1206
  }>>;
977
1207
  auto_update: z.ZodOptional<z.ZodBoolean>;
978
1208
  language: z.ZodOptional<z.ZodString>;
1209
+ profile: z.ZodOptional<z.ZodString>;
1210
+ profiles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1211
+ historian: z.ZodOptional<z.ZodObject<{
1212
+ opencode: z.ZodOptional<z.ZodObject<{
1213
+ model: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
1214
+ model: z.ZodString;
1215
+ variant: z.ZodOptional<z.ZodString>;
1216
+ }, z.core.$strict>]>>;
1217
+ fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
1218
+ model: z.ZodString;
1219
+ variant: z.ZodOptional<z.ZodString>;
1220
+ }, z.core.$strict>]>>>;
1221
+ variant: z.ZodOptional<z.ZodString>;
1222
+ }, z.core.$strict>>;
1223
+ pi: z.ZodOptional<z.ZodObject<{
1224
+ model: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
1225
+ model: z.ZodString;
1226
+ thinking_level: z.ZodOptional<z.ZodEnum<{
1227
+ off: "off";
1228
+ minimal: "minimal";
1229
+ low: "low";
1230
+ medium: "medium";
1231
+ high: "high";
1232
+ xhigh: "xhigh";
1233
+ max: "max";
1234
+ }>>;
1235
+ }, z.core.$strict>]>>;
1236
+ fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
1237
+ model: z.ZodString;
1238
+ thinking_level: z.ZodOptional<z.ZodEnum<{
1239
+ off: "off";
1240
+ minimal: "minimal";
1241
+ low: "low";
1242
+ medium: "medium";
1243
+ high: "high";
1244
+ xhigh: "xhigh";
1245
+ max: "max";
1246
+ }>>;
1247
+ }, z.core.$strict>]>>>;
1248
+ thinking_level: z.ZodOptional<z.ZodEnum<{
1249
+ off: "off";
1250
+ minimal: "minimal";
1251
+ low: "low";
1252
+ medium: "medium";
1253
+ high: "high";
1254
+ xhigh: "xhigh";
1255
+ max: "max";
1256
+ }>>;
1257
+ }, z.core.$strict>>;
1258
+ }, z.core.$strict>>;
1259
+ dreamer: z.ZodOptional<z.ZodObject<{
1260
+ opencode: z.ZodOptional<z.ZodObject<{
1261
+ model: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
1262
+ model: z.ZodString;
1263
+ variant: z.ZodOptional<z.ZodString>;
1264
+ }, z.core.$strict>]>>;
1265
+ fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
1266
+ model: z.ZodString;
1267
+ variant: z.ZodOptional<z.ZodString>;
1268
+ }, z.core.$strict>]>>>;
1269
+ variant: z.ZodOptional<z.ZodString>;
1270
+ }, z.core.$strict>>;
1271
+ pi: z.ZodOptional<z.ZodObject<{
1272
+ model: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
1273
+ model: z.ZodString;
1274
+ thinking_level: z.ZodOptional<z.ZodEnum<{
1275
+ off: "off";
1276
+ minimal: "minimal";
1277
+ low: "low";
1278
+ medium: "medium";
1279
+ high: "high";
1280
+ xhigh: "xhigh";
1281
+ max: "max";
1282
+ }>>;
1283
+ }, z.core.$strict>]>>;
1284
+ fallback_models: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
1285
+ model: z.ZodString;
1286
+ thinking_level: z.ZodOptional<z.ZodEnum<{
1287
+ off: "off";
1288
+ minimal: "minimal";
1289
+ low: "low";
1290
+ medium: "medium";
1291
+ high: "high";
1292
+ xhigh: "xhigh";
1293
+ max: "max";
1294
+ }>>;
1295
+ }, z.core.$strict>]>>>;
1296
+ thinking_level: z.ZodOptional<z.ZodEnum<{
1297
+ off: "off";
1298
+ minimal: "minimal";
1299
+ low: "low";
1300
+ medium: "medium";
1301
+ high: "high";
1302
+ xhigh: "xhigh";
1303
+ max: "max";
1304
+ }>>;
1305
+ }, z.core.$strict>>;
1306
+ }, z.core.$strict>>;
1307
+ sidekick: z.ZodOptional<z.ZodObject<{
1308
+ model: z.ZodOptional<z.ZodString>;
1309
+ variant: z.ZodOptional<z.ZodString>;
1310
+ fallback_models: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
1311
+ thinking_level: z.ZodOptional<z.ZodEnum<{
1312
+ off: "off";
1313
+ minimal: "minimal";
1314
+ low: "low";
1315
+ medium: "medium";
1316
+ high: "high";
1317
+ xhigh: "xhigh";
1318
+ max: "max";
1319
+ }>>;
1320
+ }, z.core.$strict>>;
1321
+ }, z.core.$strict>>>;
979
1322
  historian: z.ZodOptional<z.ZodObject<{
980
1323
  mode: z.ZodOptional<z.ZodEnum<{
981
1324
  primary: "primary";
@@ -1589,6 +1932,63 @@ export declare const MagicContextConfigSchema: z.ZodPipe<z.ZodObject<{
1589
1932
  };
1590
1933
  auto_update?: boolean | undefined;
1591
1934
  language?: string | undefined;
1935
+ profile?: string | undefined;
1936
+ profiles?: Record<string, {
1937
+ historian?: {
1938
+ opencode?: {
1939
+ model?: string | {
1940
+ model: string;
1941
+ variant?: string | undefined;
1942
+ } | undefined;
1943
+ fallback_models?: (string | {
1944
+ model: string;
1945
+ variant?: string | undefined;
1946
+ })[] | undefined;
1947
+ variant?: string | undefined;
1948
+ } | undefined;
1949
+ pi?: {
1950
+ model?: string | {
1951
+ model: string;
1952
+ thinking_level?: "off" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | undefined;
1953
+ } | undefined;
1954
+ fallback_models?: (string | {
1955
+ model: string;
1956
+ thinking_level?: "off" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | undefined;
1957
+ })[] | undefined;
1958
+ thinking_level?: "off" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | undefined;
1959
+ } | undefined;
1960
+ } | undefined;
1961
+ dreamer?: {
1962
+ opencode?: {
1963
+ model?: string | {
1964
+ model: string;
1965
+ variant?: string | undefined;
1966
+ } | undefined;
1967
+ fallback_models?: (string | {
1968
+ model: string;
1969
+ variant?: string | undefined;
1970
+ })[] | undefined;
1971
+ variant?: string | undefined;
1972
+ } | undefined;
1973
+ pi?: {
1974
+ model?: string | {
1975
+ model: string;
1976
+ thinking_level?: "off" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | undefined;
1977
+ } | undefined;
1978
+ fallback_models?: (string | {
1979
+ model: string;
1980
+ thinking_level?: "off" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | undefined;
1981
+ })[] | undefined;
1982
+ thinking_level?: "off" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | undefined;
1983
+ } | undefined;
1984
+ } | undefined;
1985
+ sidekick?: {
1986
+ model?: string | undefined;
1987
+ variant?: string | undefined;
1988
+ fallback_models?: string | string[] | undefined;
1989
+ thinking_level?: "off" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | undefined;
1990
+ } | undefined;
1991
+ }> | undefined;
1592
1992
  historian?: {
1593
1993
  two_pass: boolean;
1594
1994
  disallowed_tools: ("*" | "read" | "aft_outline" | "aft_zoom" | "aft_search")[];
@@ -1 +1 @@
1
- {"version":3,"file":"magic-context.d.ts","sourceRoot":"","sources":["../../../src/config/schema/magic-context.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,KAAK,EACR,mBAAmB,EAEtB,MAAM,oDAAoD,CAAC;AAI5D,eAAO,MAAM,oCAAoC,KAAK,CAAC;AAIvD,eAAO,MAAM,6BAA6B,0OACiM,CAAC;AAC5O,eAAO,MAAM,4BAA4B,SAAU,CAAC;AACpD,eAAO,MAAM,iCAAiC,OAAO,CAAC;AAEtD,eAAO,MAAM,6BAA6B,4BAA4B,CAAC;AAMvE,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEhE;;;iEAGiE;AACjE,eAAO,MAAM,qBAAqB;;;;;;;;GAEnB,CAAC;AAChB,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE;0EAC0E;AAC1E,eAAO,MAAM,cAAc;;kBASZ,CAAC;AAChB,MAAM,MAAM,QAAQ,GAAG,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC;AAEnE;;;GAGG;AACH,eAAO,MAAM,yBAAyB;;;EAA4B,CAAC;AACnE,YAAY,EAAE,mBAAmB,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ite contention (BUSY/LOCKED) is intentionally NOT handled here —
11
11
  * those stay fail-open pass-through in the outer transform wrappers.
12
12
  */
13
- import type { ProcessKind } from "../../shared/rpc-utils";
13
+ import type { ProcessKind, ProcessProbeEvidence } from "../../shared/rpc-utils";
14
14
  export declare const FAIL_CLOSED_DOCTOR_COMMAND = "npx @cortexkit/magic-context@latest doctor";
15
15
  /** How often a blocked transform pass re-attempts storage open (1 = every pass). */
16
16
  export declare const FAIL_CLOSED_REPROBE_EVERY_N = 5;
@@ -21,7 +21,17 @@ export interface FailClosedBlockingProcess {
21
21
  /** Legacy callers may still provide the old display label. */
22
22
  harness?: string;
23
23
  pid: number;
24
+ /** Epoch milliseconds from the process identity probe, when available. */
25
+ startTime?: number | null;
26
+ /** Raw command line from the process probe, when available. */
27
+ commandLine?: string | null;
24
28
  }
29
+ /**
30
+ * Preserve the old enumerable blocker shape while carrying fresh probe details
31
+ * to the diagnostic formatter. This keeps legacy reason snapshots stable while
32
+ * still making the evidence available through normal property access.
33
+ */
34
+ export declare function attachFailClosedBlockingProcessEvidence(process: FailClosedBlockingProcess, evidence: ProcessProbeEvidence): FailClosedBlockingProcess;
25
35
  export type FailClosedReason = {
26
36
  kind: "migration_guard";
27
37
  persistedVersion: number;
@@ -1 +1 @@
1
- {"version":3,"file":"fail-closed-block.d.ts","sourceRoot":"","sources":["../../../src/features/magic-context/fail-closed-block.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAE1D,eAAO,MAAM,0BAA0B,+CAA+C,CAAC;AAEvF,oFAAoF;AACpF,eAAO,MAAM,2BAA2B,IAAI,CAAC;AAE7C,MAAM,MAAM,qBAAqB,GAAG,WAAW,CAAC;AAEhD,MAAM,WAAW,yBAAyB;IACtC,gEAAgE;IAChE,IAAI,CAAC,EAAE,qBAAqB,CAAC;IAC7B,8DAA8D;IAC9D,OAAO,CAAC,EAAE,MAAM,CAAC;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C;IACjC,eAAe,CAAC,EAAE,OAAO,CAAC;CAC7B,GAAG,OAAO,CAQV;AAED,wBAAgB,4BAA4B,CACxC,QAAQ,EAAE,aAAa,CAAC;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,GAAG,SAAS,CAAC,GAC/D,MAAM,GAAG,SAAS,CAQpB;AAED,MAAM,WAAW,oBAAoB;IACjC,GAAG,CAAC,MAAM,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACpC,KAAK,IAAI,IAAI,CAAC;IACd,OAAO,IAAI,OAAO,CAAC;IACnB,SAAS,IAAI,gBAAgB,GAAG,IAAI,CAAC;IACrC;;;;;OAKG;IACH,OAAO,CAAC,KAAK,EAAE;QACX,eAAe,EAAE,OAAO,CAAC;QACzB,MAAM,EAAE,OAAO,CAAC;QAChB,SAAS,CAAC,EAAE,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;KAChD,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5B;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,CAAC,EAAE;IACjD,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B,GAAG,oBAAoB,CAgDvB;AAED,mFAAmF;AACnF,MAAM,MAAM,eAAe,GACrB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,gBAAgB,CAAA;CAAE,GAC7C;IAAE,IAAI,EAAE,YAAY,CAAA;CAAE,CAAC;AAI7B,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI,CAEpE;AAED,wBAAgB,oBAAoB,IAAI,IAAI,CAE3C;AAED,wBAAgB,sBAAsB,IAAI,eAAe,GAAG,IAAI,CAE/D"}
1
+ {"version":3,"file":"fail-closed-block.d.ts","sourceRoot":"","sources":["../../../src/features/magic-context/fail-closed-block.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,KAAK,EAAE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BAAgB,0BAA0B,CAAC,OAAO,CAAC,EAAE;IACjD,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B,GAAG,oBAAoB,CAgDvB;AAED,mFAAmF;AACnF,MAAM,MAAM,eAAe,GACrB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,gBAAgB,CAAA;CAAE,GAC7C;IAAE,IAAI,EAAE,YAAY,CAAA;CAAE,CAAC;AAI7B,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI,CAEpE;AAED,wBAAgB,oBAAoB,IAAI,IAAI,CAE3C;AAED,wBAAgB,sBAAsB,IAAI,eAAe,GAAG,IAAI,CAE/D"}
@@ -0,0 +1,11 @@
1
+ export type EmbeddingFailureClass = "substitution_rejected" | "http_error" | "transport_error" | "invalid_envelope" | "empty_result";
2
+ /** A classified remote-provider failure that can be surfaced to a caller safely. */
3
+ export interface EmbeddingFailure {
4
+ class: EmbeddingFailureClass;
5
+ /** Stable, user-facing diagnostic with only redacted response evidence. */
6
+ reason: string;
7
+ /** Whether the same configuration may plausibly succeed on another attempt. */
8
+ retryable: boolean;
9
+ }
10
+ export declare function dominantEmbeddingFailure(failures: readonly EmbeddingFailure[]): EmbeddingFailure | undefined;
11
+ //# sourceMappingURL=embedding-failure.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"embedding-failure.d.ts","sourceRoot":"","sources":["../../../../src/features/magic-context/memory/embedding-failure.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,qBAAqB,GAC3B,uBAAuB,GACvB,YAAY,GACZ,iBAAiB,GACjB,kBAAkB,GAClB,cAAc,CAAC;AAErB,oFAAoF;AACpF,MAAM,WAAW,gBAAgB;IAC7B,KAAK,EAAE,qBAAqB,CAAC;IAC7B,2EAA2E;IAC3E,MAAM,EAAE,MAAM,CAAC;IACf,+EAA+E;IAC/E,SAAS,EAAE,OAAO,CAAC;CACtB;AAED,wBAAgB,wBAAwB,CACpC,QAAQ,EAAE,SAAS,gBAAgB,EAAE,GACtC,gBAAgB,GAAG,SAAS,CAc9B"}
@@ -1,3 +1,4 @@
1
+ import type { EmbeddingFailure } from "./embedding-failure";
1
2
  import type { EmbeddingProvider, EmbeddingPurpose } from "./embedding-provider";
2
3
  interface OpenAICompatibleEmbeddingProviderOptions {
3
4
  endpoint?: string;
@@ -49,6 +50,7 @@ export declare class OpenAICompatibleEmbeddingProvider implements EmbeddingProvi
49
50
  * with one line per batch. Resets with the provider instance (i.e. on any
50
51
  * config change), so a corrected config logs again if it regresses. */
51
52
  private modelMismatchLogged;
53
+ private lastFailureReason;
52
54
  /** True while a half-open probe is in flight. Only the caller who set this
53
55
  * to true is allowed to make a real HTTP call; everyone else short-
54
56
  * circuits as if the circuit were still OPEN. */
@@ -70,8 +72,11 @@ export declare class OpenAICompatibleEmbeddingProvider implements EmbeddingProvi
70
72
  * here, synchronously, so concurrent callers see the flag and short-circuit.
71
73
  */
72
74
  private claimProbeOrShortCircuit;
75
+ private failure;
76
+ private bodyExcerpt;
73
77
  private recordFailure;
74
78
  private recordSuccess;
79
+ getLastFailureReason(): EmbeddingFailure | null;
75
80
  _getCircuitState(): CircuitState;
76
81
  _getFailureCount(): number;
77
82
  _resetCircuit(): void;
@@ -1 +1 @@
1
- {"version":3,"file":"embedding-openai.d.ts","sourceRoot":"","sources":["../../../../src/features/magic-context/memory/embedding-openai.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAGhF,UAAU,wCAAwC;IAC9C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,2EAA2E;IAC3E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6FAA6F;IAC7F,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,MAAM,CA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