@tangle-network/agent-app 0.58.1 → 0.58.3

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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  chatToolCallPart
3
- } from "../chunk-E2HFIKIZ.js";
3
+ } from "../chunk-OHRL6TO3.js";
4
4
  import "../chunk-X374TCDT.js";
5
5
  import "../chunk-3HUFJ5LO.js";
6
6
  import "../chunk-FBVLEGEG.js";
@@ -42,7 +42,7 @@ import {
42
42
  flattenHistory,
43
43
  readSandboxBinaryBytes,
44
44
  statSandboxFileSize
45
- } from "../chunk-73WE4UQG.js";
45
+ } from "../chunk-Q3XW5YKR.js";
46
46
  import "../chunk-MCYJON3F.js";
47
47
  import "../chunk-LWSJK546.js";
48
48
  import "../chunk-W5VBZTNN.js";
@@ -1870,7 +1870,8 @@ function AgentProfileEditor({
1870
1870
  requireUniqueSkillNames = false,
1871
1871
  showToolsAndPermissions = true,
1872
1872
  publicHttpsMcpOnly = false,
1873
- registry
1873
+ registry,
1874
+ onSaveStateChange
1874
1875
  }) {
1875
1876
  const id = useId();
1876
1877
  const workspaceFilePrefix = normalizedFilePathPrefix(filePathPrefix);
@@ -1903,6 +1904,14 @@ function AgentProfileEditor({
1903
1904
  const instructions = value.resources?.instructions;
1904
1905
  const constrainedEntryCount = workspaceFilePrefix || !allowExecutableFiles || requireGitHubCommitSha || requireUniqueSkillNames ? (value.resources?.files ?? []).filter((mount) => fileIssues(fileDraft(mount), workspaceFilePrefix, allowExecutableFiles, requireGitHubCommitSha, true).length > 0).length + skills.filter((ref, index) => resourceIssue("skills", resourceDraft(ref), skills, index, true)).length + toolFiles.filter((ref, index) => requireGitHubCommitSha && resourceIssue("tools", resourceDraft(ref), toolFiles, index, true)).length + Number(Boolean(requireGitHubCommitSha && instructions && typeof instructions === "object" && resourceError(resourceDraft(instructions), true, true))) : 0;
1905
1906
  const invalidMcpCount = publicHttpsMcpOnly ? Object.values(value.mcp ?? {}).filter((server) => publicHttpsMcpError(server)).length : 0;
1907
+ const pending = jsonDirty || Boolean(resourceEdit || fileEdit || addingFile || newTool.trim() || mcpName.trim() || mcpTarget.trim()) || Object.values(resourceDrafts).some((draft) => Boolean(draft.repository || draft.path || draft.ref || draft.name || draft.content));
1908
+ const invalid = Boolean(error || unsupportedResources.length || constrainedEntryCount || invalidMcpCount);
1909
+ useEffect5(() => {
1910
+ onSaveStateChange?.({ pending, invalid });
1911
+ }, [onSaveStateChange, pending, invalid]);
1912
+ useEffect5(() => () => {
1913
+ onSaveStateChange?.({ pending: false, invalid: false });
1914
+ }, [onSaveStateChange]);
1906
1915
  function emit(next) {
1907
1916
  if (jsonDirty) {
1908
1917
  setError("Apply or discard JSON edits first.");
@@ -7541,4 +7550,4 @@ export {
7541
7550
  useThinkingSeconds,
7542
7551
  ChatMessages
7543
7552
  };
7544
- //# sourceMappingURL=chunk-E2HFIKIZ.js.map
7553
+ //# sourceMappingURL=chunk-OHRL6TO3.js.map