openmates 0.27.0-alpha.46 → 0.27.0-alpha.47

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.
@@ -2748,6 +2748,9 @@ async function requestProjectRemoteOperation(options) {
2748
2748
  if (options.source.status !== "connected") {
2749
2749
  throw new ProjectRequesterError("source_offline", "The selected Project source is offline.");
2750
2750
  }
2751
+ if (options.operation === "search" && options.arguments.include_content === true && options.source.capabilities && !options.source.capabilities.includes("read")) {
2752
+ throw new ProjectRequesterError("source_capability_denied", "This Project source does not allow file reads.");
2753
+ }
2751
2754
  const timeoutMs = options.timeoutMs ?? REMOTE_PROTOCOL_TIMEOUT_MS;
2752
2755
  let sourceSessionId = stringField(options.source, "source_session_id");
2753
2756
  let keyEpoch = numberField(options.source, "key_epoch");
@@ -3071,11 +3074,16 @@ function createProjectFileJobExecutor(options) {
3071
3074
  }
3072
3075
  approved.delete(job.operation_id);
3073
3076
  const safeOutput = context.privacy ? await context.privacy.redactResult(output) : output;
3077
+ const sourceId = context.sourceId !== void 0 ? context.sourceId : job.source_id ?? null;
3078
+ const resultBody = safeOutput && typeof safeOutput === "object" && !Array.isArray(safeOutput) ? { ...safeOutput } : { value: safeOutput };
3079
+ if (job.operation === "search" && job.arguments.include_content === true && Array.isArray(resultBody.contents)) {
3080
+ resultBody.contents = resultBody.contents.map((item2) => item2 && typeof item2 === "object" && !Array.isArray(item2) ? { ...item2, source_id: sourceId } : item2);
3081
+ }
3074
3082
  await result("completed", {
3075
- ...safeOutput && typeof safeOutput === "object" ? safeOutput : { value: safeOutput },
3083
+ ...resultBody,
3076
3084
  // Preserve the resolver-selected source so a chat can reopen the
3077
3085
  // original remote file without uploading its contents as an embed.
3078
- source_id: context.sourceId !== void 0 ? context.sourceId : job.source_id ?? null,
3086
+ source_id: sourceId,
3079
3087
  ...proposalCommitment ? { proposal_commitment: proposalCommitment } : {}
3080
3088
  });
3081
3089
  if (mutation) {
@@ -3119,6 +3127,9 @@ var PROJECT_SEARCH_DEFAULT_MAX_RESULTS = 20;
3119
3127
  var PROJECT_SEARCH_MAX_RESULTS = 100;
3120
3128
  var PROJECT_SEARCH_MAX_QUERY_CHARS = 2e3;
3121
3129
  var PROJECT_SEARCH_MAX_GLOB_CHARS = 512;
3130
+ var PROJECT_SEARCH_CONTENT_MAX_FILES = 8;
3131
+ var PROJECT_SEARCH_CONTENT_MAX_FILE_BYTES = 24 * 1024;
3132
+ var PROJECT_SEARCH_CONTENT_MAX_TOTAL_BYTES = 96 * 1024;
3122
3133
  var PROJECT_CREDENTIAL_GLOBS = [
3123
3134
  ".env",
3124
3135
  ".env.*",
@@ -3180,7 +3191,9 @@ function normalizeProjectSearchRequest(args) {
3180
3191
  const path2 = args.path ?? ".";
3181
3192
  const glob = args.glob;
3182
3193
  const maxResults = args.max_results ?? PROJECT_SEARCH_DEFAULT_MAX_RESULTS;
3194
+ const includeContent = args.include_content ?? false;
3183
3195
  if (target !== "files" && target !== "content") fail2("invalid_search_target");
3196
+ if (typeof includeContent !== "boolean" || includeContent && target !== "files") fail2("invalid_search_content_option");
3184
3197
  if (mode !== "literal" && mode !== "regex") fail2("invalid_search_mode");
3185
3198
  if (typeof query !== "string" || !query.trim() || query.length > PROJECT_SEARCH_MAX_QUERY_CHARS || hasControlCharacters(query)) fail2("invalid_search_query");
3186
3199
  if (typeof path2 !== "string") fail2("invalid_search_path");
@@ -3195,7 +3208,8 @@ function normalizeProjectSearchRequest(args) {
3195
3208
  query,
3196
3209
  path: normalizedPath,
3197
3210
  ...typeof glob === "string" ? { glob } : {},
3198
- maxResults
3211
+ maxResults,
3212
+ includeContent
3199
3213
  };
3200
3214
  }
3201
3215
  function matchesProjectSearchQuery(value, request) {
@@ -3593,17 +3607,43 @@ async function executeHostedProjectFileJob(adapter, job, mutation) {
3593
3607
  }
3594
3608
  }
3595
3609
  const matches2 = [];
3610
+ const contents = [];
3611
+ const contentOmissions = [];
3612
+ let contentBytes = 0;
3596
3613
  const limit = search.maxResults;
3597
3614
  const byName = search.target === "files";
3598
3615
  let examined = 0;
3599
3616
  let omitted = 0;
3600
3617
  let incomplete = false;
3601
- for (const file of candidates.slice(0, 100)) {
3618
+ for (const file of (search.includeContent ? candidates.sort((a, b) => a.path.localeCompare(b.path)) : candidates).slice(0, 100)) {
3602
3619
  examined++;
3603
3620
  if (byName) {
3604
3621
  if (matchesProjectSearchQuery(file.path, search)) {
3605
- if (matches2.length < limit) matches2.push({ path: file.path, embed_id: file.embedId });
3606
- else omitted++;
3622
+ if (matches2.length < limit) {
3623
+ const match = { path: file.path, embed_id: file.embedId };
3624
+ matches2.push(match);
3625
+ if (search.includeContent) {
3626
+ let reason;
3627
+ if (contents.length >= PROJECT_SEARCH_CONTENT_MAX_FILES) reason = "file_limit";
3628
+ else {
3629
+ try {
3630
+ const content2 = textContent(await adapter.readHead(file.embedId));
3631
+ const size = bytes(content2).length;
3632
+ if (size > PROJECT_SEARCH_CONTENT_MAX_FILE_BYTES) reason = "file_too_large";
3633
+ else if (contentBytes + size > PROJECT_SEARCH_CONTENT_MAX_TOTAL_BYTES) reason = "total_bytes_limit";
3634
+ else {
3635
+ const expectedBase = await projectFileContentHash(content2);
3636
+ match.expected_base = expectedBase;
3637
+ contents.push({ path: file.path, embed_id: file.embedId, content: content2, expected_base: expectedBase, size_bytes: size });
3638
+ contentBytes += size;
3639
+ }
3640
+ } catch {
3641
+ reason = "unreadable_or_unsupported";
3642
+ }
3643
+ }
3644
+ if (reason) contentOmissions.push({ path: file.path, reason });
3645
+ }
3646
+ } else omitted++;
3607
3647
  }
3608
3648
  } else {
3609
3649
  let content2;
@@ -3627,6 +3667,7 @@ async function executeHostedProjectFileJob(adapter, job, mutation) {
3627
3667
  }
3628
3668
  return {
3629
3669
  matches: matches2,
3670
+ ...search.includeContent ? { contents, content_omissions: contentOmissions, content_incomplete: contentOmissions.length > 0 } : {},
3630
3671
  excluded,
3631
3672
  omitted,
3632
3673
  truncated: omitted > 0 || incomplete || candidates.length > examined
@@ -6291,7 +6332,13 @@ async function discoverCliProjectCandidates(client2, options) {
6291
6332
  typeof record10.encrypted_name === "string" ? decryptWithAesGcmCombined(record10.encrypted_name, key) : null,
6292
6333
  typeof record10.encrypted_description === "string" ? decryptWithAesGcmCombined(record10.encrypted_description, key) : null
6293
6334
  ]);
6294
- return name ? { project_id: record10.project_id, name: name.slice(0, 160), summary: (summary ?? "").slice(0, 640), auto_selection: settings.auto_selection !== false } : null;
6335
+ return name ? {
6336
+ project_id: record10.project_id,
6337
+ name: name.slice(0, 160),
6338
+ summary: (summary ?? "").slice(0, 640),
6339
+ auto_selection: settings.auto_selection !== false,
6340
+ focus_activation_policy: settings.focus_activation_policy === "immediate" || settings.focus_activation_policy === "approval" ? settings.focus_activation_policy : "delayed"
6341
+ } : null;
6295
6342
  } catch {
6296
6343
  return null;
6297
6344
  }
@@ -10911,6 +10958,20 @@ function buildInferenceHistoryMessage(historyMessage, chatId) {
10911
10958
  category: historyMessage.role === "assistant" ? historyMessage.category : void 0
10912
10959
  };
10913
10960
  }
10961
+ function canonicalSavedChatMessageId(message) {
10962
+ return message.clientMessageId || message.id;
10963
+ }
10964
+ function buildSavedChatMessageHistory(messages, chatId) {
10965
+ return messages.map((message) => ({
10966
+ message_id: canonicalSavedChatMessageId(message),
10967
+ chat_id: chatId,
10968
+ role: message.role,
10969
+ sender_name: message.senderName ?? message.role,
10970
+ content: message.content,
10971
+ created_at: message.createdAt,
10972
+ category: message.category
10973
+ }));
10974
+ }
10914
10975
  var MATE_NAMES = {
10915
10976
  software_development: "Sophia",
10916
10977
  business_development: "Burton",
@@ -15153,15 +15214,7 @@ var OpenMatesClient = class _OpenMatesClient {
15153
15214
  let messageHistoryForRequest = params.messageHistory;
15154
15215
  if (!params.incognito && !isNewChat && !messageHistoryForRequest) {
15155
15216
  const { messages } = savedPrivacyHistory;
15156
- messageHistoryForRequest = messages.map((message) => ({
15157
- message_id: message.id,
15158
- chat_id: chatId,
15159
- role: message.role,
15160
- sender_name: message.senderName ?? message.role,
15161
- content: message.content,
15162
- created_at: message.createdAt,
15163
- category: message.category
15164
- }));
15217
+ messageHistoryForRequest = buildSavedChatMessageHistory(messages, chatId);
15165
15218
  }
15166
15219
  ws.send("set_active_chat", { chat_id: chatId, ...teamId ? { team_id: teamId } : {} });
15167
15220
  const connectedAccountDirectory = buildConnectedAccountDirectoryPayload(
@@ -15241,7 +15294,7 @@ var OpenMatesClient = class _OpenMatesClient {
15241
15294
  ws,
15242
15295
  chatId,
15243
15296
  chatKey: chatKeyBytes,
15244
- existingMessageIds: savedPrivacyHistory?.messages.map((message) => message.id) ?? [],
15297
+ existingMessageIds: savedPrivacyHistory?.messages.map(canonicalSavedChatMessageId) ?? [],
15245
15298
  previousRulesSetKey: savedPrivacyHistory?.messages.filter((message) => message.role === "system").map((message) => parseChatContextContent(message.content)).filter((event) => event?.type === "rules_loaded").at(-1)?.set_key,
15246
15299
  onApplied: params.onChatContextApplied
15247
15300
  }) : null;
@@ -63395,6 +63448,12 @@ Only output the final Markdown table. Do NOT include explanations, notes, or any
63395
63448
  feature_notice: {
63396
63449
  text: "You are using free anonymous credits. File uploads, memories, chat sync, and some other features require creating an account."
63397
63450
  },
63451
+ signup_now: {
63452
+ text: "Signup now"
63453
+ },
63454
+ signup_benefits: {
63455
+ text: "to unlock all features and to keep your chats and access them across your devices."
63456
+ },
63398
63457
  daily_credits_exhausted: {
63399
63458
  text: "You used up your free daily credits. Sign up & buy credits to make full use of OpenMates."
63400
63459
  }
@@ -65407,6 +65466,20 @@ Only output the final Markdown table. Do NOT include explanations, notes, or any
65407
65466
  }
65408
65467
  },
65409
65468
  email: {
65469
+ workflow_completion: {
65470
+ subject: {
65471
+ text: "Your scheduled Workflow completed"
65472
+ },
65473
+ heading: {
65474
+ text: "Your scheduled Workflow completed"
65475
+ },
65476
+ detail: {
65477
+ text: "Run {run_id} completed at {completed_time}."
65478
+ },
65479
+ view: {
65480
+ text: "Open result"
65481
+ }
65482
+ },
65410
65483
  account_created: {
65411
65484
  text: "Account created"
65412
65485
  },
@@ -68457,6 +68530,9 @@ Only output the final Markdown table. Do NOT include explanations, notes, or any
68457
68530
  source_unavailable: {
68458
68531
  text: "Connected source is unavailable. Open it when the source is online."
68459
68532
  },
68533
+ changed_since_answer: {
68534
+ text: "This file changed since the answer. Showing the current version."
68535
+ },
68460
68536
  preview_unavailable: {
68461
68537
  text: "A preview is unavailable for this file."
68462
68538
  },
@@ -68845,6 +68921,9 @@ Only output the final Markdown table. Do NOT include explanations, notes, or any
68845
68921
  text: "Selects the fastest AI model"
68846
68922
  }
68847
68923
  }
68924
+ },
68925
+ openmates_description: {
68926
+ text: "Ask OpenMates to help"
68848
68927
  }
68849
68928
  },
68850
68929
  pii: {
@@ -75228,6 +75307,11 @@ As of mid-2026, the severe supply shocks from the 2024\u20132025 avian flu have
75228
75307
  buy_credits: {
75229
75308
  text: "Buy Credits"
75230
75309
  }
75310
+ },
75311
+ workflow_run: {
75312
+ completed: {
75313
+ text: "Your scheduled Workflow completed"
75314
+ }
75231
75315
  }
75232
75316
  },
