From c1e55892901c002b5c7f8426727d3afe014fcbb8 Mon Sep 17 00:00:00 2001 From: Gabe Hamilton Date: Tue, 12 Mar 2024 22:23:25 -0600 Subject: [PATCH 1/3] restore tab title, devhub path --- nexus/components/src/Agent/AgentCard.jsx | 2 +- nexus/components/src/Agent/AgentChat.jsx | 2 +- nexus/components/src/Agent/AgentDetails.jsx | 11 +++++++++-- nexus/components/src/Agent/AgentSummary.jsx | 2 +- nexus/components/src/Placeholder.jsx | 2 +- 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/nexus/components/src/Agent/AgentCard.jsx b/nexus/components/src/Agent/AgentCard.jsx index 24161d7..455e0c9 100644 --- a/nexus/components/src/Agent/AgentCard.jsx +++ b/nexus/components/src/Agent/AgentCard.jsx @@ -1,4 +1,4 @@ -const { href } = VM.require("devhub.${REPL_ACCOUNT}/widget/core.lib.url"); +const { href } = VM.require("devhub.near/widget/core.lib.url"); if (!href) { return <>; diff --git a/nexus/components/src/Agent/AgentChat.jsx b/nexus/components/src/Agent/AgentChat.jsx index 8b7930b..97c0122 100644 --- a/nexus/components/src/Agent/AgentChat.jsx +++ b/nexus/components/src/Agent/AgentChat.jsx @@ -1,4 +1,4 @@ -const { href } = VM.require("devhub.${REPL_ACCOUNT}/widget/core.lib.url"); +const { href } = VM.require("devhub.near/widget/core.lib.url"); const storedModel = Storage.get("agent-model"); const storedLocalModel = Storage.get("agent-local-model"); const storedCredentialType = Storage.get("agent-credential-type"); diff --git a/nexus/components/src/Agent/AgentDetails.jsx b/nexus/components/src/Agent/AgentDetails.jsx index 992d530..94d2f2f 100644 --- a/nexus/components/src/Agent/AgentDetails.jsx +++ b/nexus/components/src/Agent/AgentDetails.jsx @@ -1,4 +1,4 @@ -const { href } = VM.require("devhub.${REPL_ACCOUNT}/widget/core.lib.url"); +const { href } = VM.require("devhub.near/widget/core.lib.url"); const { schema } = VM.require(`${REPL_AGIGUILD}/widget/Schema.Agent`); if (!href || !schema ) { return <>; @@ -90,6 +90,13 @@ const agentProperties = (obj) => { ); }; +const customComponentLabel = (component) => { + if (component === `agiguild.near/widget/Agent.AgentChat`) { + return "Chat"; + } + return {component}

, trigger: "Chat (Custom component)"}} />; +} + return ( @@ -128,7 +135,7 @@ return ( icon: editIcon, }, { - name: "Chat " + agentComponent, + name: customComponentLabel(agentComponent), value: "chat", content: , icon: "ph ph-code", diff --git a/nexus/components/src/Agent/AgentSummary.jsx b/nexus/components/src/Agent/AgentSummary.jsx index 2cac57c..6989120 100644 --- a/nexus/components/src/Agent/AgentSummary.jsx +++ b/nexus/components/src/Agent/AgentSummary.jsx @@ -1,5 +1,5 @@ if (!props.agent) return ""; -const { href } = VM.require("devhub.${REPL_ACCOUNT}/widget/core.lib.url"); +const { href } = VM.require("devhub.near/widget/core.lib.url"); if (!href) { return <>; } diff --git a/nexus/components/src/Placeholder.jsx b/nexus/components/src/Placeholder.jsx index efa59a2..03f3048 100644 --- a/nexus/components/src/Placeholder.jsx +++ b/nexus/components/src/Placeholder.jsx @@ -1,4 +1,4 @@ -const { href } = VM.require("devhub.${REPL_ACCOUNT}/widget/core.lib.url"); +const { href } = VM.require("devhub.near/widget/core.lib.url"); if (!href) { return <>; } From 16443396f9179cd63424cf87a8394262c3bb4d7b Mon Sep 17 00:00:00 2001 From: Gabe Hamilton Date: Tue, 12 Mar 2024 22:26:51 -0600 Subject: [PATCH 2/3] devhub REPL variable --- nexus/components/src/Agent/AgentCard.jsx | 2 +- nexus/components/src/Agent/AgentChat.jsx | 2 +- nexus/components/src/Agent/AgentDetails.jsx | 2 +- nexus/components/src/Agent/AgentSummary.jsx | 2 +- nexus/components/src/Placeholder.jsx | 2 +- nexus/replacements.dev.json | 3 ++- nexus/replacements.mainnet.json | 3 ++- nexus/replacements.testnet.json | 3 ++- 8 files changed, 11 insertions(+), 8 deletions(-) diff --git a/nexus/components/src/Agent/AgentCard.jsx b/nexus/components/src/Agent/AgentCard.jsx index 455e0c9..9f09c3c 100644 --- a/nexus/components/src/Agent/AgentCard.jsx +++ b/nexus/components/src/Agent/AgentCard.jsx @@ -1,4 +1,4 @@ -const { href } = VM.require("devhub.near/widget/core.lib.url"); +const { href } = VM.require("${REPL_DEVHUB}/widget/core.lib.url"); if (!href) { return <>; diff --git a/nexus/components/src/Agent/AgentChat.jsx b/nexus/components/src/Agent/AgentChat.jsx index 97c0122..586c1f2 100644 --- a/nexus/components/src/Agent/AgentChat.jsx +++ b/nexus/components/src/Agent/AgentChat.jsx @@ -1,4 +1,4 @@ -const { href } = VM.require("devhub.near/widget/core.lib.url"); +const { href } = VM.require("${REPL_DEVHUB}/widget/core.lib.url"); const storedModel = Storage.get("agent-model"); const storedLocalModel = Storage.get("agent-local-model"); const storedCredentialType = Storage.get("agent-credential-type"); diff --git a/nexus/components/src/Agent/AgentDetails.jsx b/nexus/components/src/Agent/AgentDetails.jsx index 94d2f2f..f49493e 100644 --- a/nexus/components/src/Agent/AgentDetails.jsx +++ b/nexus/components/src/Agent/AgentDetails.jsx @@ -1,4 +1,4 @@ -const { href } = VM.require("devhub.near/widget/core.lib.url"); +const { href } = VM.require("${REPL_DEVHUB}/widget/core.lib.url"); const { schema } = VM.require(`${REPL_AGIGUILD}/widget/Schema.Agent`); if (!href || !schema ) { return <>; diff --git a/nexus/components/src/Agent/AgentSummary.jsx b/nexus/components/src/Agent/AgentSummary.jsx index 6989120..f810bb5 100644 --- a/nexus/components/src/Agent/AgentSummary.jsx +++ b/nexus/components/src/Agent/AgentSummary.jsx @@ -1,5 +1,5 @@ if (!props.agent) return ""; -const { href } = VM.require("devhub.near/widget/core.lib.url"); +const { href } = VM.require("${REPL_DEVHUB}/widget/core.lib.url"); if (!href) { return <>; } diff --git a/nexus/components/src/Placeholder.jsx b/nexus/components/src/Placeholder.jsx index 03f3048..355496e 100644 --- a/nexus/components/src/Placeholder.jsx +++ b/nexus/components/src/Placeholder.jsx @@ -1,4 +1,4 @@ -const { href } = VM.require("devhub.near/widget/core.lib.url"); +const { href } = VM.require("${REPL_DEVHUB}/widget/core.lib.url"); if (!href) { return <>; } diff --git a/nexus/replacements.dev.json b/nexus/replacements.dev.json index 8c0dea9..6158ec3 100644 --- a/nexus/replacements.dev.json +++ b/nexus/replacements.dev.json @@ -1,5 +1,6 @@ { "REPL_ACCOUNT": "discom-dev.testnet", "REPL_NEAR_URL": "test.near.org", - "REPL_AGIGUILD": "agiguild-dev.testnet" + "REPL_AGIGUILD": "agiguild-dev.testnet", + "REPL_DEVHUB": "devhub-dev.testnet" } diff --git a/nexus/replacements.mainnet.json b/nexus/replacements.mainnet.json index 15120eb..4d2556c 100644 --- a/nexus/replacements.mainnet.json +++ b/nexus/replacements.mainnet.json @@ -1,5 +1,6 @@ { "REPL_ACCOUNT": "near", "REPL_AGIGUILD": "agiguild.near", - "REPL_NEAR_URL": "near.org" + "REPL_NEAR_URL": "near.org", + "REPL_DEVHUB": "devhub.near" } diff --git a/nexus/replacements.testnet.json b/nexus/replacements.testnet.json index f4635c2..6465183 100644 --- a/nexus/replacements.testnet.json +++ b/nexus/replacements.testnet.json @@ -1,5 +1,6 @@ { "REPL_ACCOUNT": "discom.testnet", "REPL_NEAR_URL": "test.near.org", - "REPL_AGIGUILD": "agiguild.testnet" + "REPL_AGIGUILD": "agiguild.testnet", + "REPL_DEVHUB": "devhubtest.testnet" } From b5fd1d4b71a11815eaa27b06539278b164feda9e Mon Sep 17 00:00:00 2001 From: Gabe Hamilton Date: Tue, 12 Mar 2024 22:52:41 -0600 Subject: [PATCH 3/3] REPL fixes --- nexus/components/src/Agent/AgentChat.jsx | 2 +- nexus/components/src/Agent/AgentDetails.jsx | 2 +- nexus/components/src/Agent/AgentSummary.jsx | 2 +- nexus/replacements.dev.json | 1 + nexus/replacements.mainnet.json | 1 + nexus/replacements.testnet.json | 1 + 6 files changed, 6 insertions(+), 3 deletions(-) diff --git a/nexus/components/src/Agent/AgentChat.jsx b/nexus/components/src/Agent/AgentChat.jsx index 586c1f2..81acd59 100644 --- a/nexus/components/src/Agent/AgentChat.jsx +++ b/nexus/components/src/Agent/AgentChat.jsx @@ -454,7 +454,7 @@ return (
{role === "user" && ( - + )} diff --git a/nexus/components/src/Agent/AgentDetails.jsx b/nexus/components/src/Agent/AgentDetails.jsx index f49493e..93a83e0 100644 --- a/nexus/components/src/Agent/AgentDetails.jsx +++ b/nexus/components/src/Agent/AgentDetails.jsx @@ -94,7 +94,7 @@ const customComponentLabel = (component) => { if (component === `agiguild.near/widget/Agent.AgentChat`) { return "Chat"; } - return {component}

, trigger: "Chat (Custom component)"}} />; + return {component}

, trigger: "Chat (Custom component)"}} />; } return ( diff --git a/nexus/components/src/Agent/AgentSummary.jsx b/nexus/components/src/Agent/AgentSummary.jsx index f810bb5..6b9a038 100644 --- a/nexus/components/src/Agent/AgentSummary.jsx +++ b/nexus/components/src/Agent/AgentSummary.jsx @@ -153,7 +153,7 @@ return (