@omni-commerce/sdk 0.26.0 → 0.27.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.js CHANGED
@@ -33,7 +33,7 @@ function normalizeClientOptions(options = {}) {
33
33
  }
34
34
 
35
35
  // src/version.ts
36
- var SDK_VERSION = "0.26.0";
36
+ var SDK_VERSION = "0.27.0";
37
37
  var SDK_USER_AGENT = `omnicommerce-js/${SDK_VERSION}`;
38
38
 
39
39
  // src/environments.ts
@@ -710,7 +710,7 @@ var AgentsGeneralClient = class {
710
710
  *
711
711
  * Run the general Omni agent and wait until it completes, pauses for approval, or fails. Requires `agents:invoke`.
712
712
 
713
- A waiting call can take several minutes; raise the client timeout. Send `decisions` with the same `thread_id` to approve or reject a paused run. Omit `config.enabled_tools` to use the organization's agent tools. Attach images on the latest user message as `{ type: "image", url }` HTTP(S) URLs.
713
+ A waiting call can take several minutes; raise the client timeout. Send `decisions` with the same `thread_id` to approve or reject a paused run. Omit `config.enabled_tools` to use the organization's agent tools. Send only new messages on each turn; thread_id continues the conversation stored in Omni sessions and checkpoints. Omit thread_id for a new conversation. Optional message IDs use native LangGraph replacement semantics, not run idempotency. audience=customer restricts tools to public storefront access without establishing a verified customer identity. Attach images on the latest user message as `{ type: "image", url }` HTTP(S) URLs.
714
714
  *
715
715
  * `POST /api/v1/agents/general/invoke`
716
716
  */
@@ -766,18 +766,36 @@ var AgentsClient = class {
766
766
  this.general = new AgentsGeneralClient(this._http);
767
767
  }
768
768
  /**
769
- * Send a message to an agent
769
+ * Invoke a saved agent
770
770
  *
771
- * Message the exact built-in or custom agent in the URL, using its saved model, instructions, tools, permissions and Programmatic starting mode.
771
+ * Invoke the exact built-in or custom agent in the URL using its saved configuration and Programmatic starting mode. Uses the same invocation request and run response as the general agent and MCP.
772
772
 
773
- ### Authentication
774
- Requires an API key with `agents:invoke`, or a sign-in session. Organization-owned keys use their recorded creator's current membership and agent access; keys without a valid owner are refused. API keys identify their organization; session requests include `organizationId`.
773
+ Requires agents:invoke and current organization membership and agent access. Organization-owned keys use their recorded creator; no alternate organization member is substituted. Session requests include organizationId.
774
+
775
+ Send one or more new messages (at most 50 and 100000 text characters) ending with a user message. Omit thread_id to create a conversation, or reuse the returned thread_id to continue its stored history. An initial batch can import external history, including human replies. Do not resend history on subsequent turns. Optional message IDs follow native LangGraph replacement semantics,
776
+ *
777
+ * `POST /api/v1/agents/{agentId}/invoke`
778
+ */
779
+ invoke(request, requestOptions) {
780
+ const { agentId, ...body } = request ?? {};
781
+ return this._http.request({
782
+ method: "POST",
783
+ path: `/api/v1/agents/${encodePathParam("agentId", agentId)}/invoke`,
784
+ query: void 0,
785
+ body,
786
+ ...mergeRequestOptions(requestOptions)
787
+ });
788
+ }
789
+ /**
790
+ * Invoke a saved agent (alias)
791
+ *
792
+ * Alias of /agents/{agentId}/invoke with the identical request and response. Prefer /invoke.
793
+
794
+ Invoke the exact built-in or custom agent in the URL using its saved configuration and Programmatic starting mode. Uses the same invocation request and run response as the general agent and MCP.
795
+
796
+ Requires agents:invoke and current organization membership and agent access. Organization-owned keys use their recorded creator; no alternate organization member is substituted. Session requests include organizationId.
775
797
 
776
- ### Conversation and execution
777
- - The same caller, agent and `clientThreadKey` continue one conversation. Different callers, agents and organizations are isolated.
778
- - No model, prompt or tool overrides are accepted.
779
- - `wait=false` queues durable work and returns 202; `wait=true` returns the final reply or pending approvals.
780
- - Send `decisions` with the same `cli
798
+ Send one or more new messages (at most 50 and 100000 text characters) ending with a user message. Omit thread_id to create a conversation, or reuse the returned thread_id to continue its stored history. An initial batch can import external history, including human replies. Do not resend hist
781
799
  *
782
800
  * `POST /api/v1/agents/{agentId}/messages`
783
801
  */
@@ -792,9 +810,32 @@ var AgentsClient = class {
792
810
  });
