agency-lang 0.19.2 → 0.19.3

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 (35) hide show
  1. package/dist/lib/agents/agency-agent/lib/capabilities.agency +16 -2
  2. package/dist/lib/agents/agency-agent/lib/capabilities.js +122 -3
  3. package/dist/lib/agents/agency-agent/lib/capabilitiesUi.agency +4 -1
  4. package/dist/lib/agents/agency-agent/lib/capabilitiesUi.js +17 -5
  5. package/dist/lib/agents/agency-agent/lib/models.agency +6 -1
  6. package/dist/lib/agents/agency-agent/lib/models.js +8 -4
  7. package/dist/lib/agents/agency-agent/lib/session.agency +29 -6
  8. package/dist/lib/agents/agency-agent/lib/session.js +173 -38
  9. package/dist/lib/agents/agency-agent/shared.agency +119 -17
  10. package/dist/lib/agents/agency-agent/shared.js +894 -126
  11. package/dist/lib/backends/typescriptBuilder.js +5 -1
  12. package/dist/lib/cli/localServe.d.ts +14 -2
  13. package/dist/lib/cli/localServe.js +108 -31
  14. package/dist/lib/cli/mlxEmbedServer.py +159 -0
  15. package/dist/lib/config.d.ts +6 -1
  16. package/dist/lib/config.js +3 -1
  17. package/dist/lib/importPaths.d.ts +4 -2
  18. package/dist/lib/importPaths.js +71 -18
  19. package/dist/lib/runtime/memory/manager.d.ts +14 -0
  20. package/dist/lib/runtime/memory/manager.js +53 -10
  21. package/dist/lib/runtime/memory/types.d.ts +8 -4
  22. package/dist/lib/stdlib/embedding.js +14 -1
  23. package/dist/lib/stdlib/hubClient.d.ts +2 -0
  24. package/dist/lib/stdlib/hubClient.js +7 -1
  25. package/dist/lib/stdlib/hubDownload.js +5 -3
  26. package/dist/lib/stdlib/localModels.d.ts +10 -0
  27. package/dist/lib/stdlib/localModels.js +45 -0
  28. package/dist/lib/stdlib/memory.js +16 -3
  29. package/dist/lib/stdlib/speech.d.ts +13 -0
  30. package/dist/lib/stdlib/speech.js +3 -3
  31. package/dist/scripts/agency.js +1 -0
  32. package/package.json +1 -1
  33. package/stdlib/docs/stdlib/embedding.md +2 -2
  34. package/stdlib/embedding.agency +2 -2
  35. package/stdlib/embedding.js +3 -3
@@ -36,7 +36,8 @@ export type CapabilitySettings = {
36
36
  }
37
37
 
38
38
  /** Per-field provenance: which layer set each value. One of "default",
39
- "provider", "model", "user-global", "user-provider", "user-model".
39
+ "provider", "model", "user-global", "user-provider", "user-model", and
40
+ for memory only, "embedding-override" (see withMemoryFromEmbeddingOverride).
40
41
  A concrete type (not Record) so the /settings renderer is exhaustive. */
