openmates 0.27.0-alpha.2 → 0.27.0-alpha.21

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.
@@ -41,6 +41,8 @@ interface CachedNewChatSuggestion {
41
41
  interface SyncCache {
42
42
  /** Timestamp of last successful sync */
43
43
  syncedAt: number;
44
+ /** Local freshness of individually saved/refreshed drafts, including known deletions. */
45
+ draftSyncedAt?: Record<string, number>;
44
46
  /** Total chat count as reported by the server */
45
47
  totalChatCount: number;
46
48
  /** Number of chats loaded (may be less than total if paginated) */
@@ -203,12 +205,28 @@ interface LocalConnectorRequestFrame {
203
205
  action: string;
204
206
  arguments?: Record<string, unknown>;
205
207
  }
208
+ interface AvailableRecoveryOutputFrame {
209
+ record_id: string;
210
+ root_chat_id: string;
211
+ target_chat_id: string;
212
+ turn_id: string;
213
+ subject_id: string;
214
+ output_kind: "message" | "embed" | "diff" | "summary" | "checkpoint";
215
+ output_version: number;
216
+ chat_key_version: number;
217
+ message_role?: "user" | "assistant" | null;
218
+ root_hashed_team_id?: string | null;
219
+ }
206
220
  declare class OpenMatesWsClient {
207
221
  private readonly interactiveHuman;
208
222
  private activeHumanChatId;
209
223
  private presenceTimer;
210
224
  private readonly socket;
211
225
  private readonly passiveTaskUpdateJobs;
226
+ private readonly availableRecoveryOutputPages;
227
+ private readonly queuedRecoveryOutputIds;
228
+ private recoveryOutputDiscoveryError;
229
+ private recoveryOutputDiscoveryComplete;
212
230
  private readonly remoteCommandReviewDeferredHandlers;
213
231
  private activeResponseCollectors;
214
232
  constructor(options: {
@@ -243,6 +261,10 @@ declare class OpenMatesWsClient {
243
261
  private bufferPassiveTaskUpdateJobs;
244
262
  private handleForceLogout;
245
263
  drainPassiveTaskUpdateJobs(): PendingTaskUpdateJobFrame[];
264
+ private bufferRecoveryOutputs;
265
+ drainAvailableRecoveryOutputPages(rootChatId?: string): AvailableRecoveryOutputFrame[][];
266
+ drainAvailableRecoveryOutputs(rootChatId?: string): AvailableRecoveryOutputFrame[];
267
+ waitForRecoveryOutputDiscovery(timeoutMs?: number): Promise<void>;
246
268
  waitForMessage(expectedType: string, predicate?: (payload: unknown) => boolean, timeoutMs?: number): Promise<WsEnvelope>;
247
269
  /**
248
270
  * Collect all frames until `terminatorType` arrives (or timeout).
@@ -421,6 +443,146 @@ interface HostedProjectFileHead {
421
443
  hasInitialHistory: boolean;
422
444
  }
423
445
 
446
+ interface AppliedRule {
447
+ id: string;
448
+ title: string;
449
+ source: string;
450
+ revision: string;
451
+ body: string;
452
+ project_id?: string | null;
453
+ app_id?: string | null;
454
+ }
455
+ interface EventBase {
456
+ event_id: string;
457
+ created_at: number;
458
+ chat_id?: string;
459
+ }
460
+ type ChatContextEvent = EventBase & ({
461
+ type: "rules_loaded";
462
+ count: number;
463
+ set_key: string;
464
+ rules: AppliedRule[];
465
+ } | {
466
+ type: "chat_direction_correction";
467
+ notice: string;
468
+ instruction: string;
469
+ delivery_id: string;
470
+ provenance?: Record<string, unknown>;
471
+ } | {
472
+ type: "project_authoring_recommendation";
473
+ recommendation_id: string;
474
+ project_id: string;
475
+ kind: "focus" | "workflow";
476
+ action: "create" | "update";
477
+ target_id?: string | null;
478
+ expected_revision?: string | null;
479
+ title?: string;
480
+ team_id?: string | null;
481
+ });
482
+
483
+ /** Private saved Focus transport. Legacy conversion belongs to the server. */
484
+ interface ProjectFocusRequirement {
485
+ id: string;
486
+ text: string;
487
+ type?: "semantic" | "user_confirmation";
488
+ }
489
+ interface CanonicalProjectFocusPhase {
490
+ id: string;
491
+ title: string;
492
+ instructions: string;
493
+ requirements: ProjectFocusRequirement[];
494
+ }
495
+ interface LegacyProjectFocusPhase {
496
+ id: string;
497
+ name: string;
498
+ instructions: string;
499
+ }
500
+ interface FocusDocumentBody {
501
+ name: string;
502
+ description: string;
503
+ when_to_use: string;
504
+ instructions: string;
505
+ }
506
+ type ProjectFocusDocument = FocusDocumentBody & ({
507
+ phases_version: 1;
508
+ phases: CanonicalProjectFocusPhase[];
509
+ } | {
510
+ phases_version?: never;
511
+ phases: LegacyProjectFocusPhase[];
512
+ });
513
+
514
+ /** Bounded first-party context snapshots; discovery metadata never grants Project file access. */
515
+
516
+ interface CustomRuleDocument {
517
+ id: string;
518
+ source: "personal" | "project";
519
+ project_id?: string;
520
+ document: string;
521
+ }
522
+ interface ProjectContextDocument {
523
+ item_id: string;
524
+ kind: "spec" | "fact" | "folder";
525
+ title: string;
526
+ description: string;
527
+ document: string;
528
+ revision: string;
529
+ }
530
+ interface ProjectFocusCatalogEntry {
531
+ id: string;
532
+ title: string;
533
+ summary: string;
534
+ revision: string;
535
+ }
536
+ interface ProjectFocusDocumentInput {
537
+ item_id: string;
538
+ document: string;
539
+ revision: string;
540
+ }
541
+ interface RelatedTaskCandidate {
542
+ task_id: string;
543
+ title: string;
544
+ summary: string;
545
+ project_id: string | null;
546
+ status: string;
547
+ changed_at: number;
548
+ revision: string;
549
+ explicit_dependency: boolean;
550
+ }
551
+ interface AcceptedPlanContext {
552
+ plan_id: string;
553
+ version: number;
554
+ approved_revision_id: string;
555
+ summary: string;
556
+ linked_task_id?: string;
557
+ }
558
+ interface CliJevContext {
559
+ /** Fresh server-approved current Plan, derived from existing chat/Task linkage. */
560
+ accepted_plan_context?: AcceptedPlanContext | null;
561
+ project_focus_candidates?: Array<{
562
+ project_id: string;
563
+ name: string;
564
+ summary: string;
565
+ auto_selection: boolean;
566
+ }>;
567
+ custom_rule_documents?: CustomRuleDocument[];
568
+ project_focus_catalog?: ProjectFocusCatalogEntry[];
569
+ project_focus_documents?: ProjectFocusDocumentInput[];
570
+ project_context_documents?: ProjectContextDocument[];
571
+ related_task_candidates?: RelatedTaskCandidate[];
572
+ }
573
+ type FocusAuthoringDocument = ProjectFocusDocument;
574
+
575
+ /** Server-authorized cancellable Project activation; discovery never decrypts private context. */
576
+
577
+ interface ProjectFocusCountdown {
578
+ chatId: string;
579
+ projectId: string;
580
+ focusId: string;
581
+ requestId: string;
582
+ expiresAt: number;
583
+ reject: () => Promise<void>;
584
+ }
585
+
424
586
  /** Minimal model info needed for mention resolution */
425
587
  interface ModelInfo {
426
588
  id: string;
@@ -952,7 +1114,7 @@ interface LearningModeContext {
952
1114
  ageGroup?: LearningModeAgeGroup | null;
953
1115
  source?: "anonymous_session";
954
1116
  }
955
- type WorkflowNodeType = "schedule_trigger" | "manual_trigger" | "webhook_trigger" | "app_skill_action" | "decision" | "check" | "send_chat_message" | "start_new_chat" | "event_trigger" | "wait" | "repeat" | "create_chat_report" | "send_notification" | "send_email_notification" | "ask_user" | "custom_code" | "end";
1117
+ type WorkflowNodeType = "schedule_trigger" | "manual_trigger" | "webhook_trigger" | "app_skill_action" | "decision" | "check" | "send_chat_message" | "start_new_chat" | "event_trigger" | "wait" | "repeat" | "for_each" | "create_chat_report" | "send_notification" | "send_email_notification" | "ask_user" | "custom_code" | "end";
956
1118
  interface WorkflowNode {
957
1119
  id: string;
958
1120
  type: WorkflowNodeType;
@@ -977,13 +1139,36 @@ interface WorkflowGraph {
977
1139
  }
978
1140
  type WorkflowRunContentRetention = "last_5" | "none";
979
1141
  type WorkflowRunContentStorage = "durable" | "ephemeral" | "deleted";
980
- type WorkflowLifecycle = "persisted" | "temporary";
1142
+ type WorkflowLifecycle = "persisted" | "temporary" | "chat_embed";
1143
+ interface WorkflowRunRouting {
1144
+ sourceChatId?: string;
1145
+ messageDestinationOverrides?: Record<string, string>;
1146
+ returnOutputs?: Record<string, WorkflowReturnedOutputReference>;
1147
+ }
1148
+ interface WorkflowReturnedOutputReference {
1149
+ ref: string;
1150
+ type: "string" | "number" | "integer" | "boolean" | "object" | "array";
1151
+ }
1152
+ interface WorkflowRunOptions extends WorkflowRunRouting {
1153
+ idempotencyKey: string;
1154
+ mode?: "manual" | "test";
1155
+ input?: Record<string, unknown>;
1156
+ }
1157
+ interface WorkflowRunOnceOptions extends WorkflowRunRouting {
1158
+ title: string;
1159
+ graph: WorkflowGraph;
1160
+ idempotencyKey: string;
1161
+ sourceChatId: string;
1162
+ input?: Record<string, unknown>;
1163
+ }
981
1164
  interface WorkflowAuthoringWarning {
982
1165
  code: string;
983
1166
  node_id: string;
984
1167
  message: string;
985
1168
  }
986
1169
  interface WorkflowSummary {
1170
+ /** Authoritative record revision used for Project authoring proposals. */
1171
+ version?: number;
987
1172
  id: string;
988
1173
  slug?: string | null;
989
1174
  encrypted_slug?: string | null;
@@ -1084,6 +1269,7 @@ interface ProjectSettingsRecord {
1084
1269
  default_focus_id_hash: string | null;
1085
1270
  encrypted_settings: string | null;
1086
1271
  updated_at: number | null;
1272
+ auto_selection?: boolean;
1087
1273
  }
1088
1274
  interface ActiveProjectFocus {
1089
1275
  active: true;
@@ -1091,6 +1277,7 @@ interface ActiveProjectFocus {
1091
1277
  focus_id: string;
1092
1278
  team_id: string | null;
1093
1279
  activated_at: number;
1280
+ specialist_focus_id?: string | null;
1094
1281
  }
1095
1282
  interface ProjectRemoteAccessRequestInput {
1096
1283
  request_id: string;
@@ -1314,6 +1501,10 @@ interface UserPlanRecord {
1314
1501
  encrypted_context?: string | null;
1315
1502
  encrypted_linked_project_ids?: string | null;
1316
1503
  status: UserPlanStatus;
1504
+ /** Server-issued approval metadata; never writable through Plan create/update. */
1505
+ approval_state?: string;
1506
+ submitted_revision_id?: string | null;
1507
+ approved_revision_id?: string | null;
1317
1508
  primary_chat_id?: string | null;
1318
1509
  linked_project_ids?: string[] | null;
1319
1510
  key_wrappers?: Array<Record<string, unknown>> | null;
@@ -1324,10 +1515,10 @@ interface UserPlanRecord {
1324
1515
  completed_at?: number | null;
1325
1516
  history?: WorkspaceHistoryResult | null;
1326
1517
  }
1327
- type UserPlanCreateInput = Omit<UserPlanRecord, "version" | "completed_at"> & {
1518
+ type UserPlanCreateInput = Omit<UserPlanRecord, "version" | "completed_at" | "approval_state" | "submitted_revision_id" | "approved_revision_id"> & {
1328
1519
  version?: number;
1329
1520
  };
1330
- type UserPlanUpdateInput = Partial<Omit<UserPlanRecord, "plan_id" | "created_at">> & {
1521
+ type UserPlanUpdateInput = Partial<Omit<UserPlanRecord, "plan_id" | "created_at" | "approval_state" | "submitted_revision_id" | "approved_revision_id">> & {
1331
1522
  version?: number;
1332
1523
  };
1333
1524
  interface UserPlanCriterionRecord {
@@ -1632,6 +1823,14 @@ interface ChatListItem {
1632
1823
  category: string | null;
1633
1824
  mateName: string | null;
1634
1825
  source?: "example";
1826
+ parentId?: string | null;
1827
+ isSubChat?: boolean;
1828
+ isHiddenCandidate?: boolean;
1829
+ isHidden?: boolean;
1830
+ pinned?: boolean;
1831
+ hasDraft?: boolean;
1832
+ draftPreview?: string | null;
1833
+ metadataUpdatedAt?: number | null;
1635
1834
  }
1636
1835
  /** A single parameter extracted from the OpenAPI skill schema. */
1637
1836
  interface SkillParam {
@@ -1731,6 +1930,12 @@ interface DecryptedMessage {
1731
1930
  modelName: string | null;
1732
1931
  createdAt: number;
1733
1932
  embedIds: string[];
1933
+ /** Owner-local originals; never include these in model message history. */
1934
+ piiMappings?: Array<{
1935
+ placeholder: string;
1936
+ original: string;
1937
+ type?: string;
1938
+ }>;
1734
1939
  }
1735
1940
  interface ChatMessageSummary extends DecryptedMessage {
1736
1941
  preview: string;
@@ -1759,6 +1964,9 @@ interface ChatMessageWindowResult {
1759
1964
  endCursor: ChatMessageWindowCursor | null;
1760
1965
  anchorFound: boolean;
1761
1966
  serverMessageCount: number | null;
1967
+ storageTier?: 'hot' | 'archive' | 'mixed';
1968
+ archivePageIds?: string[];
1969
+ archivePayloadCache?: 'disabled';
1762
1970
  }
1763
1971
  interface ChatForkResult {
1764
1972
  success: boolean;
@@ -1803,8 +2011,14 @@ interface EmbedVersionsResponse {
1803
2011
  embed_id: string;
1804
2012
  current_version: number;
1805
2013
  versions: EmbedVersionMeta[];
2014
+ next_cursor?: number | null;
1806
2015
  readonly: boolean;
1807
2016
  }
2017
+ interface EmbedVersionReadContext {
2018
+ chatId?: string;
2019
+ projectId?: string;
2020
+ teamId?: string;
2021
+ }
1808
2022
  interface EmbedVersionContentResponse {
1809
2023
  embed_id: string;
1810
2024
  version_number: number;
@@ -1911,6 +2125,19 @@ interface DecryptedNewChatSuggestion {
1911
2125
  body: string;
1912
2126
  createdAt: number;
1913
2127
  }
2128
+ interface WikipediaLearningBundle {
2129
+ canonical_title: string;
2130
+ language: string;
2131
+ source_url: string;
2132
+ questions: string[];
2133
+ related_articles: Array<{
2134
+ title: string;
2135
+ canonical_title: string;
2136
+ language: string;
2137
+ description: string;
2138
+ }>;
2139
+ expires_in_seconds: number;
2140
+ }
1914
2141
  /** A decrypted memory entry as returned to CLI callers. */
1915
2142
  interface DecryptedMemoryEntry {
1916
2143
  id: string;
@@ -2065,6 +2292,8 @@ declare class OpenMatesClient {
2065
2292
  disambiguation: boolean;
2066
2293
  language: string;
2067
2294
  }>>;
2295
+ wikipediaSummary(title: string, language?: string): Promise<Record<string, unknown>>;
2296
+ wikipediaLearning(title: string, language?: string): Promise<WikipediaLearningBundle>;
2068
2297
  startAccountExport(options?: AccountExportStartOptions): Promise<AccountExportResponse>;
2069
2298
  getAccountExport(exportId: string): Promise<AccountExportResponse>;
2070
2299
  getAccountExportManifest(exportId: string): Promise<AccountExportManifestResponse>;
@@ -2131,6 +2360,14 @@ declare class OpenMatesClient {
2131
2360
  message: string;
2132
2361
  learningMode?: LearningModeContext;
2133
2362
  messageHistory?: BenchmarkHistoryMessage[];
2363
+ piiDetection?: boolean;
2364
+ piiMappings?: Array<{
2365
+ placeholder: string;
2366
+ original: string;
2367
+ type: string;
2368
+ }>;
2369
+ onPrivacyPrepared?: (message: string) => void;
2370
+ onPrivacyProgress?: (done: number, total: number) => void;
2134
2371
  }): Promise<{
2135
2372
  status: "completed";
2136
2373
  chatId: string;
@@ -2297,6 +2534,15 @@ declare class OpenMatesClient {
2297
2534
  * Decrypt a single chat record from the sync cache into a ChatListItem.
2298
2535
  */
2299
2536
  private decryptChatListItem;
2537
+ /** Global activity snapshot; decrypt only running chats and their ancestors. */
2538
+ getChatActivity(options?: TeamContextOptions): Promise<{
2539
+ ids: string[];
2540
+ chats: ChatListItem[];
2541
+ }>;
2542
+ /** Minimal encrypted metadata; unreadable keys stay excluded from normal surfaces. */
2543
+ getSidebarChats(ids: string[], options?: TeamContextOptions): Promise<ChatListItem[]>;
2544
+ /** Observe lifecycle metadata without claiming or collecting AI responses. */
2545
+ observeChatActivity(onChange: () => void): Promise<() => void>;
2300
2546
  listChats(limit?: number, page?: number, options?: TeamContextOptions): Promise<ChatListPage>;
2301
2547
  saveDraft(params: {
2302
2548
  markdown: string;
@@ -2341,6 +2587,7 @@ declare class OpenMatesClient {
2341
2587
  clearDraft(chatId: string): Promise<void>;
2342
2588
  reconcileDraftVersions(chatIds?: string[]): Promise<Record<string, number>>;
2343
2589
  private storeEncryptedDraft;
2590
+ private markDraftCacheFresh;
2344
2591
  private decryptCachedDraft;
2345
2592
  searchChats(query: string, options?: TeamContextOptions): Promise<ChatListItem[]>;
2346
2593
  resolveChatKeyForContext(query: string, options?: TeamContextOptions): Promise<{
@@ -2467,13 +2714,27 @@ declare class OpenMatesClient {
2467
2714
  * Mirrors: chat_actions_store.ts / FollowUpSuggestions.svelte (web app)
2468
2715
  */
2469
2716
  getChatFollowUpSuggestions(chatId: string, options?: TeamContextOptions): Promise<string[]>;
2717
+ private persistAvailableRecoveryOutputs;
2718
+ private replayAvailableRecoveryOutputs;
2719
+ private replayRecoveryOutputPages;
2470
2720
  sendMessage(params: {
2471
2721
  message: string;
2722
+ /** Isolated, credential-free storage-capacity replay only. */
2723
+ testMockMarker?: string;
2472
2724
  chatId?: string;
2473
2725
  /** Explicit user-selected Project; activates its focus before inference preflight. */
2474
2726
  projectId?: string;
2727
+ /** Already authorized private snapshots; inaccessible Project documents are omitted. */
2728
+ jevContext?: CliJevContext;
2729
+ onChatContextApplied?: (event: ChatContextEvent) => void | Promise<void>;
2730
+ onProjectFocusPending?: (countdown: ProjectFocusCountdown | null) => void;
2475
2731
  onProjectWriteApproval?: (request: ProjectWriteApprovalRequest) => boolean | Promise<boolean>;
2476
2732
  onProjectReadApproval?: (request: ProjectReadApprovalRequest) => boolean | Promise<boolean>;
2733
+ /** Observe committed hosted Project file versions after the normal approval flow. */
2734
+ onHostedVersionCommitted?: (result: {
2735
+ embed_id: string;
2736
+ revision: number;
2737
+ }) => void | Promise<void>;
2477
2738
  onRemoteCommandReview?: (review: RemoteCommandReview) => RemoteCommandApprovalChoice | null | undefined | Promise<RemoteCommandApprovalChoice | null | undefined>;
2478
2739
  onRemoteCommandEvent?: (event: DecryptedRemoteCommandEvent) => void | Promise<void>;
2479
2740
  /** Client-generated ID for a new chat, allowing cleanup after an uncertain send outcome. */
@@ -2498,6 +2759,9 @@ declare class OpenMatesClient {
2498
2759
  encryptedEmbeds?: EncryptedEmbed[];
2499
2760
  /** Prepared embeds to encrypt after the real chat/message IDs are known. */
2500
2761
  preparedEmbeds?: PreparedEmbed[];
2762
+ piiDetection?: boolean;
2763
+ onPrivacyProgress?: (done: number, total: number) => void;
2764
+ onPrivacyPrepared?: (message: string) => void;
2501
2765
  /** Placeholder-to-original PII mappings created before sending the user message. */
2502
2766
  piiMappings?: Array<{
2503
2767
  placeholder: string;
@@ -2693,13 +2957,17 @@ declare class OpenMatesClient {
2693
2957
  deleted: boolean;
2694
2958
  }>;
2695
2959
  keepWorkflow(workflowId: string): Promise<WorkflowDetail>;
2960
+ saveWorkflowAsReusable(workflowId: string, options: {
2961
+ idempotencyKey: string;
2962
+ }): Promise<WorkflowDetail>;
2963
+ private workflowRunRouting;
2964
+ runWorkflowOnce(params: WorkflowRunOnceOptions): Promise<{
2965
+ workflow: WorkflowDetail;
2966
+ run: WorkflowRunDetail;
2967
+ }>;
2696
2968
  enableWorkflow(workflowId: string): Promise<WorkflowDetail>;
2697
2969
  disableWorkflow(workflowId: string): Promise<WorkflowDetail>;
2698
- runWorkflow(workflowId: string, params: {
2699
- idempotencyKey: string;
2700
- mode?: "manual" | "test";
2701
- input?: Record<string, unknown>;
2702
- }): Promise<WorkflowRunDetail>;
2970
+ runWorkflow(workflowId: string, params: WorkflowRunOptions): Promise<WorkflowRunDetail>;
2703
2971
  listWorkflowRuns(workflowId: string): Promise<WorkflowRunDetail[]>;
2704
2972
  getWorkflowRun(workflowId: string, runId: string): Promise<WorkflowRunDetail>;
2705
2973
  cancelWorkflowRun(workflowId: string, runId: string): Promise<WorkflowRunCancellationResult>;
@@ -2750,12 +3018,76 @@ declare class OpenMatesClient {
2750
3018
  default_focus_id?: string;
2751
3019
  encrypted_settings?: string;
2752
3020
  updated_at?: number;
3021
+ auto_selection?: boolean;
2753
3022
  }, options?: TeamContextOptions): Promise<ProjectSettingsRecord>;
2754
3023
  activateProjectFocus(projectId: string, input: {
2755
3024
  chat_id: string;
2756
3025
  focus_id: string;
2757
3026
  instruction: string;
3027
+ activation_request_id?: string;
2758
3028
  }, options?: TeamContextOptions): Promise<ActiveProjectFocus>;
3029
+ confirmProjectFocusCountdown(projectId: string, input: {
3030
+ chat_id: string;
3031
+ activation_request_id: string;
3032
+ }, options?: TeamContextOptions): Promise<void>;
3033
+ getCustomRuleDocuments(): Promise<NonNullable<CliJevContext["custom_rule_documents"]>>;
3034
+ decryptTaskContextRecord(record: UserTaskRecord, options?: TeamContextOptions): Promise<DecryptedUserTask>;
3035
+ selectProjectContext(projectId: string, input: {
3036
+ chat_id: string;
3037
+ text: string;
3038
+ candidates: Array<{
3039
+ kind: "focus" | "rule" | "spec" | "fact" | "folder";
3040
+ id: string;
3041
+ title: string;
3042
+ description: string;
3043
+ when_to_use: string;
3044
+ revision: string;
3045
+ }>;
3046
+ }, options?: TeamContextOptions): Promise<Array<{
3047
+ id: string;
3048
+ kind: string;
3049
+ revision: string;
3050
+ }>>;
3051
+ requestProjectAuthoringRecommendations(projectId: string, input: {
3052
+ chat_id: string;
3053
+ message_id: string;
3054
+ team_id?: string | null;
3055
+ catalog: Array<{
3056
+ kind: "focus" | "workflow";
3057
+ id: string;
3058
+ title: string;
3059
+ summary: string;
3060
+ revision: string;
3061
+ }>;
3062
+ history: Array<{
3063
+ role: "user" | "assistant";
3064
+ content: string;
3065
+ }>;
3066
+ }): Promise<Array<Record<string, unknown>>>;
3067
+ inspectProjectFocusRecommendation(projectId: string, input: {
3068
+ assessment_id: string;
3069
+ history: Array<{
3070
+ role: "user" | "assistant";
3071
+ content: string;
3072
+ }>;
3073
+ document: FocusAuthoringDocument;
3074
+ }): Promise<Record<string, unknown> | null>;
3075
+ startProjectAuthoringJob(projectId: string, input: {
3076
+ recommendation_id: string;
3077
+ expected_revision: string | null;
3078
+ history: Array<{
3079
+ role: "user" | "assistant";
3080
+ content: string;
3081
+ }>;
3082
+ target?: FocusAuthoringDocument;
3083
+ remote_binding?: Record<string, unknown>;
3084
+ timezone?: string;
3085
+ }): Promise<Record<string, unknown>>;
3086
+ getProjectAuthoringJob(projectId: string, jobId: string): Promise<Record<string, unknown>>;
3087
+ getChatEncryptionKey(chatId: string, options?: TeamContextOptions): Promise<Uint8Array>;
3088
+ openProjectAuthoringWebSocket(): Promise<OpenMatesWsClient>;
3089
+ commitHostedProjectFileRevision(payload: Record<string, unknown>): Promise<Record<string, unknown>>;
3090
+ acknowledgeProjectAuthoringSave(projectId: string, jobId: string, kind: "focus" | "workflow", input: Record<string, unknown>): Promise<Record<string, unknown>>;
2759
3091
  getActiveProjectFocus(chatId: string): Promise<ActiveProjectFocus | null>;
2760
3092
  deactivateProjectFocus(chatId: string): Promise<void>;
2761
3093
  /** Request cancellation of an active AI response and wait for the server receipt. */
@@ -2787,8 +3119,11 @@ declare class OpenMatesClient {
2787
3119
  }): Promise<Record<string, unknown>>;
2788
3120
  planProjectAsk(input: {
2789
3121
  instruction: string;
3122
+ chatTitles?: string[];
2790
3123
  }): Promise<Record<string, unknown>>;
2791
- listProjectItems(projectId: string, options?: TeamContextOptions): Promise<{
3124
+ listProjectItems(projectId: string, options?: TeamContextOptions & {
3125
+ chatOnly?: boolean;
3126
+ }): Promise<{
2792
3127
  folders: Array<Record<string, unknown>>;
2793
3128
  items: ProjectItemRecord[];
2794
3129
  }>;
@@ -2822,7 +3157,10 @@ declare class OpenMatesClient {
2822
3157
  ws: OpenMatesWsClient;
2823
3158
  ownerId: string;
2824
3159
  }>;
2825
- createProjectItem(projectId: string, input: ProjectItemCreateInput): Promise<ProjectItemRecord>;
3160
+ createProjectItem(projectId: string, input: ProjectItemCreateInput, options?: TeamContextOptions): Promise<ProjectItemRecord>;
3161
+ moveProjectItemToFolder(projectId: string, itemId: string, folderId: string | null, options?: TeamContextOptions): Promise<void>;
3162
+ updateProjectItemMetadata(projectId: string, itemId: string, metadataEncrypted: string, options?: TeamContextOptions, expectedRevision?: string): Promise<void>;
3163
+ createProjectFolder(projectId: string, input: Record<string, unknown>, options?: TeamContextOptions): Promise<void>;
2826
3164
  deleteProjectItemByTarget(projectId: string, itemType: "embed" | "chat" | "workflow", targetId: string, options?: TeamContextOptions): Promise<{
2827
3165
  deleted: boolean;
2828
3166
  deleted_count: number;
@@ -2899,7 +3237,7 @@ declare class OpenMatesClient {
2899
3237
  deleteUserTaskActivity(taskId: string, entryId: string, context?: TeamContextOptions): Promise<UserTaskActivityRecord>;
2900
3238
  addTaskDependency(taskId: string, targetRef: string): Promise<WorkDependencyRecord>;
2901
3239
  removeTaskDependency(taskId: string, targetKind: "plan" | "task", targetId: string): Promise<Record<string, unknown>>;
2902
- getTaskDependencies(taskId: string): Promise<{
3240
+ getTaskDependencies(taskId: string, options?: TeamContextOptions): Promise<{
2903
3241
  dependencies: WorkDependencyRecord[];
2904
3242
  blockers: WorkDependencyRecord[];
2905
3243
  }>;
@@ -2917,6 +3255,9 @@ declare class OpenMatesClient {
2917
3255
  teamId?: string | null;
2918
3256
  personal?: boolean;
2919
3257
  }): Promise<UserPlanRecord[]>;
3258
+ getUserPlan(planId: string, options?: TeamContextOptions): Promise<UserPlanRecord>;
3259
+ /** Decrypt only the selected Plan's direction summary fields, without authoring or changing approval. */
3260
+ decryptPlanContextSummary(record: UserPlanRecord, options?: TeamContextOptions): Promise<string>;
2920
3261
  createUserPlan(input: UserPlanCreateInput): Promise<UserPlanRecord>;
2921
3262
  askUserPlans(input: {
2922
3263
  instruction: string;
@@ -3156,14 +3497,17 @@ declare class OpenMatesClient {
3156
3497
  * @returns Full share URL, e.g. https://openmates.org/share/embed/{id}#key={blob}
3157
3498
  */
3158
3499
  createEmbedShareLink(embedIdOrShort: string, durationSeconds?: ShareDuration, password?: string): Promise<string>;
3159
- listEmbedVersions(embedIdOrShort: string): Promise<EmbedVersionsResponse>;
3500
+ private embedVersionReadQuery;
3501
+ listEmbedVersions(embedIdOrShort: string, context?: EmbedVersionReadContext): Promise<EmbedVersionsResponse>;
3160
3502
  startApplicationPreview(params: ApplicationPreviewStartParams): Promise<ApplicationPreviewStartResponse>;
3161
3503
  getApplicationPreviewStatus(sessionId: string): Promise<ApplicationPreviewStatusResponse>;
3162
3504
  openApplicationPreview(sessionId: string): Promise<ApplicationPreviewStatusResponse>;
3163
3505
  stopApplicationPreview(sessionId: string): Promise<ApplicationPreviewStopResponse>;
3164
- getEmbedVersion(embedIdOrShort: string, version: number): Promise<EmbedVersionContentResponse>;
3506
+ getEmbedVersion(embedIdOrShort: string, version: number, context?: EmbedVersionReadContext): Promise<EmbedVersionContentResponse>;
3507
+ private publishEmbedSnapshotFromContent;
3165
3508
  restoreEmbedVersion(embedIdOrShort: string, version: number): Promise<EmbedVersionRestoreResponse>;
3166
3509
  private reconstructEncryptedEmbedVersion;
3510
+ private resolveVersionEmbedKey;
3167
3511
  private formatEmbedVersionError;
3168
3512
  private formatApplicationPreviewError;
3169
3513
  private resolveEmbedId;
@@ -3353,6 +3697,8 @@ declare function classifyImagesAiDetection(score: number | null | undefined): Im
3353
3697
  declare function formatImagesAiDetectionLabel(classification: ImagesAiDetectionClassification): string;
3354
3698
  declare function buildImagesAiDetectionSummary(uploadResult: UploadFileResponse, filePath: string): ImagesAiDetectionSummary;
3355
3699
  declare function buildTravelConnectionsRequest(positionals: string[], flags: Record<string, string | boolean>): Record<string, unknown>;
3700
+ /** Keep E2E auto-generated setup codes away from the TOTP rollover. */
3701
+ declare function waitForSafeE2ETotpWindow(now?: () => number, sleep?: (milliseconds: number) => Promise<void>): Promise<void>;
3356
3702
  /** Keep account output curated; complete API fields remain available with --json. */
3357
3703
  declare function printWhoAmI(user: Record<string, unknown>, client: Pick<OpenMatesClient, "apiUrl" | "getActiveTeamId" | "searchChats">): Promise<void>;
3358
3704
  /** Format a share duration for display */
@@ -3364,5 +3710,6 @@ declare function printWhoAmI(user: Record<string, unknown>, client: Pick<OpenMat
3364
3710
  declare function serializeToYaml(data: Record<string, unknown>, indent?: number): string;
3365
3711
  /** Map language identifier to file extension for code embed downloads. */
3366
3712
  declare function getExtForLang(language: string): string;
3713
+ declare function handleWiki(client: OpenMatesClient, action: string | undefined, rest: string[], flags: Record<string, string | boolean>): Promise<void>;
3367
3714
 
3368
- export { type CachedChat as $, type WorkflowGraph as A, type WorkflowRunContentRetention as B, type WorkflowRunDetail as C, type DecryptedUserTask as D, type ExternalChatContext as E, type WorkflowNode as F, type WorkflowRunCancellationResult as G, type WorkflowTemplateProjectionUpsertParams as H, type WorkflowTemplateProjectionResult as I, type PublicWorkflowTemplateProjection as J, type WorkflowTemplateProjectionRevocationResult as K, type WorkflowTemplateBindingCompletionParams as L, type WorkflowTemplateBindingCompletionResult as M, type WorkflowTemplateShortUrlParams as N, type WorkflowTemplateShortUrlResult as O, type ProjectItemRecord as P, type WorkflowTemplateImportPayload as Q, type ImportedWorkflowTemplate as R, type ShortUrlRevokeResult as S, type TaskCreateOptions as T, type UserPlanStatus as U, type AuthMethodsStatus as V, type WorkflowSummary as W, type AuthoritativeChatReconciliation as X, type BackupCodesResult as Y, type BankTransferOrderDetails as Z, type BankTransferStatus as _, type UserPlanRecord as a, type CachedNewChatSuggestion as a0, type ChatListPage as a1, type CliSignupResult as a2, type DecryptedDraft as a3, type DecryptedEmbed as a4, type DecryptedMemoryEntry as a5, type DecryptedMessage as a6, type DecryptedNewChatSuggestion as a7, type DocsFile as a8, type DocsFolder as a9, getExtForLang as aA, normalizeInterestTagIds as aB, reconcileAuthoritativeChats as aC, serializeToYaml as aD, assertTrustedAccountCommandAllowed as aE, assertTrustedAccountGuardEnvironment as aF, buildProjectDefaultFocus as aG, buildTravelConnectionsRequest as aH, extractExplicitProjectMentions as aI, printWhoAmI as aJ, readRootProjectInstructions as aK, renderProjectReadApprovalRequest as aL, renderProjectWriteApprovalRequest as aM, renderRemoteCommandEvent as aN, requireExactConfirmation as aO, resolveProjectContext as aP, shouldRequireTrustedAccountGuard as aQ, waitForWorkflowRun as aR, type DocsSearchResult as aa, type DocsTree as ab, type EncryptedDraft as ac, type GiftCardBankTransferStatus as ad, INTEREST_TAG_IDS as ae, type ImagesAiDetectionClassification as af, type ImagesAiDetectionSummary as ag, type InterestTagId as ah, MATE_NAMES as ai, MEMORY_TYPE_REGISTRY as aj, type MemoryFieldDef as ak, type MemoryTypeDef as al, OpenMatesClient as am, type OpenMatesClientOptions as an, type OpenMatesSession as ao, type SyncCache as ap, type TopicPreferencesPayload as aq, type TotpSetupStartResult as ar, type WorkflowEdge as as, type WorkflowNodeRun as at, type WorkflowNodeType as au, type WorkflowRunContentStorage as av, buildImagesAiDetectionSummary as aw, classifyImagesAiDetection as ax, deriveAppUrl as ay, formatImagesAiDetectionLabel as az, type UserPlanVerificationStatus as b, type UserPlanLearningType as c, type UserPlanLearningTargetKind as d, type UserPlanLearningStatus as e, type UserPlanLearningLevel as f, type UserPlanLearningRecord as g, type UserPlanCriterionRecord as h, type UserPlanVerificationRecord as i, type UserPlanCreateInput as j, type UserPlanUpdateInput as k, type TaskUpdateOptions as l, type UserPlanLearningCreateTasksInput as m, type UserPlanLearningCreateTasksResult as n, type UserTaskStatus as o, type TaskPriorityLevel as p, type DecryptedTaskActivityEntry as q, type TaskActivityCreateOptions as r, type UserTaskReorderInput as s, type WorkflowCapability as t, type WorkflowDetail as u, type WorkflowAuthoringWarning as v, type WorkflowInputStartParams as w, type WorkflowInputSessionResult as x, type WorkflowInputSessionDetail as y, type WorkflowInputEvent as z };
3715
+ export { type BackupCodesResult as $, type WorkflowGraph as A, type WorkflowRunContentRetention as B, type WorkflowRunOnceOptions as C, type DecryptedUserTask as D, type ExternalChatContext as E, type WorkflowRunDetail as F, type WorkflowRunOptions as G, type WorkflowNode as H, type WorkflowRunCancellationResult as I, type WorkflowTemplateProjectionUpsertParams as J, type WorkflowTemplateProjectionResult as K, type PublicWorkflowTemplateProjection as L, type WorkflowTemplateProjectionRevocationResult as M, type WorkflowTemplateBindingCompletionParams as N, type WorkflowTemplateBindingCompletionResult as O, type ProjectItemRecord as P, type WorkflowTemplateShortUrlParams as Q, type WorkflowTemplateShortUrlResult as R, type ShortUrlRevokeResult as S, type TaskCreateOptions as T, type UserPlanStatus as U, type WorkflowTemplateImportPayload as V, type WorkflowSummary as W, type ImportedWorkflowTemplate as X, type WikipediaLearningBundle as Y, type AuthMethodsStatus as Z, type AuthoritativeChatReconciliation as _, type UserPlanRecord as a, type BankTransferOrderDetails as a0, type BankTransferStatus as a1, type CachedChat as a2, type CachedNewChatSuggestion as a3, type ChatListPage as a4, type CliSignupResult as a5, type DecryptedDraft as a6, type DecryptedEmbed as a7, type DecryptedMemoryEntry as a8, type DecryptedMessage as a9, type WorkflowRunRouting as aA, buildImagesAiDetectionSummary as aB, classifyImagesAiDetection as aC, deriveAppUrl as aD, formatImagesAiDetectionLabel as aE, getExtForLang as aF, normalizeInterestTagIds as aG, reconcileAuthoritativeChats as aH, serializeToYaml as aI, assertTrustedAccountCommandAllowed as aJ, assertTrustedAccountGuardEnvironment as aK, buildProjectDefaultFocus as aL, buildTravelConnectionsRequest as aM, extractExplicitProjectMentions as aN, handleWiki as aO, printWhoAmI as aP, readRootProjectInstructions as aQ, renderProjectReadApprovalRequest as aR, renderProjectWriteApprovalRequest as aS, renderRemoteCommandEvent as aT, requireExactConfirmation as aU, resolveProjectContext as aV, shouldRequireTrustedAccountGuard as aW, waitForSafeE2ETotpWindow as aX, waitForWorkflowRun as aY, type DecryptedNewChatSuggestion as aa, type DocsFile as ab, type DocsFolder as ac, type DocsSearchResult as ad, type DocsTree as ae, type EncryptedDraft as af, type GiftCardBankTransferStatus as ag, INTEREST_TAG_IDS as ah, type ImagesAiDetectionClassification as ai, type ImagesAiDetectionSummary as aj, type InterestTagId as ak, MATE_NAMES as al, MEMORY_TYPE_REGISTRY as am, type MemoryFieldDef as an, type MemoryTypeDef as ao, OpenMatesClient as ap, type OpenMatesClientOptions as aq, type OpenMatesSession as ar, type SyncCache as as, type TopicPreferencesPayload as at, type TotpSetupStartResult as au, type WorkflowEdge as av, type WorkflowNodeRun as aw, type WorkflowNodeType as ax, type WorkflowReturnedOutputReference as ay, type WorkflowRunContentStorage as az, type UserPlanVerificationStatus as b, type UserPlanLearningType as c, type UserPlanLearningTargetKind as d, type UserPlanLearningStatus as e, type UserPlanLearningLevel as f, type UserPlanLearningRecord as g, type UserPlanCriterionRecord as h, type UserPlanVerificationRecord as i, type UserPlanCreateInput as j, type UserPlanUpdateInput as k, type TaskUpdateOptions as l, type UserPlanLearningCreateTasksInput as m, type UserPlanLearningCreateTasksResult as n, type UserTaskStatus as o, type TaskPriorityLevel as p, type DecryptedTaskActivityEntry as q, type TaskActivityCreateOptions as r, type UserTaskReorderInput as s, type WorkflowCapability as t, type WorkflowDetail as u, type WorkflowAuthoringWarning as v, type WorkflowInputStartParams as w, type WorkflowInputSessionResult as x, type WorkflowInputSessionDetail as y, type WorkflowInputEvent as z };
package/dist/cli.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- export { af as ImagesAiDetectionClassification, ag as ImagesAiDetectionSummary, aE as assertTrustedAccountCommandAllowed, aF as assertTrustedAccountGuardEnvironment, aw as buildImagesAiDetectionSummary, aG as buildProjectDefaultFocus, aH as buildTravelConnectionsRequest, ax as classifyImagesAiDetection, aI as extractExplicitProjectMentions, az as formatImagesAiDetectionLabel, aA as getExtForLang, aJ as printWhoAmI, aK as readRootProjectInstructions, aL as renderProjectReadApprovalRequest, aM as renderProjectWriteApprovalRequest, aN as renderRemoteCommandEvent, aO as requireExactConfirmation, aP as resolveProjectContext, aD as serializeToYaml, aQ as shouldRequireTrustedAccountGuard, aR as waitForWorkflowRun } from './cli-CoxPyuUN.js';
2
+ export { ai as ImagesAiDetectionClassification, aj as ImagesAiDetectionSummary, aJ as assertTrustedAccountCommandAllowed, aK as assertTrustedAccountGuardEnvironment, aB as buildImagesAiDetectionSummary, aL as buildProjectDefaultFocus, aM as buildTravelConnectionsRequest, aC as classifyImagesAiDetection, aN as extractExplicitProjectMentions, aE as formatImagesAiDetectionLabel, aF as getExtForLang, aO as handleWiki, aP as printWhoAmI, aQ as readRootProjectInstructions, aR as renderProjectReadApprovalRequest, aS as renderProjectWriteApprovalRequest, aT as renderRemoteCommandEvent, aU as requireExactConfirmation, aV as resolveProjectContext, aI as serializeToYaml, aW as shouldRequireTrustedAccountGuard, aX as waitForSafeE2ETotpWindow, aY as waitForWorkflowRun } from './cli-C2G3DpGo.js';
package/dist/cli.js CHANGED
@@ -9,6 +9,7 @@ import {
9
9
  extractExplicitProjectMentions,
10
10
  formatImagesAiDetectionLabel,
11
11
  getExtForLang,
12
+ handleWiki,
12
13
  printWhoAmI,
13
14
  readRootProjectInstructions,
14
15
  renderProjectReadApprovalRequest,
@@ -18,9 +19,12 @@ import {
18
19
  resolveProjectContext,
19
20
  serializeToYaml,
20
21
  shouldRequireTrustedAccountGuard,
22
+ waitForSafeE2ETotpWindow,
21
23
  waitForWorkflowRun
22
- } from "./chunk-S7KAERLW.js";
24
+ } from "./chunk-UIW7XY2C.js";
25
+ import "./chunk-FRNW5Q2V.js";
23
26
  import "./chunk-IWKP55ZB.js";
27
+ import "./chunk-4IRYB3YN.js";
24
28
  import "./chunk-BBKJZ23O.js";
25
29
  export {
26
30
  assertTrustedAccountCommandAllowed,
@@ -32,6 +36,7 @@ export {
32
36
  extractExplicitProjectMentions,
33
37
  formatImagesAiDetectionLabel,
34
38
  getExtForLang,
39
+ handleWiki,
35
40
  printWhoAmI,
36
41
  readRootProjectInstructions,
37
42
  renderProjectReadApprovalRequest,
@@ -41,5 +46,6 @@ export {
41
46
  resolveProjectContext,
42
47
  serializeToYaml,
43
48
  shouldRequireTrustedAccountGuard,
49
+ waitForSafeE2ETotpWindow,
44
50
  waitForWorkflowRun
45
51
  };