@arbidocs/sdk 0.4.16 → 0.4.18

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.
@@ -1,2 +1,2 @@
1
- export { A as AgentControlStateEvent, a as AgentStepDeltaEvent, b as AgentStepEvent, c as Arbi, d as ArbiApiError, e as ArbiError, f as ArbiErrorEvent, g as ArbiOptions, i as ArtifactEvent, j as AuthContext, k as AuthHeaders, l as AuthenticatedClient, C as ChatSession, m as CitationSummary, n as CliConfig, o as CliCredentials, p as CommandDescriptor, q as ConfigStore, r as ConnectOptions, s as CreateFactRequest, t as CreateFactsRequest, u as CreateTaskRequest, v as DeferredInterjectionEvent, F as FactResponse, G as FactSearchRequest, H as FactSearchResponse, J as ListFactsOptions, N as MessageMetadataPayload, O as MessageQueuedEvent, P as OutputTokensDetails, Q as ParsedSlashCommand, R as ProbeAnswerEvent, S as ProjectInvoicesResponse, T as ProjectUsageResponse, U as QueryOptions, V as ReconnectOptions, W as ReconnectableWsConnection, X as ResolvedCitation, Z as ResponseCompletedEvent, _ as ResponseContentPartAddedEvent, $ as ResponseCreatedEvent, a0 as ResponseFailedEvent, a1 as ResponseOutputItemAddedEvent, a2 as ResponseOutputItemDoneEvent, a3 as ResponseOutputTextDeltaEvent, a4 as ResponseOutputTextDoneEvent, a5 as ResponseUsage, a6 as SSEEvent, a7 as SSEStreamCallbacks, a8 as SSEStreamResult, a9 as SSEStreamStartData, ab as SkillSummary, ad as TaskResponse, ae as TokenBudgetContext, af as UpdateFactRequest, ag as UpdateTaskRequest, am as UserDailyUsageResponse, an as UserInfo, ao as UserInputRequestEvent, ap as UserMessageEvent, aq as WebSocketAuthError, ar as WorkspaceContext, as as WsConnection, at as account, au as agentconfig, av as assistant, aw as authenticatedFetch, ay as buildRetrievalChunkTool, az as buildRetrievalFullContextTool, aA as buildRetrievalTocTool, aB as connectWebSocket, aC as connectWithReconnect, aD as consumeSSEStream, aE as contacts, aF as conversations, aG as countCitations, aH as createAuthenticatedClient, aJ as dm, aK as doctags, aL as documents, aM as facts, aN as files, aO as filterSkills, aP as formatAgentStepLabel, aQ as formatFileSize, aR as formatItemLabel, aT as formatUserName, aU as formatWorkspaceChoices, aZ as getErrorMessage, a_ as getRawWorkspaceKey, a$ as health, b0 as parseSSEEvents, b1 as parseSlashCommand, b2 as parseSlashTokenInProgress, b3 as performPasswordLogin, b6 as profile, b7 as projects, b8 as requireData, b9 as requireOk, ba as resolveAuth, bb as resolveCitations, bc as resolveWorkspace, bd as responses, be as selectWorkspace, bf as selectWorkspaceById, bg as sessions, bh as settings, bi as streamSSE, bj as stripCitationMarkdown, bk as summarizeCitations, bl as tags, bm as tasks, bn as workspaces } from './browser-B53im_GV.cjs';
1
+ export { A as ActivityKind, a as ActivityResponse, b as AgentControlStateEvent, c as AgentStepDeltaEvent, d as AgentStepEvent, e as Arbi, f as ArbiApiError, g as ArbiError, h as ArbiErrorEvent, i as ArbiOptions, k as ArtifactEvent, l as AuthContext, m as AuthHeaders, n as AuthMode, o as AuthenticatedClient, C as ChatSession, p as CitationSummary, q as CliConfig, r as CliCredentials, s as CommandDescriptor, t as ConfigStore, u as ConnectOptions, v as ConversationResponse, w as CreateFactRequest, x as CreateFactsRequest, y as CreateWorkRequest, z as CreateWorkflowRequest, B as DeferredInterjectionEvent, K as FactResponse, L as FactSearchRequest, M as FactSearchResponse, P as ListFactsOptions, S as MessageMetadataPayload, T as MessageQueuedEvent, U as OutputTokensDetails, V as ParsedSlashCommand, W as PendingAuthResponse, X as PlanWorkRequest, Y as ProbeAnswerEvent, Z as ProjectInvoicesResponse, _ as ProjectUsageResponse, $ as QueryOptions, a0 as ReconnectOptions, a1 as ReconnectableWsConnection, a2 as RequestApprovalRequest, a3 as ResolvedCitation, a5 as ResponseCompletedEvent, a6 as ResponseContentPartAddedEvent, a7 as ResponseCreatedEvent, a8 as ResponseFailedEvent, a9 as ResponseOutputItemAddedEvent, aa as ResponseOutputItemDoneEvent, ab as ResponseOutputTextDeltaEvent, ac as ResponseOutputTextDoneEvent, ad as ResponseUsage, ae as ReviewWorkRequest, af as SSEEvent, ag as SSEStreamCallbacks, ah as SSEStreamResult, ai as SSEStreamStartData, ak as SkillSummary, am as TaskPlan, an as TokenBudgetContext, ao as UpdateConversationRequest, ap as UpdateFactRequest, aq as UpdateWorkflowRequest, aw as UserDailyUsageResponse, ax as UserInfo, ay as UserInputRequestEvent, az as UserMessageEvent, aA as WebSocketAuthError, aB as WorkStatus, aC as WorkflowAuthMode, aD as WorkflowResponse, aE as WorkflowRunResponse, aF as WorkspaceContext, aG as WsConnection, aH as account, aI as agentconfig, aJ as assistant, aK as authenticatedFetch, aM as buildRetrievalChunkTool, aN as buildRetrievalFullContextTool, aO as buildRetrievalTocTool, aP as connectWebSocket, aQ as connectWithReconnect, aR as consumeSSEStream, aS as contacts, aT as conversations, aU as countCitations, aV as createAuthenticatedClient, aX as dm, aY as doctags, aZ as documents, a_ as facts, a$ as files, b0 as filterSkills, b1 as formatAgentStepLabel, b2 as formatFileSize, b3 as formatItemLabel, b5 as formatUserName, b6 as formatWorkspaceChoices, bb as getErrorMessage, bc as getRawWorkspaceKey, bd as health, be as parseSSEEvents, bf as parseSlashCommand, bg as parseSlashTokenInProgress, bh as performPasswordLogin, bk as profile, bl as projects, bm as requireData, bn as requireOk, bo as resolveAuth, bp as resolveCitations, bq as resolveWorkspace, br as responses, bs as selectWorkspace, bt as selectWorkspaceById, bu as sessions, bv as settings, bw as streamSSE, bx as stripCitationMarkdown, by as summarizeCitations, bz as tags, bA as work, bB as workflows, bC as workspaces } from './browser-DY8mQOdF.cjs';
2
2
  export { LoginProfile } from '@arbidocs/client';
