@sixb/core 0.2.6 → 0.2.7

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.
Files changed (146) hide show
  1. package/dist/actions/index.js +13 -13
  2. package/dist/agents/index.d.ts +1 -1
  3. package/dist/agents/index.d.ts.map +1 -1
  4. package/dist/agents/index.js +20 -18
  5. package/dist/agents/index.js.map +1 -1
  6. package/dist/agents/model-routing.d.ts +15 -4
  7. package/dist/agents/model-routing.d.ts.map +1 -1
  8. package/dist/agents/request.d.ts.map +1 -1
  9. package/dist/agents/run-token.d.ts +6 -0
  10. package/dist/agents/run-token.d.ts.map +1 -1
  11. package/dist/agents/streams/index.js +1 -1
  12. package/dist/agents/streams/internal.js +2 -2
  13. package/dist/artifacts/live/server.js +6 -6
  14. package/dist/artifacts/publish/index.js +5 -5
  15. package/dist/bootstrap/discovery.d.ts +6 -0
  16. package/dist/bootstrap/discovery.d.ts.map +1 -1
  17. package/dist/bootstrap/index.js +19 -19
  18. package/dist/{chunk-90nqenq8.js → chunk-04r2fdsd.js} +1 -1
  19. package/dist/{chunk-9c9yknwt.js → chunk-06kpaqg4.js} +2 -2
  20. package/dist/{chunk-nxysqbt0.js → chunk-389ybvw9.js} +6 -2
  21. package/dist/chunk-389ybvw9.js.map +10 -0
  22. package/dist/{chunk-xf76csps.js → chunk-44hrfmbk.js} +2 -2
  23. package/dist/{chunk-gaj8djsw.js → chunk-5pz3htbe.js} +7 -2
  24. package/dist/{chunk-gaj8djsw.js.map → chunk-5pz3htbe.js.map} +3 -3
  25. package/dist/{chunk-kft7mp7z.js → chunk-5xkqasvn.js} +1 -1
  26. package/dist/{chunk-fmgf9h5e.js → chunk-6md802cc.js} +1 -1
  27. package/dist/{chunk-ats8y3d9.js → chunk-8qmp9fpa.js} +81 -34
  28. package/dist/{chunk-ats8y3d9.js.map → chunk-8qmp9fpa.js.map} +4 -4
  29. package/dist/{chunk-eg6xqef7.js → chunk-95ps0k5q.js} +3 -3
  30. package/dist/{chunk-eg6xqef7.js.map → chunk-95ps0k5q.js.map} +3 -3
  31. package/dist/{chunk-7r9mqpva.js → chunk-9cyq87qa.js} +12 -11
  32. package/dist/{chunk-7r9mqpva.js.map → chunk-9cyq87qa.js.map} +3 -3
  33. package/dist/{chunk-ykchk644.js → chunk-cpy282b8.js} +1 -1
  34. package/dist/{chunk-bcz9dxtf.js → chunk-fdk0ks9p.js} +1 -1
  35. package/dist/{chunk-t19wjmnc.js → chunk-fycac8e9.js} +47 -13
  36. package/dist/{chunk-t19wjmnc.js.map → chunk-fycac8e9.js.map} +3 -3
  37. package/dist/{chunk-jt012fxq.js → chunk-hvq8xs66.js} +2 -2
  38. package/dist/{chunk-bs1sd0e0.js → chunk-js9e6487.js} +1 -1
  39. package/dist/{chunk-f05994as.js → chunk-k29rdc3h.js} +1 -1
  40. package/dist/{chunk-s8xxef60.js → chunk-m1cwncee.js} +14 -12
  41. package/dist/{chunk-s8xxef60.js.map → chunk-m1cwncee.js.map} +6 -6
  42. package/dist/{chunk-grt2j5vp.js → chunk-mrs7jy17.js} +1 -1
  43. package/dist/{chunk-pqj8vff9.js → chunk-pfdq1ga6.js} +1 -1
  44. package/dist/{chunk-ym1bqd98.js → chunk-phs5fbff.js} +3 -3
  45. package/dist/{chunk-6hfbz4d0.js → chunk-r588h4ev.js} +1 -1
  46. package/dist/{chunk-htdzx40w.js → chunk-t58sktr5.js} +10 -2
  47. package/dist/{chunk-htdzx40w.js.map → chunk-t58sktr5.js.map} +3 -3
  48. package/dist/{chunk-425ydk65.js → chunk-yyj009tv.js} +3 -3
  49. package/dist/deploy/index.d.ts +1 -1
  50. package/dist/deploy/index.d.ts.map +1 -1
  51. package/dist/deploy/internal.js +2 -2
  52. package/dist/deploy/internal.js.map +2 -2
  53. package/dist/deploy/types.d.ts +8 -58
  54. package/dist/deploy/types.d.ts.map +1 -1
  55. package/dist/env/index.d.ts +10 -3
  56. package/dist/env/index.d.ts.map +1 -1
  57. package/dist/env/index.js.map +2 -2
  58. package/dist/execution/agent.js +13 -13
  59. package/dist/execution/primitive.js +13 -13
  60. package/dist/execution/request.js +13 -13
  61. package/dist/index.d.ts +2 -2
  62. package/dist/index.d.ts.map +1 -1
  63. package/dist/index.js +25 -23
  64. package/dist/index.js.map +1 -1
  65. package/dist/materializer/index.js +3 -3
  66. package/dist/models/execution/index.js +3 -3
  67. package/dist/objects/index.js +13 -13
  68. package/dist/objects/query/index.js +3 -3
  69. package/dist/pipelines/index.js +3 -3
  70. package/dist/projections/internal.js +2 -2
  71. package/dist/runtime/create.d.ts.map +1 -1
  72. package/dist/runtime/definitions.d.ts +14 -0
  73. package/dist/runtime/definitions.d.ts.map +1 -1
  74. package/dist/runtime/host.d.ts +3 -1
  75. package/dist/runtime/host.d.ts.map +1 -1
  76. package/dist/runtime/index.d.ts +1 -1
  77. package/dist/runtime/index.d.ts.map +1 -1
  78. package/dist/runtime/internal.js +7 -7
  79. package/dist/runtime/resolve-definitions.d.ts +2 -1
  80. package/dist/runtime/resolve-definitions.d.ts.map +1 -1
  81. package/dist/sandboxes/errors.d.ts +19 -0
  82. package/dist/sandboxes/errors.d.ts.map +1 -1
  83. package/dist/sandboxes/exec.d.ts +2 -0
  84. package/dist/sandboxes/exec.d.ts.map +1 -1
  85. package/dist/sandboxes/index.d.ts +1 -1
  86. package/dist/sandboxes/index.d.ts.map +1 -1
  87. package/dist/sandboxes/index.js +10 -4
  88. package/dist/sandboxes/index.js.map +1 -1
  89. package/dist/sandboxes/sandbox.d.ts +15 -1
  90. package/dist/sandboxes/sandbox.d.ts.map +1 -1
  91. package/dist/shares/internal.js +2 -2
  92. package/dist/storage/agents/provider.d.ts.map +1 -1
  93. package/dist/storage/agents/provider.js +2 -2
  94. package/dist/storage/agents/types.d.ts +14 -1
  95. package/dist/storage/agents/types.d.ts.map +1 -1
  96. package/dist/storage/index.js +3 -3
  97. package/dist/syncs/index.js +4 -4
  98. package/dist/testing/agent-storage-contract.d.ts.map +1 -1
  99. package/dist/testing/artifact-storage-contract.d.ts.map +1 -1
  100. package/dist/testing/index.js +88 -24
  101. package/dist/testing/index.js.map +5 -5
  102. package/dist/testing/sandboxes-contract.d.ts.map +1 -1
  103. package/dist/webhooks/internal.js +2 -2
  104. package/dist/workflows/index.js +17 -17
  105. package/package.json +1 -1
  106. package/src/agents/index.ts +1 -0
  107. package/src/agents/model-routing.ts +104 -38
  108. package/src/agents/request.ts +27 -1
  109. package/src/agents/run-token.ts +7 -0
  110. package/src/bootstrap/discovery.ts +61 -11
  111. package/src/deploy/index.ts +0 -5
  112. package/src/deploy/types.ts +8 -63
  113. package/src/deploy/validation.ts +1 -1
  114. package/src/env/index.ts +10 -4
  115. package/src/index.ts +3 -0
  116. package/src/runtime/create.ts +1 -0
  117. package/src/runtime/definitions.ts +25 -0
  118. package/src/runtime/host.ts +3 -1
  119. package/src/runtime/index.ts +6 -1
  120. package/src/runtime/resolve-definitions.ts +7 -1
  121. package/src/sandboxes/README.md +9 -0
  122. package/src/sandboxes/errors.ts +27 -0
  123. package/src/sandboxes/exec.ts +3 -1
  124. package/src/sandboxes/index.ts +3 -0
  125. package/src/sandboxes/sandbox.ts +15 -1
  126. package/src/storage/agents/provider.ts +8 -0
  127. package/src/storage/agents/types.ts +18 -1
  128. package/src/testing/agent-storage-contract.ts +27 -0
  129. package/src/testing/artifact-storage-contract.ts +10 -0
  130. package/src/testing/sandboxes-contract.ts +50 -0
  131. package/dist/chunk-nxysqbt0.js.map +0 -10
  132. /package/dist/{chunk-90nqenq8.js.map → chunk-04r2fdsd.js.map} +0 -0
  133. /package/dist/{chunk-9c9yknwt.js.map → chunk-06kpaqg4.js.map} +0 -0
  134. /package/dist/{chunk-xf76csps.js.map → chunk-44hrfmbk.js.map} +0 -0
  135. /package/dist/{chunk-kft7mp7z.js.map → chunk-5xkqasvn.js.map} +0 -0
  136. /package/dist/{chunk-fmgf9h5e.js.map → chunk-6md802cc.js.map} +0 -0
  137. /package/dist/{chunk-ykchk644.js.map → chunk-cpy282b8.js.map} +0 -0
  138. /package/dist/{chunk-bcz9dxtf.js.map → chunk-fdk0ks9p.js.map} +0 -0
  139. /package/dist/{chunk-jt012fxq.js.map → chunk-hvq8xs66.js.map} +0 -0
  140. /package/dist/{chunk-bs1sd0e0.js.map → chunk-js9e6487.js.map} +0 -0
  141. /package/dist/{chunk-f05994as.js.map → chunk-k29rdc3h.js.map} +0 -0
  142. /package/dist/{chunk-grt2j5vp.js.map → chunk-mrs7jy17.js.map} +0 -0
  143. /package/dist/{chunk-pqj8vff9.js.map → chunk-pfdq1ga6.js.map} +0 -0
  144. /package/dist/{chunk-ym1bqd98.js.map → chunk-phs5fbff.js.map} +0 -0
  145. /package/dist/{chunk-6hfbz4d0.js.map → chunk-r588h4ev.js.map} +0 -0
  146. /package/dist/{chunk-425ydk65.js.map → chunk-yyj009tv.js.map} +0 -0
