@standardagents/builder 0.37.6 → 0.37.8

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 (33) hide show
  1. package/dist/built-in-routes.js +121 -6
  2. package/dist/built-in-routes.js.map +1 -1
  3. package/dist/client/{ApiKeysView-Pk5oljVU.js → ApiKeysView-L85eJb6G.js} +1 -1
  4. package/dist/client/{CenteredContentView-HGpMGAQj.js → CenteredContentView-D9jkWoLc.js} +1 -1
  5. package/dist/client/{CompositionView-DN8dTOCO.js → CompositionView-BGp0EJCk.js} +1 -1
  6. package/dist/client/{ConfirmDialog.vue_vue_type_script_setup_true_lang--j_hnMZ0.js → ConfirmDialog.vue_vue_type_script_setup_true_lang-DgwqZrLV.js} +1 -1
  7. package/dist/client/{CopyButton.vue_vue_type_script_setup_true_lang-CpJDcbZx.js → CopyButton.vue_vue_type_script_setup_true_lang-B8cGgU2J.js} +1 -1
  8. package/dist/client/{DataTable.vue_vue_type_script_setup_true_lang-unLrY-PY.js → DataTable.vue_vue_type_script_setup_true_lang-CRBXym9D.js} +1 -1
  9. package/dist/client/{JsonViewer-BYj_yrGB.js → JsonViewer-DkHnIfq3.js} +1 -1
  10. package/dist/client/{LoginView-CfVqItZV.js → LoginView-BXD9Odc-.js} +1 -1
  11. package/dist/client/{MarketplaceView-Cidt0nLf.js → MarketplaceView-DEnujUBs.js} +1 -1
  12. package/dist/client/{Modal.vue_vue_type_script_setup_true_lang-C1dmm1HX.js → Modal.vue_vue_type_script_setup_true_lang-keKEwm3K.js} +1 -1
  13. package/dist/client/{ModelModal.vue_vue_type_script_setup_true_lang-DIKLuPXT.js → ModelModal.vue_vue_type_script_setup_true_lang-t1n0bbJe.js} +1 -1
  14. package/dist/client/{ModelsView-DH6wNe38.js → ModelsView-BkCLr8sp.js} +1 -1
  15. package/dist/client/{PromptEditView-D_VjoAa-.js → PromptEditView-BjCfsJQE.js} +1 -1
  16. package/dist/client/{PromptModal-a9LTOWNt.js → PromptModal-nxu_LIv6.js} +1 -1
  17. package/dist/client/{PromptsView-BCCCryKR.js → PromptsView-1yXGCmEZ.js} +1 -1
  18. package/dist/client/{ProvidersView-CF4x5F6G.js → ProvidersView-DxF6gafk.js} +1 -1
  19. package/dist/client/{ThreadInspectorPane.vue_vue_type_script_setup_true_lang-D5VDoQiK.js → ThreadInspectorPane.vue_vue_type_script_setup_true_lang-CjwWJ3uw.js} +14 -14
  20. package/dist/client/{ThreadsView-BzscU1l2.js → ThreadsView-CBup_w8u.js} +1 -1
  21. package/dist/client/{ToolsView-CeEtxDZV.js → ToolsView-B30TfXU9.js} +1 -1
  22. package/dist/client/{UsersView-Di5cmUYL.js → UsersView-kE7Xr4f3.js} +1 -1
  23. package/dist/client/{VariablesView-CXUr05jD.js → VariablesView-yYuynG0M.js} +1 -1
  24. package/dist/client/assets/{ThreadInspectorPane-D9ZMzSTn.css → ThreadInspectorPane-BRGO_P0_.css} +1 -1
  25. package/dist/client/{index-BMqXblce.js → index-AUGwDdSH.js} +2 -2
  26. package/dist/client/index.html +1 -1
  27. package/dist/index.js +56 -5
  28. package/dist/index.js.map +1 -1
  29. package/dist/plugin.js.map +1 -1
  30. package/dist/runtime.d.ts +0 -1
  31. package/dist/runtime.js +56 -5
  32. package/dist/runtime.js.map +1 -1
  33. package/package.json +5 -5
@@ -26,7 +26,7 @@
26
26
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
27
27
  <link rel="icon" type="image/svg+xml" href="/agents/assets/img/favicon-9uH1rb2F.svg">
28
28
  <title>AgentBuilder Admin</title>
29
- <script type="module" crossorigin src="/agents/index-BMqXblce.js"></script>
29
+ <script type="module" crossorigin src="/agents/index-AUGwDdSH.js"></script>
30
30
  <link rel="modulepreload" crossorigin href="/agents/formkit-CE26dtFp.js">
31
31
  <link rel="modulepreload" crossorigin href="/agents/vendor-TPZjEwCU.js">
32
32
  <link rel="modulepreload" crossorigin href="/agents/syntax-D-ZcovVx.js">
package/dist/index.js CHANGED
@@ -9560,7 +9560,12 @@ ${msg.content}` : `${imageDescriptions}${nonImageList}`;
9560
9560
  const threadState = ThreadStateImpl.fromFlowState(state);
9561
9561
  for (const executor of executors) {
9562
9562
  try {
9563
- result = await executor(threadState, result);
9563
+ const hooked = await executor(threadState, _FlowEngine.rowToHookMessage(result));
9564
+ result = {
9565
+ ...result,
9566
+ ...hooked,
9567
+ attachments: hooked.attachments === void 0 ? result.attachments : hooked.attachments === null ? null : typeof hooked.attachments === "string" ? hooked.attachments : JSON.stringify(hooked.attachments)
9568
+ };
9564
9569
  } catch (error) {
9565
9570
  console.error("[Hooks] \u2717 Error running before_create_message hook:", error);
9566
9571
  }
@@ -9580,12 +9585,31 @@ ${msg.content}` : `${imageDescriptions}${nonImageList}`;
9580
9585
  const threadState = ThreadStateImpl.fromFlowState(state);