75233
75317
  platforms: {
@@ -75272,7 +75356,22 @@ As of mid-2026, the severe supply shocks from the 2024\u20132025 avian flu have
75272
75356
  text: "Manage Rule guides"
75273
75357
  },
75274
75358
  auto_selection_description: {
75275
- text: "Suggested Project work starts after a cancellable four-second countdown. When off, mention the Project to activate it yourself."
75359
+ text: "When off, inferred Project mentions do not activate focus. A direct Project mention can still activate it."
75360
+ },
75361
+ focus_activation_policy_label: {
75362
+ text: "Inferred Project focus"
75363
+ },
75364
+ focus_activation_policy_delayed: {
75365
+ text: "After a four-second countdown"
75366
+ },
75367
+ focus_activation_policy_immediate: {
75368
+ text: "Immediately"
75369
+ },
75370
+ focus_activation_policy_approval: {
75371
+ text: "Ask me to approve"
75372
+ },
75373
+ focus_activation_policy_description: {
75374
+ text: "Choose how a suggested Project focus starts. A direct Project mention activates it when you send the message."
75276
75375
  },
75277
75376
  auto_selection_saved: {
75278
75377
  text: "Project focus preference saved."
@@ -75298,6 +75397,12 @@ As of mid-2026, the severe supply shocks from the 2024\u20132025 avian flu have
75298
75397
  focus_access_grant: {
75299
75398
  text: "Grant access"
75300
75399
  },
75400
+ focus_access_decline: {
75401
+ text: "Decline"
75402
+ },
75403
+ focus_access_activating: {
75404
+ text: "Activating\u2026"
75405
+ },
75301
75406
  focus_access_failed: {
75302
75407
  text: "Access could not be activated. Check your connection or send a new request."
75303
75408
  },
@@ -78763,13 +78868,13 @@ As of mid-2026, the severe supply shocks from the 2024\u20132025 avian flu have
78763
78868
  text: "Saving..."
78764
78869
  },