793
811
  }
794
812
  /**
795
- * Get an agent message run
813
+ * Start a saved agent run
814
+ *
815
+ * Queue durable execution using the identical invocation contract. Poll Location, honoring Retry-After.
816
+
817
+ Invoke the exact built-in or custom agent in the URL using its saved configuration and Programmatic starting mode. Uses the same invocation request and run response as the general agent and MCP.
818
+
819
+ Requires agents:invoke and current organization membership and agent access. Organization-owned keys use their recorded creator; no alternate organization member is substituted. Session requests include organizationId.
820
+
821
+ Send one or more new messages (at most 50 and 100000 text characters) ending with a user message. Omit thread_id to create a conversation, or reuse the returned thread_id to continue its stored history. An initial batch can import external history, including human replies. Do not
822
+ *
823
+ * `POST /api/v1/agents/{agentId}/runs`
824
+ */
825
+ runs(request, requestOptions) {
826
+ const { agentId, ...body } = request ?? {};
827
+ return this._http.request({
828
+ method: "POST",
829
+ path: `/api/v1/agents/${encodePathParam("agentId", agentId)}/runs`,
830
+ query: void 0,
831
+ body,
832
+ ...mergeRequestOptions(requestOptions)
833
+ });
834
+ }
835
+ /**
836
+ * Get a saved agent run
796
837
  *
797
- * Read an agent message run belonging to the authenticated caller and the exact agent in the URL. Current organization membership and agent sharing are checked again. Requires agents:invoke.
838
+ * Read the canonical run resource. Organization, caller, credential and exact agent access are checked again. Requires agents:invoke.
798
839
  *
799
840
  * `GET /api/v1/agents/{agentId}/runs/{runId}`
800
841
  */
@@ -2300,6 +2341,113 @@ var DocumentsClient = class {
2300
2341
  });
2301
2342
  }
2302
2343
  };