9581
9586
  for (const executor of executors) {
9582
9587
  try {
9583
- await executor(threadState, message);
9588
+ await executor(threadState, _FlowEngine.rowToHookMessage(message));
9584
9589
  } catch (error) {
9585
9590
  console.error("[Hooks] \u2717 Error running after_create_message hook:", error);
9586
9591
  }
9587
9592
  }
9588
9593
  }
9594
+ /**
9595
+ * Builder rows store `attachments` as a JSON string; the spec hook surface
9596
+ * carries parsed AttachmentRef[]. Convert at every hook boundary so hooks
9597
+ * see the spec shape and cannot corrupt the stored row shape.
9598
+ */
9599
+ static rowToHookMessage(row) {
9600
+ const { attachments, ...rest } = row;
9601
+ let parsed = void 0;
9602
+ if (attachments === null) parsed = null;
9603
+ else if (typeof attachments === "string" && attachments) {
9604
+ try {
9605
+ const p = JSON.parse(attachments);
9606
+ parsed = Array.isArray(p) ? p : void 0;
9607
+ } catch {
9608
+ parsed = void 0;
9609
+ }
9610
+ }
9611
+ return { ...rest, attachments: parsed };
9612
+ }
9589
9613
  /**
9590
9614
  * Run the before_update_message hook if it exists
9591
9615
  * This hook allows developers to modify a message before it's updated
@@ -9624,7 +9648,7 @@ ${msg.content}` : `${imageDescriptions}${nonImageList}`;
9624
9648
  const threadState = ThreadStateImpl.fromFlowState(state);
9625
9649
  for (const executor of executors) {
9626
9650
  try {
9627
- await executor(threadState, message);
9651
+ await executor(threadState, _FlowEngine.rowToHookMessage(message));
9628
9652
  } catch (error) {
9629
9653
  console.error("[Hooks] \u2717 Error running after_update_message hook:", error);
9630
9654
  }
@@ -10713,7 +10737,11 @@ ${msg.content}` : `${imageDescriptions}${nonImageList}`;
10713
10737
  const threadState = ThreadStateImpl.fromFlowState(state);
10714
10738
  for (const executor of executors) {
10715
10739
  try {
10716
- result = await executor(threadState, result);
10740
+ const byId = /* @__PURE__ */ new Map();
10741
+ for (const row of result) if (row.id) byId.set(row.id, row);
10742
+ const hookView = result.map((row) => _FlowEngine.rowToHookMessage(row));
10743
+ const kept = await executor(threadState, hookView);
10744
+ result = kept.map((m) => m.id && byId.get(m.id) || null).filter((row) => row !== null);
10717
10745
  } catch (error) {
10718
10746
  console.error("[Hooks] \u2717 Error running filter_messages hook:", error);
10719
10747
  }
@@ -14300,9 +14328,25 @@ var init_ThreadStateImpl = __esm({
14300
14328
  parent_id: msg.parent_id,
14301
14329
  depth: msg.depth,
14302
14330
  silent: msg.silent,
14303
- metadata: msg.metadata
14331
+ metadata: msg.metadata,
14332
+ status: msg.status,
14333
+ tool_status: msg.tool_status,
14334
+ attachments: this._parseAttachmentRefs(msg.attachments)
14304
14335
  };
14305
14336
  };
14337
+ /** Builder rows store attachments as a JSON string of AttachmentRef[];
14338
+ * spec messages carry the parsed refs. Dropping them here is what made
14339
+ * generated assets invisible to every session_state consumer. */
14340
+ _parseAttachmentRefs = (raw) => {
14341
+ if (!raw) return void 0;
14342
+ if (Array.isArray(raw)) return raw;
14343
+ try {
14344
+ const parsed = JSON.parse(raw);
14345
+ return Array.isArray(parsed) ? parsed : void 0;
14346
+ } catch {
14347
+ return void 0;
14348
+ }
14349
+ };
14306
14350
  _mapFileRecord = (record) => {
14307
14351
  return {
14308
14352
  path: record.path,
@@ -21370,6 +21414,10 @@ var PUBLIC_ROUTES = /* @__PURE__ */ new Set([
21370
21414
  function isProviderIconRoute(routePath) {
21371
21415
  return /^\/api\/providers\/[^/]+\/icon$/.test(routePath);
21372
21416
  }
21417
+ function isPublicThreadFileRoute(routePath, method) {
21418
+ if (method !== "GET" && method !== "HEAD") return false;
21419
+ return /^\/api\/threads\/[^/]+\/public\/.+/.test(routePath);
21420
+ }
21373
21421
  function isHostedInstance(env) {
21374
21422
  const value = env?.STANDARD_AGENTS_HOSTED;
21375
21423
  if (typeof value === "string") {
@@ -21396,6 +21444,9 @@ function isPublicApiRoute(routePath, request, env) {
21396
21444
  if (isProviderIconRoute(routePath)) {
21397
21445
  return true;
21398
21446
  }
21447
+ if (isPublicThreadFileRoute(routePath, request.method.toUpperCase())) {
21448
+ return true;
21449
+ }
21399
21450
  if (!isTrustedLocalDevelopmentRequest(request, env)) return false;
21400
21451
  return routePath === "/api/threads" || routePath.startsWith("/api/threads/") || routePath === "/api/platform" || routePath.startsWith("/api/platform/") || routePath === "/api/platform-session" || routePath.startsWith("/api/platform-session/") || routePath === "/api/platform-auth" || routePath.startsWith("/api/platform-auth/");
21401
21452
  }