package/dist/browser.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export { A as AgentControlStateEvent, a as AgentStepDeltaEvent, b as AgentStepEvent, c as Arbi, d as ArbiApiError, e as ArbiError, f as ArbiErrorEvent, g as ArbiOptions, i as ArtifactEvent, j as AuthContext, k as AuthHeaders, l as AuthenticatedClient, C as ChatSession, m as CitationSummary, n as CliConfig, o as CliCredentials, p as CommandDescriptor, q as ConfigStore, r as ConnectOptions, s as CreateFactRequest, t as CreateFactsRequest, u as CreateTaskRequest, v as DeferredInterjectionEvent, F as FactResponse, G as FactSearchRequest, H as FactSearchResponse, J as ListFactsOptions, N as MessageMetadataPayload, O as MessageQueuedEvent, P as OutputTokensDetails, Q as ParsedSlashCommand, R as ProbeAnswerEvent, S as ProjectInvoicesResponse, T as ProjectUsageResponse, U as QueryOptions, V as ReconnectOptions, W as ReconnectableWsConnection, X as ResolvedCitation, Z as ResponseCompletedEvent, _ as ResponseContentPartAddedEvent, $ as ResponseCreatedEvent, a0 as ResponseFailedEvent, a1 as ResponseOutputItemAddedEvent, a2 as ResponseOutputItemDoneEvent, a3 as ResponseOutputTextDeltaEvent, a4 as ResponseOutputTextDoneEvent, a5 as ResponseUsage, a6 as SSEEvent, a7 as SSEStreamCallbacks, a8 as SSEStreamResult, a9 as SSEStreamStartData, ab as SkillSummary, ad as TaskResponse, ae as TokenBudgetContext, af as UpdateFactRequest, ag as UpdateTaskRequest, am as UserDailyUsageResponse, an as UserInfo, ao as UserInputRequestEvent, ap as UserMessageEvent, aq as WebSocketAuthError, ar as WorkspaceContext, as as WsConnection, at as account, au as agentconfig, av as assistant, aw as authenticatedFetch, ay as buildRetrievalChunkTool, az as buildRetrievalFullContextTool, aA as buildRetrievalTocTool, aB as connectWebSocket, aC as connectWithReconnect, aD as consumeSSEStream, aE as contacts, aF as conversations, aG as countCitations, aH as createAuthenticatedClient, aJ as dm, aK as doctags, aL as documents, aM as facts, aN as files, aO as filterSkills, aP as formatAgentStepLabel, aQ as formatFileSize, aR as formatItemLabel, aT as formatUserName, aU as formatWorkspaceChoices, aZ as getErrorMessage, a_ as getRawWorkspaceKey, a$ as health, b0 as parseSSEEvents, b1 as parseSlashCommand, b2 as parseSlashTokenInProgress, b3 as performPasswordLogin, b6 as profile, b7 as projects, b8 as requireData, b9 as requireOk, ba as resolveAuth, bb as resolveCitations, bc as resolveWorkspace, bd as responses, be as selectWorkspace, bf as selectWorkspaceById, bg as sessions, bh as settings, bi as streamSSE, bj as stripCitationMarkdown, bk as summarizeCitations, bl as tags, bm as tasks, bn as workspaces } from './browser-B53im_GV.js';
1
+ export { A as ActivityKind, a as ActivityResponse, b as AgentControlStateEvent, c as AgentStepDeltaEvent, d as AgentStepEvent, e as Arbi, f as ArbiApiError, g as ArbiError, h as ArbiErrorEvent, i as ArbiOptions, k as ArtifactEvent, l as AuthContext, m as AuthHeaders, n as AuthMode, o as AuthenticatedClient, C as ChatSession, p as CitationSummary, q as CliConfig, r as CliCredentials, s as CommandDescriptor, t as ConfigStore, u as ConnectOptions, v as ConversationResponse, w as CreateFactRequest, x as CreateFactsRequest, y as CreateWorkRequest, z as CreateWorkflowRequest, B as DeferredInterjectionEvent, K as FactResponse, L as FactSearchRequest, M as FactSearchResponse, P as ListFactsOptions, S as MessageMetadataPayload, T as MessageQueuedEvent, U as OutputTokensDetails, V as ParsedSlashCommand, W as PendingAuthResponse, X as PlanWorkRequest, Y as ProbeAnswerEvent, Z as ProjectInvoicesResponse, _ as ProjectUsageResponse, $ as QueryOptions, a0 as ReconnectOptions, a1 as ReconnectableWsConnection, a2 as RequestApprovalRequest, a3 as ResolvedCitation, a5 as ResponseCompletedEvent, a6 as ResponseContentPartAddedEvent, a7 as ResponseCreatedEvent, a8 as ResponseFailedEvent, a9 as ResponseOutputItemAddedEvent, aa as ResponseOutputItemDoneEvent, ab as ResponseOutputTextDeltaEvent, ac as ResponseOutputTextDoneEvent, ad as ResponseUsage, ae as ReviewWorkRequest, af as SSEEvent, ag as SSEStreamCallbacks, ah as SSEStreamResult, ai as SSEStreamStartData, ak as SkillSummary, am as TaskPlan, an as TokenBudgetContext, ao as UpdateConversationRequest, ap as UpdateFactRequest, aq as UpdateWorkflowRequest, aw as UserDailyUsageResponse, ax as UserInfo, ay as UserInputRequestEvent, az as UserMessageEvent, aA as WebSocketAuthError, aB as WorkStatus, aC as WorkflowAuthMode, aD as WorkflowResponse, aE as WorkflowRunResponse, aF as WorkspaceContext, aG as WsConnection, aH as account, aI as agentconfig, aJ as assistant, aK as authenticatedFetch, aM as buildRetrievalChunkTool, aN as buildRetrievalFullContextTool, aO as buildRetrievalTocTool, aP as connectWebSocket, aQ as connectWithReconnect, aR as consumeSSEStream, aS as contacts, aT as conversations, aU as countCitations, aV as createAuthenticatedClient, aX as dm, aY as doctags, aZ as documents, a_ as facts, a$ as files, b0 as filterSkills, b1 as formatAgentStepLabel, b2 as formatFileSize, b3 as formatItemLabel, b5 as formatUserName, b6 as formatWorkspaceChoices, bb as getErrorMessage, bc as getRawWorkspaceKey, bd as health, be as parseSSEEvents, bf as parseSlashCommand, bg as parseSlashTokenInProgress, bh as performPasswordLogin, bk as profile, bl as projects, bm as requireData, bn as requireOk, bo as resolveAuth, bp as resolveCitations, bq as resolveWorkspace, br as responses, bs as selectWorkspace, bt as selectWorkspaceById, bu as sessions, bv as settings, bw as streamSSE, bx as stripCitationMarkdown, by as summarizeCitations, bz as tags, bA as work, bB as workflows, bC as workspaces } from './browser-DY8mQOdF.js';
2
2
  export { LoginProfile } from '@arbidocs/client';