@@ -46,7 +46,7 @@ import {
46
46
  validateObjectFacetRequests,
47
47
  preflightObjectQueryLinks,
48
48
  executeObjectQueryLinks2
49
- } from "./chunk-bs1sd0e0.js";
49
+ } from "./chunk-js9e6487.js";
50
50
  import {
51
51
  ObjectQueryValidationError2,
52
52
  normalizeObjectQuery2
@@ -151,7 +151,7 @@ import {
151
151
  runPlaceKey2,
152
152
  isAgentApprovalMode2,
153
153
  agentApprovalHoldsRun2
154
- } from "./chunk-gaj8djsw.js";
154
+ } from "./chunk-5pz3htbe.js";
155
155
  import {
156
156
  canonicalLocale,
157
157
  canonicalTimeZone2
@@ -174,10 +174,10 @@ import {
174
174
  objectBatchKey2,
175
175
  matchesPredicate,
176
176
  WORKFLOW_RUN_FAILURE_CODES2
177
- } from "./chunk-9c9yknwt.js";
177
+ } from "./chunk-06kpaqg4.js";
178
178
  import {
179
179
  explainObjectQuery2
180
- } from "./chunk-bs1sd0e0.js";
180
+ } from "./chunk-js9e6487.js";
181
181
  import {
182
182
  redactDomainEvent,
183
183
  uniqueLookupKeyOf,
@@ -187,7 +187,7 @@ import {
187
187
  readerClearance,
188
188
  readerEventClearance,
189
189
  readerViewConditions
190
- } from "./chunk-fmgf9h5e.js";
190
+ } from "./chunk-6md802cc.js";
191
191
  import {
192
192
  agentRunEndedShort,
193
193
  createAgentThreadAccessRule,
@@ -200,7 +200,7 @@ import {
200
200
  transactionArtifactAccessRules,
201
201
  updatableArtifactIds,
202
202
  createArtifactsRuntime
203
- } from "./chunk-jt012fxq.js";
203
+ } from "./chunk-hvq8xs66.js";
204
204
  import {
205
205
  shareSixbErrorReporter2,
206
206
  reportActionPhaseFailure2,
@@ -222,14 +222,14 @@ import {
222
222
  createActivityCaptureRuntime,
223
223
  registerActivityCaptureRuntime,
224
224
  ModelExecutionSession
225
- } from "./chunk-ym1bqd98.js";
225
+ } from "./chunk-phs5fbff.js";
226
226
  import {
227
227
  publishAgentThreadMoved2,
228
228
  publishAgentApprovalActivity,
229
229
  publishAgentRunActivity2,
230
230
  publishAgentRunCancel2,
231
231
  publishAgentRunFinished2
232
- } from "./chunk-kft7mp7z.js";
232
+ } from "./chunk-5xkqasvn.js";
233
233
  import {
234
234
  aiLimitSubjectsFromAttribution2,
235
235
  applicableAiLimitPolicyStatuses2,
@@ -265,7 +265,7 @@ import {
265
265
  aiModelCallOutputTokenAllowance,
266
266
  ModelUsageRecordingError2,
267
267
  LanguageModelCallMeter
268
- } from "./chunk-grt2j5vp.js";
268
+ } from "./chunk-mrs7jy17.js";
269
269
  import {
270
270
  createLinkScopeFingerprint2,
271
271
  normalizeJsonProperties2,
@@ -275,7 +275,7 @@ import {
275
275
  resolveEffectiveLink,
276
276
  resolveEffectiveLinkSlotMember,
277
277
  linkCardinality
278
- } from "./chunk-ykchk644.js";
278
+ } from "./chunk-cpy282b8.js";
279
279
  import {
280
280
  createSyncConnections,
281
281
  mayRunConnection,
@@ -283,7 +283,7 @@ import {
283
283
  seesConnection,
284
284
  SyncValidationError2,
285
285
  requestSyncRun2
286
- } from "./chunk-90nqenq8.js";
286
+ } from "./chunk-04r2fdsd.js";
287
287
  import {
288
288
  resolveLoggingService2
289
289
  } from "./chunk-1vg43g9q.js";
