@opengeni/react 3.5.1-canary.0 → 3.7.0-canary.0

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 (52) hide show
  1. package/dist/artifacts.d.ts +1 -1
  2. package/dist/artifacts.js +229 -6
  3. package/dist/artifacts.js.map +1 -1
  4. package/dist/{chunk-IB27C53Y.js → chunk-C6WDLHBA.js} +31 -23
  5. package/dist/chunk-C6WDLHBA.js.map +1 -0
  6. package/dist/{chunk-WY3MELVJ.js → chunk-DOK4KZF2.js} +119 -8
  7. package/dist/chunk-DOK4KZF2.js.map +1 -0
  8. package/dist/{chunk-TJFMMDQU.js → chunk-FJBOU2TH.js} +112 -6
  9. package/dist/chunk-FJBOU2TH.js.map +1 -0
  10. package/dist/{chunk-UNCXXIQR.js → chunk-R55HFTT3.js} +66 -24
  11. package/dist/chunk-R55HFTT3.js.map +1 -0
  12. package/dist/client.d.ts +1 -1
  13. package/dist/components/artifacts/index.d.ts +1 -1
  14. package/dist/components/artifacts/published-html-artifact-frame.d.ts +45 -3
  15. package/dist/components/composer.d.ts +2 -0
  16. package/dist/components/session-chrome.d.ts +1 -1
  17. package/dist/composer.js +1 -1
  18. package/dist/{fleet-decision-row-GGCAT4E4.js → fleet-decision-row-YZ3ZKWMM.js} +2 -1
  19. package/dist/fleet-decision-row-YZ3ZKWMM.js.map +1 -0
  20. package/dist/hooks/use-file-attachments.d.ts +6 -0
  21. package/dist/hooks/use-sandbox-files.d.ts +4 -1
  22. package/dist/hooks/use-workspace-edit.d.ts +4 -0
  23. package/dist/index.js +114 -58
  24. package/dist/index.js.map +1 -1
  25. package/dist/session-ui.js +2 -2
  26. package/dist/session.js +2 -2
  27. package/dist/timeline/registry.d.ts +2 -0
  28. package/dist/timeline/types.d.ts +1 -1
  29. package/package.json +2 -2
  30. package/src/artifacts.ts +3 -0
  31. package/src/client.ts +2 -1
  32. package/src/components/artifacts/index.ts +3 -0
  33. package/src/components/artifacts/published-html-artifact-frame.tsx +284 -4
  34. package/src/components/composer.tsx +89 -25
  35. package/src/components/message-timeline.tsx +32 -8
  36. package/src/components/sandbox-workspace.tsx +11 -1
  37. package/src/components/session-chrome.tsx +3 -3
  38. package/src/hooks/use-file-attachments.ts +34 -0
  39. package/src/hooks/use-sandbox-files.ts +68 -20
  40. package/src/hooks/use-session-events.ts +21 -26
  41. package/src/hooks/use-workspace-edit.ts +23 -5
  42. package/src/timeline/fleet-decision-projection.ts +2 -1
  43. package/src/timeline/fleet-decision-row.tsx +1 -0
  44. package/src/timeline/projection.ts +151 -7
  45. package/src/timeline/registry.ts +15 -3
  46. package/src/timeline/tool-renderers.tsx +117 -1
  47. package/src/timeline/types.ts +8 -1
  48. package/dist/chunk-IB27C53Y.js.map +0 -1
  49. package/dist/chunk-TJFMMDQU.js.map +0 -1
  50. package/dist/chunk-UNCXXIQR.js.map +0 -1
  51. package/dist/chunk-WY3MELVJ.js.map +0 -1
  52. package/dist/fleet-decision-row-GGCAT4E4.js.map +0 -1
