@dudousxd/nestjs-agent-core 0.43.0 → 0.44.1

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
@@ -4194,6 +4194,10 @@ declare function claimActionProposalOutcome(row: ActionProposal, command: {
4194
4194
  }, now: number, token: string): ActionProposal | null;
4195
4195
  declare function actionProposalOutcomeFenceValid(row: ActionProposal, command: ActionProposalOutcomeLease, now: number): boolean;
4196
4196
  declare function actionProposalOutcomeScope(outcome: ActionProposalOutcome): ActionProposalScope;
4197
+ /**
4198
+ * The outcome message admitted to the thread. The tool's own presentation text (`present` /
4199
+ * `emitUi`), when it has one, leads — what a person reads in the history; the summary follows.
4200
+ */
4197
4201
  declare function actionProposalOutcomeText(outcome: ActionProposalOutcome): string;
4198
4202
 
4199
4203
  interface TextActionProposalCandidate {
@@ -4236,6 +4240,11 @@ interface TextActionProposalVocabulary {
4236
4240
  reject: readonly string[];
4237
4241
  /** The phrase after an approve word that also approves later calls of the tool in this thread. */
4238
4242
  remember: readonly string[];
4243
+ /**
4244
+ * The language these words are in (a BCP 47 tag, e.g. `pt-BR`). Surfaces that speak on their own
4245
+ * (text channels) pick their default texts by it, so the words and the texts agree.
4246
+ */
4247
+ language?: string;
4239
4248
  }
4240
4249
  /**
4241
4250
  * English. Portuguese ships as {@link ptBrActionProposalText}; any other language through
package/dist/index.d.ts CHANGED
@@ -4194,6 +4194,10 @@ declare function claimActionProposalOutcome(row: ActionProposal, command: {
4194
4194
  }, now: number, token: string): ActionProposal | null;
4195
4195
  declare function actionProposalOutcomeFenceValid(row: ActionProposal, command: ActionProposalOutcomeLease, now: number): boolean;
4196
4196
  declare function actionProposalOutcomeScope(outcome: ActionProposalOutcome): ActionProposalScope;
4197
+ /**
4198
+ * The outcome message admitted to the thread. The tool's own presentation text (`present` /
4199
+ * `emitUi`), when it has one, leads — what a person reads in the history; the summary follows.
4200
+ */
4197
4201
  declare function actionProposalOutcomeText(outcome: ActionProposalOutcome): string;
4198
4202
 
4199
4203
  interface TextActionProposalCandidate {
@@ -4236,6 +4240,11 @@ interface TextActionProposalVocabulary {
4236
4240
  reject: readonly string[];
4237
4241
  /** The phrase after an approve word that also approves later calls of the tool in this thread. */
4238
4242
  remember: readonly string[];
4243
+ /**
4244
+ * The language these words are in (a BCP 47 tag, e.g. `pt-BR`). Surfaces that speak on their own
4245
+ * (text channels) pick their default texts by it, so the words and the texts agree.
4246
+ */
4247
+ language?: string;
4239
4248
  }
4240
4249
  /**
4241
4250
  * English. Portuguese ships as {@link ptBrActionProposalText}; any other language through
package/dist/index.js CHANGED
@@ -2715,9 +2715,10 @@ function actionProposalOutcomeFenceValid(row2, command, now) {
2715
2715
  }
2716
2716
  __name(actionProposalOutcomeFenceValid, "actionProposalOutcomeFenceValid");
2717
2717
  function outcomeSummary(outcome) {
2718
- if (outcome.executionStatus === "succeeded") return `Action ${JSON.stringify(outcome.toolName)} completed (proposal ${JSON.stringify(outcome.proposalId)}).${Object.hasOwn(outcome, "result") ? ` Result: ${JSON.stringify(outcome.result)}` : ""}`;
2719
- if (outcome.executionStatus === "failed") return `Action ${JSON.stringify(outcome.toolName)} failed (proposal ${JSON.stringify(outcome.proposalId)}): ${JSON.stringify(outcome.error ?? "Execution failed")}`;
2720
- return `Action ${JSON.stringify(outcome.toolName)} was ${outcome.decision} (proposal ${JSON.stringify(outcome.proposalId)}) and was not executed.${outcome.error ? ` Reason: ${JSON.stringify(outcome.error)}` : ""}`;
2718
+ const tool = JSON.stringify(outcome.toolName);
2719
+ if (outcome.executionStatus === "succeeded") return `Action ${tool} completed.${Object.hasOwn(outcome, "result") ? ` Result: ${JSON.stringify(outcome.result)}` : ""}`;
2720
+ if (outcome.executionStatus === "failed") return `Action ${tool} failed: ${JSON.stringify(outcome.error ?? "Execution failed")}`;
2721
+ return `Action ${tool} was ${outcome.decision} and was not executed.${outcome.error ? ` Reason: ${JSON.stringify(outcome.error)}` : ""}`;
2721
2722
  }
2722
2723
  __name(outcomeSummary, "outcomeSummary");
2723
2724
  function actionProposalOutcomeScope(outcome) {
@@ -2728,8 +2729,15 @@ function actionProposalOutcomeScope(outcome) {
2728
2729
  };
2729
2730
  }
2730
2731
  __name(actionProposalOutcomeScope, "actionProposalOutcomeScope");
2732
+ function storableText(text) {
2733
+ return text.replaceAll(String.fromCharCode(0), "\\u0000").replace(/[\ud800-\udbff](?![\udc00-\udfff])|(?<![\ud800-\udbff])[\udc00-\udfff]/g, (char) => `\\u${char.charCodeAt(0).toString(16)}`);
2734
+ }
2735
+ __name(storableText, "storableText");
2731
2736
  function actionProposalOutcomeText(outcome) {
2732
- return outcomeSummary(outcome) + (outcome.text ? ` UI: ${JSON.stringify(outcome.text)}` : "");
2737
+ const text = outcome.text === void 0 ? void 0 : storableText(outcome.text).trim();
2738
+ return text ? `${text}
2739
+
2740
+ ${outcomeSummary(outcome)}` : outcomeSummary(outcome);
2733
2741
  }
2734
2742
  __name(actionProposalOutcomeText, "actionProposalOutcomeText");
2735
2743
 
@@ -9134,6 +9142,7 @@ function parseTextActionProposalCommand(text, vocabulary = DEFAULT_TEXT_ACTION_P
9134
9142
  __name(parseTextActionProposalCommand, "parseTextActionProposalCommand");
9135
9143
  var ptBrActionProposalText = {
9136
9144
  vocabulary: {
9145
+ language: "pt-BR",
9137
9146
  approve: [
9138
9147
  "sim",
9139
9148
  "confirmo",
@@ -9158,9 +9167,9 @@ var ptBrActionProposalText = {
9158
9167
  ]
9159
9168
  },
9160
9169
  replies: {
9161
- approved: "Proposta aprovada e enfileirada para execu\xE7\xE3o.",
9162
- rejected: "Proposta rejeitada; nenhuma a\xE7\xE3o foi executada.",
9163
- expired: "A proposta expirou; nenhuma a\xE7\xE3o foi executada.",
9170
+ approved: "Confirmado! J\xE1 estou cuidando disso.",
9171
+ rejected: "Tudo bem, cancelado. Nada foi feito.",
9172
+ expired: "Esse pedido expirou; nada foi feito.",
9164
9173
  unchanged: "N\xE3o foi poss\xEDvel alterar esta proposta; atualize a lista para consultar seu estado.",
9165
9174
  ambiguous: /* @__PURE__ */ __name((ids) => `Qual proposta? Responda confirmar #ID ou cancelar #ID: ${ids.join(", ")}`, "ambiguous"),
9166
9175
  tooMany: "H\xE1 v\xE1rias propostas. Confirme ou rejeite usando #ID expl\xEDcito."