78765
78870
  email_chat_how_it_works: {
78766
- text: "Chat emails are sent when you're away. Workflow runs are summarized in one daily email."
78871
+ text: "Chat emails are sent when you're away. Successful scheduled Workflow runs get a completion email and a daily summary."
78767
78872
  },
78768
78873
  email_workflow_runs: {
78769
78874
  text: "Workflow runs"
78770
78875
  },
78771
78876
  email_workflow_runs_desc: {
78772
- text: "One daily email summarizing your workflow runs"
78877
+ text: "Completion emails for successful scheduled Workflow runs, plus a daily summary"
78773
78878
  },
78774
78879
  email_include_content: {
78775
78880
  text: "Include titles and previews in email"
@@ -83621,6 +83726,9 @@ As of mid-2026, the severe supply shocks from the 2024\u20132025 avian flu have
83621
83726
  },
83622
83727
  untitled_team: {
83623
83728
  text: "Untitled team"
83729
+ },
83730
+ chat_ai_reminder: {
83731
+ text: "Mention @openmates or a specific Mate to involve AI in this conversation."
83624
83732
  }
83625
83733
  },
83626
83734
  watch_whisper: {
@@ -84918,9 +85026,6 @@ As of mid-2026, the severe supply shocks from the 2024\u20132025 avian flu have
84918
85026
  elapsed: {
84919
85027
  text: "{time} elapsed"
84920
85028
  },
84921
- remaining: {
84922
- text: "{time} left"
84923
- },
84924
85029
  visual: {
84925
85030
  text: "Call visual"
84926
85031
  },
@@ -86022,6 +86127,20 @@ As of mid-2026, the severe supply shocks from the 2024\u20132025 avian flu have
86022
86127
  text: "Too many changes are waiting for evaluation or delivery. The last successful version was kept."
86023
86128
  }