41
42
  export type CapabilitySources = {
42
43
  prompt: string;
@@ -109,13 +110,17 @@ export static const PROVIDER_CAPABILITIES: Record<string, CapabilityPatch> = {
109
110
  // lands here. Small models under a JSON grammar can miss their stop
110
111
  // token and generate until the context fills, so the summarizer is
111
112
  // off and output is capped.
113
+ // memory: off for lack of embeddings. --model embedding=llama-cpp/nomic-embed-text
114
+ // turns it on (memoryEnablePlan); the other three lines stay.
112
115
  "llama-cpp": {
113
116
  prompt: "small",
114
117
  summarize: false,
115
118
  memory: false,
116
119
  maxTokens: 2000
117
120
  },
118
- // No embeddings endpoint. The models are large enough for the full prompt.
121
+ // No embeddings endpoint of its own. Naming an embedding model in the
122
+ // embedding slot (--model embedding=mlx/<model>) turns memory on; see
123
+ // memoryEnablePlan. The models are large enough for the full prompt.
119
124
  mlx: {
120
125
  memory: false
121
126
  }
@@ -176,6 +181,15 @@ def applyPatch(
176
181
  }
177
182
  }
178
183
 
184
+ /** Memory on because the embedding slot names a model, which outranks a
185
+ provider profile's off (the profile is off only for lack of an embeddings
186
+ endpoint). Recorded as its own source so /settings can say why. */
187
+ export def withMemoryFromEmbeddingOverride(
188
+ current: ResolvedCapabilities,
189
+ ): ResolvedCapabilities {
190
+ return applyPatch(current, { memory: true }, "embedding-override")
191
+ }
192
+
179
193
  /** Resolve the capability profile for (modelKey, provider) under the user's
180
194
  overrides. Layers applied lowest to highest so later wins:
181
195
  built-in default < built-in provider < built-in model < user global <
@@ -157,7 +157,7 @@ function registerTools(tools) {
157
157
  }
158
158
  }
159
159
  }
160
- __registerModuleFingerprint("dist/lib/agents/agency-agent/lib/capabilities.agency", "21d8a8be224079809d89507f9d79560bc9c77161a94ed2d06467b81fe8f9c211", import.meta.url);
160
+ __registerModuleFingerprint("dist/lib/agents/agency-agent/lib/capabilities.agency", "4af64cee8b20d203f14bdb5d0ce1bee25e8cf2e3a2167dba83db9adf07cb971b", import.meta.url);
161
161
  __registerTool(print);
162
162
  __registerTool(printJSON);
163
163
  __registerTool(input);
@@ -605,6 +605,124 @@ const applyPatch = __AgencyFunction.create({
605
605
  },
606
606
  exported: false
607
607
  }, __toolRegistry);
608
+ async function __withMemoryFromEmbeddingOverride_impl(current) {
609
+ const __setupData = setupFunction();
610
+ const __stack = __setupData.stack;
611
+ const __step = __setupData.step;
612
+ const __self = __setupData.self;
613
+ const __ctx = getRuntimeContext().ctx;
614
+ let __forked;
615
+ let __functionCompleted = false;
616
+ claimFrameForScope(__stack, "withMemoryFromEmbeddingOverride", "dist/lib/agents/agency-agent/lib/capabilities.agency");
617
+ if (!__globals().isInitialized("dist/lib/agents/agency-agent/lib/capabilities.agency")) {
618
+ await __initializeGlobals(__ctx);
619
+ }
620
+ let __funcStartTime = performance.now();
621
+ __stack.args["current"] = current;
622
+ __self.__destructiveRan = __self.__destructiveRan ?? false;
623
+ const runner = new Runner(__ctx, __stack, { state: __stack, moduleId: "dist/lib/agents/agency-agent/lib/capabilities.agency", scopeName: "withMemoryFromEmbeddingOverride", threads: __setupData.threads });
624
+ let __resultCheckpointId = -1;
625
+ if (__ctx._pendingArgOverrides?.moduleId === __stack.moduleId && __ctx._pendingArgOverrides?.scopeName === __stack.scopeName) {
626
+ const __overrides = __ctx._pendingArgOverrides.values;
627
+ __ctx._pendingArgOverrides = void 0;
628
+ if ("current" in __overrides) {
629
+ current = __overrides["current"];
630
+ __stack.args["current"] = current;
631
+ }
632
+ }
633
+ try {
634
+ await agencyStore.run({
635
+ ...getRuntimeContext(),
636
+ ctx: __ctx,
637
+ stack: __setupData.stateStack,
638
+ threads: __setupData.threads
639
+ }, async () => {
640
+ await runner.hook(0, async () => {
641
+ await callHook({
642
+ name: "onFunctionStart",
643
+ data: {
644
+ functionName: "withMemoryFromEmbeddingOverride",
645
+ args: {
646
+ current
647
+ },
648
+ moduleId: "dist/lib/agents/agency-agent/lib/capabilities.agency"
649
+ }
650
+ });
651
+ });
652
+ await runner.step(1, async (runner2) => {
653
+ __functionCompleted = true;
654
+ runner2.halt(await __call(applyPatch, {
655
+ type: "positional",
656
+ args: [__stack.args.current, {
657
+ "memory": true
658
+ }, `embedding-override`]
659
+ }));
660
+ return;
661
+ });
662
+ });
663
+ if (runner.halted) {
664
+ if (isFailure(runner.haltResult)) {
665
+ stampFailureBoundary(runner.haltResult, __self.__destructiveRan);
666
+ }
667
+ return runner.haltResult;
668
+ }
669
+ } catch (__error) {
670
+ if (__error instanceof RunControlSignal) {
671
+ throw __error;
672
+ }
673
+ if (__error instanceof AgencyAbort) {
674
+ return AbortedResult.fromError(__error, __stack, "withMemoryFromEmbeddingOverride");
675
+ }
676
+ {
677
+ const __errMsg = __error instanceof Error ? __error.message : String(__error);
678
+ const __errStack = __error instanceof Error && __error.stack ? __error.stack : "";
679
+ const __log = __createLogger(__ctx.logLevel);
680
+ __log.error("Function withMemoryFromEmbeddingOverride threw an exception (converted to Failure): " + __errMsg);
681
+ if (__errStack) __log.error(__errStack);
682
+ __ctx.statelogClient?.error?.({
683
+ errorType: "runtimeError",
684
+ message: __errMsg,
685
+ functionName: "withMemoryFromEmbeddingOverride"
686
+ });
687
+ }
688
+ return runtimeFailure(__error, {
689
+ checkpoint: getRuntimeContext().ctx.getResultCheckpoint(),
690
+ destructiveRan: __self.__destructiveRan,
691
+ functionName: "withMemoryFromEmbeddingOverride",
692
+ args: __stack.args
693
+ });
694
+ } finally {
695
+ __stateStack()?.pop();
696
+ if (__functionCompleted) {
697
+ await callHook({
698
+ name: "onFunctionEnd",
699
+ data: {
700
+ functionName: "withMemoryFromEmbeddingOverride",
701
+ timeTaken: performance.now() - __funcStartTime
702
+ }
703
+ });
704
+ }
705
+ }
706
+ }
707
+ const withMemoryFromEmbeddingOverride = __AgencyFunction.create({
708
+ name: "withMemoryFromEmbeddingOverride",
709
+ module: "dist/lib/agents/agency-agent/lib/capabilities.agency",
710
+ fn: __withMemoryFromEmbeddingOverride_impl,
711
+ params: [{
712
+ name: "current",
713
+ hasDefault: false,
714
+ defaultValue: void 0,
715
+ variadic: false,
716
+ isFunctionTyped: false,
717
+ acceptsResult: false
718
+ }],
719
+ toolDefinition: {
720
+ name: "withMemoryFromEmbeddingOverride",
721
+ description: "No description provided.",
722
+ schema: z.object({ "current": ResolvedCapabilities })
723
+ },
724
+ exported: true
725
+ }, __toolRegistry);
608
726
  async function __resolveCapabilities_impl(modelKey, provider, user) {
609
727
  const __setupData = setupFunction();
610
728
  const __stack = __setupData.stack;
@@ -2650,7 +2768,7 @@ const removeCapabilityField = __AgencyFunction.create({
2650
2768
  exported: true
2651
2769
  }, __toolRegistry);
2652
2770
  var stdin_default = graph;
2653
- const __sourceMap = { "dist/lib/agents/agency-agent/lib/capabilities.agency:providerLacksEmbeddings": { "1": { "line": 136, "col": 2 }, "2": { "line": 137, "col": 2 } }, "dist/lib/agents/agency-agent/lib/capabilities.agency:applyPatch": { "1": { "line": 147, "col": 2 }, "2": { "line": 150, "col": 2 }, "3": { "line": 153, "col": 2 }, "4": { "line": 156, "col": 2 }, "5": { "line": 160, "col": 2 }, "6": { "line": 164, "col": 2 }, "7": { "line": 168, "col": 2 }, "8": { "line": 172, "col": 2 }, "1.0": { "line": 148, "col": 4 }, "4.0": { "line": 157, "col": 4 }, "4.1": { "line": 158, "col": 4 }, "5.0": { "line": 161, "col": 4 }, "5.1": { "line": 162, "col": 4 }, "6.0": { "line": 165, "col": 4 }, "6.1": { "line": 166, "col": 4 }, "7.0": { "line": 169, "col": 4 }, "7.1": { "line": 170, "col": 4 } }, "dist/lib/agents/agency-agent/lib/capabilities.agency:resolveCapabilities": { "1": { "line": 187, "col": 2 }, "2": { "line": 198, "col": 2 }, "3": { "line": 199, "col": 2 }, "4": { "line": 200, "col": 2 }, "5": { "line": 203, "col": 2 }, "6": { "line": 204, "col": 2 }, "7": { "line": 207, "col": 2 }, "8": { "line": 208, "col": 2 }, "9": { "line": 211, "col": 2 }, "4.0": { "line": 201, "col": 4 }, "6.0": { "line": 205, "col": 4 }, "8.0": { "line": 209, "col": 4 } }, "dist/lib/agents/agency-agent/lib/capabilities.agency:sanitizePatch": { "1": { "line": 218, "col": 2 }, "2": { "line": 219, "col": 2 }, "3": { "line": 228, "col": 2 }, "4": { "line": 237, "col": 2 }, "5": { "line": 246, "col": 2 }, "6": { "line": 255, "col": 2 }, "2.0.0": { "line": 221, "col": 6 }, "2.0.1": { "line": 223, "col": 6 }, "2.0": { "line": 220, "col": 4 }, "3.0.0": { "line": 230, "col": 6 }, "3.0.1": { "line": 232, "col": 6 }, "3.0": { "line": 229, "col": 4 }, "4.0.0": { "line": 239, "col": 6 }, "4.0.1": { "line": 241, "col": 6 }, "4.0": { "line": 238, "col": 4 }, "5.0.0": { "line": 248, "col": 6 }, "5.0.1": { "line": 250, "col": 6 }, "5.0": { "line": 247, "col": 4 } }, "dist/lib/agents/agency-agent/lib/capabilities.agency:validCapabilityEntry": { "1": { "line": 265, "col": 2 }, "2": { "line": 271, "col": 2 }, "3": { "line": 277, "col": 2 }, "1.0": { "line": 266, "col": 4 }, "1.1": { "line": 269, "col": 4 }, "2.0": { "line": 272, "col": 4 }, "2.1": { "line": 275, "col": 4 } }, "dist/lib/agents/agency-agent/lib/capabilities.agency:sanitizeCapabilitySettings": { "1": { "line": 285, "col": 2 }, "2": { "line": 286, "col": 2 }, "3": { "line": 287, "col": 2 }, "4": { "line": 297, "col": 2 }, "5": { "line": 298, "col": 2 }, "6": { "line": 308, "col": 2 }, "7": { "line": 311, "col": 2 }, "3.0": { "line": 288, "col": 4 }, "3.1": { "line": 289, "col": 21 }, "3.2.0": { "line": 290, "col": 11 }, "3.2.1": { "line": 290, "col": 6 }, "3.2.2": { "line": 293, "col": 6 }, "3.2": { "line": 289, "col": 4 }, "3.3": { "line": 295, "col": 4 }, "5.0": { "line": 299, "col": 4 }, "5.1": { "line": 300, "col": 24 }, "5.2.0": { "line": 301, "col": 11 }, "5.2.1": { "line": 301, "col": 6 }, "5.2.2": { "line": 304, "col": 6 }, "5.2": { "line": 300, "col": 4 }, "5.3": { "line": 306, "col": 4 }, "6.0": { "line": 309, "col": 4 } }, "dist/lib/agents/agency-agent/lib/capabilities.agency:mergeCapabilityOverride": { "1": { "line": 323, "col": 2 }, "2": { "line": 326, "col": 2 }, "3": { "line": 337, "col": 2 }, "4": { "line": 355, "col": 2 }, "5": { "line": 356, "col": 2 }, "6": { "line": 361, "col": 2 }, "7": { "line": 362, "col": 2 }, "8": { "line": 365, "col": 2 }, "9": { "line": 369, "col": 2 }, "10": { "line": 370, "col": 2 }, "2.0": { "line": 327, "col": 4 }, "2.1.0": { "line": 329, "col": 6 }, "2.1": { "line": 328, "col": 4 }, "2.2": { "line": 331, "col": 4 }, "2.3": { "line": 335, "col": 4 }, "3.0": { "line": 338, "col": 4 }, "3.1.0": { "line": 340, "col": 6 }, "3.1": { "line": 339, "col": 4 }, "3.2": { "line": 344, "col": 4 }, "3.3.0": { "line": 346, "col": 6 }, "3.3": { "line": 345, "col": 4 }, "3.4": { "line": 348, "col": 4 }, "3.5": { "line": 352, "col": 4 }, "3.6": { "line": 353, "col": 4 }, "5.0": { "line": 357, "col": 4 }, "7.0": { "line": 363, "col": 4 } }, "dist/lib/agents/agency-agent/lib/capabilities.agency:patchFieldToNull": { "1": { "line": 379, "col": 2 }, "2": { "line": 382, "col": 2 }, "3": { "line": 385, "col": 2 }, "4": { "line": 388, "col": 2 }, "5": { "line": 391, "col": 2 }, "6": { "line": 394, "col": 2 }, "2.0": { "line": 383, "col": 4 }, "3.0": { "line": 386, "col": 4 }, "4.0": { "line": 389, "col": 4 }, "5.0": { "line": 392, "col": 4 } }, "dist/lib/agents/agency-agent/lib/capabilities.agency:patchIsEmpty": { "1": { "line": 399, "col": 2 } }, "dist/lib/agents/agency-agent/lib/capabilities.agency:recordWithout": { "1": { "line": 408, "col": 2 }, "2": { "line": 409, "col": 19 }, "3": { "line": 409, "col": 2 }, "4": { "line": 414, "col": 2 }, "3.0.0": { "line": 411, "col": 6 }, "3.0": { "line": 410, "col": 4 } }, "dist/lib/agents/agency-agent/lib/capabilities.agency:removeCapabilityField": { "1": { "line": 429, "col": 2 }, "2": { "line": 432, "col": 2 }, "3": { "line": 439, "col": 2 }, "4": { "line": 455, "col": 2 }, "5": { "line": 458, "col": 2 }, "6": { "line": 461, "col": 2 }, "7": { "line": 462, "col": 6 }, "8": { "line": 462, "col": 2 }, "9": { "line": 467, "col": 2 }, "10": { "line": 468, "col": 2 }, "2.0.0": { "line": 434, "col": 6 }, "2.0": { "line": 433, "col": 4 }, "2.1": { "line": 436, "col": 4 }, "2.2": { "line": 437, "col": 4 }, "3.0.0": { "line": 441, "col": 6 }, "3.0": { "line": 440, "col": 4 }, "3.1": { "line": 443, "col": 4 }, "3.2": { "line": 446, "col": 4 }, "3.3": { "line": 447, "col": 8 }, "3.4.0": { "line": 448, "col": 6 }, "3.4.1": { "line": 450, "col": 6 }, "3.4": { "line": 447, "col": 4 }, "3.5": { "line": 452, "col": 4 }, "3.6": { "line": 453, "col": 4 }, "4.0": { "line": 456, "col": 4 }, "8.0": { "line": 463, "col": 4 }, "8.1": { "line": 465, "col": 4 } } };
2771
+ const __sourceMap = { "dist/lib/agents/agency-agent/lib/capabilities.agency:providerLacksEmbeddings": { "1": { "line": 141, "col": 2 }, "2": { "line": 142, "col": 2 } }, "dist/lib/agents/agency-agent/lib/capabilities.agency:applyPatch": { "1": { "line": 152, "col": 2 }, "2": { "line": 155, "col": 2 }, "3": { "line": 158, "col": 2 }, "4": { "line": 161, "col": 2 }, "5": { "line": 165, "col": 2 }, "6": { "line": 169, "col": 2 }, "7": { "line": 173, "col": 2 }, "8": { "line": 177, "col": 2 }, "1.0": { "line": 153, "col": 4 }, "4.0": { "line": 162, "col": 4 }, "4.1": { "line": 163, "col": 4 }, "5.0": { "line": 166, "col": 4 }, "5.1": { "line": 167, "col": 4 }, "6.0": { "line": 170, "col": 4 }, "6.1": { "line": 171, "col": 4 }, "7.0": { "line": 174, "col": 4 }, "7.1": { "line": 175, "col": 4 } }, "dist/lib/agents/agency-agent/lib/capabilities.agency:withMemoryFromEmbeddingOverride": { "1": { "line": 189, "col": 2 } }, "dist/lib/agents/agency-agent/lib/capabilities.agency:resolveCapabilities": { "1": { "line": 201, "col": 2 }, "2": { "line": 212, "col": 2 }, "3": { "line": 213, "col": 2 }, "4": { "line": 214, "col": 2 }, "5": { "line": 217, "col": 2 }, "6": { "line": 218, "col": 2 }, "7": { "line": 221, "col": 2 }, "8": { "line": 222, "col": 2 }, "9": { "line": 225, "col": 2 }, "4.0": { "line": 215, "col": 4 }, "6.0": { "line": 219, "col": 4 }, "8.0": { "line": 223, "col": 4 } }, "dist/lib/agents/agency-agent/lib/capabilities.agency:sanitizePatch": { "1": { "line": 232, "col": 2 }, "2": { "line": 233, "col": 2 }, "3": { "line": 242, "col": 2 }, "4": { "line": 251, "col": 2 }, "5": { "line": 260, "col": 2 }, "6": { "line": 269, "col": 2 }, "2.0.0": { "line": 235, "col": 6 }, "2.0.1": { "line": 237, "col": 6 }, "2.0": { "line": 234, "col": 4 }, "3.0.0": { "line": 244, "col": 6 }, "3.0.1": { "line": 246, "col": 6 }, "3.0": { "line": 243, "col": 4 }, "4.0.0": { "line": 253, "col": 6 }, "4.0.1": { "line": 255, "col": 6 }, "4.0": { "line": 252, "col": 4 }, "5.0.0": { "line": 262, "col": 6 }, "5.0.1": { "line": 264, "col": 6 }, "5.0": { "line": 261, "col": 4 } }, "dist/lib/agents/agency-agent/lib/capabilities.agency:validCapabilityEntry": { "1": { "line": 279, "col": 2 }, "2": { "line": 285, "col": 2 }, "3": { "line": 291, "col": 2 }, "1.0": { "line": 280, "col": 4 }, "1.1": { "line": 283, "col": 4 }, "2.0": { "line": 286, "col": 4 }, "2.1": { "line": 289, "col": 4 } }, "dist/lib/agents/agency-agent/lib/capabilities.agency:sanitizeCapabilitySettings": { "1": { "line": 299, "col": 2 }, "2": { "line": 300, "col": 2 }, "3": { "line": 301, "col": 2 }, "4": { "line": 311, "col": 2 }, "5": { "line": 312, "col": 2 }, "6": { "line": 322, "col": 2 }, "7": { "line": 325, "col": 2 }, "3.0": { "line": 302, "col": 4 }, "3.1": { "line": 303, "col": 21 }, "3.2.0": { "line": 304, "col": 11 }, "3.2.1": { "line": 304, "col": 6 }, "3.2.2": { "line": 307, "col": 6 }, "3.2": { "line": 303, "col": 4 }, "3.3": { "line": 309, "col": 4 }, "5.0": { "line": 313, "col": 4 }, "5.1": { "line": 314, "col": 24 }, "5.2.0": { "line": 315, "col": 11 }, "5.2.1": { "line": 315, "col": 6 }, "5.2.2": { "line": 318, "col": 6 }, "5.2": { "line": 314, "col": 4 }, "5.3": { "line": 320, "col": 4 }, "6.0": { "line": 323, "col": 4 } }, "dist/lib/agents/agency-agent/lib/capabilities.agency:mergeCapabilityOverride": { "1": { "line": 337, "col": 2 }, "2": { "line": 340, "col": 2 }, "3": { "line": 351, "col": 2 }, "4": { "line": 369, "col": 2 }, "5": { "line": 370, "col": 2 }, "6": { "line": 375, "col": 2 }, "7": { "line": 376, "col": 2 }, "8": { "line": 379, "col": 2 }, "9": { "line": 383, "col": 2 }, "10": { "line": 384, "col": 2 }, "2.0": { "line": 341, "col": 4 }, "2.1.0": { "line": 343, "col": 6 }, "2.1": { "line": 342, "col": 4 }, "2.2": { "line": 345, "col": 4 }, "2.3": { "line": 349, "col": 4 }, "3.0": { "line": 352, "col": 4 }, "3.1.0": { "line": 354, "col": 6 }, "3.1": { "line": 353, "col": 4 }, "3.2": { "line": 358, "col": 4 }, "3.3.0": { "line": 360, "col": 6 }, "3.3": { "line": 359, "col": 4 }, "3.4": { "line": 362, "col": 4 }, "3.5": { "line": 366, "col": 4 }, "3.6": { "line": 367, "col": 4 }, "5.0": { "line": 371, "col": 4 }, "7.0": { "line": 377, "col": 4 } }, "dist/lib/agents/agency-agent/lib/capabilities.agency:patchFieldToNull": { "1": { "line": 393, "col": 2 }, "2": { "line": 396, "col": 2 }, "3": { "line": 399, "col": 2 }, "4": { "line": 402, "col": 2 }, "5": { "line": 405, "col": 2 }, "6": { "line": 408, "col": 2 }, "2.0": { "line": 397, "col": 4 }, "3.0": { "line": 400, "col": 4 }, "4.0": { "line": 403, "col": 4 }, "5.0": { "line": 406, "col": 4 } }, "dist/lib/agents/agency-agent/lib/capabilities.agency:patchIsEmpty": { "1": { "line": 413, "col": 2 } }, "dist/lib/agents/agency-agent/lib/capabilities.agency:recordWithout": { "1": { "line": 422, "col": 2 }, "2": { "line": 423, "col": 19 }, "3": { "line": 423, "col": 2 }, "4": { "line": 428, "col": 2 }, "3.0.0": { "line": 425, "col": 6 }, "3.0": { "line": 424, "col": 4 } }, "dist/lib/agents/agency-agent/lib/capabilities.agency:removeCapabilityField": { "1": { "line": 443, "col": 2 }, "2": { "line": 446, "col": 2 }, "3": { "line": 453, "col": 2 }, "4": { "line": 469, "col": 2 }, "5": { "line": 472, "col": 2 }, "6": { "line": 475, "col": 2 }, "7": { "line": 476, "col": 6 }, "8": { "line": 476, "col": 2 }, "9": { "line": 481, "col": 2 }, "10": { "line": 482, "col": 2 }, "2.0.0": { "line": 448, "col": 6 }, "2.0": { "line": 447, "col": 4 }, "2.1": { "line": 450, "col": 4 }, "2.2": { "line": 451, "col": 4 }, "3.0.0": { "line": 455, "col": 6 }, "3.0": { "line": 454, "col": 4 }, "3.1": { "line": 457, "col": 4 }, "3.2": { "line": 460, "col": 4 }, "3.3": { "line": 461, "col": 8 }, "3.4.0": { "line": 462, "col": 6 }, "3.4.1": { "line": 464, "col": 6 }, "3.4": { "line": 461, "col": 4 }, "3.5": { "line": 466, "col": 4 }, "3.6": { "line": 467, "col": 4 }, "4.0": { "line": 470, "col": 4 }, "8.0": { "line": 477, "col": 4 }, "8.1": { "line": 479, "col": 4 } } };
2654
2772
  export {
2655
2773
  CAPABILITY_DEFAULT,
2656
2774
  CAPABILITY_FIELDS,
@@ -2693,5 +2811,6 @@ export {
2693
2811
  rewindFrom,
2694
2812
  sanitizeCapabilitySettings,
2695
2813
  sanitizePatch,
2696
- validCapabilityEntry
2814
+ validCapabilityEntry,
2815
+ withMemoryFromEmbeddingOverride
2697
2816
  };
@@ -48,6 +48,9 @@ def capabilitySourceLabel(source: string): string {
48
48
  if (source == "user-provider") {
49
49
  return "your override for ${getCapabilityProvider()}"
50
50
  }
51
+ if (source == "embedding-override") {
52
+ return "on: the embedding slot names a model"
53
+ }
51
54
  return "your override for ${getCapabilityModelKey()}"
52
55
  }
53
56
 
@@ -244,7 +247,7 @@ export def editCapabilities() {
244
247
  if (status.state == "no-override" && providerLacksEmbeddings(getCapabilityProvider())) {
245
248
  pushMessage(
246
249
  color.dim(
247
- "Note: ${getCapabilityProvider()} has no embeddings endpoint, so Tier-2 semantic recall stays off. Point the embedding slot at a provider that has one, e.g. /model embedding=openai/text-embedding-3-small.",
250
+ "Note: ${getCapabilityProvider()} has no embeddings endpoint, so Tier-2 semantic recall stays off. Point the embedding slot at a provider that has one, e.g. /model embedding=openai/text-embedding-3-small, or a served local model, e.g. /model embedding=mlx/qwen3-embedding-4b-mlx.",
248
251
  ),
249
252
  )
250
253
  }
@@ -160,7 +160,7 @@ function registerTools(tools) {
160
160
  }
161
161
  }
162
162
  }
163
- __registerModuleFingerprint("dist/lib/agents/agency-agent/lib/capabilitiesUi.agency", "f5f606cdd17099df3520cc75cf5d7e5996d9b4a20ee2f8da9fc265baebf298a4", import.meta.url);
163
+ __registerModuleFingerprint("dist/lib/agents/agency-agent/lib/capabilitiesUi.agency", "816c53a3747a39740a7dbbf20063297d6cfe22be4cfe55eb53c8e9d5dfc8c241", import.meta.url);
164
164
  __registerTool(print);
165
165
  __registerTool(printJSON);
166
166
  __registerTool(input);
@@ -372,7 +372,19 @@ async function __capabilitySourceLabel_impl(source) {
372
372
  }
373
373
  }
374
374
  ]);
375
- await runner.step(6, async (runner2) => {
375
+ await runner.ifElse(6, [
376
+ {
377
+ condition: async () => __eq(__stack.args.source, `embedding-override`),
378
+ body: async (runner2) => {
379
+ await runner2.step(0, async (runner3) => {
380
+ __functionCompleted = true;
381
+ runner3.halt(`on: the embedding slot names a model`);
382
+ return;
383
+ });
384
+ }
385
+ }
386
+ ]);
387
+ await runner.step(7, async (runner2) => {
376
388
  __stack.locals.__hoist_3 = await __call(getCapabilityModelKey, {
377
389
  type: "positional",
378
390
  args: []
@@ -387,7 +399,7 @@ async function __capabilitySourceLabel_impl(source) {
387
399
  return;
388
400
  }
389
401
  });
390
- await runner.step(7, async (runner2) => {
402
+ await runner.step(8, async (runner2) => {
391
403
  __functionCompleted = true;
392
404
  runner2.halt(`your override for ${__stack.locals.__hoist_3}`);
393
405
  return;
@@ -2098,7 +2110,7 @@ async function __editCapabilities_impl() {
2098
2110
  await runner5.step(1, async (runner6) => {
2099
2111
  __stack.locals.__hoist_3 = await __callMethod(color, "dim", {
2100
2112
  type: "positional",
2101
- args: [`Note: ${__stack.locals.__hoist_2} has no embeddings endpoint, so Tier-2 semantic recall stays off. Point the embedding slot at a provider that has one, e.g. /model embedding=openai/text-embedding-3-small.`]
2113
+ args: [`Note: ${__stack.locals.__hoist_2} has no embeddings endpoint, so Tier-2 semantic recall stays off. Point the embedding slot at a provider that has one, e.g. /model embedding=openai/text-embedding-3-small, or a served local model, e.g. /model embedding=mlx/qwen3-embedding-4b-mlx.`]
2102
2114
  });
2103
2115
  });
2104
2116
  await runner5.step(2, async (runner6) => {
@@ -2578,7 +2590,7 @@ const editCapabilities = __AgencyFunction.create({
2578
2590
  exported: true
2579
2591
  }, __toolRegistry);
2580
2592
  var stdin_default = graph;
2581
- const __sourceMap = { "dist/lib/agents/agency-agent/lib/capabilitiesUi.agency:capabilitySourceLabel": { "1": { "line": 35, "col": 2 }, "2": { "line": 38, "col": 2 }, "3": { "line": 41, "col": 2 }, "4": { "line": 44, "col": 2 }, "5": { "line": 47, "col": 2 }, "6": { "line": 50, "col": 30 }, "7": { "line": 50, "col": 2 }, "1.0": { "line": 36, "col": 4 }, "2.0": { "line": 39, "col": 32 }, "2.1": { "line": 39, "col": 4 }, "3.0": { "line": 42, "col": 27 }, "3.1": { "line": 42, "col": 4 }, "4.0": { "line": 45, "col": 4 }, "5.0": { "line": 48, "col": 32 }, "5.1": { "line": 48, "col": 4 } }, "dist/lib/agents/agency-agent/lib/capabilitiesUi.agency:capabilityRow": { "1": { "line": 56, "col": 2 }, "2": { "line": 57, "col": 2 }, "3": { "line": 58, "col": 2 }, "4": { "line": 59, "col": 2 }, "5": { "line": 62, "col": 2 }, "6": { "line": 65, "col": 2 }, "7": { "line": 68, "col": 2 }, "8": { "line": 69, "col": 2 }, "9": { "line": 72, "col": 22 }, "10": { "line": 72, "col": 2 }, "4.0": { "line": 60, "col": 34 }, "4.1": { "line": 60, "col": 4 }, "5.0": { "line": 63, "col": 37 }, "5.1": { "line": 63, "col": 4 }, "6.0": { "line": 66, "col": 34 }, "6.1": { "line": 66, "col": 4 }, "8.0": { "line": 70, "col": 4 } }, "dist/lib/agents/agency-agent/lib/capabilitiesUi.agency:showCapabilities": { "1": { "line": 78, "col": 24 }, "2": { "line": 78, "col": 52 }, "3": { "line": 77, "col": 2 }, "4": { "line": 80, "col": 2 }, "4.0": { "line": 81, "col": 38 }, "4.1": { "line": 81, "col": 4 } }, "dist/lib/agents/agency-agent/lib/capabilitiesUi.agency:scopeTargetName": { "1": { "line": 87, "col": 2 }, "2": { "line": 90, "col": 2 }, "1.0": { "line": 88, "col": 4 } }, "dist/lib/agents/agency-agent/lib/capabilitiesUi.agency:saveCapabilityOverride": { "1": { "line": 95, "col": 2 }, "2": { "line": 97, "col": 4 }, "3": { "line": 99, "col": 4 }, "4": { "line": 96, "col": 2 }, "5": { "line": 102, "col": 2 }, "6": { "line": 103, "col": 22 }, "7": { "line": 103, "col": 47 }, "8": { "line": 103, "col": 2 } }, "dist/lib/agents/agency-agent/lib/capabilitiesUi.agency:removeCapabilityOverride": { "1": { "line": 108, "col": 2 }, "2": { "line": 110, "col": 4 }, "3": { "line": 112, "col": 4 }, "4": { "line": 109, "col": 2 }, "5": { "line": 115, "col": 2 }, "6": { "line": 116, "col": 22 }, "7": { "line": 116, "col": 47 }, "8": { "line": 116, "col": 2 } }, "dist/lib/agents/agency-agent/lib/capabilitiesUi.agency:pickOverrideScope": { "1": { "line": 121, "col": 2 }, "2": { "line": 122, "col": 2 }, "3": { "line": 128, "col": 2 }, "4": { "line": 134, "col": 2 }, "5": { "line": 138, "col": 2 }, "6": { "line": 144, "col": 2 }, "7": { "line": 147, "col": 2 }, "6.0": { "line": 145, "col": 4 } }, "dist/lib/agents/agency-agent/lib/capabilitiesUi.agency:applyLiveMaxTokens": { "2": { "line": 154, "col": 2 }, "3": { "line": 155, "col": 2 }, "3.0": { "line": 156, "col": 4 } }, "dist/lib/agents/agency-agent/lib/capabilitiesUi.agency:editCapabilities": { "1": { "line": 164, "col": 2 }, "2": { "line": 165, "col": 2 }, "3": { "line": 173, "col": 2 }, "4": { "line": 179, "col": 2 }, "5": { "line": 183, "col": 2 }, "6": { "line": 184, "col": 2 }, "7": { "line": 211, "col": 2 }, "8": { "line": 253, "col": 2 }, "9": { "line": 292, "col": 2 }, "10": { "line": 293, "col": 2 }, "11": { "line": 296, "col": 2 }, "12": { "line": 299, "col": 2 }, "13": { "line": 317, "col": 2 }, "14": { "line": 320, "col": 2 }, "15": { "line": 327, "col": 2 }, "16": { "line": 328, "col": 2 }, "2.0": { "line": 166, "col": 4 }, "4.0": { "line": 180, "col": 4 }, "6.0": { "line": 185, "col": 4 }, "6.1": { "line": 186, "col": 4 }, "6.2": { "line": 192, "col": 4 }, "6.3": { "line": 198, "col": 4 }, "6.4.0": { "line": 205, "col": 6 }, "6.4": { "line": 204, "col": 4 }, "6.5": { "line": 207, "col": 4 }, "7.0": { "line": 212, "col": 4 }, "7.1": { "line": 213, "col": 4 }, "7.2": { "line": 217, "col": 4 }, "7.3": { "line": 221, "col": 4 }, "7.4.0": { "line": 223, "col": 6 }, "7.4": { "line": 222, "col": 4 }, "7.5.0": { "line": 226, "col": 6 }, "7.5.1": { "line": 230, "col": 6 }, "7.5.2.0": { "line": 234, "col": 42 }, "7.5.2.1": { "line": 234, "col": 8 }, "7.5.2.2.0": { "line": 237, "col": 12 }, "7.5.2.2.1": { "line": 236, "col": 10 }, "7.5.2.2.2": { "line": 241, "col": 10 }, "7.5.2.2": { "line": 235, "col": 8 }, "7.5.2.3.0": { "line": 246, "col": 21 }, "7.5.2.3.1": { "line": 245, "col": 12 }, "7.5.2.3.2": { "line": 244, "col": 10 }, "7.5.2.3": { "line": 243, "col": 8 }, "7.5.2": { "line": 233, "col": 6 }, "7.5": { "line": 225, "col": 4 }, "8.0": { "line": 254, "col": 4 }, "8.1": { "line": 255, "col": 4 }, "8.2": { "line": 261, "col": 4 }, "8.3.0": { "line": 269, "col": 6 }, "8.3": { "line": 268, "col": 4 }, "8.4.0": { "line": 272, "col": 6 }, "8.4.1.0": { "line": 274, "col": 8 }, "8.4.1": { "line": 273, "col": 6 }, "8.4.2": { "line": 276, "col": 6 }, "8.4.3": { "line": 277, "col": 6 }, "8.4.4": { "line": 278, "col": 6 }, "8.4.5": { "line": 279, "col": 6 }, "8.4.6": { "line": 280, "col": 6 }, "8.4": { "line": 271, "col": 4 }, "8.5": { "line": 282, "col": 4 }, "8.6.0": { "line": 284, "col": 18 }, "8.6.1": { "line": 284, "col": 6 }, "8.6.2": { "line": 285, "col": 6 }, "8.6": { "line": 283, "col": 4 }, "8.7": { "line": 287, "col": 4 }, "10.0": { "line": 294, "col": 4 }, "12.1.1": { "line": 309, "col": 8 }, "12.1.2": { "line": 308, "col": 6 }, "12.1.3": { "line": 314, "col": 6 }, "12.1": { "line": 300, "col": 4 }, "13.0": { "line": 318, "col": 4 }, "14.0": { "line": 322, "col": 6 }, "14.1": { "line": 321, "col": 4 } } };
2593
+ const __sourceMap = { "dist/lib/agents/agency-agent/lib/capabilitiesUi.agency:capabilitySourceLabel": { "1": { "line": 35, "col": 2 }, "2": { "line": 38, "col": 2 }, "3": { "line": 41, "col": 2 }, "4": { "line": 44, "col": 2 }, "5": { "line": 47, "col": 2 }, "6": { "line": 50, "col": 2 }, "7": { "line": 53, "col": 30 }, "8": { "line": 53, "col": 2 }, "1.0": { "line": 36, "col": 4 }, "2.0": { "line": 39, "col": 32 }, "2.1": { "line": 39, "col": 4 }, "3.0": { "line": 42, "col": 27 }, "3.1": { "line": 42, "col": 4 }, "4.0": { "line": 45, "col": 4 }, "5.0": { "line": 48, "col": 32 }, "5.1": { "line": 48, "col": 4 }, "6.0": { "line": 51, "col": 4 } }, "dist/lib/agents/agency-agent/lib/capabilitiesUi.agency:capabilityRow": { "1": { "line": 59, "col": 2 }, "2": { "line": 60, "col": 2 }, "3": { "line": 61, "col": 2 }, "4": { "line": 62, "col": 2 }, "5": { "line": 65, "col": 2 }, "6": { "line": 68, "col": 2 }, "7": { "line": 71, "col": 2 }, "8": { "line": 72, "col": 2 }, "9": { "line": 75, "col": 22 }, "10": { "line": 75, "col": 2 }, "4.0": { "line": 63, "col": 34 }, "4.1": { "line": 63, "col": 4 }, "5.0": { "line": 66, "col": 37 }, "5.1": { "line": 66, "col": 4 }, "6.0": { "line": 69, "col": 34 }, "6.1": { "line": 69, "col": 4 }, "8.0": { "line": 73, "col": 4 } }, "dist/lib/agents/agency-agent/lib/capabilitiesUi.agency:showCapabilities": { "1": { "line": 81, "col": 24 }, "2": { "line": 81, "col": 52 }, "3": { "line": 80, "col": 2 }, "4": { "line": 83, "col": 2 }, "4.0": { "line": 84, "col": 38 }, "4.1": { "line": 84, "col": 4 } }, "dist/lib/agents/agency-agent/lib/capabilitiesUi.agency:scopeTargetName": { "1": { "line": 90, "col": 2 }, "2": { "line": 93, "col": 2 }, "1.0": { "line": 91, "col": 4 } }, "dist/lib/agents/agency-agent/lib/capabilitiesUi.agency:saveCapabilityOverride": { "1": { "line": 98, "col": 2 }, "2": { "line": 100, "col": 4 }, "3": { "line": 102, "col": 4 }, "4": { "line": 99, "col": 2 }, "5": { "line": 105, "col": 2 }, "6": { "line": 106, "col": 22 }, "7": { "line": 106, "col": 47 }, "8": { "line": 106, "col": 2 } }, "dist/lib/agents/agency-agent/lib/capabilitiesUi.agency:removeCapabilityOverride": { "1": { "line": 111, "col": 2 }, "2": { "line": 113, "col": 4 }, "3": { "line": 115, "col": 4 }, "4": { "line": 112, "col": 2 }, "5": { "line": 118, "col": 2 }, "6": { "line": 119, "col": 22 }, "7": { "line": 119, "col": 47 }, "8": { "line": 119, "col": 2 } }, "dist/lib/agents/agency-agent/lib/capabilitiesUi.agency:pickOverrideScope": { "1": { "line": 124, "col": 2 }, "2": { "line": 125, "col": 2 }, "3": { "line": 131, "col": 2 }, "4": { "line": 137, "col": 2 }, "5": { "line": 141, "col": 2 }, "6": { "line": 147, "col": 2 }, "7": { "line": 150, "col": 2 }, "6.0": { "line": 148, "col": 4 } }, "dist/lib/agents/agency-agent/lib/capabilitiesUi.agency:applyLiveMaxTokens": { "2": { "line": 157, "col": 2 }, "3": { "line": 158, "col": 2 }, "3.0": { "line": 159, "col": 4 } }, "dist/lib/agents/agency-agent/lib/capabilitiesUi.agency:editCapabilities": { "1": { "line": 167, "col": 2 }, "2": { "line": 168, "col": 2 }, "3": { "line": 176, "col": 2 }, "4": { "line": 182, "col": 2 }, "5": { "line": 186, "col": 2 }, "6": { "line": 187, "col": 2 }, "7": { "line": 214, "col": 2 }, "8": { "line": 256, "col": 2 }, "9": { "line": 295, "col": 2 }, "10": { "line": 296, "col": 2 }, "11": { "line": 299, "col": 2 }, "12": { "line": 302, "col": 2 }, "13": { "line": 320, "col": 2 }, "14": { "line": 323, "col": 2 }, "15": { "line": 330, "col": 2 }, "16": { "line": 331, "col": 2 }, "2.0": { "line": 169, "col": 4 }, "4.0": { "line": 183, "col": 4 }, "6.0": { "line": 188, "col": 4 }, "6.1": { "line": 189, "col": 4 }, "6.2": { "line": 195, "col": 4 }, "6.3": { "line": 201, "col": 4 }, "6.4.0": { "line": 208, "col": 6 }, "6.4": { "line": 207, "col": 4 }, "6.5": { "line": 210, "col": 4 }, "7.0": { "line": 215, "col": 4 }, "7.1": { "line": 216, "col": 4 }, "7.2": { "line": 220, "col": 4 }, "7.3": { "line": 224, "col": 4 }, "7.4.0": { "line": 226, "col": 6 }, "7.4": { "line": 225, "col": 4 }, "7.5.0": { "line": 229, "col": 6 }, "7.5.1": { "line": 233, "col": 6 }, "7.5.2.0": { "line": 237, "col": 42 }, "7.5.2.1": { "line": 237, "col": 8 }, "7.5.2.2.0": { "line": 240, "col": 12 }, "7.5.2.2.1": { "line": 239, "col": 10 }, "7.5.2.2.2": { "line": 244, "col": 10 }, "7.5.2.2": { "line": 238, "col": 8 }, "7.5.2.3.0": { "line": 249, "col": 21 }, "7.5.2.3.1": { "line": 248, "col": 12 }, "7.5.2.3.2": { "line": 247, "col": 10 }, "7.5.2.3": { "line": 246, "col": 8 }, "7.5.2": { "line": 236, "col": 6 }, "7.5": { "line": 228, "col": 4 }, "8.0": { "line": 257, "col": 4 }, "8.1": { "line": 258, "col": 4 }, "8.2": { "line": 264, "col": 4 }, "8.3.0": { "line": 272, "col": 6 }, "8.3": { "line": 271, "col": 4 }, "8.4.0": { "line": 275, "col": 6 }, "8.4.1.0": { "line": 277, "col": 8 }, "8.4.1": { "line": 276, "col": 6 }, "8.4.2": { "line": 279, "col": 6 }, "8.4.3": { "line": 280, "col": 6 }, "8.4.4": { "line": 281, "col": 6 }, "8.4.5": { "line": 282, "col": 6 }, "8.4.6": { "line": 283, "col": 6 }, "8.4": { "line": 274, "col": 4 }, "8.5": { "line": 285, "col": 4 }, "8.6.0": { "line": 287, "col": 18 }, "8.6.1": { "line": 287, "col": 6 }, "8.6.2": { "line": 288, "col": 6 }, "8.6": { "line": 286, "col": 4 }, "8.7": { "line": 290, "col": 4 }, "10.0": { "line": 297, "col": 4 }, "12.1.1": { "line": 312, "col": 8 }, "12.1.2": { "line": 311, "col": 6 }, "12.1.3": { "line": 317, "col": 6 }, "12.1": { "line": 303, "col": 4 }, "13.0": { "line": 321, "col": 4 }, "14.0": { "line": 325, "col": 6 }, "14.1": { "line": 324, "col": 4 } } };
2582
2594
  export {
2583
2595
  __getCheckpoints,
2584
2596
  __invokeFunction,
@@ -68,6 +68,11 @@ static const BASE_URL_PROVIDERS: Record<string, string> = {
68
68
  litellm: "LITELLM_BASE_URL"
69
69
  }
70
70
 
71
+ /** Providers that run on this machine. They need no key and no base URL,
72
+ * and they appear in the embedding slot as mlx/<model> or
73
+ * llama-cpp/<model>. */
74
+ export static const LOCAL_PROVIDERS: string[] = ["mlx", "llama-cpp"]
75
+
71
76
  /** The first env var the provider requires that the environment leaves
72
77
  * unset or empty, or "" when the provider is fully configured. Checks the
73
78
  * API-key var, then the base-URL var for proxy providers. A truly-custom
@@ -356,7 +361,7 @@ export def priceDefault(
356
361
  base-URL proxy providers. Source-of-truth derived (MODELS + BASE_URL_PROVIDERS),
357
362
  not a hand-maintained list, so it never drifts. Used by parseModelSpec. */
358
363
  export def knownProviders(): string[] {
359
- return [...Object.keys(MODELS), ...Object.keys(BASE_URL_PROVIDERS)]
364
+ return [...Object.keys(MODELS), ...Object.keys(BASE_URL_PROVIDERS), ...LOCAL_PROVIDERS]
360
365
  }
361
366
 
362
367
  /** Split a --model value: `slot=model` becomes per-slot (alias-resolved); a bare
@@ -163,7 +163,7 @@ function registerTools(tools) {
163
163
  }
164
164
  }
165
165
  }
166
- __registerModuleFingerprint("dist/lib/agents/agency-agent/lib/models.agency", "c0b4cccd3263ce536642e554b169f6b08c2458f0543afb28436bbd2cbe0f6b1e", import.meta.url);
166
+ __registerModuleFingerprint("dist/lib/agents/agency-agent/lib/models.agency", "b8e9096df53dbbcaa1cd6e2ce645212b581e8e3b656693798d228822048807d4", import.meta.url);
167
167
  __registerTool(print);
168
168
  __registerTool(printJSON);
169
169
  __registerTool(input);
@@ -204,6 +204,7 @@ __registerTool(canonicalSlot);
204
204
  let __staticInitPromise = null;
205
205
  let MODELS = __UNINIT_STATIC;
206
206
  let BASE_URL_PROVIDERS = __UNINIT_STATIC;
207
+ let LOCAL_PROVIDERS = __UNINIT_STATIC;
207
208
  async function __initializeStatic(__ctx) {
208
209
  if (__staticInitPromise) {
209
210
  return __staticInitPromise;
@@ -234,13 +235,15 @@ async function __initializeStatic(__ctx) {
234
235
  BASE_URL_PROVIDERS = __deepFreeze({
235
236
  "litellm": `LITELLM_BASE_URL`
236
237
  });
238
+ LOCAL_PROVIDERS = __deepFreeze([`mlx`, `llama-cpp`]);
237
239
  })();
238
240
  return __staticInitPromise;
239
241
  }
240
242
  function __getStaticVars() {
241
243
  return {
242
244
  MODELS,
243
- BASE_URL_PROVIDERS
245
+ BASE_URL_PROVIDERS,
246
+ LOCAL_PROVIDERS
244
247
  };
245
248
  }
246
249
  __globalCtx.getStaticVars = __getStaticVars;
@@ -1920,7 +1923,7 @@ async function __knownProviders_impl() {
1920
1923
  });
1921
1924
  await runner.step(3, async (runner2) => {
1922
1925
  __functionCompleted = true;
1923
- runner2.halt([...__stack.locals.__hoist_0, ...__stack.locals.__hoist_1]);
1926
+ runner2.halt([...__stack.locals.__hoist_0, ...__stack.locals.__hoist_1, ...__readStatic(LOCAL_PROVIDERS, "LOCAL_PROVIDERS", "dist/lib/agents/agency-agent/lib/models.agency")]);
1924
1927
  return;
1925
1928
  });
1926
1929
  });
@@ -2151,8 +2154,9 @@ const parseModelFlag = __AgencyFunction.create({
2151
2154
  exported: true
2152
2155
  }, __toolRegistry);
2153
2156
  var stdin_default = graph;
2154
- const __sourceMap = { "dist/lib/agents/agency-agent/lib/models.agency:missingProviderEnvVar": { "1": { "line": 77, "col": 2 }, "2": { "line": 78, "col": 2 }, "3": { "line": 84, "col": 2 }, "4": { "line": 85, "col": 2 }, "5": { "line": 91, "col": 2 }, "2.0.0": { "line": 79, "col": 4 }, "2.0": { "line": 79, "col": 4 }, "2.1.0": { "line": 81, "col": 6 }, "2.1": { "line": 80, "col": 4 }, "4.0.0": { "line": 86, "col": 4 }, "4.0": { "line": 86, "col": 4 }, "4.1.0": { "line": 88, "col": 6 }, "4.1": { "line": 87, "col": 4 } }, "dist/lib/agents/agency-agent/lib/models.agency:checkProviderEnv": { "1": { "line": 97, "col": 2 }, "2": { "line": 98, "col": 2 }, "3": { "line": 101, "col": 17 }, "4": { "line": 101, "col": 2 }, "5": { "line": 104, "col": 2 }, "2.0": { "line": 99, "col": 4 }, "4.0": { "line": 102, "col": 4 } }, "dist/lib/agents/agency-agent/lib/models.agency:embeddingSpecHasProvider": { "1": { "line": 113, "col": 38 }, "3": { "line": 113, "col": 2 } }, "dist/lib/agents/agency-agent/lib/models.agency:agentProvider": { "1": { "line": 120, "col": 2 }, "2": { "line": 123, "col": 2 }, "1.0": { "line": 121, "col": 4 } }, "dist/lib/agents/agency-agent/lib/models.agency:resolveDetected": { "1": { "line": 162, "col": 2 }, "2": { "line": 163, "col": 2 }, "3": { "line": 165, "col": 2 }, "4": { "line": 181, "col": 2 }, "6": { "line": 187, "col": 2 }, "3.1.0": { "line": 170, "col": 6 }, "3.1.1": { "line": 172, "col": 133 }, "3.1.2": { "line": 171, "col": 6 }, "3.1": { "line": 169, "col": 4 }, "3.3": { "line": 178, "col": 4 }, "4.1": { "line": 184, "col": 4 } }, "dist/lib/agents/agency-agent/lib/models.agency:planModels": { "1": { "line": 207, "col": 2 }, "2": { "line": 208, "col": 2 }, "3": { "line": 216, "col": 2 }, "4": { "line": 217, "col": 2 }, "5": { "line": 218, "col": 2 }, "7": { "line": 238, "col": 18 }, "8": { "line": 240, "col": 18 }, "9": { "line": 236, "col": 2 }, "2.0.0": { "line": 210, "col": 6 }, "2.0.1": { "line": 212, "col": 6 }, "2.0": { "line": 209, "col": 4 }, "5.0": { "line": 219, "col": 4 }, "5.1": { "line": 220, "col": 4 }, "5.2": { "line": 222, "col": 4 }, "5.3": { "line": 223, "col": 4 }, "5.4": { "line": 225, "col": 4 }, "5.5": { "line": 226, "col": 4 } }, "dist/lib/agents/agency-agent/lib/models.agency:parseModelSpec": { "1": { "line": 259, "col": 2 }, "2": { "line": 265, "col": 2 }, "3": { "line": 266, "col": 2 }, "4": { "line": 272, "col": 2 }, "5": { "line": 273, "col": 6 }, "6": { "line": 273, "col": 2 }, "7": { "line": 279, "col": 2 }, "1.0": { "line": 260, "col": 4 }, "3.0": { "line": 267, "col": 4 }, "6.0": { "line": 275, "col": 13 }, "6.1": { "line": 274, "col": 4 } }, "dist/lib/agents/agency-agent/lib/models.agency:priceDefault": { "2": { "line": 308, "col": 6 }, "3": { "line": 308, "col": 2 }, "4": { "line": 317, "col": 2 }, "5": { "line": 322, "col": 2 }, "6": { "line": 323, "col": 2 }, "7": { "line": 324, "col": 2 }, "8": { "line": 333, "col": 2 }, "9": { "line": 342, "col": 2 }, "10": { "line": 351, "col": 2 }, "3.0": { "line": 309, "col": 4 }, "4.0": { "line": 318, "col": 4 }, "7.0": { "line": 325, "col": 4 }, "8.0": { "line": 334, "col": 4 }, "9.0": { "line": 343, "col": 4 } }, "dist/lib/agents/agency-agent/lib/models.agency:knownProviders": { "1": { "line": 358, "col": 13 }, "2": { "line": 358, "col": 37 }, "3": { "line": 358, "col": 2 } }, "dist/lib/agents/agency-agent/lib/models.agency:parseModelFlag": { "1": { "line": 366, "col": 2 }, "2": { "line": 367, "col": 2 }, "3": { "line": 368, "col": 2 }, "4": { "line": 374, "col": 2 }, "3.0": { "line": 370, "col": 26 }, "3.1": { "line": 370, "col": 12 }, "3.2": { "line": 371, "col": 13 }, "3.3": { "line": 369, "col": 4 } } };
2157
+ const __sourceMap = { "dist/lib/agents/agency-agent/lib/models.agency:missingProviderEnvVar": { "1": { "line": 82, "col": 2 }, "2": { "line": 83, "col": 2 }, "3": { "line": 89, "col": 2 }, "4": { "line": 90, "col": 2 }, "5": { "line": 96, "col": 2 }, "2.0.0": { "line": 84, "col": 4 }, "2.0": { "line": 84, "col": 4 }, "2.1.0": { "line": 86, "col": 6 }, "2.1": { "line": 85, "col": 4 }, "4.0.0": { "line": 91, "col": 4 }, "4.0": { "line": 91, "col": 4 }, "4.1.0": { "line": 93, "col": 6 }, "4.1": { "line": 92, "col": 4 } }, "dist/lib/agents/agency-agent/lib/models.agency:checkProviderEnv": { "1": { "line": 102, "col": 2 }, "2": { "line": 103, "col": 2 }, "3": { "line": 106, "col": 17 }, "4": { "line": 106, "col": 2 }, "5": { "line": 109, "col": 2 }, "2.0": { "line": 104, "col": 4 }, "4.0": { "line": 107, "col": 4 } }, "dist/lib/agents/agency-agent/lib/models.agency:embeddingSpecHasProvider": { "1": { "line": 118, "col": 38 }, "3": { "line": 118, "col": 2 } }, "dist/lib/agents/agency-agent/lib/models.agency:agentProvider": { "1": { "line": 125, "col": 2 }, "2": { "line": 128, "col": 2 }, "1.0": { "line": 126, "col": 4 } }, "dist/lib/agents/agency-agent/lib/models.agency:resolveDetected": { "1": { "line": 167, "col": 2 }, "2": { "line": 168, "col": 2 }, "3": { "line": 170, "col": 2 }, "4": { "line": 186, "col": 2 }, "6": { "line": 192, "col": 2 }, "3.1.0": { "line": 175, "col": 6 }, "3.1.1": { "line": 177, "col": 133 }, "3.1.2": { "line": 176, "col": 6 }, "3.1": { "line": 174, "col": 4 }, "3.3": { "line": 183, "col": 4 }, "4.1": { "line": 189, "col": 4 } }, "dist/lib/agents/agency-agent/lib/models.agency:planModels": { "1": { "line": 212, "col": 2 }, "2": { "line": 213, "col": 2 }, "3": { "line": 221, "col": 2 }, "4": { "line": 222, "col": 2 }, "5": { "line": 223, "col": 2 }, "7": { "line": 243, "col": 18 }, "8": { "line": 245, "col": 18 }, "9": { "line": 241, "col": 2 }, "2.0.0": { "line": 215, "col": 6 }, "2.0.1": { "line": 217, "col": 6 }, "2.0": { "line": 214, "col": 4 }, "5.0": { "line": 224, "col": 4 }, "5.1": { "line": 225, "col": 4 }, "5.2": { "line": 227, "col": 4 }, "5.3": { "line": 228, "col": 4 }, "5.4": { "line": 230, "col": 4 }, "5.5": { "line": 231, "col": 4 } }, "dist/lib/agents/agency-agent/lib/models.agency:parseModelSpec": { "1": { "line": 264, "col": 2 }, "2": { "line": 270, "col": 2 }, "3": { "line": 271, "col": 2 }, "4": { "line": 277, "col": 2 }, "5": { "line": 278, "col": 6 }, "6": { "line": 278, "col": 2 }, "7": { "line": 284, "col": 2 }, "1.0": { "line": 265, "col": 4 }, "3.0": { "line": 272, "col": 4 }, "6.0": { "line": 280, "col": 13 }, "6.1": { "line": 279, "col": 4 } }, "dist/lib/agents/agency-agent/lib/models.agency:priceDefault": { "2": { "line": 313, "col": 6 }, "3": { "line": 313, "col": 2 }, "4": { "line": 322, "col": 2 }, "5": { "line": 327, "col": 2 }, "6": { "line": 328, "col": 2 }, "7": { "line": 329, "col": 2 }, "8": { "line": 338, "col": 2 }, "9": { "line": 347, "col": 2 }, "10": { "line": 356, "col": 2 }, "3.0": { "line": 314, "col": 4 }, "4.0": { "line": 323, "col": 4 }, "7.0": { "line": 330, "col": 4 }, "8.0": { "line": 339, "col": 4 }, "9.0": { "line": 348, "col": 4 } }, "dist/lib/agents/agency-agent/lib/models.agency:knownProviders": { "1": { "line": 363, "col": 13 }, "2": { "line": 363, "col": 37 }, "3": { "line": 363, "col": 2 } }, "dist/lib/agents/agency-agent/lib/models.agency:parseModelFlag": { "1": { "line": 371, "col": 2 }, "2": { "line": 372, "col": 2 }, "3": { "line": 373, "col": 2 }, "4": { "line": 379, "col": 2 }, "3.0": { "line": 375, "col": 26 }, "3.1": { "line": 375, "col": 12 }, "3.2": { "line": 376, "col": 13 }, "3.3": { "line": 374, "col": 4 } } };
2155
2158
  export {
2159
+ LOCAL_PROVIDERS,
2156
2160
  MODELS,
2157
2161
  ModelPlan,
2158
2162
  ModelSpec,
@@ -47,6 +47,9 @@ import {
47
47
  configureLocalModel,
48
48
  getResolvedSlots,
49
49
  getCapabilities,
50
+ getCapabilitiesResolved,
51
+ markMemoryEnabledByOverride,
52
+ resolveLocalEmbeddingSlot,
50
53
  embeddingKeyStatus,
51
54
  memoryEnablePlan,
52
55
  enableAgentMemory,
@@ -72,11 +75,15 @@ export def markMemoryEmbeddingsPinned(pinned: boolean) {
72
75
  // Persistent knowledge graph, gated on the capability profile.
73
76
  export def maybeEnableMemory() {
74
77
  const status = embeddingKeyStatus(getResolvedSlots())
75
- const plan = memoryEnablePlan(getCapabilities().memory, status)
78
+ const capabilities = getCapabilitiesResolved()
79
+ const plan = memoryEnablePlan(capabilities.values.memory, capabilities.sources.memory, status)
76
80
  markMemoryEmbeddingsPinned(plan == "enable-override")
77
81
  return match(plan) {
78
82
  "skip" => null
79
83
  "enable-override" => {
84
+ if (!capabilities.values.memory) {
85
+ markMemoryEnabledByOverride()
86
+ }
80
87
  enableAgentMemory(status.override)
81
88
  return null
82
89
  }
@@ -169,7 +176,16 @@ export def switchModel(
169
176
  changes: []
170
177
  }
171
178
  }
172
- const resolved = promoteAll(all.value)
179
+ const localized = resolveLocalEmbeddingSlot(promoteAll(all.value))
180
+ if (isFailure(localized)) {
181
+ pushMessage(color.red("Could not switch model: ${localized.error}"))
182
+ return {
183
+ session: prior,
184
+ resolved: before,
185
+ changes: []
186
+ }
187
+ }
188
+ const resolved = localized.value
173
189
  applyResolved(resolved)
174
190
  return {
175
191
  session: next,
@@ -266,13 +282,20 @@ export def parseModelsFilters(cmd: string): ModelFilters {
266
282
  export def pickModelsForAgent(args: Record<string, any>) {
267
283
  const localVal = args.flags["local"]
268
284
  const modelArg = args.flags.model ?? ""
269
- const hasModelFlags = modelArg != "" || (args.flags.fastmodel ?? "") != "" || (args.flags.slowmodel ?? "") != ""
285
+ // --model embedding=<local provider>/<model> is the one --model slot that
286
+ // goes with --local: it is the only way to name an embedding model.
287
+ const parsedFlag = parseModelFlag(modelArg)
288
+ const embeddingOnly = modelArg != "" && parsedFlag.slot == "embedding"
289
+ const hasModelFlags = (modelArg != "" && !embeddingOnly) || (args.flags.fastmodel ?? "") != "" || (args.flags.slowmodel ?? "") != ""
270
290
  if (localVal != null && hasModelFlags) {
271
291
  print(
272
- color.red("Pass either --model (hosted) or --local (local), not both."),
292
+ color.red(
293
+ "Pass either --model (hosted) or --local (local), not both. The one exception is --model embedding=<local provider>/<model>.",
294
+ ),
273
295
  )
274
296
  process.exit(1)
275
297
  }
298
+ const localEmbedding = if embeddingOnly then parsedFlag.model else ""
276
299
  if (localVal == "") {
277
300
  // Bare --local: guided setup.
278
301
  // Non-interactive can't prompt, so just print the local catalog and exit.
@@ -303,11 +326,11 @@ export def pickModelsForAgent(args: Record<string, any>) {
303
326
  if (choice == "" || choice == null) {
304
327
  process.exit(0)
305
328
  }
306
- configureLocalModel(choice)
329
+ configureLocalModel(choice, localEmbedding)
307
330
  configureSearch(true)
308
331
  // fall through into the session on the chosen local model
309
332
  } else if (localVal != null) {
310
- configureLocalModel(localVal)
333
+ configureLocalModel(localVal, localEmbedding)
311
334
  configureSearch(true)
312
335
  } else {
313
336
  // Hosted path. --model accepts `slot=model` (per-slot) or a bare model