2344
+ var EmailClient = class {
2345
+ constructor(_http) {
2346
+ __publicField(this, "_http", _http);
2347
+ }
2348
+ /**
2349
+ * List Email Accounts
2350
+ *
2351
+ * Your connected Gmail and Outlook accounts, default first. Pass an account's `connectionId` to the other email endpoints to choose it.
2352
+
2353
+ ### Authorization
2354
+
2355
+ Requires `email:read` and the integration permission the matching chat tool needs, with a person's credential: a CLI login, a signed-in session, or the SDK key inside your own chat sandbox. Only your own connected mailboxes are reachable; another account's `connectionId` is refused.
2356
+ *
2357
+ * `GET /api/v1/email/accounts`
2358
+ */
2359
+ listAccounts(request = {}, requestOptions) {
2360
+ const { organizationId } = request ?? {};
2361
+ return this._http.request({
2362
+ method: "GET",
2363
+ path: "/api/v1/email/accounts",
2364
+ query: { organizationId },
2365
+ body: void 0,
2366
+ ...mergeRequestOptions(requestOptions)
2367
+ });
2368
+ }
2369
+ /**
2370
+ * Create Email Draft
2371
+ *
2372
+ * Save a draft in your mailbox; nothing is sent. Pass `replyToMessageId` (and `threadId`) from Search Emails to draft a reply in its conversation. Review and send it from Gmail or Outlook.
2373
+
2374
+ When the provider saved a draft whose threading could not be verified, the request fails with `unverifiedDraftId` in `data` so you can find or discard it.
2375
+
2376
+ ### Authorization
2377
+
2378
+ Requires `email:write` and the integration permission the matching chat tool needs, with a person's credential: a CLI login, a signed-in session, or the SDK key inside your own chat sandbox. Only your own connected mailboxes are reachable; another account's `connectionId` is refused.
2379
+ *
2380
+ * `POST /api/v1/email/drafts`
2381
+ */
2382
+ createDraft(request, requestOptions) {
2383
+ const { ...body } = request ?? {};
2384
+ return this._http.request({
2385
+ method: "POST",
2386
+ path: "/api/v1/email/drafts",
2387
+ query: void 0,
2388
+ body,
2389
+ ...mergeRequestOptions(requestOptions)
2390
+ });
2391
+ }
2392
+ /**
2393
+ * Get Email Message
2394
+ *
2395
+ * One message from your mailbox: headers, plain-text body (at most 12,000 characters) and attachment metadata. Use a message `id` from Search Emails; encode it as one path segment.
2396
+
2397
+ ### Authorization
2398
+
2399
+ Requires `email:read` and the integration permission the matching chat tool needs, with a person's credential: a CLI login, a signed-in session, or the SDK key inside your own chat sandbox. Only your own connected mailboxes are reachable; another account's `connectionId` is refused.
2400
+ *
2401
+ * `GET /api/v1/email/messages/{messageId}`
2402
+ */
2403
+ getMessage(request, requestOptions) {
2404
+ const { messageId, connectionId, organizationId } = request ?? {};
2405
+ return this._http.request({
2406
+ method: "GET",
2407
+ path: `/api/v1/email/messages/${encodePathParam("messageId", messageId)}`,
2408
+ query: { connectionId, organizationId },
2409
+ body: void 0,
2410
+ ...mergeRequestOptions(requestOptions)
2411
+ });
2412
+ }
2413
+ /**
2414
+ * Search Emails
2415
+ *
2416
+ * One page of message summaries (subject, from, to, date, snippet, read and draft state) from your mailbox. Gmail accepts its search operators (`from:`, `subject:`, `newer_than:`); Outlook takes free text.
2417
+
2418
+ Pass `nextPageToken` back as `pageToken` with the same mailbox, query, `readState` and `maxResults` until it is null; a token is refused with different search arguments. `readState=unread` filters unread messages, which is not the same as unreplied.
2419
+
2420
+ ### Authorization
2421
+
2422
+ Requires `email:read` and the integration permission the matching chat tool needs, with a person's credential: a CLI login, a signed-in session, or the SDK key inside your own chat sandbox. Only your own connected mailboxes are reachable; another account's `connectionId` is refused.
2423
+ *
2424
+ * `GET /api/v1/email/search`
2425
+ */
2426
+ search(request = {}, requestOptions) {
2427
+ const {
2428
+ query,
2429
+ connectionId,
2430
+ maxResults,
2431
+ pageToken,
2432
+ readState,
2433
+ organizationId
2434
+ } = request ?? {};
2435
+ return this._http.request({
2436
+ method: "GET",
2437
+ path: "/api/v1/email/search",
2438
+ query: {
2439
+ query,
2440
+ connectionId,
2441
+ maxResults,
2442
+ pageToken,
2443
+ readState,
2444
+ organizationId
2445
+ },
2446
+ body: void 0,
2447
+ ...mergeRequestOptions(requestOptions)
2448
+ });
2449
+ }
2450
+ };
2303
2451
  var EvaluateClient = class {
2304
2452
  constructor(_http) {
2305
2453
  __publicField(this, "_http", _http);
@@ -5562,6 +5710,7 @@ var OmniGeneratedClient = class {
5562
5710
  __publicField(this, "compare");
5563
5711
  __publicField(this, "directory");
5564
5712
  __publicField(this, "documents");
5713
+ __publicField(this, "email");
5565
5714
  __publicField(this, "evaluate");
5566
5715
  __publicField(this, "feed");
5567
5716
  __publicField(this, "followUps");
@@ -5605,6 +5754,7 @@ var OmniGeneratedClient = class {
5605
5754
  this.compare = new CompareClient(this._http);
5606
5755
  this.directory = new DirectoryClient(this._http);
5607
5756
  this.documents = new DocumentsClient(this._http);
5757
+ this.email = new EmailClient(this._http);
5608
5758
  this.evaluate = new EvaluateClient(this._http);
5609
5759
  this.feed = new FeedClient(this._http);
5610
5760
  this.followUps = new FollowUpsClient(this._http);