@getmodus/sdk 0.7.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { c as components, H as HttpClient, M as ModusConfig, P as Page, W as WorkflowType, V as VariationView, a as Workflow, C as ContextItem, b as ContextItemLookupRow, d as CustomContextItemsResource, e as ConversationKind, f as ConversationListItem, g as Conversation, S as ScopeConversationsResource, h as Scope, i as ModusClientBase, j as ModusOptions } from './conversations-B0_jmEuT.cjs';
2
- export { A as Agent, k as AgentType, l as ContextType, m as Message, O as OPERATIONS, n as OperationId, o as OperationSpec, p as ScopeStatus, q as ScopeVariation, r as Skill, s as SkillStatus, t as SkillVariation, u as conversationScopeId, v as conversationSkillId, w as operations, x as paths } from './conversations-B0_jmEuT.cjs';
1
+ import { c as components, H as HttpClient, M as ModusConfig, P as Page, W as WorkflowType, V as VariationView, a as Workflow, C as ContextItem, b as ContextItemLookupRow, d as CustomContextItemsResource, e as ConversationKind, f as ConversationListItem, g as Conversation, S as ScopeConversationsResource, h as Scope, i as ModusClientBase, j as ModusOptions } from './conversations-COA6NW8I.cjs';
2
+ export { A as Agent, k as AgentType, l as ContextItemAncestor, m as ContextItemDeletion, n as ContextItemMove, o as ContextType, p as Message, O as OPERATIONS, q as OperationId, r as OperationSpec, s as ScopeStatus, t as ScopeVariation, u as Skill, v as SkillStatus, w as SkillVariation, x as conversationScopeId, y as conversationSkillId, z as operations, B as paths } from './conversations-COA6NW8I.cjs';
3
3
 
4
4
  /**
5
5
  * Base class for all Modus SDK errors.
@@ -107,18 +107,18 @@ declare class ValidationError extends ModusError {
107
107
  * validation before the request is sent.
108
108
  *
109
109
  * Allowed values:
110
- * - `claude-sonnet-5`, `claude-sonnet-4.6`, `claude-opus-4.8`
111
- * - `gpt-5.2`, `gpt-5.5`, `gpt-5-mini`, `gpt-oss-120b`, `gpt-oss-20b`
110
+ * - `claude-sonnet-5`, `claude-sonnet-5.5`, `claude-sonnet-4.6`, `claude-opus-4.8`, `claude-opus-5.5`
111
+ * - `gpt-5.2`, `gpt-5.5`, `gpt-5-mini`, `gpt-5.6-luna`, `gpt-6-luna`, `gpt-oss-120b`, `gpt-oss-20b`
112
112
  * - `qwen3-235b-a22b-2507`, `qwen3-coder`, `qwen3-32b`
113
113
  * - `deepseek-chat-v3.1`, `deepseek-v4-pro`, `deepseek-v4-flash-latest`, `minimax-m2.7`
114
114
  * - `llama-4-maverick`, `llama-4-scout`, `llama-3.3-70b-instruct`
115
115
  * - `gemini-3.1-pro-preview`, `gemini-3-flash-preview`
116
- * - `grok-4.3-fast`, `grok-4.3`
116
+ * - `grok-4.3-fast`, `grok-4.3`, `grok-4.7`, `kimi-k3`
117
117
  *
118
118
  * @example
119
119
  * ```ts
120
120
  * const result = await client.modus.chat('Summarize open tickets', {
121
- * model: 'claude-sonnet-4.6',
121
+ * model: 'claude-sonnet-5.5',
122
122
  * })
123
123
  * ```
124
124
  */