@@ -296,7 +296,7 @@ import {
296
296
  } from "./chunk-qbd282aa.js";
297
297
  import {
298
298
  requestPipelineRun2
299
- } from "./chunk-pqj8vff9.js";
299
+ } from "./chunk-pfdq1ga6.js";
300
300
  import {
301
301
  PipelineError2
302
302
  } from "./chunk-hke9aeen.js";
@@ -308,7 +308,7 @@ import {
308
308
  SandboxError2,
309
309
  sandboxCredentialIssue2,
310
310
  staticSandboxRecipe2
311
- } from "./chunk-htdzx40w.js";
311
+ } from "./chunk-t58sktr5.js";
312
312
  import {
313
313
  executionRecordInputFromRuntime,
314
314
  ensureExecutionRecord2,
@@ -385,7 +385,7 @@ import {
385
385
  } from "./chunk-9wr3yajk.js";
386
386
  import {
387
387
  AGENT_APPROVAL_MODES2
388
- } from "./chunk-nxysqbt0.js";
388
+ } from "./chunk-389ybvw9.js";
389
389
  import {
390
390
  resolveFileRefAtPath2,
391
391
  openFileRef2,
@@ -2321,22 +2321,35 @@ var HEAVY_FROM = 0.4;
2321
2321
  var LIGHT_FROM = 0.8;
2322
2322
  var DECISION_TIMEOUT_MS = 2000;
2323
2323
  var PROMPT_CACHE_TTL_MS = 5 * 60000;
2324
- var TIER_QUESTIONS = {
2325
- tier: question2.choice({
2326
- instructions: "A user sent this message to a data agent. The agent answers from the project's data with " + "tools: it searches and reads objects, queries and aggregates datasets, follows links, runs " + "actions and writes reports. Pick the model tier the answer needs. Judge the work the " + "answer takes, not the length or tone of the message.",
2327
- options: {
2328
- light: "A lookup, a count, a filter or a list: one or two queries with an obvious answer. " + "Greetings, thanks and short follow-ups.",
2329
- standard: "Usual analysis: several queries, comparisons, trends or aggregations, a short summary, " + "or a simple action, with a clear path to the answer.",
2330
- heavy: "Open-ended work: a multi-step investigation, explaining why something happened, " + "weighing trade-offs, building a plan, or writing a long report."
2331
- }
2332
- })
2324
+ var PREVIOUS_MESSAGE_CHARS = 2000;
2325
+ var TIER_WORK = {
2326
+ light: "A lookup, a count, a filter or a list with an obvious answer. Greetings, thanks, and short " + "questions that start no new work.",
2327
+ standard: "Usual work with a clear path: several queries or reads, a comparison, a short summary, a " + "simple action, or a small change to a few files.",
2328
+ heavy: "Open-ended or long work: a multi-step investigation, explaining why something happened, " + "weighing trade-offs, building a plan, writing a long report, or changes across many files " + "that must be checked."
2333
2329
  };
2330
+ function tierQuestions(language) {
2331
+ return {
2332
+ tier: question2.choice({
2333
+ instructions: "A user sent this message to an agent that works in a project with tools: it reads and " + "changes the project's data, runs actions, writes documents, and in a workspace runs " + "commands and edits files. Pick the model tier the answer needs. Judge the work the " + "answer takes, not the length or tone of the message. When the input holds the " + "previous message, with the tier it ran on, judge the <message> in its light: a short " + "message that carries on that work, such as approving a plan or asking for the next " + "step, takes the tier the work needs.",
2334
+ options: {
2335
+ light: tierOption(language, "light"),
2336
+ standard: tierOption(language, "standard"),
2337
+ heavy: tierOption(language, "heavy")
2338
+ }
2339
+ })
2340
+ };
2341
+ }
2342
+ function tierOption(language, tier) {
2343
+ const description = language.tiers.includes(tier) ? language.getByTier(tier).model.definition.description?.trim() : undefined;
2344
+ return description ? `${TIER_WORK[tier]} This tier's model: ${description}` : TIER_WORK[tier];
2345
+ }
2334
2346
  function assertTurnModelRouting(models) {
2335
- const tiers = models?.language?.tiers ?? [];
2347
+ const language = models?.language;
2336
2348
  const decision = models?.decision?.default;
2337
- if (tiers.length === 0 || !decision)
2349
+ if (!language || language.tiers.length === 0 || !decision)
2338
2350
  return;
2339
- if (supportsQuestion(decision.model.definition.capabilities, TIER_QUESTIONS.tier))
2351
+ const { tier } = tierQuestions(language);
2352
+ if (supportsQuestion(decision.model.definition.capabilities, tier))
2340
2353
  return;
2341
2354
  throw new RuntimeError2(`[Sixb] The default decision model '${decision.provider}/${decision.modelId}' cannot pick the tier of an Agent turn: it needs 'choice' questions with ${LANGUAGE_MODEL_TIERS2.length} options. Put a decision model that supports them first in 'models.decision', or configure 'models.language' as a list.`);
2342
2355
  }
@@ -2344,25 +2357,44 @@ function createTurnModelRouter(models, decision) {
2344
2357
  const language = models?.language;
2345
2358
  if (!language || language.tiers.length === 0 || !models?.decision)
2346
2359
  return;
2360
+ const questions = tierQuestions(language);
2347
2361
  return {
2348
- async choose(text, previous, place) {
2349
- const tierProbabilities = text.trim() ? await askTier(decision, text) : undefined;
2362
+ async choose(turn) {
2363
+ const last = turn.previous && previousTurn(language, turn.previous.run, turn.place);
2364
+ const tierProbabilities = turn.text.trim() ? await askTier(decision, questions, decisionInput(turn, last)) : undefined;
2350
2365
  const tier = tierProbabilities ? tierFor(tierProbabilities) : "standard";
2351
2366
  return {
2352
- model: turnModel(language, tier, previous, place),
2367
+ model: turnModel(language, tier, last),
2353
2368
  ...tierProbabilities ? { tierProbabilities } : {}
2354
2369
  };
2355
2370
  }
2356
2371
  };
2357
2372
  }
2358
- async function askTier(decision, text) {
2373
+ function decisionInput(turn, last) {
2374
+ const before = turn.previous?.text?.trim();
2375
+ if (!before)
2376
+ return turn.text;
2377
+ const clipped = before.length > PREVIOUS_MESSAGE_CHARS ? `${before.slice(0, PREVIOUS_MESSAGE_CHARS)}\u2026` : before;
2378
+ const tier = last ? ` tier="${last.tier}"` : "";
2379
+ return [
2380
+ `<previous_message${tier}>`,
2381
+ clipped,
2382
+ "</previous_message>",
2383
+ "",
2384
+ "<message>",
2385
+ turn.text,
2386
+ "</message>"
2387
+ ].join(`
2388
+ `);
2389
+ }
2390
+ async function askTier(decision, questions, input) {
2359
2391
  const timeout = new AbortController;
2360
2392
  const timer = setTimeout(() => {
2361
2393
  timeout.abort(new DOMException("[Sixb] The decision model did not answer in time.", "TimeoutError"));
2362
2394
  }, DECISION_TIMEOUT_MS);
2363
2395
  try {
2364
2396
  const { output } = await Promise.race([
2365
- decision.evaluate({ input: text, questions: TIER_QUESTIONS, signal: timeout.signal }),
2397
+ decision.evaluate({ input, questions, signal: timeout.signal }),
2366
2398
  rejectOnAbort(timeout.signal)
2367
2399
  ]);
2368
2400
  const { light, standard, heavy } = output.tier.probabilities;
@@ -2383,9 +2415,8 @@ function tierFor(probabilities) {
2383
2415
  return "light";
2384
2416
  return "standard";
2385
2417
  }
2386
- function turnModel(language, tier, previous, place) {
2418
+ function turnModel(language, tier, last) {
2387
2419
  const target = language.getByTier(tier);
2388
- const last = previous && previousTurn(language, previous, place);
2389
2420
  if (!last)
2390
2421
  return target;
2391
2422
  const change = tierRank(target.tier ?? tier) - tierRank(last.tier);
@@ -2720,6 +2751,8 @@ async function requestAgentRun2(runtime, execution, models, input) {
2720
2751
  const place = turnPlace2(runsOn, existingThread ? existingThread.computer : input.computer);
2721
2752
  const selected = "router" in requested ? await routedConversationRunSpec({
2722
2753
  ...requested,
2754
+ agents,
2755
+ projectId,
2723
2756
  previous: existingThread ? await latestConversationRun(agents, projectId, existingThread.id) : undefined,
2724
2757
  place,
2725
2758
  settings,
@@ -2834,6 +2867,8 @@ async function editAgentMessage2(runtime, execution, models, input, blobStorage)
2834
2867
  const place = turnPlace2(thread.runsOn, thread.computer);
2835
2868
  const selected = "router" in requested ? await routedConversationRunSpec({
2836
2869
  ...requested,
2870
+ agents,
2871
+ projectId,
2837
2872
  previous: await latestRetainedConversationRun(agents, projectId, thread.id, tail),
2838
2873
  place,
2839
2874
  settings,
@@ -3667,7 +3702,11 @@ function routedTurn(router, selection, input) {
3667
3702
  return { router, text: input.text ?? "" };
3668
3703
  }
3669
3704
  async function routedConversationRunSpec(input) {
3670
- const choice = await input.router.choose(input.text, input.previous, input.place);
3705
+ const previous = input.previous && {
3706
+ run: input.previous,
3707
+ text: await messageWords(input.agents, input.projectId, input.previous.triggerMessageId)
3708
+ };
3709
+ const choice = await input.router.choose({ text: input.text, previous, place: input.place });
3671
3710
  return resolveConversationRunSpec({
3672
3711
  models: input.language,
3673
3712
  selection: { model: choice.model },
@@ -3675,6 +3714,14 @@ async function routedConversationRunSpec(input) {
3675
3714
  tierProbabilities: choice.tierProbabilities
3676
3715
  });
3677
3716
  }
3717
+ async function messageWords(agents, projectId, messageId) {
3718
+ const message = await agents.messages.getById({ projectId, id: messageId });
3719
+ if (!message)
3720
+ return;
3721
+ const words = message.parts.flatMap((part) => part.type === "text" ? [part.text] : []).join(`
3722
+ `).trim();
3723
+ return words || undefined;
3724
+ }
3678
3725
  async function latestConversationRun(agents, projectId, threadId) {
3679
3726
  const { runs } = await agents.runs.list({
3680
3727
  projectId,
@@ -12891,4 +12938,4 @@ function snapshotActionRequest(input) {
12891
12938
  }
12892
12939
  export { defineAction2, param2, optional2, ActionRegistry2, bindRequestClient, bindModelExecutionAttempt, canInheritAgentRequestAuthorization2, createAgentExecutionRecord2, createInheritedAgentExecutionRecord2, bindDurableAgentExecution2, bindAgentRunRequestExecution2, bindAgentModelExecution2, restoreAgentExecutionScope2, assertAgentExecutionRecord2, resumeDecidedAgentTurn2, agentRunApprovalMode2, holdAgentApprovalCall2, approvalCallSummary2, listChildApprovalsAwaiting2, isAwaitingApprovalRun2, isPausedSubagentRun2, AGENT_APPROVAL_EXECUTION_LEASE_MS2, turnResumeReadiness2, turnPausesOnHeldCalls2, hasActiveChildren2, listTurnApprovals2, stopAgentTurn2, announceAgentApprovals2, agentApprovalCallers2, AgentRunScopeError2, resolveAgentRunExecutionScope2, createAgentApprovalExecutor, registerAgentApprovalExecutor, getAgentApprovalExecutor2, requestAgentRunCancel2, cancelQueuedRun, AGENT_QUESTION_LIMITS2, agentQuestionsText2, isChildAskTool2, isAwaitingAnswerRun2, deferredChildQuestion2, listSubagentThreadRuns2, subagentSandboxFiles2, assertTurnModelRouting, registerAgentQueuedTurn2, startQueuedAgentTurn2, resolveAgentContextParts2, agentRunQueueJobId2, workflowAgentNodeQueueJobId2, dispatchQueuedAgentRuns2, assertNoAgentDefinitions, turnAnsweredEveryMessage, requestAgentRun2, isEditableAgentMessage2, editAgentMessage2, isRetryableAgentRun2, retryAgentRun2, AGENT_MESSAGE_DELIVERIES2, sendAgentMessage2, promoteAgentInboxItem2, withdrawAgentInboxItem2, startQueuedAgentTurnFromInbox2, WorkflowDefinitionError2, WorkflowValidationError2, assertNonEmpty, isStepDefinition2, isAgentStepDefinition2, isInterventionDefinition2, isWorkflowDefinition2, validateWorkflowDefinition2, validateWorkflowsAtStartup2, validateWorkflowAgentStepGroupReferences2, validateWorkflowInput2, validateWorkflowStepInput2, validateWorkflowStepOutput2, validateWorkflowInterventionInput2, validateWorkflowInterventionResponse2, validateWorkflowInterventionDefaultResponse2, assertAgentStepSandbox, validateWorkflowAgentStepInput2, validateWorkflowAgentStepOutput2, snapshotWorkflowAgentStepInput2, snapshotWorkflowAgentStepOutput2, snapshotWorkflowInput2, snapshotWorkflowStepInput2, snapshotWorkflowStepOutput2, snapshotWorkflowInterventionInput2, snapshotWorkflowInterventionResponse2, snapshotWorkflowInterventionDefaultResponse2, snapshotWorkflowActionInput2, WorkflowRunDispatcher2, requestWorkflowRun2, prepareBoundActionRequest2, prepareBoundWorkflowRequest2, runModelLoop2, requestAction2, ObjectError2, removeLink2, upsertLink2, upsertLinkBatch2, deleteObject2, restoreObject2, upsertObject2, upsertObjectBatch2, writeTelemetryBatch2, appendTelemetryBatch2, getTelemetryHistoryBatch2, requireLinkDefinition2, resolveObjectContext2, resolveLinkContext2, createObjectSet2, exports_service, ShareError2, createBoundSixb, isBoundSixb, bindDurablePrimitiveExecution2, ACTION_RUN_DRAIN_TIMEOUT_MS2, ActionRunExecutor, registerActionRunExecutor, drainActionRuns2, requestAction3 };
12893
12940
 
12894
- //# debugId=6AB827512C16B65C64756E2164756E21
12941
+ //# debugId=F06C1A95F7E3542964756E2164756E21