@anuma/sdk 5.1.0 → 5.1.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.
@@ -15925,9 +15925,12 @@ Output strict JSON matching the schema. No prose.`;
15925
15925
  async function extractFacts(messages, options) {
15926
15926
  if (messages.length === 0) return [];
15927
15927
  const redactor = resolvePiiRedactor(options.piiRedaction);
15928
- const transcript = messages.map(
15929
- (m) => `[${m.id}] ${m.role}: ${redactor ? redactor.redactText(m.content).text : m.content}`
15930
- ).join("\n");
15928
+ const transcriptLines = [];
15929
+ for (const m of messages) {
15930
+ const content = redactor ? (await redactor.redactTextAsync(m.content)).text : m.content;
15931
+ transcriptLines.push(`[${m.id}] ${m.role}: ${content}`);
15932
+ }
15933
+ const transcript = transcriptLines.join("\n");
15931
15934
  const today = formatLocalDate(options.now ?? Date.now());
15932
15935
  const parsed = await callPortalJsonCompletion({
15933
15936
  ...options.apiKey !== void 0 && { apiKey: options.apiKey },
@@ -6915,9 +6915,12 @@ Output strict JSON matching the schema. No prose.`;
6915
6915
  async function extractFacts(messages, options) {
6916
6916
  if (messages.length === 0) return [];
6917
6917
  const redactor = resolvePiiRedactor(options.piiRedaction);
6918
- const transcript = messages.map(
6919
- (m) => `[${m.id}] ${m.role}: ${redactor ? redactor.redactText(m.content).text : m.content}`
6920
- ).join("\n");
6918
+ const transcriptLines = [];
6919
+ for (const m of messages) {
6920
+ const content = redactor ? (await redactor.redactTextAsync(m.content)).text : m.content;
6921
+ transcriptLines.push(`[${m.id}] ${m.role}: ${content}`);
6922
+ }
6923
+ const transcript = transcriptLines.join("\n");
6921
6924
  const today = formatLocalDate(options.now ?? Date.now());
6922
6925
  const parsed = await callPortalJsonCompletion({
6923
6926
  ...options.apiKey !== void 0 && { apiKey: options.apiKey },
@@ -17224,9 +17224,12 @@ Output strict JSON matching the schema. No prose.`;
17224
17224
  async function extractFacts(messages, options) {
17225
17225
  if (messages.length === 0) return [];
17226
17226
  const redactor = resolvePiiRedactor(options.piiRedaction);
17227
- const transcript = messages.map(
17228
- (m) => `[${m.id}] ${m.role}: ${redactor ? redactor.redactText(m.content).text : m.content}`
17229
- ).join("\n");
17227
+ const transcriptLines = [];
17228
+ for (const m of messages) {
17229
+ const content = redactor ? (await redactor.redactTextAsync(m.content)).text : m.content;
17230
+ transcriptLines.push(`[${m.id}] ${m.role}: ${content}`);
17231
+ }
17232
+ const transcript = transcriptLines.join("\n");
17230
17233
  const today = formatLocalDate(options.now ?? Date.now());
17231
17234
  const parsed = await callPortalJsonCompletion({
17232
17235
  ...options.apiKey !== void 0 && { apiKey: options.apiKey },
@@ -7732,9 +7732,12 @@ Output strict JSON matching the schema. No prose.`;
7732
7732
  async function extractFacts(messages, options) {
7733
7733
  if (messages.length === 0) return [];
7734
7734
  const redactor = resolvePiiRedactor(options.piiRedaction);
7735
- const transcript = messages.map(
7736
- (m) => `[${m.id}] ${m.role}: ${redactor ? redactor.redactText(m.content).text : m.content}`
7737
- ).join("\n");
7735
+ const transcriptLines = [];
7736
+ for (const m of messages) {
7737
+ const content = redactor ? (await redactor.redactTextAsync(m.content)).text : m.content;
7738
+ transcriptLines.push(`[${m.id}] ${m.role}: ${content}`);
7739
+ }
7740
+ const transcript = transcriptLines.join("\n");
7738
7741
  const today = formatLocalDate(options.now ?? Date.now());
7739
7742
  const parsed = await callPortalJsonCompletion({
7740
7743
  ...options.apiKey !== void 0 && { apiKey: options.apiKey },
@@ -28970,9 +28970,12 @@ Output strict JSON matching the schema. No prose.`;
28970
28970
  async function extractFacts(messages, options) {
28971
28971
  if (messages.length === 0) return [];
28972
28972
  const redactor = resolvePiiRedactor(options.piiRedaction);
28973
- const transcript = messages.map(
28974
- (m) => `[${m.id}] ${m.role}: ${redactor ? redactor.redactText(m.content).text : m.content}`
28975
- ).join("\n");
28973
+ const transcriptLines = [];
28974
+ for (const m of messages) {
28975
+ const content = redactor ? (await redactor.redactTextAsync(m.content)).text : m.content;
28976
+ transcriptLines.push(`[${m.id}] ${m.role}: ${content}`);
28977
+ }
28978
+ const transcript = transcriptLines.join("\n");
28976
28979
  const today = formatLocalDate(options.now ?? Date.now());
28977
28980
  const parsed = await callPortalJsonCompletion({
28978
28981
  ...options.apiKey !== void 0 && { apiKey: options.apiKey },
@@ -5713,9 +5713,12 @@ Output strict JSON matching the schema. No prose.`;
5713
5713
  async function extractFacts(messages, options) {
5714
5714
  if (messages.length === 0) return [];
5715
5715
  const redactor = resolvePiiRedactor(options.piiRedaction);
5716
- const transcript = messages.map(
5717
- (m) => `[${m.id}] ${m.role}: ${redactor ? redactor.redactText(m.content).text : m.content}`
5718
- ).join("\n");
5716
+ const transcriptLines = [];
5717
+ for (const m of messages) {
5718
+ const content = redactor ? (await redactor.redactTextAsync(m.content)).text : m.content;
5719
+ transcriptLines.push(`[${m.id}] ${m.role}: ${content}`);
5720
+ }
5721
+ const transcript = transcriptLines.join("\n");
5719
5722
  const today = formatLocalDate(options.now ?? Date.now());
5720
5723
  const parsed = await callPortalJsonCompletion({
5721
5724
  ...options.apiKey !== void 0 && { apiKey: options.apiKey },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anuma/sdk",
3
- "version": "5.1.0",
3
+ "version": "5.1.1",
4
4
  "description": "",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",