@@ -22,7 +22,7 @@ import {
22
22
  isActionableHumanInputRequest,
23
23
  mcpToolLeaf,
24
24
  toolDisplayName
25
- } from "./chunk-TJFMMDQU.js";
25
+ } from "./chunk-FJBOU2TH.js";
26
26
  import {
27
27
  formatBytes,
28
28
  formatClockTime,
@@ -1851,6 +1851,7 @@ function createToolRegistry(baseEntries, baseFallback, options = {}) {
1851
1851
  const fallback = options.fallback ?? baseFallback;
1852
1852
  const byRawType = /* @__PURE__ */ new Map();
1853
1853
  const byName = /* @__PURE__ */ new Map();
1854
+ const byPrefixedLeaf = /* @__PURE__ */ new Map();
1854
1855
  for (const entry of entries) {
1855
1856
  if (entry.match === "rawType") {
1856
1857
  if (!byRawType.has(entry.type)) {
@@ -1859,6 +1860,11 @@ function createToolRegistry(baseEntries, baseFallback, options = {}) {
1859
1860
  } else if (!byName.has(entry.name)) {
1860
1861
  byName.set(entry.name, entry.render);
1861
1862
  }
1863
+ if (entry.match === "name" && entry.matchPrefixedLeaf !== false) {
1864
+ if (!byPrefixedLeaf.has(entry.name)) {
1865
+ byPrefixedLeaf.set(entry.name, entry.render);
1866
+ }
1867
+ }
1862
1868
  }
1863
1869
  const resolve = (item) => {
1864
1870
  const rawType = rawTypeOf(item);
@@ -1874,7 +1880,7 @@ function createToolRegistry(baseEntries, baseFallback, options = {}) {
1874
1880
  }
1875
1881
  const leaf = mcpToolLeaf(item.name);
1876
1882
  if (leaf !== item.name) {
1877
- const byLeaf = byName.get(leaf);
1883
+ const byLeaf = byPrefixedLeaf.get(leaf);
1878
1884
  if (byLeaf) {
1879
1885
  return byLeaf;
1880
1886
  }
@@ -3740,6 +3746,76 @@ function SandboxFilePublishRenderer({ item, loadRetainedArtifact }) {
3740
3746
  }
3741
3747
  );
3742
3748
  }
3749
+ function publishedSiteReceipt(output) {
3750
+ const { text, isError } = unwrapMcpOutput(output);
3751
+ if (isError) return null;
3752
+ const parsed = tryParseJson(text);
3753
+ if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return null;
3754
+ const artifact = parsed.artifact;
3755
+ const version = parsed.version;
3756
+ if (!artifact || typeof artifact !== "object" || Array.isArray(artifact) || !version || typeof version !== "object" || Array.isArray(version)) {
3757
+ return null;
3758
+ }
3759
+ const artifactRecord = artifact;
3760
+ const versionRecord = version;
3761
+ if (typeof artifactRecord.workspaceId !== "string" || typeof artifactRecord.id !== "string" || typeof artifactRecord.title !== "string" || typeof versionRecord.revision !== "number" || !Number.isInteger(versionRecord.revision) || versionRecord.revision < 1) {
3762
+ return null;
3763
+ }
3764
+ return {
3765
+ workspaceId: artifactRecord.workspaceId,
3766
+ artifactId: artifactRecord.id,
3767
+ title: artifactRecord.title,
3768
+ revision: versionRecord.revision,
3769
+ replayed: parsed.replayed === true
3770
+ };
3771
+ }
3772
+ function SiteOpenLink({ receipt }) {
3773
+ const href = `/workspaces/${encodeURIComponent(receipt.workspaceId)}/artifacts/${encodeURIComponent(receipt.artifactId)}`;
3774
+ return /* @__PURE__ */ jsx10(
3775
+ "a",
3776
+ {
3777
+ href,
3778
+ "aria-label": `Open ${receipt.title}`,
3779
+ className: "inline-flex min-h-7 items-center rounded-og-sm px-2 text-og-sm font-medium text-og-accent-strong hover:bg-og-surface-2 hover:underline focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-og-accent pointer-coarse:min-h-10",
3780
+ onClick: (event) => event.stopPropagation(),
3781
+ onKeyDown: (event) => event.stopPropagation(),
3782
+ children: "Open"
3783
+ }
3784
+ );
3785
+ }
3786
+ function SiteArtifactRenderer({ item }) {
3787
+ const leaf = mcpToolLeaf(item.name);
3788
+ const publishingExisting = leaf === "artifacts_publish";
3789
+ if (item.status === "running") {
3790
+ return /* @__PURE__ */ jsx10(
3791
+ ActivityDisclosure,
3792
+ {
3793
+ icon: /* @__PURE__ */ jsx10(PanelsTopLeftIcon, { className: ICON_SIZE }),
3794
+ iconTone: "running",
3795
+ title: publishingExisting ? "Publishing Site update" : "Publishing Site",
3796
+ running: true,
3797
+ preview: /* @__PURE__ */ jsx10(RunningPreview, { children: "retaining source and compiled HTML\u2026" })
3798
+ }
3799
+ );
3800
+ }
3801
+ const receipt = publishedSiteReceipt(item.output);
3802
+ if (!receipt || item.status === "failed") return /* @__PURE__ */ jsx10(GenericRenderer, { item });
3803
+ return /* @__PURE__ */ jsx10(
3804
+ ActivityDisclosure,
3805
+ {
3806
+ icon: /* @__PURE__ */ jsx10(PanelsTopLeftIcon, { className: ICON_SIZE }),
3807
+ iconTone: "accent",
3808
+ title: publishingExisting ? `Updated ${receipt.title}` : `Published ${receipt.title}`,
3809
+ media: /* @__PURE__ */ jsx10(SiteOpenLink, { receipt }),
3810
+ children: /* @__PURE__ */ jsxs7(BodyNote, { children: [
3811
+ "Version ",
3812
+ receipt.revision,
3813
+ " is live",
3814
+ receipt.replayed ? " (replayed from the original publication)." : "."
3815
+ ] })
3816
+ }
3817
+ );
3818
+ }
3743
3819
  function GeneratedImageDisclosure({
3744
3820
  receipt,
3745
3821
  load,
@@ -4632,7 +4708,7 @@ function GenericRenderer({ item }) {
4632
4708
  }
4633
4709
  function goalToolPreview(name, args) {
4634
4710
  const leaf = mcpToolLeaf(name);
4635
- if (leaf !== "goal_set" && leaf !== "goal_update" && leaf !== "goal_complete" && leaf !== "goal_pause" && leaf !== "goal_wait") {
4711
+ if (leaf !== "goal_set" && leaf !== "goal_update" && leaf !== "goal_complete" && leaf !== "goal_pause" && leaf !== "wait_for_input") {
4636
4712
  return null;
4637
4713
  }
4638
4714
  const record = args && typeof args === "object" ? args : null;
@@ -4684,6 +4760,30 @@ var BASE_ENTRIES = [
4684
4760
  { match: "name", name: "tool_search", render: ToolSearchRenderer },
4685
4761
  { match: "name", name: "view_image", render: ViewImageRenderer },
4686
4762
  { match: "name", name: "sandbox_file_publish", render: SandboxFilePublishRenderer },
4763
+ {
4764
+ match: "name",
4765
+ name: "artifacts_create",
4766
+ render: SiteArtifactRenderer,
4767
+ matchPrefixedLeaf: false
4768
+ },
4769
+ {
4770
+ match: "name",
4771
+ name: "artifacts_publish",
4772
+ render: SiteArtifactRenderer,
4773
+ matchPrefixedLeaf: false
4774
+ },
4775
+ {
4776
+ match: "name",
4777
+ name: "opengeni__artifacts_create",
4778
+ render: SiteArtifactRenderer,
4779
+ matchPrefixedLeaf: false
4780
+ },
4781
+ {
4782
+ match: "name",
4783
+ name: "opengeni__artifacts_publish",
4784
+ render: SiteArtifactRenderer,
4785
+ matchPrefixedLeaf: false
4786
+ },
4687
4787
  { match: "name", name: "environment_set_variable", render: SecretSetRenderer },
4688
4788
  { match: "name", name: "variable_set_set_variable", render: SecretSetRenderer },
4689
4789
  { match: "name", name: "search_documents", render: DocsSearchRenderer },
@@ -4734,7 +4834,7 @@ function useSeenActivityIds() {
4734
4834
 
4735
4835
  // src/timeline/activity-rail.tsx
4736
4836
  import { Fragment as Fragment3, jsx as jsx12, jsxs as jsxs8 } from "react/jsx-runtime";
4737
- var LazyFleetDecisionRow = lazy2(() => import("./fleet-decision-row-GGCAT4E4.js"));
4837
+ var LazyFleetDecisionRow = lazy2(() => import("./fleet-decision-row-YZ3ZKWMM.js"));
4738
4838
  var LazyPlatformActivityRow = lazy2(() => import("./platform-activity-row-BJHUHXAT.js"));
4739
4839
  function familyOf(item) {
4740
4840
  if (item.kind === "tool-call") {
@@ -6651,7 +6751,9 @@ function MessageTimeline({
6651
6751
  applyPinned(false);
6652
6752
  }
6653
6753
  } else if (prepended) {
6654
- if (autoFollow && pinnedRef.current && !hasNewer && !pendingReaderLeaveRef.current && (wasAtLiveTailBeforeCommit || olderLoadAttemptRef.current)) {
6754
+ const olderAttemptState = olderLoadAttemptRef.current?.[1];
6755
+ const underfillOwned = !!olderLoadAttemptRef.current && olderAttemptState !== 1 && olderAttemptState !== 2 && olderAttemptState !== 3;
6756
+ if (autoFollow && pinnedRef.current && !hasNewer && !pendingReaderLeaveRef.current && (wasAtLiveTailBeforeCommit || underfillOwned)) {
6655
6757
  clearPendingReaderLeave();
6656
6758
  snapToBottom(node);
6657
6759
  } else {
@@ -6943,6 +7045,13 @@ function MessageTimeline({
6943
7045
  syncScrollBaseline(node);
6944
7046
  return;
6945
7047
  }
7048
+ if (programmatic && !pinnedRef.current) {
7049
+ syncScrollBaseline(node);
7050
+ if (wantPinRef.current && !isNearBottom(node)) {
7051
+ wantPinRef.current = false;
7052
+ }
7053
+ return;
7054
+ }
6946
7055
  if (autoFollow && pinnedRef.current && !hasNewer) {
6947
7056
  const previousClient = followRef.current.lastClientHeight;
6948
7057
  const viewportShrunk = previousClient > 0 && node.clientHeight < previousClient - TIP_FOLLOW_SHRINK_EPS_PX;
@@ -6979,7 +7088,9 @@ function MessageTimeline({
6979
7088
  }
6980
7089
  syncScrollBaseline(node);
6981
7090
  const nearBottom = isNearBottom(node);
6982
- const nextPinned = !hasNewer && nearBottom && nextTop >= previousTop - TIP_FOLLOW_READER_UP_EPS_PX;
7091
+ const inserted = Math.max(0, nextMaxScroll - previousMaxScroll);
7092
+ const towardTip = nextTop - previousTop - inserted;
7093
+ const nextPinned = !hasNewer && nearBottom && towardTip >= -TIP_FOLLOW_READER_UP_EPS_PX && inserted <= 1;
6983
7094
  if (!nextPinned) {
6984
7095
  stopFollow();
6985
7096
  }
@@ -8586,7 +8697,7 @@ function sessionChromeGoalPillExplanation(state, record) {
8586
8697
  if (state === "held" && continuation?.reason === "held_for_input") {
8587
8698
  const reason = continuation.holdReason?.trim();
8588
8699
  const until = continuation.nextAttemptAt ? ` until ${formatClockTime(continuation.nextAttemptAt)}` : "";
8589
- return `Waiting for input${reason ? `: ${reason}` : ""}${until}. A child result, an agent message, or your prompt wakes it sooner.`;
8700
+ return `Waiting for input${reason ? `: ${reason}` : ""}${until}. Relevant session input\u2014including a child result, background-command result, agent message, schedule, or your prompt\u2014wakes it sooner.`;
8590
8701
  }
8591
8702
  return null;
8592
8703
  }
@@ -9570,4 +9681,4 @@ export {
9570
9681
  sessionChromeGoalPillState,
9571
9682
  SessionChrome
9572
9683
  };
9573
- //# sourceMappingURL=chunk-WY3MELVJ.js.map
9684
+ //# sourceMappingURL=chunk-DOK4KZF2.js.map