86024
86129
  },
86130
+ completion: {
86131
+ opening_message: {
86132
+ text: "Opening the Workflow message\u2026"
86133
+ },
86134
+ message_unavailable: {
86135
+ text: "This Workflow message is unavailable."
86136
+ },
86137
+ review_run_or: {
86138
+ text: "You can review the run or"
86139
+ },
86140
+ retry_message: {
86141
+ text: "retry opening the message"
86142
+ }
86143
+ },
86025
86144
  sidebar: {
86026
86145
  loading: {
86027
86146
  text: "Loading workflows..."
@@ -86298,6 +86417,9 @@ As of mid-2026, the severe supply shocks from the 2024\u20132025 avian flu have
86298
86417
  content_unavailable: {
86299
86418
  text: "Saved inputs and results are no longer available. Run and step statuses remain visible."
86300
86419
  },
86420
+ target_unavailable: {
86421
+ text: "This Workflow run is unavailable."
86422
+ },
86301
86423
  execution_failed: {
86302
86424
  text: "This run failed. Check the highlighted step before trying again."
86303
86425
  },
@@ -105645,6 +105767,14 @@ async function handleLiveRemoteAccessRequest(client2, ws, ownerId2, sourceSessio
105645
105767
  authorize
105646
105768
  });
105647
105769
  } else {
105770
+ if (frame.operation === "search" && bootstrap.arguments.include_content === true) {
105771
+ const context = binding.teamId ? { teamId: binding.teamId } : { personal: true };
105772
+ const currentSources = await client2.listProjectSources(frame.project_id, context);
105773
+ const currentSource = currentSources.find((source) => source.source_id === frame.source_id);
105774
+ if (!currentSource?.capabilities?.includes("search") || !currentSource.capabilities.includes("read")) {
105775
+ throw Object.assign(new Error("source_capability_denied"), { code: "source_capability_denied" });
105776
+ }
105777
+ }
105648
105778
  let approvedIgnoredPath = null;
105649
105779
  const requestedPath = typeof bootstrap.arguments.path === "string" ? bootstrap.arguments.path : ".";
105650
105780
  const ignoredReadContext = bootstrap.ignored_read_context;
@@ -105724,10 +105854,12 @@ async function executeRemoteAccessOperation(sourceRoot, operation, args, trusted
105724
105854
  priorityPath: args.priority_path,
105725
105855
  glob: typeof args.glob === "string" ? args.glob : void 0,
105726
105856
  maxResults: typeof args.max_results === "number" ? args.max_results : void 0,
105857
+ includeContent: args.include_content,
105727
105858
  runRg: runRgCommand
105728
105859
  });
105729
105860
  }
105730
105861
  function remoteAccessOperationErrorCode(error) {
105862
+ if (error?.code === "source_capability_denied") return "source_capability_denied";
105731
105863
  if (error instanceof RemoteFileMutationError) return error.code;
105732
105864
  if (error instanceof RemoteFileTransferError) return error.code;
105733
105865
  if (error instanceof ProjectSearchProtocolError) return error.code;
@@ -105816,7 +105948,8 @@ async function searchRemoteSource(options) {
105816
105948
  mode: options.mode,
105817
105949
  path: options.path,
105818
105950
  glob: options.glob,
105819
- max_results: options.maxResults
105951
+ max_results: options.maxResults,
105952
+ include_content: options.includeContent
105820
105953
  });
