@mindstudio-ai/agent 0.1.95 → 0.1.97

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.js CHANGED
@@ -3546,9 +3546,13 @@ var init_source = __esm({
3546
3546
  * or a regression check on top of it. There is no seed to set. Two things do
3547
3547
  * legitimately move the results: adding or removing documents, and changing
3548
3548
  * the corpus configuration — both of which you control.
3549
+ *
3550
+ * Alongside `results` and `latencyMs` comes {@link SearchRan} — what the
3551
+ * search actually did, which is the first thing to check when results don't
3552
+ * look like the options you passed.
3549
3553
  */
3550
3554
  async search(query, options) {
3551
- const { results, latencyMs } = await this._call("search", {
3555
+ const { results, mode, latencyMs } = await this._call("search", {
3552
3556
  slug: this._slug,
3553
3557
  query,
3554
3558
  ...options?.topK !== void 0 ? { topK: options.topK } : {},
@@ -3562,7 +3566,7 @@ var init_source = __esm({
3562
3566
  ...options?.explain !== void 0 ? { explain: options.explain } : {},
3563
3567
  ...options?.expand !== void 0 ? { expand: options.expand } : {}
3564
3568
  });
3565
- return { results: results ?? [], latencyMs: latencyMs ?? 0 };
3569
+ return { results: results ?? [], mode, latencyMs: latencyMs ?? 0 };
3566
3570
  }
3567
3571
  /**
3568
3572
  * What is in the corpus, and how it was built.
@@ -7333,7 +7337,7 @@ async function startMcpServer(options) {
7333
7337
  capabilities: { tools: {} },
7334
7338
  serverInfo: {
7335
7339
  name: "mindstudio-agent",
7336
- version: "0.1.95"
7340
+ version: "0.1.97"
7337
7341
  },
7338
7342
  instructions: 'Welcome to MindStudio \u2014 a platform with 200+ AI models, 850+ third-party integrations, and pre-built agents.\n\nGetting started:\n1. Call `ask` with any question about the SDK \u2014 it knows every action, model, and connector and returns working code with real model IDs and config options. Examples: ask("generate an image with FLUX"), ask("what models support vision?"), ask("how do I send a Slack message?").\n2. Call `changeName` to set your display name \u2014 use your name or whatever your user calls you. This is how you\'ll appear in MindStudio request logs.\n3. If you have a profile picture, pass its public image URL to `changeProfilePicture`.\n4. For manual browsing, call `listActions` to discover all available actions.\n\nThen use the tools to generate text, images, video, audio, search the web, work with data sources, run agents, and more.\n\nImportant:\n- AI-powered actions (text generation, image generation, video, audio, etc.) cost money. Before running these, call `estimateActionCost` and confirm with the user before proceeding \u2014 unless they\'ve explicitly told you to go ahead.\n- Not all agents from `listAgents` are configured for API use. Do not try to run an agent just because it appears in the list \u2014 it will likely fail. Only run agents the user specifically asks you to run.'
7339
7343
  });
@@ -8318,7 +8322,7 @@ function isNewerVersion(current, latest) {
8318
8322
  return false;
8319
8323
  }
8320
8324
  async function checkForUpdate() {
8321
- const currentVersion = "0.1.95";
8325
+ const currentVersion = "0.1.97";
8322
8326
  if (!currentVersion) return null;
8323
8327
  try {
8324
8328
  const { loadConfig: loadConfig2, saveConfig: saveConfig2 } = await Promise.resolve().then(() => (init_config(), config_exports));
@@ -8347,7 +8351,7 @@ async function checkForUpdate() {
8347
8351
  }
8348
8352
  }
8349
8353
  function printUpdateNotice(latestVersion) {
8350
- const currentVersion = "0.1.95";
8354
+ const currentVersion = "0.1.97";
8351
8355
  process.stderr.write(
8352
8356
  `
8353
8357
  ${ansi2.cyanBright("Update available")} ${ansi2.gray(currentVersion + " \u2192")} ${ansi2.cyanBold(latestVersion)}
@@ -8360,7 +8364,7 @@ function isStandaloneBinary() {
8360
8364
  return !argv1.includes("node_modules");
8361
8365
  }
8362
8366
  async function cmdUpdate() {
8363
- const currentVersion = "0.1.95";
8367
+ const currentVersion = "0.1.97";
8364
8368
  process.stderr.write(
8365
8369
  ` ${ansi2.gray("Current version:")} ${currentVersion}
8366
8370
  `
@@ -8495,7 +8499,7 @@ async function cmdLogin(options) {
8495
8499
  process.stderr.write("\n");
8496
8500
  printLogo();
8497
8501
  process.stderr.write("\n");
8498
- const ver = "0.1.95";
8502
+ const ver = "0.1.97";
8499
8503
  process.stderr.write(
8500
8504
  ` ${ansi2.bold("MindStudio Agent")} ${ver ? " " + ansi2.gray("v" + ver) : ""}
8501
8505
  `
@@ -8822,7 +8826,7 @@ async function main() {
8822
8826
  try {
8823
8827
  if (command === "version" || command === "-v") {
8824
8828
  process.stdout.write(
8825
- "0.1.95\n"
8829
+ "0.1.97\n"
8826
8830
  );
8827
8831
  return;
8828
8832
  }
package/dist/index.d.ts CHANGED
@@ -1672,15 +1672,35 @@ interface SearchHit {
1672
1672
  after: string[];
1673
1673
  };
1674
1674
  /**
1675
- * Only when `highlight` was requested: where query terms land in `text`, as
1676
- * `text.slice(start, end)` ranges. Keyword-based — a hit that matched
1677
- * semantically may report an empty array, which is itself informative.
1675
+ * Only when `highlight` was requested: where the query's most distinctive
1676
+ * terms land in `text`, as `text.slice(start, end)` ranges, each carrying the
1677
+ * `token` it matched so you can colour or group by term.
1678
+ *
1679
+ * NOT every query term — see {@link SearchOptions.highlight}. Keyword-based,
1680
+ * so a hit that matched semantically may report an empty array, which is
1681
+ * itself informative.
1678
1682
  */
1679
1683
  matches?: {
1680
1684
  start: number;
1681
1685
  end: number;
1686
+ token: string;
1682
1687
  }[];
1683
1688
  }
1689
+ /**
1690
+ * What a search actually ran — as opposed to what was asked for.
1691
+ *
1692
+ * Worth checking when a result surprises you: an omitted `mode` falls back to
1693
+ * the corpus's own configuration, and `reranked` is false when reranking was
1694
+ * skipped or failed open. Absent only when the data source doesn't exist yet,
1695
+ * in which case nothing ran at all.
1696
+ */
1697
+ interface SearchRan {
1698
+ search: SearchMode;
1699
+ hybrid: boolean;
1700
+ reranked: boolean;
1701
+ /** Which build served the query. Changes when a re-vectorization is promoted. */
1702
+ pipelineVersion: number;
1703
+ }
1684
1704
  /**
1685
1705
  * Per-query overrides.
1686
1706
  *
@@ -1717,8 +1737,16 @@ interface SearchOptions {
1717
1737
  */
1718
1738
  maxPerDocument?: number;
1719
1739
  /**
1720
- * Return `matches` on each hit: offsets of query terms within its text, for
1721
- * rendering highlights.
1740
+ * Return {@link SearchHit.matches} on each hit: where query terms land in its
1741
+ * text, for rendering highlights.
1742
+ *
1743
+ * Only the query's **distinctive** terms are marked. English function words —
1744
+ * `the`, `for`, `is`, `of` — are never marked, and when a passage holds more
1745
+ * matches than it can usefully show, the rarest terms win the space. So
1746
+ * `what is the policy for parental leave` marks `policy`, `parental` and
1747
+ * `leave`, and nothing else. Without that a natural-language query lights up
1748
+ * most of the passage and you would need your own stopword list to render
1749
+ * anything. Words you filtered on (`contains`, `phrase`) are always marked.
1722
1750
  */
1723
1751
  highlight?: boolean;
1724
1752
  /**
@@ -1868,9 +1896,14 @@ declare class DataSource {
1868
1896
  * or a regression check on top of it. There is no seed to set. Two things do
1869
1897
  * legitimately move the results: adding or removing documents, and changing
1870
1898
  * the corpus configuration — both of which you control.
1899
+ *
1900
+ * Alongside `results` and `latencyMs` comes {@link SearchRan} — what the
1901
+ * search actually did, which is the first thing to check when results don't
1902
+ * look like the options you passed.
1871
1903
  */
1872
1904
  search(query: string, options?: SearchOptions): Promise<{
1873
1905
  results: SearchHit[];
1906
+ mode?: SearchRan;
1874
1907
  latencyMs: number;
1875
1908
  }>;
1876
1909
  /**
@@ -9676,7 +9709,14 @@ declare class MindStudioError extends Error {
9676
9709
  * Channel-discriminated so future surfaces extend without breaking.
9677
9710
  */
9678
9711
  interface SessionContext {
9679
- channel: 'voice' | 'agent';
9712
+ /**
9713
+ * Which surface invoked this method: `voice`/`agent` for conversational
9714
+ * tool calls (which carry their session/thread ids below), `web` for a
9715
+ * browser interface-session method call, `api` for an app-key or
9716
+ * platform-key call. `web`/`api` carry only `visitorId`. Absent entirely
9717
+ * on older platform versions.
9718
+ */
9719
+ channel: 'voice' | 'agent' | 'web' | 'api';
9680
9720
  /** Voice-session id — matches the browser voice client's `session.sessionId`. */
9681
9721
  voiceSessionId?: string;
9682
9722
  /** Agent-chat thread id. */
package/dist/index.js CHANGED
@@ -2149,9 +2149,13 @@ var DataSource = class {
2149
2149
  * or a regression check on top of it. There is no seed to set. Two things do
2150
2150
  * legitimately move the results: adding or removing documents, and changing
2151
2151
  * the corpus configuration — both of which you control.
2152
+ *
2153
+ * Alongside `results` and `latencyMs` comes {@link SearchRan} — what the
2154
+ * search actually did, which is the first thing to check when results don't
2155
+ * look like the options you passed.
2152
2156
  */
2153
2157
  async search(query, options) {
2154
- const { results, latencyMs } = await this._call("search", {
2158
+ const { results, mode, latencyMs } = await this._call("search", {
2155
2159
  slug: this._slug,
2156
2160
  query,
2157
2161
  ...options?.topK !== void 0 ? { topK: options.topK } : {},
@@ -2165,7 +2169,7 @@ var DataSource = class {
2165
2169
  ...options?.explain !== void 0 ? { explain: options.explain } : {},
2166
2170
  ...options?.expand !== void 0 ? { expand: options.expand } : {}
2167
2171
  });
2168
- return { results: results ?? [], latencyMs: latencyMs ?? 0 };
2172
+ return { results: results ?? [], mode, latencyMs: latencyMs ?? 0 };
2169
2173
  }
2170
2174
  /**
2171
2175
  * What is in the corpus, and how it was built.