zam-core 0.6.0 → 0.6.1

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.
package/dist/cli/index.js CHANGED
@@ -1722,7 +1722,17 @@ async function listPersonalCards(db, userId, options) {
1722
1722
  t.bloom_level AS bloomLevel,
1723
1723
  t.context,
1724
1724
  t.symbiosis_mode AS symbiosisMode,
1725
- t.source_link AS sourceLink,
1725
+ COALESCE(
1726
+ t.source_link,
1727
+ (
1728
+ SELECT s.uri
1729
+ FROM token_sources ts
1730
+ INNER JOIN sources s ON s.id = ts.source_id
1731
+ WHERE ts.token_id = t.id
1732
+ ORDER BY s.created_at DESC, s.id DESC
1733
+ LIMIT 1
1734
+ )
1735
+ ) AS sourceLink,
1726
1736
  t.question,
1727
1737
  t.created_at AS createdAt,
1728
1738
  t.updated_at AS updatedAt,
@@ -5019,12 +5029,7 @@ function installFastFlowLM() {
5019
5029
  }
5020
5030
  }
5021
5031
  function installOllama() {
5022
- const isMac = process.platform === "darwin";
5023
- const isWin = process.platform === "win32";
5024
- const hasOllama = hasCommand("ollama") || isMac && existsSync9("/Applications/Ollama.app") || isWin && existsSync9(
5025
- join10(homedir7(), "AppData", "Local", "Programs", "Ollama", "ollama.exe")
5026
- );
5027
- if (hasOllama) {
5032
+ if (isOllamaInstalled()) {
5028
5033
  return { success: true, message: "Ollama is already installed." };
5029
5034
  }
5030
5035
  if (process.platform === "darwin") {
@@ -5079,19 +5084,23 @@ function installOllama() {
5079
5084
  }
5080
5085
  }
5081
5086
  }
5082
- function resolveOllamaCommand() {
5083
- if (hasCommand("ollama")) return "ollama";
5084
- const candidates = process.platform === "win32" ? [
5085
- join10(
5086
- homedir7(),
5087
- "AppData",
5088
- "Local",
5089
- "Programs",
5090
- "Ollama",
5091
- "ollama.exe"
5092
- )
5093
- ] : process.platform === "darwin" ? ["/Applications/Ollama.app/Contents/Resources/ollama"] : [];
5094
- return candidates.find((candidate) => existsSync9(candidate));
5087
+ function resolveOllamaCommand(options = {}) {
5088
+ const platform = options.platform ?? process.platform;
5089
+ const homeDir = options.homeDir ?? homedir7();
5090
+ const commandAvailable = options.commandAvailable ?? hasCommand;
5091
+ const pathExists2 = options.pathExists ?? existsSync9;
5092
+ if (commandAvailable("ollama")) return "ollama";
5093
+ const candidates = platform === "win32" ? [join10(homeDir, "AppData", "Local", "Programs", "Ollama", "ollama.exe")] : platform === "darwin" ? [
5094
+ "/opt/homebrew/bin/ollama",
5095
+ "/usr/local/bin/ollama",
5096
+ "/Applications/Ollama.app/Contents/Resources/ollama"
5097
+ ] : ["/usr/local/bin/ollama", "/usr/bin/ollama"];
5098
+ return candidates.find((candidate) => pathExists2(candidate));
5099
+ }
5100
+ function isOllamaInstalled(options = {}) {
5101
+ const platform = options.platform ?? process.platform;
5102
+ const pathExists2 = options.pathExists ?? existsSync9;
5103
+ return resolveOllamaCommand(options) !== void 0 || platform === "darwin" && pathExists2("/Applications/Ollama.app");
5095
5104
  }
5096
5105
  function prepareLocalModel(runner, model) {
5097
5106
  if (runner === "fastflowlm") {
@@ -6263,6 +6272,17 @@ Guidelines:
6263
6272
  - Break complex requirements into multiple separate, atomic cards.
6264
6273
  - Keep questions focused on one fact.
6265
6274
  - Do not repeat the same concept in multiple cards.
6275
+ - Test the subject matter directly. Never ask what learners "must know", what
6276
+ a curriculum "requires", or merely restate a competency as a question.
6277
+ - Stay within the scope of the supplied curriculum. A reference answer may add
6278
+ the definition, formula, or minimal worked example needed to answer a direct
6279
+ subject-matter question, but it must not introduce named methods, terminology,
6280
+ or adjacent topics that the curriculum passage does not mention.
6281
+ - Keep every reference answer concise, mathematically/factually correct, and
6282
+ focused on the competency being tested.
6283
+ - Set "context" to the exact sentence or bullet that supports that specific
6284
+ card. Never reuse an unrelated passage merely because it comes from the same
6285
+ curriculum section.
6266
6286
  - Output ONLY a raw valid JSON array of objects. Do NOT wrap the JSON in markdown code blocks, HTML, or include any preamble, headers, or conversational filler.`;
6267
6287
  const userPrompt = `Curriculum Text to Parse:
6268
6288
  ${text}
@@ -7186,7 +7206,7 @@ async function readWebLink(url) {
7186
7206
  redirect: "manual",
7187
7207
  signal: controller.signal,
7188
7208
  headers: {
7189
- "User-Agent": "ZAM-Content-Studio/0.6.0"
7209
+ "User-Agent": "ZAM-Content-Studio/0.6.1"
7190
7210
  }
7191
7211
  });
7192
7212
  if (res.status >= 300 && res.status < 400) {
@@ -9955,7 +9975,7 @@ bridgeCommand.command("cloud-model-hint").description("Suggest a cloud model for
9955
9975
  bridgeCommand.command("local-llm-hints").description("Detect installed local LLM servers and suggest defaults (JSON)").action(() => {
9956
9976
  const profile = getSystemProfile();
9957
9977
  const flmInstalled = hasCommand("flm") || existsSync17("C:\\Program Files\\flm\\flm.exe");
9958
- const ollamaInstalled = hasCommand("ollama");
9978
+ const ollamaInstalled = isOllamaInstalled();
9959
9979
  const runners = [
9960
9980
  { id: "flm", label: "FastFlowLM", installed: flmInstalled },
9961
9981
  { id: "ollama", label: "Ollama", installed: ollamaInstalled },