package/dist/browser.js CHANGED
@@ -3487,12 +3487,26 @@ var ArbiSessionExpiredError = class extends ArbiError {
3487
3487
  this.name = "ArbiSessionExpiredError";
3488
3488
  }
3489
3489
  };
3490
+ function detailText(detail) {
3491
+ if (!Array.isArray(detail)) return detail || void 0;
3492
+ const messages = detail.map((d2) => d2?.msg).filter((m2) => Boolean(m2));
3493
+ return messages.length ? messages.join("; ") : void 0;
3494
+ }
3495
+ function apiErrorDetail(apiError) {
3496
+ if (typeof apiError === "string") return apiError || void 0;
3497
+ if (!apiError || typeof apiError !== "object") return void 0;
3498
+ const body = apiError;
3499
+ return detailText(body.detail) || (typeof body.message === "string" ? body.message : void 0);
3500
+ }
3490
3501
  var ArbiApiError = class extends ArbiError {
3491
3502
  apiError;
3503
+ /** Why the server refused, in its words (e.g. "run_at must be in the future"), when it said. */
3504
+ detail;
3492
3505
  constructor(message, apiError) {
3493
3506
  super(message);
3494
3507
  this.name = "ArbiApiError";
3495
3508
  this.apiError = apiError;
3509
+ this.detail = apiErrorDetail(apiError);
3496
3510
  }
3497
3511
  };
