@anvia/studio 0.7.9 → 0.7.10

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
@@ -1640,13 +1640,15 @@ function transcriptFromMessages(messages) {
1640
1640
  let textEntryAdded = false;
1641
1641
  for (const content of message.content) {
1642
1642
  if (content.type === "text") {
1643
- transcript.push(compact({
1644
- entryId: transcript.length,
1645
- kind: "message",
1646
- role: "user",
1647
- text: content.text,
1648
- attachments: attachments.length === 0 ? void 0 : attachments
1649
- }));
1643
+ transcript.push(
1644
+ compact({
1645
+ entryId: transcript.length,
1646
+ kind: "message",
1647
+ role: "user",
1648
+ text: content.text,
1649
+ attachments: attachments.length === 0 ? void 0 : attachments
1650
+ })
1651
+ );
1650
1652
  textEntryAdded = true;
1651
1653
  }
1652
1654
  }
@@ -1680,12 +1682,14 @@ function transcriptFromMessages(messages) {
1680
1682
  if (content.type === "text") {
1681
1683
  appendAssistantTranscriptText(transcript, content.text);
1682
1684
  } else if (content.type === "reasoning") {
1683
- transcript.push(compact({
1684
- entryId: transcript.length,
1685
- kind: "reasoning",
1686
- reasoningId: content.id,
1687
- text: content.text
1688
- }));
1685
+ transcript.push(
1686
+ compact({
1687
+ entryId: transcript.length,
1688
+ kind: "reasoning",
1689
+ reasoningId: content.id,
1690
+ text: content.text
1691
+ })
1692
+ );
1689
1693
  } else if (content.type === "tool_call") {
1690
1694
  transcript.push({
1691
1695
  entryId: transcript.length,
@@ -3706,7 +3710,9 @@ async function agentKnowledgeConfig(agent) {
3706
3710
  staticContext: agent.agent.staticContext.map((document) => ({
3707
3711
  id: document.id,
3708
3712
  text: document.text,
3709
- ...compact({ additionalProps: document.additionalProps !== void 0 ? jsonObjectFromRecord(document.additionalProps) : void 0 })
3713
+ ...compact({
3714
+ additionalProps: document.additionalProps !== void 0 ? jsonObjectFromRecord(document.additionalProps) : void 0
3715
+ })
3710
3716
  }))
3711
3717
  };
3712
3718
  }
@@ -3838,9 +3844,13 @@ function staticKnowledgeItemsPage(agent, request) {
3838
3844
  id: document.id,
3839
3845
  kind: "static_context",
3840
3846
  text: document.text,
3841
- ...compact({ metadata: document.additionalProps !== void 0 ? jsonObjectFromRecord(document.additionalProps) : void 0 })
3847
+ ...compact({
3848
+ metadata: document.additionalProps !== void 0 ? jsonObjectFromRecord(document.additionalProps) : void 0
3849
+ })
3842
3850
  })),
3843
- ...compact({ nextCursor: nextOffset < agent.agent.staticContext.length ? String(nextOffset) : void 0 }),
3851
+ ...compact({
3852
+ nextCursor: nextOffset < agent.agent.staticContext.length ? String(nextOffset) : void 0
3853
+ }),
3844
3854
  totalCount: agent.agent.staticContext.length
3845
3855
  };
3846
3856
  }
@@ -3860,7 +3870,9 @@ function dynamicContextItem(item) {
3860
3870
  id: item.id,
3861
3871
  kind: "dynamic_context",
3862
3872
  ...text === void 0 ? { document: toJsonValue(item.document) } : { text },
3863
- ...compact({ metadata: item.metadata !== void 0 ? jsonObjectFromRecord(item.metadata) : void 0 })
3873
+ ...compact({
3874
+ metadata: item.metadata !== void 0 ? jsonObjectFromRecord(item.metadata) : void 0
3875
+ })
3864
3876
  };
3865
3877
  }
3866
3878
  function dynamicToolItem(item) {
@@ -3875,7 +3887,9 @@ function dynamicToolItem(item) {
3875
3887
  description,
3876
3888
  parameterKeys: parameterKeys(definition.parameters),
3877
3889
  document: toJsonValue(item.document),
3878
- ...compact({ metadata: item.metadata !== void 0 ? jsonObjectFromRecord(item.metadata) : void 0 })
3890
+ ...compact({
3891
+ metadata: item.metadata !== void 0 ? jsonObjectFromRecord(item.metadata) : void 0
3892
+ })
3879
3893
  };
3880
3894
  }
3881
3895
  function parameterKeys(parameters) {
@@ -4009,9 +4023,7 @@ function evidenceDocument(value) {
4009
4023
  if (id === void 0 && text === void 0 && additionalProps === void 0) {
4010
4024
  return [];
4011
4025
  }
4012
- return [
4013
- compact({ id, text, additionalProps })
4014
- ];
4026
+ return [compact({ id, text, additionalProps })];
4015
4027
  }
4016
4028
  function evidenceToolName(value) {
4017
4029
  if (!isRecord3(value) || typeof value.name !== "string") {
@@ -4780,12 +4792,14 @@ async function parseQuestionAnswerRequest(c) {
4780
4792
  if ("custom" in answer && typeof answer.custom !== "boolean") {
4781
4793
  return { error: errorResponse(c, 400, "bad_request", "custom must be a boolean") };
4782
4794
  }
4783
- answers.push(compact({
4784
- questionId: answer.questionId.trim(),
4785
- answer: answer.answer.trim(),
4786
- choice: typeof answer.choice === "string" ? answer.choice : void 0,
4787
- custom: typeof answer.custom === "boolean" ? answer.custom : void 0
4788
- }));
4795
+ answers.push(
4796
+ compact({
4797
+ questionId: answer.questionId.trim(),
4798
+ answer: answer.answer.trim(),
4799
+ choice: typeof answer.choice === "string" ? answer.choice : void 0,
4800
+ custom: typeof answer.custom === "boolean" ? answer.custom : void 0
4801
+ })
4802
+ );
4789
4803
  }
4790
4804
  return { answers };
4791
4805
  }
@@ -4803,13 +4817,17 @@ function createQuestionRuntime() {
4803
4817
  if ("error" in prompts) {
4804
4818
  return control.skip(prompts.error);
4805
4819
  }
4806
- const answers = await requestQuestion(questions, context, compact({
4807
- toolName,
4808
- toolCallId,
4809
- internalCallId,
4810
- args,
4811
- questions: prompts.questions
4812
- }));
4820
+ const answers = await requestQuestion(
4821
+ questions,
4822
+ context,
4823
+ compact({
4824
+ toolName,
4825
+ toolCallId,
4826
+ internalCallId,
4827
+ args,
4828
+ questions: prompts.questions
4829
+ })
4830
+ );
4813
4831
  return control.skip(JSON.stringify({ answers }));
4814
4832
  }
4815
4833
  });