@@ -673,6 +673,17 @@ declare class ContextItemsResource {
673
673
  * @param options.pageSize - Maximum items per page (default 25).
674
674
  * @param options.pageToken - Opaque token from a previous page.
675
675
  * @param options.contextType - Filter to a single context type (e.g. `"note"`).
676
+ * @param options.parentUids - Exact ordered native ancestry chain for direct
677
+ * children. Omit to leave parent unrestricted; pass `[]` for the known-empty
678
+ * root. Native UIDs are exact tokens (including whitespace); do not use the
679
+ * hashed context-item `uid`. For a folder's children, send that item's
680
+ * `ancestry` UIDs plus its last `dataPath` token.
681
+ * @param options.ancestorUids - Ordered UID ancestry prefix for strict
682
+ * descendants. Omit to leave unrestricted; pass `[]` for every item with
683
+ * non-null ancestry.
684
+ * @param options.connectionIds - Restrict to these connection ids. Omit to
685
+ * leave unfiltered; pass `[]` to match none. The Files root is
686
+ * `connectionIds: ['files']` with `parentUids: []`.
676
687
  * @returns A page of context items — use `.autoPagingIter()` for all pages.
677
688
  *
678
689
  * @example
@@ -682,11 +693,33 @@ declare class ContextItemsResource {
682
693
  * console.log(item.description ?? item.uid, item.uid)
683
694
  * }
684
695
  * ```
696
+ *
697
+ * @example
698
+ * ```ts
699
+ * const rootFolders = await client.context.items.list({
700
+ * connectionIds: ['files'],
701
+ * contextType: 'file_folder_metadata',
702
+ * parentUids: [],
703
+ * })
704
+ * const folder = rootFolders.items[0]
705
+ * const nativeUid = folder?.dataPath?.at(-1)
706
+ * // Known ancestry only — never treat null/omitted ancestry as a root chain.
707
+ * if (folder?.ancestry != null && nativeUid !== undefined) {
708
+ * const filesInFolder = await client.context.items.list({
709
+ * connectionIds: ['files'],
710
+ * contextType: 'file_upload',
711
+ * parentUids: [...folder.ancestry.map((a) => a.uid), nativeUid],
712
+ * })
713
+ * }
714
+ * ```
685
715
  */
686
716
  list(options?: {
687
717
  pageSize?: number;
688
718
  pageToken?: string;
689
719
  contextType?: string;
720
+ parentUids?: readonly string[];
721
+ ancestorUids?: readonly string[];
722
+ connectionIds?: readonly string[];
690
723
  }): Promise<Page<ContextItem>>;
691
724
  private listPage;
692
725
  /**
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { c as components, H as HttpClient, M as ModusConfig, P as Page, W as WorkflowType, V as VariationView, a as Workflow, C as ContextItem, b as ContextItemLookupRow, d as CustomContextItemsResource, e as ConversationKind, f as ConversationListItem, g as Conversation, S as ScopeConversationsResource, h as Scope, i as ModusClientBase, j as ModusOptions } from './conversations-B0_jmEuT.js';
2
- export { A as Agent, k as AgentType, l as ContextType, m as Message, O as OPERATIONS, n as OperationId, o as OperationSpec, p as ScopeStatus, q as ScopeVariation, r as Skill, s as SkillStatus, t as SkillVariation, u as conversationScopeId, v as conversationSkillId, w as operations, x as paths } from './conversations-B0_jmEuT.js';
1
+ import { c as components, H as HttpClient, M as ModusConfig, P as Page, W as WorkflowType, V as VariationView, a as Workflow, C as ContextItem, b as ContextItemLookupRow, d as CustomContextItemsResource, e as ConversationKind, f as ConversationListItem, g as Conversation, S as ScopeConversationsResource, h as Scope, i as ModusClientBase, j as ModusOptions } from './conversations-COA6NW8I.js';
2
+ export { A as Agent, k as AgentType, l as ContextItemAncestor, m as ContextItemDeletion, n as ContextItemMove, o as ContextType, p as Message, O as OPERATIONS, q as OperationId, r as OperationSpec, s as ScopeStatus, t as ScopeVariation, u as Skill, v as SkillStatus, w as SkillVariation, x as conversationScopeId, y as conversationSkillId, z as operations, B as paths } from './conversations-COA6NW8I.js';
3
3
 
4
4
  /**
5
5
  * Base class for all Modus SDK errors.
@@ -107,18 +107,18 @@ declare class ValidationError extends ModusError {
107
107
  * validation before the request is sent.
108
108
  *
109
109
  * Allowed values:
110
- * - `claude-sonnet-5`, `claude-sonnet-4.6`, `claude-opus-4.8`
111
- * - `gpt-5.2`, `gpt-5.5`, `gpt-5-mini`, `gpt-oss-120b`, `gpt-oss-20b`
110
+ * - `claude-sonnet-5`, `claude-sonnet-5.5`, `claude-sonnet-4.6`, `claude-opus-4.8`, `claude-opus-5.5`
111
+ * - `gpt-5.2`, `gpt-5.5`, `gpt-5-mini`, `gpt-5.6-luna`, `gpt-6-luna`, `gpt-oss-120b`, `gpt-oss-20b`
112
112
  * - `qwen3-235b-a22b-2507`, `qwen3-coder`, `qwen3-32b`
113
113
  * - `deepseek-chat-v3.1`, `deepseek-v4-pro`, `deepseek-v4-flash-latest`, `minimax-m2.7`
114
114
  * - `llama-4-maverick`, `llama-4-scout`, `llama-3.3-70b-instruct`
115
115
  * - `gemini-3.1-pro-preview`, `gemini-3-flash-preview`
116
- * - `grok-4.3-fast`, `grok-4.3`
116
+ * - `grok-4.3-fast`, `grok-4.3`, `grok-4.7`, `kimi-k3`
117
117
  *
118
118
  * @example
119
119
  * ```ts
120
120
  * const result = await client.modus.chat('Summarize open tickets', {
121
- * model: 'claude-sonnet-4.6',
121
+ * model: 'claude-sonnet-5.5',
122
122
  * })
123
123
  * ```
124
124
  */
@@ -673,6 +673,17 @@ declare class ContextItemsResource {
673
673
  * @param options.pageSize - Maximum items per page (default 25).
674
674
  * @param options.pageToken - Opaque token from a previous page.
675
675
  * @param options.contextType - Filter to a single context type (e.g. `"note"`).
676
+ * @param options.parentUids - Exact ordered native ancestry chain for direct
677
+ * children. Omit to leave parent unrestricted; pass `[]` for the known-empty
678
+ * root. Native UIDs are exact tokens (including whitespace); do not use the
679
+ * hashed context-item `uid`. For a folder's children, send that item's
680
+ * `ancestry` UIDs plus its last `dataPath` token.
681
+ * @param options.ancestorUids - Ordered UID ancestry prefix for strict
682
+ * descendants. Omit to leave unrestricted; pass `[]` for every item with
683
+ * non-null ancestry.
684
+ * @param options.connectionIds - Restrict to these connection ids. Omit to
685
+ * leave unfiltered; pass `[]` to match none. The Files root is
686
+ * `connectionIds: ['files']` with `parentUids: []`.
676
687
  * @returns A page of context items — use `.autoPagingIter()` for all pages.
677
688
  *
678
689
  * @example
@@ -682,11 +693,33 @@ declare class ContextItemsResource {
682
693
  * console.log(item.description ?? item.uid, item.uid)
683
694
  * }
684
695
  * ```
696
+ *
697
+ * @example
698
+ * ```ts
699
+ * const rootFolders = await client.context.items.list({
700
+ * connectionIds: ['files'],
701
+ * contextType: 'file_folder_metadata',
702
+ * parentUids: [],
703
+ * })
704
+ * const folder = rootFolders.items[0]
705
+ * const nativeUid = folder?.dataPath?.at(-1)
706
+ * // Known ancestry only — never treat null/omitted ancestry as a root chain.
707
+ * if (folder?.ancestry != null && nativeUid !== undefined) {
708
+ * const filesInFolder = await client.context.items.list({
709
+ * connectionIds: ['files'],
710
+ * contextType: 'file_upload',
711
+ * parentUids: [...folder.ancestry.map((a) => a.uid), nativeUid],
712
+ * })
713
+ * }
714
+ * ```
685
715
  */
686
716
  list(options?: {
687
717
  pageSize?: number;
688
718
  pageToken?: string;
689
719
  contextType?: string;
720
+ parentUids?: readonly string[];
721
+ ancestorUids?: readonly string[];
722
+ connectionIds?: readonly string[];
690
723
  }): Promise<Page<ContextItem>>;
691
724
  private listPage;
692
725
  /**
package/dist/index.js CHANGED
@@ -29,7 +29,7 @@ import {
29
29
  validateChatModel,
30
30
  validateId,
31
31
  validatePageSize
32
- } from "./chunk-JMFT5KO5.js";
32
+ } from "./chunk-GFS7CNON.js";
33
33
 
34
34
  // src/_agent_run_request.ts
35
35
  import { randomUUID } from "crypto";
@@ -901,9 +901,18 @@ var ConnectionsResource = class {
901
901
  };
902
902
 
903
903
  // src/resources/context/items.ts
904
- function contextListParams(pageSize, pageToken, contextType) {
904
+ function contextListParams(pageSize, pageToken, filters = {}) {
905
905
  const extra = {};
906
- if (contextType !== void 0) extra.contextTypes = [contextType];
906
+ if (filters.contextType !== void 0) extra.contextTypes = [filters.contextType];
907
+ if (filters.parentUids !== void 0) {
908
+ extra.parentUids = filters.parentUids.length === 0 ? "" : [...filters.parentUids];
909
+ }
910
+ if (filters.ancestorUids !== void 0) {
911
+ extra.ancestorUids = filters.ancestorUids.length === 0 ? "" : [...filters.ancestorUids];
912
+ }
913
+ if (filters.connectionIds !== void 0) {
914
+ extra.connectionIds = filters.connectionIds.length === 0 ? "" : [...filters.connectionIds];
915
+ }
907
916
  return aipListParams(pageSize, pageToken, extra);
908
917
  }
909
918
  function parseContextItem(raw) {
@@ -929,6 +938,17 @@ var ContextItemsResource = class {
929
938
  * @param options.pageSize - Maximum items per page (default 25).
930
939
  * @param options.pageToken - Opaque token from a previous page.
931
940
  * @param options.contextType - Filter to a single context type (e.g. `"note"`).
941
+ * @param options.parentUids - Exact ordered native ancestry chain for direct
942
+ * children. Omit to leave parent unrestricted; pass `[]` for the known-empty
943
+ * root. Native UIDs are exact tokens (including whitespace); do not use the
944
+ * hashed context-item `uid`. For a folder's children, send that item's
945
+ * `ancestry` UIDs plus its last `dataPath` token.
946
+ * @param options.ancestorUids - Ordered UID ancestry prefix for strict
947
+ * descendants. Omit to leave unrestricted; pass `[]` for every item with
948
+ * non-null ancestry.
949
+ * @param options.connectionIds - Restrict to these connection ids. Omit to
950
+ * leave unfiltered; pass `[]` to match none. The Files root is
951
+ * `connectionIds: ['files']` with `parentUids: []`.
932
952
  * @returns A page of context items — use `.autoPagingIter()` for all pages.
933
953
  *
934
954
  * @example
@@ -938,23 +958,47 @@ var ContextItemsResource = class {
938
958
  * console.log(item.description ?? item.uid, item.uid)
939
959
  * }
940
960
  * ```
961
+ *
962
+ * @example
963
+ * ```ts
964
+ * const rootFolders = await client.context.items.list({
965
+ * connectionIds: ['files'],
966
+ * contextType: 'file_folder_metadata',
967
+ * parentUids: [],
968
+ * })
969
+ * const folder = rootFolders.items[0]
970
+ * const nativeUid = folder?.dataPath?.at(-1)
971
+ * // Known ancestry only — never treat null/omitted ancestry as a root chain.
972
+ * if (folder?.ancestry != null && nativeUid !== undefined) {
973
+ * const filesInFolder = await client.context.items.list({
974
+ * connectionIds: ['files'],
975
+ * contextType: 'file_upload',
976
+ * parentUids: [...folder.ancestry.map((a) => a.uid), nativeUid],
977
+ * })
978
+ * }
979
+ * ```
941
980
  */
942
981
  list(options = {}) {
943
982
  const pageSize = options.pageSize ?? 25;
944
983
  validatePageSize(pageSize);
945
- return this.listPage(pageSize, options.pageToken, options.contextType);
984
+ return this.listPage(pageSize, options.pageToken, {
985
+ contextType: options.contextType,
986
+ parentUids: options.parentUids,
987
+ ancestorUids: options.ancestorUids,
988
+ connectionIds: options.connectionIds
989
+ });
946
990
  }
947
- async listPage(pageSize, pageToken, contextType) {
991
+ async listPage(pageSize, pageToken, filters) {
948
992
  const data = asRecord(
949
993
  await invokeWithRetry(this.config, this.http, "ContextItemsController_list", {
950
- query: contextListParams(pageSize, pageToken, contextType)
994
+ query: contextListParams(pageSize, pageToken, filters)
951
995
  })
952
996
  );
953
997
  return buildAipPage(
954
998
  data,
955
999
  "contextItems",
956
1000
  parseContextItem,
957
- (token) => this.listPage(pageSize, token, contextType)
1001
+ (token) => this.listPage(pageSize, token, filters)
958
1002
  );
959
1003
  }
960
1004
  /**