3498
3512
  function requireData(result, message) {
@@ -3541,7 +3555,7 @@ async function extractErrorMessage(res) {
3541
3555
  if (text) {
3542
3556
  try {
3543
3557
  const json = JSON.parse(text);
3544
- bodyDetail = json.detail || json.message || json.error || void 0;
3558
+ bodyDetail = detailText(json.detail) || json.message || json.error || void 0;
3545
3559
  } catch {
3546
3560
  if (text.length < 200) bodyDetail = text;
3547
3561
  }
@@ -4785,8 +4799,8 @@ __export(conversations_exports, {
4785
4799
  getMessage: () => getMessage,
4786
4800
  importConversations: () => importConversations,
4787
4801
  listConversations: () => listConversations,
4788
- shareConversation: () => shareConversation,
4789
- updateConversationTitle: () => updateConversationTitle
4802
+ postConversationMessage: () => postConversationMessage,
4803
+ updateConversationAssistantMode: () => updateConversationAssistantMode
4790
4804
  });
4791
4805
  async function listConversations(arbi) {
4792
4806
  return requireData(await arbi.fetch.GET("/v1/conversation/list"), "Failed to fetch conversations");
@@ -4818,23 +4832,6 @@ async function deleteConversation(arbi, conversationId) {
4818
4832
  "Failed to delete conversation"
4819
4833
  );
4820
4834
  }
4821
- async function shareConversation(arbi, conversationId) {
4822
- return requireData(
4823
- await arbi.fetch.POST("/v1/conversation/{conversation_ext_id}/share", {
4824
- params: { path: { conversation_ext_id: conversationId } }
4825
- }),
4826
- "Failed to share conversation"
4827
- );
4828
- }
4829
- async function updateConversationTitle(arbi, conversationId, title) {
4830
- return requireData(
4831
- await arbi.fetch.PATCH("/v1/conversation/{conversation_ext_id}/title", {
4832
- params: { path: { conversation_ext_id: conversationId } },
4833
- body: { title }
4834
- }),
4835
- "Failed to update title"
4836
- );
4837
- }
4838
4835
  async function getMessage(arbi, messageId) {
4839
4836
  return requireData(
4840
4837
  await arbi.fetch.GET("/v1/conversation/message/{message_ext_id}", {
@@ -4851,6 +4848,21 @@ async function deleteMessage(arbi, messageId) {
4851
4848
  "Failed to delete message"
4852
4849
  );
4853
4850
  }
4851
+ async function postConversationMessage(arbi, body) {
4852
+ return requireData(
4853
+ await arbi.fetch.POST("/v1/conversation/message", { body }),
4854
+ "Failed to post message"
4855
+ );
4856
+ }
4857
+ async function updateConversationAssistantMode(arbi, conversationId, assistantMode) {
4858
+ return requireData(
4859
+ await arbi.fetch.PATCH("/v1/conversation/{conversation_ext_id}/assistant-mode", {
4860
+ params: { path: { conversation_ext_id: conversationId } },
4861
+ body: { assistant_mode: assistantMode }
4862
+ }),
4863
+ "Failed to update assistant mode"
4864
+ );
4865
+ }
4854
4866
 
4855
4867
  // src/operations/assistant.ts
4856
4868
  var assistant_exports = {};
@@ -4928,7 +4940,7 @@ async function retrieve(options) {
4928
4940
  return data;
4929
4941
  }
4930
4942
  async function queryAssistant(options) {
4931
- const { workspaceId, question, docIds, previousResponseId, model, signal, ...auth } = options;
4943
+ const { workspaceId, question, docIds, previousResponseId, model, mentions, signal, ...auth } = options;
4932
4944
  const body = {
4933
4945
  input: question,
4934
4946
  workspace_ext_id: workspaceId,
@@ -4940,7 +4952,8 @@ async function queryAssistant(options) {
4940
4952
  retrieval_full_context: buildRetrievalFullContextTool([])
4941
4953
  },
4942
4954
  ...previousResponseId ? { previous_response_id: previousResponseId } : {},
4943
- ...model ? { model } : {}
4955
+ ...model ? { model } : {},
4956
+ ...mentions && mentions.length > 0 ? { mentions } : {}
4944
4957
  };
4945
4958
  return authenticatedFetch({
4946
4959
  ...auth,
@@ -5632,54 +5645,121 @@ async function getUserUsageToday(arbi) {
5632
5645
  return requireData(await arbi.fetch.GET("/v1/user/me/usage/today"), "Failed to fetch today usage");
5633
5646
  }
5634
5647
 
5635
- // src/operations/tasks.ts
5636
- var tasks_exports = {};
5637
- __export(tasks_exports, {
5638
- createTask: () => createTask,
5639
- deleteTask: () => deleteTask,
5640
- getTask: () => getTask,
5641
- listTaskRuns: () => listTaskRuns,
5642
- listTasks: () => listTasks,
5643
- runTask: () => runTask,
5644
- updateTask: () => updateTask
5648
+ // src/operations/work.ts
5649
+ var work_exports = {};
5650
+ __export(work_exports, {
5651
+ createWork: () => createWork,
5652
+ getActivity: () => getActivity,
5653
+ getPendingAuth: () => getPendingAuth,
5654
+ planWork: () => planWork,
5655
+ requestApproval: () => requestApproval,
5656
+ reviewConversation: () => reviewConversation,
5657
+ runConversation: () => runConversation,
5658
+ updateConversation: () => updateConversation
5645
5659
  });
5646
- async function listTasks(arbi) {
5647
- return requireData(await arbi.fetch.GET("/v1/tasks"), "Failed to list tasks");
5660
+ var byId = (conversationId) => ({
5661
+ params: { path: { conversation_ext_id: conversationId } }
5662
+ });
5663
+ async function updateConversation(arbi, conversationId, body) {
5664
+ return requireData(
5665
+ await arbi.fetch.PATCH("/v1/conversation/{conversation_ext_id}", {
5666
+ ...byId(conversationId),
5667
+ body
5668
+ }),
5669
+ "Failed to update conversation"
5670
+ );
5648
5671
  }
5649
- async function createTask(arbi, body) {
5650
- return requireData(await arbi.fetch.POST("/v1/tasks", { body }), "Failed to create task");
5672
+ async function createWork(arbi, body) {
5673
+ return requireData(
5674
+ await arbi.fetch.POST("/v1/conversation/work", { body }),
5675
+ "Failed to create task"
5676
+ );
5651
5677
  }
5652
- async function getTask(arbi, taskId) {
5678
+ async function runConversation(arbi, conversationId) {
5653
5679
  return requireData(
5654
- await arbi.fetch.GET("/v1/tasks/{task_id}", { params: { path: { task_id: taskId } } }),
5655
- "Failed to get task"
5680
+ await arbi.fetch.POST("/v1/conversation/{conversation_ext_id}/run", byId(conversationId)),
5681
+ "Failed to run task"
5656
5682
  );
5657
5683
  }
5658
- async function updateTask(arbi, taskId, body) {
5684
+ async function reviewConversation(arbi, conversationId, body) {
5659
5685
  return requireData(
5660
- await arbi.fetch.PATCH("/v1/tasks/{task_id}", {
5661
- params: { path: { task_id: taskId } },
5686
+ await arbi.fetch.POST("/v1/conversation/{conversation_ext_id}/review", {
5687
+ ...byId(conversationId),
5662
5688
  body
5663
5689
  }),
5664
- "Failed to update task"
5690
+ "Failed to review task"
5665
5691
  );
5666
5692
  }
5667
- async function deleteTask(arbi, taskId) {
5668
- const { error } = await arbi.fetch.DELETE("/v1/tasks/{task_id}", {
5669
- params: { path: { task_id: taskId } }
5670
- });
5671
- if (error) throw new Error("Failed to delete task");
5693
+ async function requestApproval(arbi, conversationId, body) {
5694
+ return requireData(
5695
+ await arbi.fetch.POST("/v1/conversation/{conversation_ext_id}/request-approval", {
5696
+ ...byId(conversationId),
5697
+ body
5698
+ }),
5699
+ "Failed to request approval"
5700
+ );
5672
5701
  }
5673
- async function runTask(arbi, taskId) {
5702
+ async function getPendingAuth(arbi, conversationId) {
5674
5703
  return requireData(
5675
- await arbi.fetch.POST("/v1/tasks/{task_id}/run", { params: { path: { task_id: taskId } } }),
5676
- "Failed to run task"
5704
+ await arbi.fetch.GET(
5705
+ "/v1/conversation/{conversation_ext_id}/pending-auth",
5706
+ byId(conversationId)
5707
+ ),
5708
+ "Failed to read the pending access request"
5677
5709
  );
5678
5710
  }
5679
- async function listTaskRuns(arbi, taskId) {
5711
+ async function getActivity(arbi, conversationId) {
5680
5712
  return requireData(
5681
- await arbi.fetch.GET("/v1/tasks/{task_id}/runs", { params: { path: { task_id: taskId } } }),
5682
- "Failed to list task runs"
5713
+ await arbi.fetch.GET("/v1/conversation/{conversation_ext_id}/activity", byId(conversationId)),
5714
+ "Failed to read the task activity"
5715
+ );
5716
+ }
5717
+ async function planWork(arbi, body) {
5718
+ return requireData(
5719
+ await arbi.fetch.POST("/v1/conversation/work/plan", { body }),
5720
+ "Failed to draft a plan"
5721
+ );
5722
+ }
5723
+
5724
+ // src/operations/workflows.ts
5725
+ var workflows_exports = {};
5726
+ __export(workflows_exports, {
5727
+ createWorkflow: () => createWorkflow,
5728
+ deleteWorkflow: () => deleteWorkflow,
5729
+ getWorkflow: () => getWorkflow,
5730
+ listWorkflows: () => listWorkflows,
5731
+ runWorkflow: () => runWorkflow,
5732
+ updateWorkflow: () => updateWorkflow
5733
+ });
5734
+ var byId2 = (workflowId) => ({ params: { path: { workflow_id: workflowId } } });
5735
+ async function listWorkflows(arbi) {
5736
+ return requireData(await arbi.fetch.GET("/v1/workflow"), "Failed to list workflows");
5737
+ }
5738
+ async function createWorkflow(arbi, body) {
5739
+ return requireData(await arbi.fetch.POST("/v1/workflow", { body }), "Failed to create workflow");
5740
+ }
5741
+ async function getWorkflow(arbi, workflowId) {
5742
+ return requireData(
5743
+ await arbi.fetch.GET("/v1/workflow/{workflow_id}", byId2(workflowId)),
5744
+ "Failed to get workflow"
5745
+ );
5746
+ }
5747
+ async function updateWorkflow(arbi, workflowId, body) {
5748
+ return requireData(
5749
+ await arbi.fetch.PATCH("/v1/workflow/{workflow_id}", { ...byId2(workflowId), body }),
5750
+ "Failed to update workflow"
5751
+ );
5752
+ }
5753
+ async function deleteWorkflow(arbi, workflowId) {
5754
+ requireOk(
5755
+ await arbi.fetch.DELETE("/v1/workflow/{workflow_id}", byId2(workflowId)),
5756
+ "Failed to delete workflow"
5757
+ );
5758
+ }
5759
+ async function runWorkflow(arbi, workflowId) {
5760
+ return requireData(
5761
+ await arbi.fetch.POST("/v1/workflow/{workflow_id}/run", byId2(workflowId)),
5762
+ "Failed to run workflow"
5683
5763
  );
5684
5764
  }
5685
5765
 
@@ -6191,10 +6271,52 @@ var Arbi = class {
6191
6271
  list: () => listConversations(this.requireClient()),
6192
6272
  getThreads: (conversationId) => getConversationThreads(this.requireClient(), conversationId),
6193
6273
  delete: (conversationId) => deleteConversation(this.requireClient(), conversationId),
6194
- share: (conversationId) => shareConversation(this.requireClient(), conversationId),
6195
- updateTitle: (conversationId, title) => updateConversationTitle(this.requireClient(), conversationId, title),
6274
+ /**
6275
+ * Patch a conversation: `title`, `shared` (owner only), and the work fields (`description`,
6276
+ * `due_at`, `signoff_user_ext_id`, `parent_conversation_ext_id`, `status`, `plan`). The one call
6277
+ * behind rename, share and unshare.
6278
+ */
6279
+ update: (conversationId, body) => updateConversation(this.requireClient(), conversationId, body),
6280
+ /** Create a work item: a plain to-do, or (with a prompt / skill) agent work that starts now. */
6281
+ createWork: (body) => createWork(this.requireClient(), body),
6282
+ /** Run a work item now, or retry it. */
6283
+ run: (conversationId) => runConversation(this.requireClient(), conversationId),
6284
+ /** The sign-off person approves, or sends feedback back to the agent in the same thread. */
6285
+ review: (conversationId, body) => reviewConversation(this.requireClient(), conversationId, body),
6286
+ /** Hand sign-off to another workspace member. */
6287
+ requestApproval: (conversationId, body) => requestApproval(this.requireClient(), conversationId, body),
6288
+ /** The session key an unattended run waits for the owner to allow; 404 when nothing waits. */
6289
+ pendingAuth: (conversationId) => getPendingAuth(this.requireClient(), conversationId),
6290
+ /** The task's history, oldest first. */
6291
+ activity: (conversationId) => getActivity(this.requireClient(), conversationId),
6292
+ /** Draft a reviewable plan from an objective. */
6293
+ plan: (body) => planWork(this.requireClient(), body),
6294
+ /**
6295
+ * Run a work item and, when the run is parked waiting for workspace access, grant the agent's
6296
+ * run session a temporary key and run it again. Work that needs no approval returns from the
6297
+ * first call already running.
6298
+ */
6299
+ runWithAuth: async (conversationId) => {
6300
+ const client = this.requireClient();
6301
+ const first = await runConversation(client, conversationId);
6302
+ if (!first.pending_auth_request_id) return first;
6303
+ const pending = await getPendingAuth(client, conversationId);
6304
+ await this.workspaces.grantTemporaryAccess({
6305
+ workspaceId: pending.workspace_ext_id ?? this.getWorkspaceId(),
6306
+ emails: [pending.agent_email],
6307
+ sessionPubkeyB64: pending.session_pubkey
6308
+ });
6309
+ return runConversation(client, conversationId);
6310
+ },
6196
6311
  getMessage: (messageId) => getMessage(this.requireClient(), messageId),
6197
- deleteMessage: (messageId) => deleteMessage(this.requireClient(), messageId)
6312
+ deleteMessage: (messageId) => deleteMessage(this.requireClient(), messageId),
6313
+ /** Post a human comment (no assistant run) — see `postConversationMessage`. */
6314
+ postMessage: (body) => postConversationMessage(this.requireClient(), body),
6315
+ setAssistantMode: (conversationId, assistantMode) => updateConversationAssistantMode(
6316
+ this.requireClient(),
6317
+ conversationId,
6318
+ assistantMode
6319
+ )
6198
6320
  };
6199
6321
  // ── Assistant ─────────────────────────────────────────────────────────
6200
6322
  assistant = {
@@ -6414,33 +6536,14 @@ var Arbi = class {
6414
6536
  return session;
6415
6537
  }
6416
6538
  };
6417
- // ── Scheduled tasks ───────────────────────────────────────────────────
6418
- tasks = {
6419
- list: () => listTasks(this.requireClient()),
6420
- create: (body) => createTask(this.requireClient(), body),
6421
- get: (taskId) => getTask(this.requireClient(), taskId),
6422
- update: (taskId, body) => updateTask(this.requireClient(), taskId, body),
6423
- delete: (taskId) => deleteTask(this.requireClient(), taskId),
6424
- run: (taskId) => runTask(this.requireClient(), taskId),
6425
- listRuns: (taskId) => listTaskRuns(this.requireClient(), taskId),
6426
- /**
6427
- * Run a task and, when the run is parked waiting for workspace access (a temporary
6428
- * authorization tier), grant the agent's run session a temporary key and run it again.
6429
- * A task that needs no approval returns from the first call already running.
6430
- */
6431
- runWithAuth: async (taskId) => {
6432
- const client = this.requireClient();
6433
- const first = await runTask(client, taskId);
6434
- if (!first.pending_auth_request_id || !first.pending_auth_session_pubkey || !first.pending_auth_agent_email || !first.workspace_ext_id) {
6435
- return first;
6436
- }
6437
- await this.workspaces.grantTemporaryAccess({
6438
- workspaceId: first.workspace_ext_id,
6439
- emails: [first.pending_auth_agent_email],
6440
- sessionPubkeyB64: first.pending_auth_session_pubkey
6441
- });
6442
- return runTask(client, taskId);
6443
- }
6539
+ // ── Workflows ─────────────────────────────────────────────────────────
6540
+ workflows = {
6541
+ list: () => listWorkflows(this.requireClient()),
6542
+ create: (body) => createWorkflow(this.requireClient(), body),
6543
+ update: (workflowId, body) => updateWorkflow(this.requireClient(), workflowId, body),
6544
+ delete: (workflowId) => deleteWorkflow(this.requireClient(), workflowId),
6545
+ /** Fire a workflow now, as a test run. Resolves with the conversation it created and whether it started. */
6546
+ run: (workflowId) => runWorkflow(this.requireClient(), workflowId)
6444
6547
  };
6445
6548
  // ── Workspace facts ─────────────────────────────────────────────────
6446
6549
  facts = {
@@ -6555,6 +6658,6 @@ function extractResponseText(response) {
6555
6658
  return parts.join("");
6556
6659
  }
6557
6660
 
6558
- export { Arbi, ArbiApiError, ArbiError, WebSocketAuthError, account_exports as account, agentconfig_exports as agentconfig, assistant_exports as assistant, authenticatedFetch, buildRetrievalChunkTool, buildRetrievalFullContextTool, buildRetrievalTocTool, connectWebSocket, connectWithReconnect, consumeSSEStream, contacts_exports as contacts, conversations_exports as conversations, countCitations, createAuthenticatedClient, dm_exports as dm, doctags_exports as doctags, documents_exports as documents, facts_exports as facts, files_exports as files, filterSkills, formatAgentStepLabel, formatFileSize, formatItemLabel, formatUserName, formatWorkspaceChoices, getErrorMessage, getRawWorkspaceKey, health_exports as health, parseSSEEvents, parseSlashCommand, parseSlashTokenInProgress, performPasswordLogin, profile_exports as profile, projects_exports as projects, requireData, requireOk, resolveAuth, resolveCitations, resolveWorkspace, responses_exports as responses, selectWorkspace, selectWorkspaceById, sessions_exports as sessions, settings_exports as settings, streamSSE, stripCitationMarkdown, summarizeCitations, tags_exports as tags, tasks_exports as tasks, workspaces_exports as workspaces };
6661
+ export { Arbi, ArbiApiError, ArbiError, WebSocketAuthError, account_exports as account, agentconfig_exports as agentconfig, assistant_exports as assistant, authenticatedFetch, buildRetrievalChunkTool, buildRetrievalFullContextTool, buildRetrievalTocTool, connectWebSocket, connectWithReconnect, consumeSSEStream, contacts_exports as contacts, conversations_exports as conversations, countCitations, createAuthenticatedClient, dm_exports as dm, doctags_exports as doctags, documents_exports as documents, facts_exports as facts, files_exports as files, filterSkills, formatAgentStepLabel, formatFileSize, formatItemLabel, formatUserName, formatWorkspaceChoices, getErrorMessage, getRawWorkspaceKey, health_exports as health, parseSSEEvents, parseSlashCommand, parseSlashTokenInProgress, performPasswordLogin, profile_exports as profile, projects_exports as projects, requireData, requireOk, resolveAuth, resolveCitations, resolveWorkspace, responses_exports as responses, selectWorkspace, selectWorkspaceById, sessions_exports as sessions, settings_exports as settings, streamSSE, stripCitationMarkdown, summarizeCitations, tags_exports as tags, work_exports as work, workflows_exports as workflows, workspaces_exports as workspaces };
6559
6662
  //# sourceMappingURL=browser.js.map
6560
6663
  //# sourceMappingURL=browser.js.map