105821
105954
  const policy = loadProjectPathPolicy(sourceRoot, {
105822
105955
  trustedPrivatePaths: options.userProtectedPatterns,
@@ -105853,9 +105986,9 @@ async function searchRemoteSource(options) {
105853
105986
  try {
105854
105987
  if (request.target === "files") {
105855
105988
  if (metadataTruncated) {
105856
- return searchRemoteFileNamesWithoutRg(request, sourceRoot, targetPath2, policy, priorityPath, priorityAbsolute);
105989
+ return includeRemoteSearchContent(searchRemoteFileNamesWithoutRg(request, sourceRoot, targetPath2, policy, priorityPath, priorityAbsolute), sourceRoot, request);
105857
105990
  }
105858
- return await searchRemoteFileNamesWithRg(options.runRg, sourceRoot, searchPath, request, policy, hardlinkExclusions, directories, priorityPath);
105991
+ return includeRemoteSearchContent(await searchRemoteFileNamesWithRg(options.runRg, sourceRoot, searchPath, request, policy, hardlinkExclusions, directories, priorityPath), sourceRoot, request);
105859
105992
  }
105860
105993
  const output = await options.runRg(
105861
105994
  buildRgContentSearchArgs(request, searchPath, policy, hardlinkExclusions),
@@ -105867,11 +106000,45 @@ async function searchRemoteSource(options) {
105867
106000
  if (error.code !== "ENOENT") throw error;
105868
106001
  if (request.mode === "regex") throw new ProjectSearchProtocolError("regex_search_unavailable");
105869
106002
  if (request.target === "files") {
105870
- return searchRemoteFileNamesWithoutRg(request, sourceRoot, targetPath2, policy, priorityPath, priorityAbsolute);
106003
+ return includeRemoteSearchContent(searchRemoteFileNamesWithoutRg(request, sourceRoot, targetPath2, policy, priorityPath, priorityAbsolute), sourceRoot, request);
105871
106004
  }
105872
106005
  return searchRemoteSourceWithoutRg(request, sourceRoot, targetPath2, policy);
105873
106006
  }
105874
106007
  }
106008
+ function includeRemoteSearchContent(result, sourceRoot, request) {
106009
+ if (!request.includeContent) return result;
106010
+ const contents = [];
106011
+ const contentOmissions = [];
106012
+ let totalBytes = 0;
106013
+ for (const match of result.matches) {
106014
+ let reason;
106015
+ if (match.kind === "directory") reason = "directory";
106016
+ else if (contents.length >= PROJECT_SEARCH_CONTENT_MAX_FILES) reason = "file_limit";
106017
+ else if (isBinaryPath(match.path)) reason = "binary_or_unsupported";
106018
+ else {
106019
+ try {
106020
+ const read = readRemoteAccessTextFile({
106021
+ sourceRoot,
106022
+ relativePath: match.path,
106023
+ maxBytes: PROJECT_SEARCH_CONTENT_MAX_FILE_BYTES,
106024
+ maxLines: DEFAULT_MAX_READ_LINES,
106025
+ isIgnoredReadApproved: () => false
106026
+ });
106027
+ if (read.truncated || !read.expected_base) reason = "file_too_large_or_line_limit";
106028
+ else if (totalBytes + read.sizeBytes > PROJECT_SEARCH_CONTENT_MAX_TOTAL_BYTES) reason = "total_bytes_limit";
106029
+ else {
106030
+ match.expected_base = read.expected_base;
106031
+ contents.push({ path: match.path, content: read.content, expected_base: read.expected_base, size_bytes: read.sizeBytes });
106032
+ totalBytes += read.sizeBytes;
106033
+ }
106034
+ } catch {
106035
+ reason = "unreadable_or_unsupported";
106036
+ }
106037
+ }
106038
+ if (reason) contentOmissions.push({ path: match.path, reason });
106039
+ }
106040
+ return { ...result, contents, content_omissions: contentOmissions, content_incomplete: contentOmissions.length > 0 };
106041
+ }
105875
106042
  function collectRgContentMatches(output, sourceRoot, request, policy) {
105876
106043
  const matches2 = [];
105877
106044
  let omitted = 0;
@@ -109569,25 +109736,31 @@ async function handleProjects(client2, subcommand, rest, flags, redactor) {
109569
109736
  else console.log(`Project focus activated for ${project.name} in chat ${chatId}.`);
109570
109737
  return;
109571
109738
  }
109572
- if (flags["write-policy"] === void 0 && flags["auto-selection"] === void 0) {
109739
+ if (flags["write-policy"] === void 0 && flags["auto-selection"] === void 0 && flags["focus-activation"] === void 0) {
109573
109740
  const settings2 = await client2.getProjectSettings(project.projectId, context);
109574
109741
  if (flags.json === true) printJson2({ project_id: project.projectId, settings: settings2 });
109575
109742
  else console.log(`Write policy: ${settings2.write_mode ?? "selection required"}
109576
- Automatic focus selection: ${settings2.auto_selection === false ? "off" : "on"}`);
109743
+ Automatic focus selection: ${settings2.auto_selection === false ? "off" : "on"}
109744
+ Focus activation: ${settings2.focus_activation_policy ?? "delayed"}`);
109577
109745
  return;
109578
109746
  }
109579
109747
  const autoSelectionFlag = flags["auto-selection"];
109580
109748
  if (autoSelectionFlag !== void 0 && autoSelectionFlag !== "on" && autoSelectionFlag !== "off") {
109581
109749
  throw new CliContractError("invalid_auto_selection", "--auto-selection must be on or off.");
109582
109750
  }
109751
+ const focusActivationFlag = flags["focus-activation"];
109752
+ if (focusActivationFlag !== void 0 && focusActivationFlag !== "delayed" && focusActivationFlag !== "immediate" && focusActivationFlag !== "approval") {
109753
+ throw new CliContractError("invalid_focus_activation", "--focus-activation must be delayed, immediate, or approval.");
109754
+ }
109583
109755
  const writeMode = flags["write-policy"] === void 0 ? void 0 : await resolveProjectWriteMode(flags, "Choose the Project write policy:");
109584
109756
  const settings = await client2.updateProjectSettings(project.projectId, {
109585
109757
  ...writeMode === void 0 ? {} : { write_mode: writeMode },
109586
109758
  ...autoSelectionFlag === void 0 ? {} : { auto_selection: autoSelectionFlag === "on" },
109759
+ ...focusActivationFlag === void 0 ? {} : { focus_activation_policy: focusActivationFlag },
109587
109760
  updated_at: nowSeconds2()
109588
109761
  }, context);
109589
109762
  if (flags.json === true) printJson2({ project_id: project.projectId, settings });
109590
- else console.log(`Project settings saved. Write policy: ${settings.write_mode}; automatic focus selection: ${settings.auto_selection === false ? "off" : "on"}.`);
109763
+ else console.log(`Project settings saved. Write policy: ${settings.write_mode}; automatic focus selection: ${settings.auto_selection === false ? "off" : "on"}; focus activation: ${settings.focus_activation_policy ?? "delayed"}.`);
109591
109764
  return;
109592
109765
  }
109593
109766
  if (["update", "archive", "unarchive"].includes(subcommand)) {
@@ -109757,6 +109930,9 @@ async function handleProjectFiles(client2, masterKey, rest, flags, context) {
109757
109930
  if (flags["include-ignored"] === true && action2 !== "read") {
109758
109931
  throw new CliContractError("include_ignored_read_only", "--include-ignored is allowed only for one exact file read.");
109759
109932
  }
109933
+ if (flags["include-content"] === true && action2 !== "search") {
109934
+ throw new CliContractError("include_content_search_only", "--include-content is allowed only for filename search.");
109935
+ }
109760
109936
  const project = await requiredResolvedProject(client2, masterKey, requiredStringFlag(rest[1], "project"), flags, context);
109761
109937
  const sources = await client2.listProjectSources(project.projectId, context);
109762
109938
  const source = await selectProjectSource(sources, flags);
@@ -109771,7 +109947,7 @@ async function handleProjectFiles(client2, masterKey, rest, flags, context) {
109771
109947
  operation = "search";
109772
109948
  const query = requiredStringFlag(rest[2], "search query");
109773
109949
  if (Buffer.byteLength(query, "utf8") > 256) throw new CliContractError("query_too_large", "Search query exceeds 256 bytes.");
109774
- argumentsValue = { query, target: "files", mode: "literal", path: "." };
109950
+ argumentsValue = { query, target: "files", mode: "literal", path: ".", include_content: flags["include-content"] === true };
109775
109951
  } else {
109776
109952
  operation = "read_text";
109777
109953
  argumentsValue = { path: safeRelativeProjectPath(requiredStringFlag(rest[2], "relative path")) };
@@ -119182,7 +119358,7 @@ function printProjectsHelp() {
119182
119358
  openmates projects show <project> [--personal|--team <team>] [--json]
119183
119359
  openmates projects open <project> [--personal|--team <team>] [--json]
119184
119360
  openmates projects create <name> [--write-policy apply_and_show|always_ask] [--description <text>] [--icon <name>] [--color <token>] [--pinned] [--personal|--team <team>] [--json]
119185
- openmates projects settings <project> [--write-policy apply_and_show|always_ask] [--auto-selection on|off] [--personal|--team <team>] [--json]
119361
+ openmates projects settings <project> [--write-policy apply_and_show|always_ask] [--auto-selection on|off] [--focus-activation delayed|immediate|approval] [--personal|--team <team>] [--json]
119186
119362
  openmates projects settings <project> focus activate|deactivate --chat <chat-id> [--personal|--team <team>] [--json]
119187
119363
  openmates projects settings <project> command-presets list|enable|disable [<preset-id>] [--source <source-id>|--path <folder>] [--json]
119188
119364
  openmates projects settings <project> command-resources list [--source <source-id>|--path <folder>] [--json]
@@ -633,6 +633,7 @@ interface CliJevContext {
633
633
  name: string;
634
634
  summary: string;
635
635
  auto_selection: boolean;
636
+ focus_activation_policy: "delayed" | "immediate" | "approval";
636
637
  }>;
637
638
  custom_memory_documents?: CustomRuleDocument[];
638
639
  /** Legacy input alias, never a personal consent bypass. */
@@ -1382,6 +1383,7 @@ interface ProjectSettingsRecord {
1382
1383
  encrypted_settings: string | null;
1383
1384
  updated_at: number | null;
1384
1385
  auto_selection?: boolean;
1386
+ focus_activation_policy?: "delayed" | "immediate" | "approval";
1385
1387
  }
1386
1388
  interface ActiveProjectFocus {
1387
1389
  active: true;
@@ -3186,6 +3188,7 @@ declare class OpenMatesClient {
3186
3188
  encrypted_settings?: string;
3187
3189
  updated_at?: number;
3188
3190
  auto_selection?: boolean;
3191
+ focus_activation_policy?: "delayed" | "immediate" | "approval";
3189
3192
  }, options?: TeamContextOptions): Promise<ProjectSettingsRecord>;
3190
3193
  activateProjectFocus(projectId: string, input: {
3191
3194
  chat_id: string;
package/dist/cli.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- export { ak as ImagesAiDetectionClassification, al as ImagesAiDetectionSummary, aK as assertTrustedAccountCommandAllowed, aL as assertTrustedAccountGuardEnvironment, aC as buildImagesAiDetectionSummary, aM as buildProjectDefaultFocus, aN as buildTravelConnectionsRequest, aD as classifyImagesAiDetection, aO as extractExplicitProjectMentions, aF as formatImagesAiDetectionLabel, aG as getExtForLang, aP as handleWiki, aQ as printWhoAmI, aR as readRootProjectInstructions, aS as renderProjectReadApprovalRequest, aT as renderProjectWriteApprovalRequest, aU as renderRemoteCommandEvent, aV as requireExactConfirmation, aW as resolveProjectContext, aJ as serializeToYaml, aX as shouldRequireTrustedAccountGuard, aY as waitForSafeE2ETotpWindow, aZ as waitForWorkflowRun } from './cli-D-jTGCjY.js';
2
+ export { ak as ImagesAiDetectionClassification, al as ImagesAiDetectionSummary, aK as assertTrustedAccountCommandAllowed, aL as assertTrustedAccountGuardEnvironment, aC as buildImagesAiDetectionSummary, aM as buildProjectDefaultFocus, aN as buildTravelConnectionsRequest, aD as classifyImagesAiDetection, aO as extractExplicitProjectMentions, aF as formatImagesAiDetectionLabel, aG as getExtForLang, aP as handleWiki, aQ as printWhoAmI, aR as readRootProjectInstructions, aS as renderProjectReadApprovalRequest, aT as renderProjectWriteApprovalRequest, aU as renderRemoteCommandEvent, aV as requireExactConfirmation, aW as resolveProjectContext, aJ as serializeToYaml, aX as shouldRequireTrustedAccountGuard, aY as waitForSafeE2ETotpWindow, aZ as waitForWorkflowRun } from './cli-CM2HlOYK.js';
package/dist/cli.js CHANGED
@@ -21,7 +21,7 @@ import {
21
21
  shouldRequireTrustedAccountGuard,
22
22
  waitForSafeE2ETotpWindow,
23
23
  waitForWorkflowRun
24
- } from "./chunk-WCND4GFX.js";
24
+ } from "./chunk-WKEUTPBX.js";
25
25
  import "./chunk-B4UXKGH3.js";
26
26
  import "./chunk-IWKP55ZB.js";
27
27
  import "./chunk-FC27KZIW.js";
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { O as OpenMatesSession, U as UserPlanStatus, a as UserPlanRecord, b as UserPlanVerificationStatus, c as UserPlanLearningType, d as UserPlanLearningTargetKind, e as UserPlanLearningStatus, f as UserPlanLearningLevel, g as UserPlanLearningRecord, h as UserPlanCriterionRecord, i as UserPlanVerificationRecord, j as UserPlanCreateInput, k as UserPlanUpdateInput, B as BuyerAddress, P as ProjectItemRecord, T as TaskCreateOptions, l as TaskUpdateOptions, m as UserPlanLearningCreateTasksInput, n as UserPlanLearningCreateTasksResult, o as UserTaskStatus, E as ExternalChatContext, p as TaskPriorityLevel, D as DecryptedUserTask, q as DecryptedTaskActivityEntry, r as TaskActivityCreateOptions, s as UserTaskReorderInput, W as WorkflowSummary, t as WorkflowCapability, u as WorkflowDetail, v as WorkflowAuthoringWarning, w as WorkflowInputStartParams, x as WorkflowInputSessionResult, y as WorkflowInputSessionDetail, z as WorkflowInputEvent, A as WorkflowGraph, C as WorkflowRunContentRetention, F as WorkflowRunOnceOptions, G as WorkflowRunDetail, H as WorkflowRunOptions, I as WorkflowNode, J as WorkflowRunCancellationResult, K as WorkflowTemplateProjectionUpsertParams, L as WorkflowTemplateProjectionResult, M as PublicWorkflowTemplateProjection, N as WorkflowTemplateProjectionRevocationResult, Q as WorkflowTemplateBindingCompletionParams, R as WorkflowTemplateBindingCompletionResult, S as WorkflowTemplateShortUrlParams, V as WorkflowTemplateShortUrlResult, X as ShortUrlRevokeResult, Y as WorkflowTemplateImportPayload, Z as ImportedWorkflowTemplate, _ as WikipediaLearningBundle } from './cli-D-jTGCjY.js';
2
- export { $ as AuthMethodsStatus, a0 as AuthoritativeChatReconciliation, a1 as BackupCodesResult, a2 as BankTransferOrderDetails, a3 as BankTransferStatus, a4 as CachedChat, a5 as CachedNewChatSuggestion, a6 as ChatListPage, a7 as CliSignupResult, a8 as DecryptedDraft, a9 as DecryptedEmbed, aa as DecryptedMemoryEntry, ab as DecryptedMessage, ac as DecryptedNewChatSuggestion, ad as DocsFile, ae as DocsFolder, af as DocsSearchResult, ag as DocsTree, ah as EncryptedDraft, ai as GiftCardBankTransferStatus, aj as INTEREST_TAG_IDS, ak as ImagesAiDetectionClassification, al as ImagesAiDetectionSummary, am as InterestTagId, an as MATE_NAMES, ao as MEMORY_TYPE_REGISTRY, ap as MemoryFieldDef, aq as MemoryTypeDef, ar as OpenMatesClient, as as OpenMatesClientOptions, at as SyncCache, au as TopicPreferencesPayload, av as TotpSetupStartResult, aw as WorkflowEdge, ax as WorkflowNodeRun, ay as WorkflowNodeType, az as WorkflowReturnedOutputReference, aA as WorkflowRunContentStorage, aB as WorkflowRunRouting, aC as buildImagesAiDetectionSummary, aD as classifyImagesAiDetection, aE as deriveAppUrl, aF as formatImagesAiDetectionLabel, aG as getExtForLang, aH as normalizeInterestTagIds, aI as reconcileAuthoritativeChats, aJ as serializeToYaml } from './cli-D-jTGCjY.js';
1
+ import { O as OpenMatesSession, U as UserPlanStatus, a as UserPlanRecord, b as UserPlanVerificationStatus, c as UserPlanLearningType, d as UserPlanLearningTargetKind, e as UserPlanLearningStatus, f as UserPlanLearningLevel, g as UserPlanLearningRecord, h as UserPlanCriterionRecord, i as UserPlanVerificationRecord, j as UserPlanCreateInput, k as UserPlanUpdateInput, B as BuyerAddress, P as ProjectItemRecord, T as TaskCreateOptions, l as TaskUpdateOptions, m as UserPlanLearningCreateTasksInput, n as UserPlanLearningCreateTasksResult, o as UserTaskStatus, E as ExternalChatContext, p as TaskPriorityLevel, D as DecryptedUserTask, q as DecryptedTaskActivityEntry, r as TaskActivityCreateOptions, s as UserTaskReorderInput, W as WorkflowSummary, t as WorkflowCapability, u as WorkflowDetail, v as WorkflowAuthoringWarning, w as WorkflowInputStartParams, x as WorkflowInputSessionResult, y as WorkflowInputSessionDetail, z as WorkflowInputEvent, A as WorkflowGraph, C as WorkflowRunContentRetention, F as WorkflowRunOnceOptions, G as WorkflowRunDetail, H as WorkflowRunOptions, I as WorkflowNode, J as WorkflowRunCancellationResult, K as WorkflowTemplateProjectionUpsertParams, L as WorkflowTemplateProjectionResult, M as PublicWorkflowTemplateProjection, N as WorkflowTemplateProjectionRevocationResult, Q as WorkflowTemplateBindingCompletionParams, R as WorkflowTemplateBindingCompletionResult, S as WorkflowTemplateShortUrlParams, V as WorkflowTemplateShortUrlResult, X as ShortUrlRevokeResult, Y as WorkflowTemplateImportPayload, Z as ImportedWorkflowTemplate, _ as WikipediaLearningBundle } from './cli-CM2HlOYK.js';
2
+ export { $ as AuthMethodsStatus, a0 as AuthoritativeChatReconciliation, a1 as BackupCodesResult, a2 as BankTransferOrderDetails, a3 as BankTransferStatus, a4 as CachedChat, a5 as CachedNewChatSuggestion, a6 as ChatListPage, a7 as CliSignupResult, a8 as DecryptedDraft, a9 as DecryptedEmbed, aa as DecryptedMemoryEntry, ab as DecryptedMessage, ac as DecryptedNewChatSuggestion, ad as DocsFile, ae as DocsFolder, af as DocsSearchResult, ag as DocsTree, ah as EncryptedDraft, ai as GiftCardBankTransferStatus, aj as INTEREST_TAG_IDS, ak as ImagesAiDetectionClassification, al as ImagesAiDetectionSummary, am as InterestTagId, an as MATE_NAMES, ao as MEMORY_TYPE_REGISTRY, ap as MemoryFieldDef, aq as MemoryTypeDef, ar as OpenMatesClient, as as OpenMatesClientOptions, at as SyncCache, au as TopicPreferencesPayload, av as TotpSetupStartResult, aw as WorkflowEdge, ax as WorkflowNodeRun, ay as WorkflowNodeType, az as WorkflowReturnedOutputReference, aA as WorkflowRunContentStorage, aB as WorkflowRunRouting, aC as buildImagesAiDetectionSummary, aD as classifyImagesAiDetection, aE as deriveAppUrl, aF as formatImagesAiDetectionLabel, aG as getExtForLang, aH as normalizeInterestTagIds, aI as reconcileAuthoritativeChats, aJ as serializeToYaml } from './cli-CM2HlOYK.js';
3
3
 
4
4
  type ChatModelSelection = "auto" | (string & {});
5
5
  interface ChatModelCatalogEntry {
package/dist/index.js CHANGED
@@ -44,7 +44,7 @@ import {
44
44
  selectAssistantMessagesForSpeech,
45
45
  serializeToYaml,
46
46
  summarizeAssistantSpeech
47
- } from "./chunk-WCND4GFX.js";
47
+ } from "./chunk-WKEUTPBX.js";
48
48
  import "./chunk-B4UXKGH3.js";
49
49
  import "./chunk-IWKP55ZB.js";
50
50
  import "./chunk-FC27KZIW.js";
@@ -17,47 +17,47 @@
17
17
  {
18
18
  "name": "libggml-base.so",
19
19
  "bytes": 1110088,
20
- "sha256": "3d3b5f5729c23afbd1ddae2e4dca2a37c010ad8b2f67227dff147a070cc35313"
20
+ "sha256": "0e032b2501ba3798235d23a65b7d84f628496b860503b22d02f190e7351ae546"
21
21
  },
22
22
  {
23
23
  "name": "libggml-base.so.0",
24
24
  "bytes": 1110088,
25
- "sha256": "3d3b5f5729c23afbd1ddae2e4dca2a37c010ad8b2f67227dff147a070cc35313"
25
+ "sha256": "0e032b2501ba3798235d23a65b7d84f628496b860503b22d02f190e7351ae546"
26
26
  },
27
27
  {
28
28
  "name": "libggml-base.so.0.15.1",
29
29
  "bytes": 1110088,
30
- "sha256": "3d3b5f5729c23afbd1ddae2e4dca2a37c010ad8b2f67227dff147a070cc35313"
30
+ "sha256": "0e032b2501ba3798235d23a65b7d84f628496b860503b22d02f190e7351ae546"
31
31
  },
32
32
  {
33
33
  "name": "libggml-cpu.so",
34
34
  "bytes": 869800,
35
- "sha256": "f823b482cb87acd8e9ba3ec0272c3092a9fcb68cf93eecd20c2ab4c4d27889cf"
35
+ "sha256": "c792362ba1e6d5e704eaa9047013ca028e99d9b0ea525e61c9b4ccfb6ae64aa4"
36
36
  },
37
37
  {
38
38
  "name": "libggml-cpu.so.0",
39
39
  "bytes": 869800,
40
- "sha256": "f823b482cb87acd8e9ba3ec0272c3092a9fcb68cf93eecd20c2ab4c4d27889cf"
40
+ "sha256": "c792362ba1e6d5e704eaa9047013ca028e99d9b0ea525e61c9b4ccfb6ae64aa4"
41
41
  },
42
42
  {
43
43
  "name": "libggml-cpu.so.0.15.1",
44
44
  "bytes": 869800,
45
- "sha256": "f823b482cb87acd8e9ba3ec0272c3092a9fcb68cf93eecd20c2ab4c4d27889cf"
45
+ "sha256": "c792362ba1e6d5e704eaa9047013ca028e99d9b0ea525e61c9b4ccfb6ae64aa4"
46
46
  },
47
47
  {
48
48
  "name": "libggml.so",
49
49
  "bytes": 1899104,
50
- "sha256": "b24c630710e35e68d38c99c8d3af584299269fd031807ee7efc5cebb1a51fa69"
50
+ "sha256": "8f3c50d871e737ff72187c4c72b3633940f9f9056f8efd9e1cc49d33ff436d76"
51
51
  },
52
52
  {
53
53
  "name": "libggml.so.0",
54
54
  "bytes": 1899104,
55
- "sha256": "b24c630710e35e68d38c99c8d3af584299269fd031807ee7efc5cebb1a51fa69"
55
+ "sha256": "8f3c50d871e737ff72187c4c72b3633940f9f9056f8efd9e1cc49d33ff436d76"
56
56
  },
57
57
  {
58
58
  "name": "libggml.so.0.15.1",
59
59
  "bytes": 1899104,
60
- "sha256": "b24c630710e35e68d38c99c8d3af584299269fd031807ee7efc5cebb1a51fa69"
60
+ "sha256": "8f3c50d871e737ff72187c4c72b3633940f9f9056f8efd9e1cc49d33ff436d76"
61
61
  },
62
62
  {
63
63
  "name": "openmates-pii-worker",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openmates",
3
- "version": "0.27.0-alpha.46",
3
+ "version": "0.27.0-alpha.47",
4
4
  "description": "OpenMates CLI and SDK",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",