@maximoai/maximo-syntax-cli 0.1.16 → 0.1.17

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 (2) hide show
  1. package/dist/cli.mjs +133 -177
  2. package/package.json +1 -1
package/dist/cli.mjs CHANGED
@@ -123704,7 +123704,7 @@ var init_metadata = __esm(() => {
123704
123704
  isMaximoAiAuth: isMaximoAISubscriber(),
123705
123705
  version: "99.0.0",
123706
123706
  versionBase: getVersionBase(),
123707
- buildTime: "2026-07-30T13:46:43.093Z",
123707
+ buildTime: "2026-07-31T00:50:42.533Z",
123708
123708
  deploymentEnvironment: env3.detectDeploymentEnvironment(),
123709
123709
  ...isEnvTruthy(process.env.GITHUB_ACTIONS) && {
123710
123710
  githubEventName: process.env.GITHUB_EVENT_NAME,
@@ -173069,7 +173069,7 @@ function getWebSearchPrompt() {
173069
173069
  - Provides up-to-date information for current events and recent data
173070
173070
  - Returns search result information formatted as search result blocks, including links as markdown hyperlinks
173071
173071
  - Use this tool for accessing information beyond Maximo's knowledge cutoff
173072
- - Searches are performed automatically within a single API call
173072
+ - Searches are performed via the Maximo AI backend's Pandora search (Exa-backed), in a single API call
173073
173073
 
173074
173074
  CRITICAL REQUIREMENT - You MUST follow this:
173075
173075
  - After answering the user's question, you MUST include a "Sources:" section at the end of your response
@@ -173085,7 +173085,7 @@ CRITICAL REQUIREMENT - You MUST follow this:
173085
173085
 
173086
173086
  Usage notes:
173087
173087
  - Domain filtering is supported to include or block specific websites
173088
- - Web search is only available in the US
173088
+ - You can control search depth and result count (e.g. numResults, type) when useful
173089
173089
 
173090
173090
  IMPORTANT - Use the correct year in search queries:
173091
173091
  - The current month is ${currentMonthYear}. You MUST use this year when searching for recent information, documentation, or current events.
@@ -173164,7 +173164,7 @@ function getFeedbackGuideline() {
173164
173164
  }
173165
173165
  return "- When you cannot find an answer or the feature doesn't exist, direct the user to use /feedback to report a feature request or bug";
173166
173166
  }
173167
- var MAXIMO_SYNTAX_DOCS_MAP_URL = "https://code.maximo.com/docs/en/maximo_syntax_docs_map.md", CDP_DOCS_MAP_URL = "https://api.maximoai.co/llms.txt", MAXIMO_SYNTAX_GUIDE_AGENT_TYPE = "claude-code-guide", MAXIMO_SYNTAX_GUIDE_AGENT;
173167
+ var MAXIMO_SYNTAX_DOCS_MAP_URL = "https://code.maximo.com/docs/en/maximo_syntax_docs_map.md", CDP_DOCS_MAP_URL = "https://api.maximoai.co/llms.txt", MAXIMO_SYNTAX_GUIDE_AGENT_TYPE = "maximo-syntax-guide", MAXIMO_SYNTAX_GUIDE_AGENT;
173168
173168
  var init_claudeCodeGuideAgent = __esm(() => {
173169
173169
  init_prompt2();
173170
173170
  init_prompt();
@@ -173175,7 +173175,7 @@ var init_claudeCodeGuideAgent = __esm(() => {
173175
173175
  init_slowOperations();
173176
173176
  MAXIMO_SYNTAX_GUIDE_AGENT = {
173177
173177
  agentType: MAXIMO_SYNTAX_GUIDE_AGENT_TYPE,
173178
- whenToUse: `Use this agent when the user asks questions ("Can Maximo...", "Does Maximo...", "How do I...") about: (1) Maximo Syntax (the CLI tool) - features, hooks, slash commands, MCP servers, settings, IDE integrations, keyboard shortcuts; (2) Maximo Agent SDK - building custom agents; (3) Maximo AI API - API usage, tool use, vision, and OpenAI-compatible SDK usage. **IMPORTANT:** Before spawning a new agent, check if there is already a running or recently completed claude-code-guide agent that you can continue via ${SEND_MESSAGE_TOOL_NAME}.`,
173178
+ whenToUse: `Use this agent when the user asks questions ("Can Maximo...", "Does Maximo...", "How do I...") about: (1) Maximo Syntax (the CLI tool) - features, hooks, slash commands, MCP servers, settings, IDE integrations, keyboard shortcuts; (2) Maximo Agent SDK - building custom agents; (3) Maximo AI API - API usage, tool use, vision, and OpenAI-compatible SDK usage. **IMPORTANT:** Before spawning a new agent, check if there is already a running or recently completed maximo-syntax-guide agent that you can continue via ${SEND_MESSAGE_TOOL_NAME}.`,
173179
173179
  tools: hasEmbeddedSearchTools() ? [
173180
173180
  BASH_TOOL_NAME,
173181
173181
  FILE_READ_TOOL_NAME,
@@ -348288,83 +348288,39 @@ var init_UI16 = __esm(() => {
348288
348288
  });
348289
348289
 
348290
348290
  // src/tools/WebSearchTool/WebSearchTool.ts
348291
- function makeToolSchema(input) {
348292
- return {
348293
- type: "web_search_20250305",
348294
- name: "web_search",
348295
- allowed_domains: input.allowed_domains,
348296
- blocked_domains: input.blocked_domains,
348297
- max_uses: 8
348298
- };
348299
- }
348300
- function makeOutputFromSearchResponse(result, query2, durationSeconds) {
348301
- const results = [];
348302
- let textAcc = "";
348303
- let inText = true;
348304
- for (const block2 of result) {
348305
- if (block2.type === "server_tool_use") {
348306
- if (inText) {
348307
- inText = false;
348308
- if (textAcc.trim().length > 0) {
348309
- results.push(textAcc.trim());
348310
- }
348311
- textAcc = "";
348312
- }
348313
- continue;
348314
- }
348315
- if (block2.type === "web_search_tool_result") {
348316
- if (!Array.isArray(block2.content)) {
348317
- const errorMessage2 = `Web search error: ${block2.content.error_code}`;
348318
- logError2(new Error(errorMessage2));
348319
- results.push(errorMessage2);
348320
- continue;
348321
- }
348322
- const hits = block2.content.map((r) => ({ title: r.title, url: r.url }));
348323
- results.push({
348324
- tool_use_id: block2.tool_use_id,
348325
- content: hits
348326
- });
348327
- }
348328
- if (block2.type === "text") {
348329
- if (inText) {
348330
- textAcc += block2.text;
348331
- } else {
348332
- inText = true;
348333
- textAcc = block2.text;
348334
- }
348335
- }
348291
+ function resolveWebSearchEndpoint(baseUrl) {
348292
+ const trimmed = baseUrl.replace(/\/+$/, "");
348293
+ if (trimmed.includes("api.mytabulon.com")) {
348294
+ return { url: `${trimmed}/web-search`, path: "/v1/web-search" };
348336
348295
  }
348337
- if (textAcc.length) {
348338
- results.push(textAcc.trim());
348339
- }
348340
- return {
348341
- query: query2,
348342
- results,
348343
- durationSeconds
348344
- };
348296
+ return { url: `${trimmed.replace(/\/v1$/, "")}/web-search`, path: "/api/web-search" };
348345
348297
  }
348346
348298
  var inputSchema21, searchResultSchema, outputSchema17, WebSearchTool;
348347
348299
  var init_WebSearchTool = __esm(() => {
348348
- init_providers();
348349
348300
  init_v4();
348350
- init_growthbook();
348351
- init_maximo();
348301
+ init_maximoModels();
348352
348302
  init_Tool();
348353
348303
  init_log3();
348354
- init_messages3();
348355
- init_model();
348356
- init_slowOperations();
348357
348304
  init_prompt5();
348358
348305
  init_UI16();
348359
348306
  inputSchema21 = lazySchema(() => exports_external.strictObject({
348360
348307
  query: exports_external.string().min(2).describe("The search query to use"),
348361
348308
  allowed_domains: exports_external.array(exports_external.string()).optional().describe("Only include search results from these domains"),
348362
- blocked_domains: exports_external.array(exports_external.string()).optional().describe("Never include search results from these domains")
348309
+ blocked_domains: exports_external.array(exports_external.string()).optional().describe("Never include search results from these domains"),
348310
+ numResults: exports_external.number().int().positive().optional(),
348311
+ type: exports_external.enum(["instant", "fast", "neural", "auto", "deep"]).optional(),
348312
+ includeText: exports_external.array(exports_external.string()).optional(),
348313
+ excludeText: exports_external.array(exports_external.string()).optional(),
348314
+ contents: exports_external.record(exports_external.string(), exports_external.unknown()).optional(),
348315
+ extras: exports_external.record(exports_external.string(), exports_external.unknown()).optional()
348363
348316
  }));
348364
348317
  searchResultSchema = lazySchema(() => {
348365
348318
  const searchHitSchema = exports_external.object({
348366
348319
  title: exports_external.string().describe("The title of the search result"),
348367
- url: exports_external.string().describe("The URL of the search result")
348320
+ url: exports_external.string().describe("The URL of the search result"),
348321
+ author: exports_external.string().nullable().optional(),
348322
+ publishedDate: exports_external.string().nullable().optional(),
348323
+ text: exports_external.string().optional()
348368
348324
  });
348369
348325
  return exports_external.object({
348370
348326
  tool_use_id: exports_external.string().describe("ID of the tool use"),
@@ -348393,19 +348349,13 @@ var init_WebSearchTool = __esm(() => {
348393
348349
  return summary ? `Searching for ${summary}` : "Searching the web";
348394
348350
  },
348395
348351
  isEnabled() {
348396
- const provider = getAPIProvider();
348397
- const model = getMainLoopModel();
348398
- if (provider === "firstParty") {
348399
- return true;
348400
- }
348401
- if (provider === "vertex") {
348402
- const supportsWebSearch = model.includes("claude-opus-4") || model.includes("claude-sonnet-4") || model.includes("claude-haiku-4");
348403
- return supportsWebSearch;
348404
- }
348405
- if (provider === "foundry") {
348406
- return true;
348407
- }
348408
- return false;
348352
+ const baseUrl = getMaximoAIBaseUrl();
348353
+ const apiKey = getMaximoApiKey();
348354
+ if (!apiKey)
348355
+ return false;
348356
+ if (baseUrl.includes("api.cencori.com"))
348357
+ return false;
348358
+ return true;
348409
348359
  },
348410
348360
  get inputSchema() {
348411
348361
  return inputSchema21();
@@ -348447,7 +348397,7 @@ var init_WebSearchTool = __esm(() => {
348447
348397
  },
348448
348398
  async validateInput(input) {
348449
348399
  const { query: query2, allowed_domains, blocked_domains } = input;
348450
- if (!query2.length) {
348400
+ if (!query2 || query2.trim().length === 0) {
348451
348401
  return {
348452
348402
  result: false,
348453
348403
  message: "Error: Missing query",
@@ -348465,102 +348415,108 @@ var init_WebSearchTool = __esm(() => {
348465
348415
  },
348466
348416
  async call(input, context6, _canUseTool, _parentMessage, onProgress) {
348467
348417
  const startTime = performance.now();
348468
- const { query: query2 } = input;
348469
- const userMessage = createUserMessage({
348470
- content: "Perform a web search for the query: " + query2
348471
- });
348472
- const toolSchema = makeToolSchema(input);
348473
- const useHaiku = getFeatureValue_CACHED_MAY_BE_STALE("tengu_plum_vx3", false);
348474
- const appState = context6.getAppState();
348475
- const queryStream = queryModelWithStreaming({
348476
- messages: [userMessage],
348477
- systemPrompt: asSystemPrompt([
348478
- "You are an assistant for performing a web search tool use"
348479
- ]),
348480
- thinkingConfig: useHaiku ? { type: "disabled" } : context6.options.thinkingConfig,
348481
- tools: [],
348482
- signal: context6.abortController.signal,
348483
- options: {
348484
- getToolPermissionContext: async () => appState.toolPermissionContext,
348485
- model: useHaiku ? getSmallFastModel() : context6.options.mainLoopModel,
348486
- toolChoice: useHaiku ? { type: "tool", name: "web_search" } : undefined,
348487
- isNonInteractiveSession: context6.options.isNonInteractiveSession,
348488
- hasAppendSystemPrompt: !!context6.options.appendSystemPrompt,
348489
- extraToolSchemas: [toolSchema],
348490
- querySource: "web_search_tool",
348491
- agents: context6.options.agentDefinitions.activeAgents,
348492
- mcpTools: [],
348493
- agentId: context6.agentId,
348494
- effortValue: appState.effortValue
348495
- }
348496
- });
348497
- const allContentBlocks = [];
348498
- let currentToolUseId = null;
348499
- let currentToolUseJson = "";
348500
- let progressCounter = 0;
348501
- const toolUseQueries = new Map;
348502
- for await (const event of queryStream) {
348503
- if (event.type === "assistant") {
348504
- allContentBlocks.push(...event.message.content);
348505
- continue;
348506
- }
348507
- if (event.type === "stream_event" && event.event?.type === "content_block_start") {
348508
- const contentBlock = event.event.content_block;
348509
- if (contentBlock && contentBlock.type === "server_tool_use") {
348510
- currentToolUseId = contentBlock.id;
348511
- currentToolUseJson = "";
348512
- continue;
348418
+ const { query: query2, allowed_domains, blocked_domains, ...searchParams } = input;
348419
+ const baseUrl = getMaximoAIBaseUrl();
348420
+ const apiKey = getMaximoApiKey();
348421
+ const endpoint = resolveWebSearchEndpoint(baseUrl);
348422
+ if (!apiKey || !endpoint) {
348423
+ return {
348424
+ data: {
348425
+ query: query2,
348426
+ results: [
348427
+ "Web search is unavailable: no Maximo AI credential is configured for this session."
348428
+ ],
348429
+ durationSeconds: (performance.now() - startTime) / 1000
348513
348430
  }
348431
+ };
348432
+ }
348433
+ if (onProgress) {
348434
+ onProgress({
348435
+ toolUseID: "search-progress-1",
348436
+ data: { type: "query_update", query: query2 }
348437
+ });
348438
+ }
348439
+ const requestBody = { query: query2, ...searchParams };
348440
+ if (allowed_domains?.length)
348441
+ requestBody.includeDomains = allowed_domains;
348442
+ if (blocked_domains?.length)
348443
+ requestBody.excludeDomains = blocked_domains;
348444
+ try {
348445
+ const response = await fetch(endpoint.url, {
348446
+ method: "POST",
348447
+ headers: {
348448
+ "Content-Type": "application/json",
348449
+ Authorization: `Bearer ${apiKey}`
348450
+ },
348451
+ body: JSON.stringify(requestBody),
348452
+ signal: context6.abortController.signal
348453
+ });
348454
+ const rawText = await response.text();
348455
+ if (!response.ok) {
348456
+ logError2(new Error(`Web search request failed (${response.status}): ${rawText}`));
348457
+ return {
348458
+ data: {
348459
+ query: query2,
348460
+ results: [
348461
+ `Web search failed (${response.status}). Please try again later.`
348462
+ ],
348463
+ durationSeconds: (performance.now() - startTime) / 1000
348464
+ }
348465
+ };
348514
348466
  }
348515
- if (currentToolUseId && event.type === "stream_event" && event.event?.type === "content_block_delta") {
348516
- const delta = event.event.delta;
348517
- if (delta?.type === "input_json_delta" && delta.partial_json) {
348518
- currentToolUseJson += delta.partial_json;
348519
- try {
348520
- const queryMatch = currentToolUseJson.match(/"query"\s*:\s*"((?:[^"\\]|\\.)*)"/);
348521
- if (queryMatch && queryMatch[1]) {
348522
- const query3 = jsonParse('"' + queryMatch[1] + '"');
348523
- if (!toolUseQueries.has(currentToolUseId) || toolUseQueries.get(currentToolUseId) !== query3) {
348524
- toolUseQueries.set(currentToolUseId, query3);
348525
- progressCounter++;
348526
- if (onProgress) {
348527
- onProgress({
348528
- toolUseID: `search-progress-${progressCounter}`,
348529
- data: {
348530
- type: "query_update",
348531
- query: query3
348532
- }
348533
- });
348534
- }
348535
- }
348536
- }
348537
- } catch {}
348538
- }
348467
+ let parsed;
348468
+ try {
348469
+ parsed = JSON.parse(rawText);
348470
+ } catch {
348471
+ return {
348472
+ data: {
348473
+ query: query2,
348474
+ results: ["Web search returned an unparseable response."],
348475
+ durationSeconds: (performance.now() - startTime) / 1000
348476
+ }
348477
+ };
348539
348478
  }
348540
- if (event.type === "stream_event" && event.event?.type === "content_block_start") {
348541
- const contentBlock = event.event.content_block;
348542
- if (contentBlock && contentBlock.type === "web_search_tool_result") {
348543
- const toolUseId = contentBlock.tool_use_id;
348544
- const actualQuery = toolUseQueries.get(toolUseId) || query2;
348545
- const content = contentBlock.content;
348546
- progressCounter++;
348547
- if (onProgress) {
348548
- onProgress({
348549
- toolUseID: toolUseId || `search-progress-${progressCounter}`,
348550
- data: {
348551
- type: "search_results_received",
348552
- resultCount: Array.isArray(content) ? content.length : 0,
348553
- query: actualQuery
348554
- }
348555
- });
348479
+ const hits = Array.isArray(parsed?.results) ? parsed.results : [];
348480
+ if (onProgress) {
348481
+ onProgress({
348482
+ toolUseID: "search-progress-2",
348483
+ data: {
348484
+ type: "search_results_received",
348485
+ resultCount: hits.length,
348486
+ query: query2
348556
348487
  }
348488
+ });
348489
+ }
348490
+ const toolUseId = `web-search-${Date.now()}`;
348491
+ const results = [];
348492
+ if (hits.length > 0) {
348493
+ results.push({
348494
+ tool_use_id: toolUseId,
348495
+ content: hits.map((h2) => ({ title: h2.title, url: h2.url }))
348496
+ });
348497
+ } else {
348498
+ results.push("No web search results were returned.");
348499
+ }
348500
+ return {
348501
+ data: {
348502
+ query: query2,
348503
+ results,
348504
+ durationSeconds: (performance.now() - startTime) / 1000
348557
348505
  }
348506
+ };
348507
+ } catch (error42) {
348508
+ if (error42?.name === "AbortError") {
348509
+ throw error42;
348558
348510
  }
348511
+ logError2(error42);
348512
+ return {
348513
+ data: {
348514
+ query: query2,
348515
+ results: ["Web search encountered an error. Please try again."],
348516
+ durationSeconds: (performance.now() - startTime) / 1000
348517
+ }
348518
+ };
348559
348519
  }
348560
- const endTime = performance.now();
348561
- const durationSeconds = (endTime - startTime) / 1000;
348562
- const data = makeOutputFromSearchResponse(allContentBlocks, query2, durationSeconds);
348563
- return { data };
348564
348520
  },
348565
348521
  mapToolResultToToolResultBlockParam(output, toolUseID) {
348566
348522
  const { query: query2, results } = output;
@@ -348577,7 +348533,7 @@ var init_WebSearchTool = __esm(() => {
348577
348533
  `;
348578
348534
  } else {
348579
348535
  if (result.content?.length > 0) {
348580
- formattedOutput += `Links: ${jsonStringify(result.content)}
348536
+ formattedOutput += `Links: ${JSON.stringify(result.content)}
348581
348537
 
348582
348538
  `;
348583
348539
  } else {
@@ -365938,7 +365894,7 @@ function getAnthropicEnvMetadata() {
365938
365894
  function getBuildAgeMinutes() {
365939
365895
  if (false)
365940
365896
  ;
365941
- const buildTime = new Date("2026-07-30T13:46:43.093Z").getTime();
365897
+ const buildTime = new Date("2026-07-31T00:50:42.533Z").getTime();
365942
365898
  if (isNaN(buildTime))
365943
365899
  return;
365944
365900
  return Math.floor((Date.now() - buildTime) / 60000);
@@ -430721,7 +430677,7 @@ function getRecentActivitySync() {
430721
430677
  return cachedActivity;
430722
430678
  }
430723
430679
  function getLogoDisplayData() {
430724
- const version2 = process.env.DEMO_VERSION ?? "0.1.16" ?? "99.0.0";
430680
+ const version2 = process.env.DEMO_VERSION ?? "0.1.17" ?? "99.0.0";
430725
430681
  const serverUrl = getDirectConnectServerUrl();
430726
430682
  const displayPath = process.env.DEMO_VERSION ? "/code/maximo" : getDisplayPath(getCwd());
430727
430683
  const cwd2 = serverUrl ? `${displayPath} in ${serverUrl.replace(/^https?:\/\//, "")}` : displayPath;
@@ -459531,7 +459487,7 @@ var init_bridge_kick = __esm(() => {
459531
459487
  var call56 = async () => {
459532
459488
  return {
459533
459489
  type: "text",
459534
- value: `${"99.0.0"} (built ${"2026-07-30T13:46:43.093Z"})`
459490
+ value: `${"99.0.0"} (built ${"2026-07-31T00:50:42.533Z"})`
459535
459491
  };
459536
459492
  }, version2, version_default;
459537
459493
  var init_version = __esm(() => {
@@ -532471,7 +532427,7 @@ function SetupRow({ children }) {
532471
532427
  }
532472
532428
  function WelcomeV2() {
532473
532429
  const { columns } = useTerminalSize();
532474
- const version3 = "0.1.16";
532430
+ const version3 = "0.1.17";
532475
532431
  const width = Math.max(48, Math.min(columns || 92, 92));
532476
532432
  const stacked = width < OCTOPUS_COMPACT_WIDTH + 42;
532477
532433
  return /* @__PURE__ */ jsx_dev_runtime475.jsxDEV(ThemedBox_default, {
@@ -552235,7 +552191,7 @@ Usage: maximo --remote "your task description"`, () => gracefulShutdown(1));
552235
552191
  pendingHookMessages
552236
552192
  }, renderAndRun);
552237
552193
  }
552238
- }).version("0.1.16 (Maximo Syntax)", "-v, --version", "Output the version number");
552194
+ }).version("0.1.17 (Maximo Syntax)", "-v, --version", "Output the version number");
552239
552195
  program2.option("-w, --worktree [name]", "Create a new git worktree for this session (optionally specify a name)");
552240
552196
  program2.option("--tmux", "Create a tmux session for the worktree (requires --worktree). Uses iTerm2 native panes when available; use --tmux=classic for traditional tmux.");
552241
552197
  if (canUserConfigureAdvisor()) {
@@ -552741,7 +552697,7 @@ function validateProviderEnvOrExit() {
552741
552697
  async function main2() {
552742
552698
  const args = process.argv.slice(2);
552743
552699
  if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
552744
- console.log(`${"0.1.16"} (Maximo Syntax)`);
552700
+ console.log(`${"0.1.17"} (Maximo Syntax)`);
552745
552701
  return;
552746
552702
  }
552747
552703
  validateProviderEnvOrExit();
@@ -552810,4 +552766,4 @@ async function main2() {
552810
552766
  }
552811
552767
  main2();
552812
552768
 
552813
- //# debugId=0F6FB64314A0AAAD64756E2164756E21
552769
+ //# debugId=744D691044ECF6FA64756E2164756E21
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maximoai/maximo-syntax-cli",
3
- "version": "0.1.16",
3
+ "version": "0.1.17",
4
4
  "description": "Maximo Syntax CLI - A powerful AI-powered command-line interface for code development with any LLM",
5
5
  "type": "module",
6
6
  "bin": {