mitra-interactions-sdk 1.0.60 → 1.0.61-beta.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.mts CHANGED
@@ -576,6 +576,12 @@ interface GetAgentTaskCreateOptions {
576
576
  modelId?: string;
577
577
  /** Nome do chat (default: derivado do prompt). */
578
578
  name?: string;
579
+ /**
580
+ * Connection do projeto a usar (issue #756). Quando passado, a credencial e o
581
+ * sandbox da task usam a connection do projeto em vez das suas pessoais; o
582
+ * chat/histórico continua seu. Requer que o dono do projeto a tenha configurado.
583
+ */
584
+ connectionId?: string;
579
585
  }
580
586
  interface GetAgentTaskOpenOptions {
581
587
  /** Abre chat existente. Detecta automático se stream está ativo. */
@@ -767,6 +773,12 @@ interface ManageAgentCredentialOptions {
767
773
  action: Exclude<CredentialAction, 'connect' | 'auth'>;
768
774
  /** Obrigatório exceto para action='list' / 'list_models'. */
769
775
  target?: CredentialTarget;
776
+ /**
777
+ * Quando passado, as operações refletem a CONNECTION do projeto
778
+ * (list_models/list_providers/status). Escritas (save/remove/validate) exigem
779
+ * token dev/owner do projeto — RBAC server-side (issue #756).
780
+ */
781
+ connectionId?: string;
770
782
  /** Para `save` / `validate` de API key. */
771
783
  key?: string;
772
784
  /** Para `oauth_exchange`. */
package/dist/index.d.ts CHANGED
@@ -576,6 +576,12 @@ interface GetAgentTaskCreateOptions {
576
576
  modelId?: string;
577
577
  /** Nome do chat (default: derivado do prompt). */
578
578
  name?: string;
579
+ /**
580
+ * Connection do projeto a usar (issue #756). Quando passado, a credencial e o
581
+ * sandbox da task usam a connection do projeto em vez das suas pessoais; o
582
+ * chat/histórico continua seu. Requer que o dono do projeto a tenha configurado.
583
+ */
584
+ connectionId?: string;
579
585
  }
580
586
  interface GetAgentTaskOpenOptions {
581
587
  /** Abre chat existente. Detecta automático se stream está ativo. */
@@ -767,6 +773,12 @@ interface ManageAgentCredentialOptions {
767
773
  action: Exclude<CredentialAction, 'connect' | 'auth'>;
768
774
  /** Obrigatório exceto para action='list' / 'list_models'. */
769
775
  target?: CredentialTarget;
776
+ /**
777
+ * Quando passado, as operações refletem a CONNECTION do projeto
778
+ * (list_models/list_providers/status). Escritas (save/remove/validate) exigem
779
+ * token dev/owner do projeto — RBAC server-side (issue #756).
780
+ */
781
+ connectionId?: string;
770
782
  /** Para `save` / `validate` de API key. */
771
783
  key?: string;
772
784
  /** Para `oauth_exchange`. */
package/dist/index.js CHANGED
@@ -959,6 +959,7 @@ var AgentTaskSession = class {
959
959
  this._agentType = init.agentType;
960
960
  this._modelId = init.modelId;
961
961
  this._initialName = init.name;
962
+ this._connectionId = init.connectionId;
962
963
  this._setStatus("idle");
963
964
  this._wsUnsubscribePending = this._transport.subscribePending(
964
965
  this._sessionId,
@@ -1120,6 +1121,7 @@ var AgentTaskSession = class {
1120
1121
  if (modelId) payload.modelId = modelId;
1121
1122
  if (attachments) payload.attachments = attachments;
1122
1123
  if (this._taskId) payload.taskId = this._taskId;
1124
+ if (this._connectionId) payload.connectionId = this._connectionId;
1123
1125
  if (this._initialName && !this._taskId) {
1124
1126
  payload.name = this._initialName;
1125
1127
  }
@@ -1546,7 +1548,8 @@ function getAgentTaskMitra(options) {
1546
1548
  projectId: options.projectId,
1547
1549
  agentType: options.agentType,
1548
1550
  modelId: options.modelId,
1549
- name: options.name
1551
+ name: options.name,
1552
+ connectionId: options.connectionId
1550
1553
  },
1551
1554
  transport
1552
1555
  );
@@ -1563,12 +1566,12 @@ function manageAgentCredentialMitra(options) {
1563
1566
  }
1564
1567
  function rpc(options) {
1565
1568
  const transport2 = getTransport();
1566
- const { action, target, ...rest } = options;
1569
+ const { action, target, connectionId, ...rest } = options;
1567
1570
  const data = {};
1568
1571
  for (const [k, v] of Object.entries(rest)) {
1569
1572
  if (v !== void 0) data[k] = v;
1570
1573
  }
1571
- return transport2.request("credentials", { action, target, data });
1574
+ return transport2.request("credentials", { action, target, connectionId, data });
1572
1575
  }
1573
1576
  async function authSubscription(options) {
1574
1577
  const { target } = options;