@esri/solutions-components 5.1.0-next.159 → 5.1.0-next.160
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.
- package/dist/cdn/{T6BYV326.js → CGOOAJVN.js} +2 -2
- package/dist/cdn/{DLDR5V2P.js → IE5TTSUW.js} +7 -2
- package/dist/cdn/{ZNC2XEOJ.js → JDI57IEI.js} +1 -2
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/assessBuildRequest.js +7 -2
- package/dist/chunks/classifyIntent.js +1 -2
- package/dist/components/arcgis-solutions-assistant/customElement.js +1 -1
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/solutions-components_commit.txt +6 -6
- package/package.json +1 -1
|
@@ -78,7 +78,7 @@ Description: {description}`,Cz=A.object({schemaVersion:A.literal(Bf),modified:A.
|
|
|
78
78
|
Available prompts:
|
|
79
79
|
${Object.keys(t).join(`
|
|
80
80
|
`)}`);return await r[1]()}function Co(t){return t?.configurable?.context?.translations}function Wc(t){if(typeof window>"u"||t.length<=1)return;let e=t.map(n=>n.solution.id),r=t.map(n=>n.solution.title);window.dispatchEvent(new CustomEvent("searchTermSet",{detail:{scope:"all-solutions",searchTerm:""}})),window.dispatchEvent(new CustomEvent("solutionMatchesFromAssistant",{detail:{solutionIds:e,solutionTitles:r},bubbles:!0,composed:!0})),window.dispatchEvent(new CustomEvent("navTabSelected",{detail:{tabType:"all-solutions"}}))}function Hc(t){if(typeof window>"u"||!t)return;let e=new CustomEvent("solutionIDFromAssistant",{detail:t,bubbles:!0,composed:!0});window.dispatchEvent(e)}var ph=A.object({needsContext:A.boolean().describe("True when the explorer query requires added context from prior turns."),rewrittenQuery:A.string().min(1).describe("The final query to send to doc AI. Keep original query if no context is needed.")}),Jc=Object.assign({"./prompts/solutions_explorer_description.md":()=>import("./AS6VINEU.js").then(t=>t.default),"./prompts/transformQuery.md":()=>import("./SNZRQPXI.js").then(t=>t.default)});function dh(t){return t.replace(/<sup>\[\[(\d+)\]\]\(([^)]+)\)<\/sup>/g,'<sup><a href="$2">[$1]</a></sup>')}function mh(t){return t.replace(/!\[([^\]]*)\]\(([^)]+)\)/g,(e,r,n)=>`<img src="${n}" alt="${r}" style="width: 100%;">`)}function fh(t,e){let r=[];return(e?.configurable?.context?.configContext.allCards??[]).forEach(n=>{let s=n.title;if(!s)return;let o=new RegExp(`(?<![\\p{L}\\p{N}])${s}(?![\\p{L}\\p{N}])`,"giu"),i=!1;t=t.replace(o,(a,u,l)=>{let p=l.slice(0,u);return/<img[^>]*alt\s*=\s*["'][^"']*$/i.test(p)?a:(i=!0,`<a href="" target="solutionId:${n.deployCommonId}">${s}</a>`)}),i&&r.push({solution:{title:n.title,id:n.deployCommonId,snippet:n.snippet,description:n.description},score:100})}),{source:t,allMatches:r}}function hh(t){return t&&t.helperServices.aiAssistantServices?`${t.helperServices.aiAssistantServices.url}/skills/doc_ai_assistant/chat`:null}function Vc(t){return t&&t.helperServices.aiAssistantServices?`${t.helperServices.aiAssistantServices.url}/skills/doc_ai_assistant/api/pre-chat`:null}async function ua(t,e,r){let n=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json",token:r},body:JSON.stringify(t)});if(!n.ok)throw new Error(`HTTP ${n.status} calling ${e}`);return n.json()}var gh=t=>new Promise(e=>setTimeout(e,t));async function _h(t,e){let r=t.agentExecutionContext.userRequest,n=e?.configurable?.context?.lastTurnAgent,s=t.agentExecutionContext.messages??[];if(!n||s.length<=1||n==="explorer")return r;try{let o=await he(Jc,"transformQuery"),i=await Ve({promptText:o,modelTier:"fast",temperature:0,schema:ph,messages:s.slice(-11),inputVariables:{query:r,lastTurnAgent:n}});if(i.needsContext&&i.rewrittenQuery.trim())return console.debug(`Rephrased query from "${r}" to "${i.rewrittenQuery.trim()}"`),i.rewrittenQuery.trim()}catch{}return r}var yh=z.Root({...ho(),solutionResponse:z({reducer:(t,e)=>e??null,default:()=>null}),documentSkillUrl:z({reducer:(t,e)=>e??null,default:()=>null}),conversationId:z({reducer:(t,e)=>e??t,default:()=>null})}),wh=()=>new er(yh).addNode("initializeAgent",bh).addNode("askSolutionsQuestions",Ah).addEdge(Xt,"initializeAgent").addEdge("initializeAgent","askSolutionsQuestions").addEdge("askSolutionsQuestions",pe),Zc=async(t,e,r,n)=>{if(!t)return;let s=Vc(t);if(!s)return;let o={context:{kind:"DocAIAssistantRequest",filters:{products:"ArcGIS Solutions",persona:{persona:"apps-solutions"},pipeline:{translation:{allow:!0,language:r,use_llm:!1}}}}};n&&(o.conversationId=n),ua(o,s,e??"")},Ah=async(t,e)=>{if(e?.configurable?.abortSignal?.aborted)return{};let r=Co(e),n=t.documentSkillUrl,s=[],o=await _h(t,e);await Te({text:r.agentProgress.explorerAgentSearching},e);let i=await ua({message:o,conversationId:e?.configurable?.context?.convoId??void 0,context:{kind:"DocAIAssistantRequest",filters:{products:"ArcGIS Solutions",persona:{persona:"apps-solutions"},pipeline:{translation:{allow:!0,language:e?.configurable?.context?.configContext.locale??"en",use_llm:!1}}}}},n,e?.configurable?.context?.token??"");i.conversationId&&e?.configurable?.context?.setConversationId&&e.configurable.context.setConversationId(i.conversationId);let a={message:i.message,conversationId:i.conversationId,hasMore:i.hasMore,ackSequenceNumber:i.sequenceNumber,inquiryId:i.inquiryId},u="",l=async p=>{let m=p.context?.results?.[0]?.reply??"";if(m!==""){let h=dh(m),b=mh(h),I=fh(b,e);u=I.source,s=[...s,...I.allMatches.filter(R=>!s.some(g=>g.solution.id===R.solution.id))]}let _=p.context?.results?.[0]?.status?.currentStatusStep;if(_){let h="";_===1?h=r.agentProgress.explorerAgentReading:_===2?h=r.agentProgress.explorerAgentReviewing:_===3&&(h=r.agentProgress.explorerAgentPreparing),await Te({text:h},e)}};for(await l(i);a.hasMore;){if(e?.configurable?.abortSignal?.aborted)return{};await gh(500),i=await ua({conversationId:a.conversationId,ackSequenceNumber:a.ackSequenceNumber,inquiryId:a.inquiryId},n,e?.configurable?.context?.token??""),a={message:i.message,conversationId:i.conversationId,hasMore:i.hasMore,ackSequenceNumber:i.sequenceNumber,inquiryId:i.inquiryId},await l(i)}return Vc(e?.configurable?.context.portal)&&Zc(e?.configurable?.context.portal,e?.configurable?.context.token??"",e?.configurable?.context.configContext.locale??"en",a.conversationId),s.length&&(s.length===1?Hc(s[0].solution.id):Wc(s)),{outputMessage:u,summary:u,status:"success",solutionResponse:a,conversationId:a.conversationId}},bh=async(t,e)=>{let r=null;return t.documentSkillUrl===null&&e?.configurable?.context?.portal&&(r=hh(e.configurable.context.portal)),{documentSkillUrl:r}};await he(Jc,"solutions_explorer_description");var Gc=t=>{if(t&&Array.isArray(t.id)&&t.id.length>0)return t.id[t.id.length-1].replace("Message","").toLowerCase();if(t&&typeof t._getType=="function")try{return t._getType()}catch{return"human"}return"human"},Ih=t=>{let e=Gc(t);if(t&&t.kwargs)return{role:e,...t.kwargs};if(t&&typeof t=="object"){let r={role:e,content:typeof t.content=="string"?t.content:String(t.content||"")};return t.id&&(r.id=t.id),t.name&&(r.name=t.name),t.additional_kwargs&&(r.additional_kwargs=t.additional_kwargs),t.response_metadata&&(r.response_metadata=t.response_metadata),r}return{role:"human",content:String(t)}},xh=t=>Gc(t)==="human",vh=(t,e=3)=>t.filter(r=>xh(r)).slice(-e).map(Ih),Th=(t,e=" ")=>vh(t).map(r=>r.content).join(e).trim(),Ch={understandingRequest:"Understanding your request...",selectTemplatePrompt:"This use case could be supported in a few different ways. Choose the option that best matches what you want to accomplish.",searchingExistingSolutions:"Searching for existing solutions...",existingSolutionMatch:"I found one or more existing solutions that match your use case. These are ready-to-use solutions that may already meet your needs and can be deployed now. Do you want to continue building your own solution?",continueBuildingYes:"Yes, I want to build a new solution",continueBuildingNo:"No, I\u2019ll review existing solutions",continueBuildingDeclined:"Sounds good. We can focus on existing solutions. Let me know if I can help answer any questions or provide more details.",creatingDesign:"Generating solution design...",updatingDesign:"Updating solution design...",applyChangeFailed:"I wasn't able to apply that change. The design was not modified. Please try rephrasing your request.",createDesignFailed:"I wasn't able to create a solution design from that request. Please try rephrasing and try again.",discardMessage:"Are you sure you want to discard your solution?",discardForNewSolution:"I can help you build a new solution, but I will need to discard your current solution design. Do you want to continue?"},Ph={builderMessages:Ch},To=class{constructor(e,r,n=!0){this.isValid=!0,this.issues=[],this.fieldNameRegistry=null,this.response=e,this.template=r,this.newDesign=n,this.validate()}validate(){this.compareModels(),this.validateResponse()}compareModels(){this._compareStrings(),this._compareItems(),this._compareFeatureLayers()}validateResponse(){this._validateSolutionProps(),this._validateItems(),this._validateFeatureLayer()}_compareStrings(){let e=new Set(this.template.solution.strings.map(n=>n.key)),r=new Set(this.response.solution.strings.map(n=>n.key));e.size===r.size&&[...e].every(n=>r.has(n))||this._logIssue("String keys in llm response do not match the template.");for(let n of this.response.solution.strings)n.value||this._logIssue(`String key '${n.key}' has no value in the design. It must be populated.`)}_compareItems(){let e=new Set(this.template.items.map(n=>n.id)),r=new Set(this.response.items.map(n=>n.id));e.size===r.size&&[...e].every(n=>r.has(n))||this._logIssue("Item IDs in design do not match the template.")}_compareFeatureLayers(){let e=this.template.featureLayer,r=this.response.featureLayer;if(e.itemId!==r.itemId){this._logIssue(`Feature Layer itemId '${r.itemId}' does not match template '${e.itemId}'.`);return}if(!e.addLayers){let n=new Set(e.layers.map(o=>o.id)),s=new Set(r.layers.map(o=>o.id));if(!(n.size===s.size&&[...n].every(o=>s.has(o))))this._logIssue(`Feature Layer '${e.itemId}' had its layer ids altered.`);else for(let o of e.layers)if(o.type){let i=r.layers.find(a=>a.id===o.id);i&&i.type!==o.type&&this._logIssue(`Layer '${o.id}' type '${i.type}' does not match template type '${o.type}'. This layer type is immutable.`)}}}_validateSolutionProps(){let e=this.response.solution.title,r=this.response.solution.description,n=Is(e??"");if(n.isValid||this._logIssue(`Solution title is invalid (${n.errorType}).`),r){let s=xs(r,2048,!0);s.isValid||this._logIssue(`Solution description is invalid (${s.errorType}).`)}}_validateItems(){let e=new Set(["Feature Layer (hosted)","Feature Layer (hosted, view)"]);for(let r of this.response.items){e.has(r.type)&&r.title.length>100&&this._logIssue(`Service name '${r.title}' exceeds 100 characters.`);let n=Is(r.title??"");if(n.isValid||this._logIssue(`Item '${r.id}' title is invalid (${n.errorType}).`),r.description){let s=xs(r.description,2048,!0);s.isValid||this._logIssue(`Item '${r.id}' description is invalid (${s.errorType}).`)}}}_validateFeatureLayer(){let e=this.template.featureLayer.layers;this.response.featureLayer.layers.length||this._logIssue("Feature layer item must contain at least one layer.");let r=this.response.featureLayer.layers.map(n=>n.name.toLowerCase());r.length!==new Set(r).size&&this._logIssue(`Layer names must be unique (case-insensitive). Layer names in design: ${r}.`);for(let n of this.response.featureLayer.layers){this._validateLayer(n,this.response.featureLayer.addLayers);let s=e.find(o=>o.id===n.id);s&&this._validateRequiredFields(n,s)}}_validateRequiredFields(e,r){let n=new Set(e.requiredFields.map(s=>s.name));for(let s of r.requiredFields)n.has(s.name)||this._logIssue(`Layer '${e.name}' is missing required field '${s.name}'.`)}_validateLayer(e,r){!r&&e.typeMutable===!0&&e.type==="Table"&&this._logIssue(`Layer '${e.name}' cannot be a Table. It may be a Point, Line, or Polygon.`);let n=Is(e.name??"");if(n.isValid||this._logIssue(`Layer '${e.name}' name is invalid (${n.errorType}).`),e.description){let s=xs(e.description,2048,!0);s.isValid||this._logIssue(`Layer '${e.name}' description is invalid (${s.errorType}).`)}this._validateLayerFields(e)}_validateLayerFields(e){let r=new Set(["objectid","globalid","created_date","created_user","last_edited_date","last_edited_user"]),n=e.customFields.map(l=>l.name),s=new Set(e.requiredFields.map(l=>l.name)),o=[...new Set(n.filter(l=>r.has(l)))];for(let l of o)this._logIssue(`Layer '${e.name}' field '${l}' collides with a reserved system field name.`);let i=[...new Set(n.filter(l=>s.has(l)))];for(let l of i)this._logIssue(`Layer '${e.name}' field '${l}' collides with a required field name.`);if(!o.length&&!i.length){let l=e.systemFields??[],p=[...e.customFields,...e.requiredFields,...l].map(m=>m.name);p.length!==new Set(p).size&&this._logIssue(`Layer '${e.name}' has duplicate fields: ${JSON.stringify(p)}.`)}let a=e.systemFields??[],u=[...e.customFields,...e.requiredFields,...a].map(l=>l.name.toLowerCase());this.fieldNameRegistry=new Set(u);for(let l of[...e.customFields,...e.requiredFields])this._validateField(l);this.fieldNameRegistry=null}_getUniqueTruncatedFieldName(e){let r=this.fieldNameRegistry;if(!r)return e.slice(0,31);let n=e.toLowerCase();r.delete(n);let s=e.slice(0,31),o=s,i=1;for(;r.has(o.toLowerCase());){let a=`_${i}`,u=Math.max(1,31-a.length);o=`${s.slice(0,u)}${a}`,i+=1}return r.add(o.toLowerCase()),o}_validateField(e){let r=/^\p{L}/u,n=/^.[\p{L}\p{M}\p{N}_]*$/u;if(e.alias||this._logIssue(`Field '${e.name}' has no display name (alias).`),r.test(e.name)||this._logIssue(`Field '${e.name}' does not start with a letter.`),n.test(e.name)||this._logIssue(`Field '${e.name}' contains invalid characters (only letters from any writing system, numbers, and underscores are allowed; emojis and punctuation are not allowed).`),e.name.length>31)if(this.newDesign){let s=e.name;e.name=this._getUniqueTruncatedFieldName(e.name),console.debug(`Field '${s}' exceeds 31 characters. Auto-fixing to '${e.name}'.`)}else this._logIssue(`Field '${e.name}' exceeds 31 characters.`);if(Ga.has(e.name.toLowerCase()))if(this.newDesign){let s=e.name;e.name=`${s}_`,console.debug(`Field '${s}' is a SQL reserved keyword. Auto-fixing to '${e.name}'.`)}else this._logIssue(`Field '${e.name}' is a SQL reserved keyword.`);if(e.type==="string"&&this._validateStringFieldLength(e),Array.isArray(e.choiceList)&&(e.type!=="string"&&this._logIssue(`Field '${e.name}' must be of type 'string' to have a domain.`),e.choiceList.length||this._logIssue(`Field '${e.name}' has an empty domain. At least one value is required.`),e.choiceList.some(s=>!s?.trim())&&this._logIssue(`A blank domain value was added to Field '${e.name}'.`),e.choiceList.length!==new Set(e.choiceList).size&&this._logIssue(`Field '${e.name}' has duplicate domain values.`),e.length!=null)){let s=Math.max(...e.choiceList.map(o=>o.length));s>e.length&&(this.newDesign?(console.debug(`The choice provided for field '${e.name}' is too long. It must fit within ${e.length} characters, but the choice requires ${s} characters. Auto-fixing to ${s}.`),e.length=s):this._logIssue(`The choice provided for field '${e.name}' is too long. It must fit within ${e.length} characters, but the choice requires ${s} characters.`))}}_validateStringFieldLength(e){if(this.newDesign&&e.length===255&&(e.length=256),typeof e.length!="number"||Number.isNaN(e.length)){this._handleInvalidStringFieldLength(e,256);return}let r=e.length;if(!Ya(r).isValid){let n=r>4e3?4e3:256;this._handleInvalidStringFieldLength(e,n)}}_handleInvalidStringFieldLength(e,r){this.newDesign?(console.debug(`Field '${e.name}' has an invalid length. Auto-fixing to ${r}.`),e.length=r):this._logIssue(`Field '${e.name}' length is invalid (must be a number between 1 and 4000).`)}_logIssue(e){console.debug(e),this.issues.push(e),this.isValid=!1}},Oh=v.object({key:v.string().describe("Stable key identifier for the string."),value:v.string().describe("Display value for the string."),description:v.string().describe("Explanation of where/how the string is used.")}),kh=v.object({id:v.string().describe("ArcGIS item id (32 hex characters)."),title:v.string().describe("Item title."),description:v.string().describe("Item description."),type:v.enum(["Feature Layer (hosted)","Feature Layer (hosted, view)","Web Map","Instant App","Dashboard","Web Experience","Form","Table (hosted)","Table (hosted, view)","Hub Site Application","Hub Page","CSV","Data Pipeline","Desktop Application Template","Group","Notebook","QuickCapture Project"]).describe("ArcGIS item type.")}),qc=v.object({name:v.string().describe("Field name."),type:v.enum(["string","integer","double","date","oid","guid","globalid"]).describe("Field data type."),alias:v.string().describe("Field alias for display."),description:v.string().describe("Field description."),choiceList:v.array(v.string()).nullable().describe("List of allowed values for string fields with a controlled vocabulary. Null if unrestricted or not applicable."),length:v.number().int().nullable().describe("Maximum string length for string fields. Null for non-string fields.")}),Sh=v.object({id:v.number().int().describe("Layer/table id within the feature service."),type:v.enum(["Point","Polyline","Polygon","Table"]).describe("Layer type."),typeMutable:v.boolean().describe("Indicates whether the layer type can be changed."),name:v.string().describe("Layer/table name."),description:v.string().describe("Layer/table description."),customFields:v.array(qc).describe("User/business fields specific to the solution."),requiredFields:v.array(qc).describe("Fields required for solution functionality (e.g., relationship keys).")}),Eh=v.object({itemId:v.string().describe("ArcGIS item id for the feature layer."),addLayers:v.boolean().describe("Indicates whether new layers can be added during solution design."),layers:v.array(Sh)}),pa=v.object({response:v.string().describe("Conversational response to the user's query."),solution:v.object({itemId:v.string().nullable().describe("ArcGIS item id of the source Solution template used for deployment. Preserve the existing value exactly when known; otherwise use null."),title:v.string().describe("Title of the solution."),description:v.string().describe("Description of the solution."),tags:v.array(v.string()).describe("Keywords/tags associated with the solution."),strings:v.array(Oh).describe("Localized strings/labels used by apps (dashboards, forms, etc.).")}),items:v.array(kh).describe("ArcGIS items that belong to the solution (apps, maps, layers, etc.)."),featureLayer:Eh.describe("Primary feature layer item and its schema/layers/tables details.")}),Mh=v.object({op:v.enum(["add","remove","replace","move","copy"]).describe("RFC 6902 operation type."),path:v.string().describe("RFC 6901 JSON Pointer to the target location."),value:v.string().nullable().describe(`JSON-encoded value to apply (required for add and replace). Must be null \u2014 not an empty string \u2014 for remove, move, and copy operations. Serialize as a JSON string, e.g. '\\"text\\"' for a string, '[\\"a\\",\\"b\\"]' for an array, or '{\\"name\\":\\"x\\"}' for an object.`),from:v.string().nullable().describe("RFC 6901 JSON Pointer to the source location (required for move and copy). Must be null \u2014 not an empty string \u2014 for all other operations.")}),Rh=v.object({response:v.string().describe("Conversational response describing the accepted design changes."),patches:v.array(Mh).describe("Minimal RFC 6902 patch operations needed to update the current design.")}),$h=v.object({response:v.string().describe("Short, user-friendly explanation of why the requested update was not applied.")}),Nh=v.object({assistantResponse:v.string().describe("Natural-language response for the user."),isValidUpdate:v.boolean().describe("True only when the request is in scope for supported design updates.")}),Lh=v.object({matchedTitles:v.array(v.string()).describe("Titles of solutions that match the user's request. Empty array if no strong match.")}),Dh=v.object({templateId:v.string().min(1).describe("Template id from the available template list."),confidence:v.number().min(0).max(1).describe("Confidence score from 0 to 1 for this template match."),templateDescription:v.string().min(1).describe("Short action\u2011oriented description of the template in the user's use case/workflow, starting with a verb.")}),jh=v.object({assistantResponse:v.string().nullable().describe("Natural-language response for the user."),isValidUseCase:v.boolean().describe("True only when the request is concrete, appropriate, and has at least one matching template."),matchedTemplates:v.array(Dh).describe("Ordered list of matching templates, best match first. Empty when no valid match exists.")}),zh=t=>t.length?t.map((e,r)=>`${r+1}. ${e}`).join(`
|
|
81
|
-
`):"No validation errors were provided.",Uh=async t=>{let{query:e,validationIssues:r,recentMessages:n,fallbackMessage:s,promptModules:o}=t;try{return(await Ve({promptText:await he(o,"explainValidationFailure"),modelTier:"fast",temperature:0,schema:$h,messages:n,inputVariables:{query:e,validationIssueCount:String(r.length),validationIssues:zh(r)}})).response?.trim()||s}catch(i){return console.warn("Natural language response failed:",{error:i}),s}},da=t=>t in tr,Fh=5,Bh=.8,Kh=.
|
|
81
|
+
`):"No validation errors were provided.",Uh=async t=>{let{query:e,validationIssues:r,recentMessages:n,fallbackMessage:s,promptModules:o}=t;try{return(await Ve({promptText:await he(o,"explainValidationFailure"),modelTier:"fast",temperature:0,schema:$h,messages:n,inputVariables:{query:e,validationIssueCount:String(r.length),validationIssues:zh(r)}})).response?.trim()||s}catch(i){return console.warn("Natural language response failed:",{error:i}),s}},da=t=>t in tr,Fh=5,Bh=.8,Kh=.5,qh="Web Mapping Application",Wh="Embeddings",Io=null,la=null,xo=null,vo=null,Hh="Build",Gt=Object.assign({"./prompts/assessBuildRequest.md":()=>import("./IE5TTSUW.js").then(t=>t.default),"./prompts/assessUpdateRequest.md":()=>import("./QLX3XORL.js").then(t=>t.default),"./prompts/description.md":()=>import("./E25ZWVBK.js").then(t=>t.default),"./prompts/designSolution.md":()=>import("./VXGLGWIF.js").then(t=>t.default),"./prompts/explainValidationFailure.md":()=>import("./I5E3PM26.js").then(t=>t.default),"./prompts/findExistingSolution.md":()=>import("./LPFG5XTA.js").then(t=>t.default),"./prompts/updateDesign.md":()=>import("./MDKHW7NM.js").then(t=>t.default)}),Jh=Ph.builderMessages,q=t=>t?.configurable?.abortSignal.aborted??!1,Q=(t,e,r)=>Co(e)?.builderMessages?.[t]??Jh[t],Yc=t=>{typeof window<"u"&&window.dispatchEvent(new CustomEvent("arcgis-solution-design-update",{detail:t}))},Vh=async(t,e,r)=>{if(!t)return null;let n=`type:"${qh}" AND typekeywords:${Wh} AND group:${t}`;return(await Mo({q:n,params:e?{token:e}:void 0,portal:r,num:1}))?.results?.[0]??null};async function Zh(t,e,r,n){try{let s=await Vh(t,e,r);if(!s||q(n))return null;let o=new uh({id:s.id});return await o.load(),q(n)?null:await o.fetchData("json")}catch{return null}}var Gh=async(t,e,r)=>{if(!t)return[];let n=`type:Solution AND typekeywords:${Hh} AND group:${t}`;return(await Mo({q:n,params:e?{token:e}:void 0,portal:r,num:100}))?.results??[]},Yh=async(t,e,r)=>{try{let n=await Ea(t,{params:e?{token:e}:void 0,portal:r}),s=n?.buildSolution;if(!s)return null;let o=n?.params,i=o&&typeof o=="object"&&!Array.isArray(o)?o:null;return{buildSolution:s,params:i}}catch{return null}},Yt=(t,e={})=>{let r=t;return"itemId"in e&&(r={...r,solution:{...r.solution,itemId:e.itemId??null}}),e.sourceBuildSolution!=null&&(r={...r,sourceBuildSolution:e.sourceBuildSolution}),"params"in e&&(r={...r,params:e.params??null}),"templateId"in e&&(r={...r,templateId:e.templateId??null}),r},Xc=(t,e)=>{if(t==null||e==null)return{ok:!1,error:"design or sourceBuildSolution is null/undefined"};try{let r=structuredClone(e);return new qo({buildSolution:r}).applyLlmTemplate(t),{ok:!0}}catch(r){return{ok:!1,error:r instanceof Error?r.stack??r.message:String(r)}}},ma=async t=>{if(la){Object.entries(la).forEach(([i,a])=>{tr[i]&&(tr[i].initialTemplate=a)});return}let e=t?.configurable?.context?.token,r=ep(t),n=tp(t);if(!r){console.warn("Solution Builder: missing primarySolutionsGroupId in appConfig; skipping live template hydration.");return}let s=await Gh(r,e,n),o={};q(t)||(await Promise.all(s.map(async i=>{let a=i.properties?.templateInfo;if(!a||typeof a!="object")return;let u=a.id;if(typeof u!="string"||o[u])return;let l=await Yh(i.id,e,n);if(!l||q(t))return;let{buildSolution:p,params:m}=l;if(typeof p=="object"&&p!==null&&"solution"in p){let h=p.solution;h.thumbnailUrl=i.thumbnail?`${n??"https://www.arcgis.com/sharing/rest"}/content/items/${i.id}/info/${i.thumbnail}`:void 0,h.item=i}let _={...a,buildSolution:p};o[u]=Yt(new qo(_).dumpToLlmTemplate(),{itemId:i.id,sourceBuildSolution:structuredClone(p),params:m?structuredClone(m):null}),tr[u]={...a,initialTemplate:o[u]}})),la=o)},Qc=t=>{let e=t?.configurable?.context?.token;return typeof e!="string"||!e.trim()?null:e},ep=t=>{let e=t?.configurable?.context?.configContext?.primarySolutionsGroupId;return typeof e!="string"||!e.trim()?null:e},tp=t=>{let e=t?.configurable?.context?.configContext?.portalURL;if(!(typeof e!="string"||!e.trim()))return`${e.replace(/\/+$/,"")}/sharing/rest`},Xh=async t=>{await Promise.all([np(t),ma(t)])},rp=async t=>{let e=Qc(t);(!xo||e&&e!==vo)&&(vo=e??vo,xo=Xh(t).catch(r=>{throw xo=null,vo=null,r})),await xo};async function np(t){if(Io)return Io;let e=ep(t);if(!e)return console.warn("Solution Builder: missing primarySolutionsGroupId in appConfig; skipping embeddings load."),null;let r=tp(t),n=t?.configurable?.context?.configContext?.portalURL;if(await new lh(n?{url:n}:void 0).load(),q(t))return null;let s=Qc(t)??void 0,o=await Zh(e,s,r,t);return q(t)?null:o?(Io=o.items,Io):null}var Qh=()=>Object.entries(tr).map(([t,e])=>`ID: ${t}
|
|
82
82
|
Label: ${e.label}
|
|
83
83
|
Description: ${e.description}`).join(`
|
|
84
84
|
|
|
@@ -87,4 +87,4 @@ Snippet: ${p.snippet}
|
|
|
87
87
|
Description: ${p.description}`).join(`
|
|
88
88
|
|
|
89
89
|
`),l=t.agentExecutionContext.messages.slice(-11);return{existingMatches:(await Ve({promptText:await he(Gt,"findExistingSolution"),modelTier:"fast",temperature:0,schema:Lh,messages:l,inputVariables:{query:r,candidates:u}})).matchedTitles.map(p=>a.find(({solution:m})=>m.title===p)).filter(p=>p!==void 0)}},ug=(t,e)=>{if(q(e))return{};let{existingMatches:r}=t,{hitlResponse:n}=e.configurable,s=`confirmExistingSolution:${r[0].solution.id}`;if(n?.agentId!=="solutionBuilder"||n.id!==s){r.length===1?Hc(r[0].solution.id):Wc(r);let a=Q("existingSolutionMatch",e),u=[Q("continueBuildingYes",e),Q("continueBuildingNo",e)],l={agentId:"solutionBuilder",id:s,kind:"singleSelection",message:a,metadata:u};throw new Ro(l)}let o=String(n.payload??"").trim(),i=Q("continueBuildingNo",e);return{continueBuilding:o!==i}},cg=(t,e)=>{let r=Q("continueBuildingDeclined",e);return{outputMessage:r,summary:r,status:"success"}},sp=async(t,e)=>{if(q(e))return{};if(await rp(e),q(e))return{};let{currentDesign:r}=t,n=t.agentExecutionContext.userRequest;await Te({text:Q("creatingDesign",e)},e);let s=On(t.selectedTemplate);if(s?.initialTemplate||(await ma(e),s=On(t.selectedTemplate)),q(e))return{};if(!s?.initialTemplate)throw new Error("No hydrated templates are available for solution design.");let o=Yt(r??s.initialTemplate,{itemId:(r??s.initialTemplate)?.solution?.itemId??null,sourceBuildSolution:r?.sourceBuildSolution??s.initialTemplate.sourceBuildSolution,params:r?.params??s.initialTemplate.params??null}),i=t.agentExecutionContext.messages.slice(-11),a=await Ve({promptText:await he(Gt,"designSolution"),modelTier:"advanced",temperature:0,schema:pa,messages:i,inputVariables:{currentDesign:JSON.stringify(Wo(o)),templateInstructions:s.instructions,query:n}});if(await Te({text:" of design solution 1"},e),q(e))return{};let{response:u,featureLayer:l,...p}=a,m=Jo(l,o.featureLayer),_=Yt({...p,featureLayer:m},{itemId:o?.solution?.itemId,sourceBuildSolution:o.sourceBuildSolution,templateId:t.selectedTemplate??null,params:o.params??null}),h=new To(_,s.initialTemplate);if(!h.isValid)return console.warn("[SolutionBuilder] designSolution validation failed:",{issues:h.issues,llmResponse:a}),{outputMessage:Q("createDesignFailed",e)};let b=_.sourceBuildSolution,I=Xc(_,b);if(!I.ok){console.warn("[SolutionBuilder] designSolution Esri JSON conversion failed:",{error:I.error,llmResponse:a,design:_});let R=Q("createDesignFailed",e);return{outputMessage:R,summary:R,status:"success"}}return q(e)?{}:(Yc(_),{outputMessage:u,summary:u,status:"success",currentDesign:_})},pg=async(t,e)=>{if(q(e))return{};let{currentDesign:r}=t;if(!r)return sp(t,e);let n=t.agentExecutionContext.userRequest,s=t.agentExecutionContext.messages.slice(-11);await Te({text:Q("updatingDesign",e)},e);let o;try{o=await Ve({promptText:await he(Gt,"updateDesign"),modelTier:"advanced",temperature:0,schema:Rh,messages:s,inputVariables:{currentDesign:JSON.stringify(Ho(r)),query:n}})}catch(k){console.warn("[SolutionBuilder] updateDesign structured prompt failed:",k);let D=Q("applyChangeFailed",e);return{outputMessage:D,summary:D,status:"success"}}let{response:i,patches:a}=o;if(!a||a.length===0)return{outputMessage:i,summary:i,status:"success"};let u=k=>{try{return JSON.parse(k)}catch{let D=k.replace(/[\u0000-\u001F]/g,U=>{switch(U){case"\b":return"\\b";case"\f":return"\\f";case`
|
|
90
|
-
`:return"\\n";case"\r":return"\\r";case" ":return"\\t";default:return"\\u"+U.charCodeAt(0).toString(16).padStart(4,"0")}});try{return JSON.parse(D)}catch{return k}}},l=[...a.map(k=>({op:k.op,path:k.path.replace(/\/+$/,""),...k.value!=null&&k.value!==""?{value:u(k.value)}:{},...k.from!=null&&k.from!==""?{from:k.from}:{}}))].sort((k,D)=>k.op!=="remove"||D.op!=="remove"?0:D.path.localeCompare(k.path,void 0,{numeric:!0})),p=structuredClone(Wo(r));try{vn(p,l,!0)}catch(k){console.warn("[SolutionBuilder] updateDesign JSON patch failed:",{error:k,llmResponse:o,patches:l,patchTarget:p});let D=Q("applyChangeFailed",e);return{outputMessage:D,summary:D,status:"success"}}let m=Yt({response:"",...p},{itemId:r.solution?.itemId??null}),_=pa.safeParse(m);if(!_.success){console.warn("[SolutionBuilder] updateDesign schema validation failed:",{errors:_.error.issues,llmResponse:o,patchedDesign:m});let k=Q("applyChangeFailed",e);return{outputMessage:k,summary:k,status:"success"}}let{response:h,featureLayer:b,...I}=_.data,R=Jo(b,r.featureLayer),g=Yt({...I,featureLayer:R},{itemId:r.solution?.itemId,sourceBuildSolution:r.sourceBuildSolution,templateId:r.templateId??t.selectedTemplate??null,params:r.params??null}),w=On(t.selectedTemplate);if(w?.initialTemplate||(await ma(e),w=On(t.selectedTemplate)),q(e))return{};if(!w?.initialTemplate)throw new Error("No hydrated templates are available for solution design.");let O=new To(g,w.initialTemplate,!1);if(!O.isValid){console.warn("[SolutionBuilder] updateDesign validation failed:",{issues:O.issues,llmResponse:o,patchedDesign:g});let k=await Uh({query:n,validationIssues:O.issues,recentMessages:s,fallbackMessage:Q("applyChangeFailed",e),promptModules:Gt});return{outputMessage:k,summary:k,status:"success"}}let L=g.sourceBuildSolution,W=Xc(g,L);if(!W.ok){console.warn("[SolutionBuilder] updateDesign Esri JSON conversion failed:",{error:W.error,llmResponse:o,design:g});let k=Q("applyChangeFailed",e);return{outputMessage:k,summary:k,status:"success"}}return q(e)?{}:(Yc(g),{outputMessage:i,summary:i,status:"success",currentDesign:g})},dg=t=>t.currentDesign!==null?"assessUpdateRequest":"assessBuildRequest",mg=t=>!t.updateAssessment||!t.updateAssessment.isValidUpdate?"invalidUpdateExit":"updateDesign",fg=t=>!t.assessment||!t.assessment.isValidUseCase?"invalidBuildExit":!t.selectedTemplate&&t.assessment.matchedTemplates.length>1?"selectTemplateHIL":"findExistingSolutions",hg=t=>t.existingMatches.length>0?"confirmContinueBuildingHIL":"designSolution",gg=t=>t.continueBuilding===!1?"declineContinueBuildingExit":"designSolution",_g=()=>new er(tg).addNode("syncCurrentDesignFromContext",rg).addNode("assessBuildRequest",ng).addNode("assessUpdateRequest",og).addNode("invalidBuildExit",sg).addNode("invalidUpdateExit",ig).addNode("selectTemplateHIL",ag).addNode("findExistingSolutions",lg).addNode("confirmContinueBuildingHIL",ug).addNode("declineContinueBuildingExit",cg).addNode("designSolution",sp).addNode("updateDesign",pg).addEdge(Xt,"syncCurrentDesignFromContext").addConditionalEdges("syncCurrentDesignFromContext",dg,{assessUpdateRequest:"assessUpdateRequest",assessBuildRequest:"assessBuildRequest"}).addConditionalEdges("assessUpdateRequest",mg,{invalidUpdateExit:"invalidUpdateExit",updateDesign:"updateDesign"}).addConditionalEdges("assessBuildRequest",fg,{invalidBuildExit:"invalidBuildExit",selectTemplateHIL:"selectTemplateHIL",findExistingSolutions:"findExistingSolutions"}).addEdge("invalidBuildExit",pe).addEdge("invalidUpdateExit",pe).addEdge("selectTemplateHIL","findExistingSolutions").addConditionalEdges("findExistingSolutions",hg,{confirmContinueBuildingHIL:"confirmContinueBuildingHIL",designSolution:"designSolution"}).addConditionalEdges("confirmContinueBuildingHIL",gg,{declineContinueBuildingExit:"declineContinueBuildingExit",designSolution:"designSolution"}).addEdge("declineContinueBuildingExit",pe).addEdge("designSolution",pe).addEdge("updateDesign",pe);await he(Gt,"description");var yg=A.object({tool:A.enum(["explorer","builder","other"]).describe("The selected tool based on the user's query."),confidence:A.number().min(0).max(1).describe("A confidence score (0.00\u20131.00)."),rationale:A.string().min(1).describe("A brief rationale for the tool choice (\u2264140 characters)")}),fa=Object.assign({"./prompts/assistantResponse.md":()=>import("./632J5NXN.js").then(t=>t.default),"./prompts/classifyIntent.md":()=>import("./ZNC2XEOJ.js").then(t=>t.default),"./prompts/description.md":()=>import("./ENLFOYSI.js").then(t=>t.default)}),ha=(t,e)=>{let r=t?.configurable?.context?.setLastTurnAgent;typeof r=="function"&&r(e);let n=new CustomEvent("assistantProcessing",{detail:{finished:!0,agent:e}});window.dispatchEvent(n)},op=z.Root({...ho(),selectedTool:z({reducer:(t,e)=>e??null,default:()=>null}),intentRationale:z({reducer:(t,e)=>e??null,default:()=>null})}),wg=async(t,e)=>{if(e?.configurable?.abortSignal?.aborted)return{};let r=Co(e);await Te({text:r?.builderMessages.understandingRequest},e);let n=t.agentExecutionContext.userRequest,s=t.agentExecutionContext.messages.slice(-11),o=e?.configurable?.context?.solutionDesignJson,i=!1;if(typeof o=="string"&&o.trim())try{i=JSON.parse(o).solution!=null}catch{i=!1}let a=await he(fa,"classifyIntent"),u=await Ve({promptText:a,modelTier:"advanced",temperature:0,schema:yg,messages:s,inputVariables:{query:n,activeSolutionDesign:i}});return{selectedTool:u.tool,intentRationale:u.rationale}},Ag=async(t,e)=>{if(e?.configurable?.abortSignal?.aborted)return{};let r=await wh().compile().invoke(t,e);return ha(e,"explorer"),r},bg=async(t,e)=>{if(e?.configurable?.abortSignal?.aborted)return{};let r=await _g().compile().invoke(t,e);return ha(e,"builder"),r},Ig=async(t,e)=>{if(e?.configurable?.abortSignal?.aborted)return{};let r=Co(e),n=t.agentExecutionContext.userRequest,s=t.intentRationale??"No rationale available.";await Te({text:r?.executingSolutionsAssistantAgent},e);let o=await he(fa,"assistantResponse"),i=t.agentExecutionContext.messages.slice(-11),a=await Uc({promptText:o,modelTier:"advanced",temperature:0,messages:i,inputVariables:{query:n,rationale:s}});return ha(e,"assistant"),{outputMessage:a,summary:a,status:"success"}},xg=t=>t.selectedTool??"other",vg=()=>new er(op).addNode("classifyIntent",wg).addNode("routeToExplorer",Ag).addNode("routeToBuilder",bg).addNode("assistantResponse",Ig).addEdge(Xt,"classifyIntent").addConditionalEdges("classifyIntent",xg,{explorer:"routeToExplorer",builder:"routeToBuilder",other:"assistantResponse"}).addEdge("routeToExplorer",pe).addEdge("routeToBuilder",pe).addEdge("assistantResponse",pe),Tg=await he(fa,"description"),Cg={id:"solutionsAssistant",name:"Solutions Assistant Agent",description:Tg,createGraph:vg,workspace:op},Pg="https://links.esri.com/solutions/agol-organizational-account",Og="https://links.esri.com/solutions/configure-assistants",ca=class extends Ca{constructor(){super(),this.open=!1,this.userFirstName="",this.builderVisible=!1,this.hasActiveBuilderDesign=!1,this._conversationId=void 0,this._lastTurnAgent=void 0,this._orgSettings={aiAssistantsEnabled:!1,blockBetaApps:!0,colocateCompute:!1},this._suggestedPrompts=[],this._hasInteracted=!1,this._isMobile=window.innerWidth<=800,this._translations=Oa({name:"arcgis-solutions-assistant",blocking:!0}),this._builderWidth=48,this._solutionDesignJson='{ "solution": null }',this._isAssistantBusy=!1,this._isBuilderBusy=!1,this._preChatCheck=!1,this._showNewChatConfirm=!1,this._assistantRef=va(),this._configContextConsumer=Eo({context:ka,subscribe:!0,callback:e=>{e?.portalURL&&(aa.portalUrl=e.portalURL),e?.userSession&&!this.userFirstName&&this._loadUserFirstName(),e?.authentication?.PortalSubset?.orgSettings&&(this._orgSettings=e?.authentication?.PortalSubset?.orgSettings)}}),this._builderDesignContextConsumer=Eo({context:Sa,subscribe:!0,callback:e=>{e?.design&&(this._solutionDesignJson=JSON.stringify(e.design,null,2))}}),this._handleResize=()=>{this._isMobile=window.innerWidth<=800},this._chatStartTime=null,this._handleAssistantProcessingFinished=e=>{let r=e;if(r.detail?.finished&&this._chatStartTime!==null){let n=Ma(this._chatStartTime);this._telemetry?.logEvent({category:Tn.ASSISTANT,action:"Chat",dimensions:[r.detail.agent],metrics:[n]}),this._chatStartTime=null,this.assistantProcessing.emit(!1)}},this.closeAssistant=ko(),this.assistantProcessing=ko(),this._handleAssistantLinkClick=e=>{let r=e.composedPath().find(n=>n instanceof HTMLAnchorElement);if(r?.href)if(e.preventDefault(),r.target.indexOf("solutionId:")>-1){let n=r.target.split("solutionId:")[1];this._emitItemIdFromAI(n)}else window.open(r.href,"_blank","noopener,noreferrer")},this._onSolutionDesignUpdate=e=>{let r=e.detail;this._solutionDesignJson=r?JSON.stringify(r,null,2):'{ "solution": null }'},this._handleSignIn=()=>{this._configContextConsumer.value?.authentication?.signIn("aiOpen")},this._checkURLOpenParameter=()=>{this.open=this._configContextConsumer.value?.authentication?.SignInParam==="aiOpen"||this.open},this.listenOn(window,"arcgisFeedback",e=>{let r=e.detail,{agentPicked:n,taskAssigned:s,userMessage:o}=this._parseAgentPickedAndTask(r);this._sendFeedback(r.content,o??s??"",r.feedback?.positive?"Good":r.feedback?.positive=="Bad"?"Bad":"N/A",n??"")}),this.listenOn(window,"clearAssistantConversation",()=>{this._clearConversation()})}static{this.properties={open:5,userFirstName:1,builderVisible:5,hasActiveBuilderDesign:5,_conversationId:16,_lastTurnAgent:16,_orgSettings:16,_suggestedPrompts:16,_hasInteracted:16,_isMobile:16,_translations:16,_builderWidth:16,_solutionDesignJson:16,_isAssistantBusy:16,_isBuilderBusy:16,_preChatCheck:16,_showNewChatConfirm:16}}static{this.styles=ch}get _telemetry(){return this._configContextConsumer.value?.telemetrySession}connectedCallback(){super.connectedCallback(),window.addEventListener("arcgis-solution-design-update",this._onSolutionDesignUpdate),this.el.addEventListener("click",this._handleAssistantLinkClick),window.addEventListener("resize",this._handleResize),window.addEventListener("assistantProcessing",this._handleAssistantProcessingFinished),this._builderDesignContextConsumer}disconnectedCallback(){window.removeEventListener("arcgis-solution-design-update",this._onSolutionDesignUpdate),this.el.removeEventListener("click",this._handleAssistantLinkClick),window.removeEventListener("resize",this._handleResize),window.removeEventListener("assistantProcessing",this._handleAssistantProcessingFinished),super.disconnectedCallback()}loaded(){this._checkURLOpenParameter()}load(){aa.applicationName="Solutions",this._configContextConsumer.value?.portalURL&&(aa.portalUrl=this._configContextConsumer.value.portalURL)}firstUpdated(e){this._loadUserFirstName()}willUpdate(e){e.has("open")&&this.open&&window.dispatchEvent(new CustomEvent("openAssistant")),this._configContextConsumer.value?.authentication&&this._configContextConsumer.value?.userSession?.token&&(this._preChatCheck||(Zc(this._configContextConsumer.value?.authentication.Portal,this._configContextConsumer.value?.userSession?.token,this._configContextConsumer.value?.locale??"en"),this._preChatCheck=!0)),this._configContextConsumer.value?.userSession?.token&&this._configContextConsumer.value?.authentication?.CanUseAI}_renderNoSign(){return Ze`<calcite-notice class="margin-lg" open scale=m icon=effects kind=info><div slot=message>${this._translations.signInMessage}</div><calcite-link @click=${this._handleSignIn} slot=link title=${this._translations.signInMessage??So} class="padding-top-10">${this._translations.signIn}</calcite-link></calcite-notice>`}_renderNoPermission(){return Ze`<calcite-notice class="margin-lg" open scale=m icon=effects kind=info><div slot=title>${this._translations.noPermissionTitle}</div><div slot=message class="padding-top-10">${Xa(this._translations.noPermissionMessage.replace("{{orgUrl}}",Pg).replace("{{configAI}}",Og))}</div></calcite-notice>`}render(){let e=this._suggestedPrompts.length>0?this._suggestedPrompts:this._hasInteracted?[]:Object.values(this._translations.defaultFollowUpQuestions);return this._suggestedPrompts.length>0?e=this._suggestedPrompts:this._hasInteracted||(e=[...Object.values(this._translations.defaultFollowUpQuestions)]),Ze`<calcite-panel class="chat-panel"><div class="header-content" slot=header-content><span class="header-title">${this._translations.solutionAssistantTitle}</span></div>${this._configContextConsumer.value?.userSession?.token?this._configContextConsumer.value?.authentication?.CanUseAI?Ze`${!this._isMobile&&Ze`<calcite-action id=solutionBuilderAction icon=pencil-square .text=${this._translations.tooltips.builder} text-enabled .indicator=${this.hasActiveBuilderDesign} .disabled=${!this.hasActiveBuilderDesign} .active=${this.builderVisible} selection-appearance=highlight @click=${()=>{this._telemetry?.logEvent({category:Tn.ASSISTANT,action:"Toggle Builder Panel",dimensions:[this.builderVisible?"Close":"Open"]}),window.dispatchEvent(new CustomEvent("toggleSolutionBuilder"))}} scale=m slot=header-actions-end></calcite-action>`||""}${!this._isMobile&&Ze`<calcite-tooltip placement=bottom reference-element=solutionBuilderAction><span>${this._translations.tooltips.solutionBuilder}</span></calcite-tooltip>`||""}<arcgis-assistant reference-element copy-enabled feedback-enabled heading description entry-message=${this._translations.defaultStartUpMessage??So} .suggestedPrompts=${e} @arcgisSubmit=${r=>{console.log("arcgis submit: ",r.detail),this._suggestedPrompts=[],e=[],this._hasInteracted=!0,this._chatStartTime=Date.now(),this.assistantProcessing.emit(!0)}} @arcgisFeedback=${r=>{r.detail}} ${Ta(this._assistantRef)}><calcite-button appearance=transparent id=newChatButton icon-start=speech-bubble-plus kind=neutral .label=${this._translations.tooltips.newChat} @click=${()=>{this.hasActiveBuilderDesign?this._showNewChatConfirm=!0:(this._telemetry?.logEvent({category:Tn.ASSISTANT,action:"New Chat",dimensions:["No Active Design"]}),this._clearConversation())}} round scale=m slot=entry-actions-start>${this._translations.tooltips.newChat}</calcite-button><arcgis-assistant-agent .agent=${Cg} .context=${{token:this._configContextConsumer.value?.userSession?.token,configContext:this._configContextConsumer.value,convoId:this._conversationId,portal:this._configContextConsumer.value?.authentication.Portal,assistantRef:this._assistantRef,translations:this._translations,solutionDesignJson:this._solutionDesignJson,lastTurnAgent:this._lastTurnAgent,setConversationId:r=>{this._conversationId=r},setLastTurnAgent:r=>{this._lastTurnAgent=r},clearSuggestedPrompts:()=>{this._suggestedPrompts=[]}}}></arcgis-assistant-agent></arcgis-assistant><div slot=footer class="disclaimer-div width-100"><calcite-chip class="beta-chip" appearance=solid kind=neutral .label=${this._translations.betaTag} scale=s>${this._translations.betaTag}</calcite-chip><span>${this._translations.disclaimerMessage} <a href=https://links.esri.com/solutions/security-concern rel="noopener noreferrer" target=_blank>${this._translations.reportConcern}</a></span></div>`:this._renderNoPermission():this._renderNoSign()}${this._showNewChatConfirm&&Ze`<calcite-dialog close-disabled escape-disabled .heading=${this._translations.newConversationConfirmTitle} modal open outside-close-disabled>${this._translations.builderMessages.discardMessage}<calcite-button appearance=outline @click=${()=>{this._showNewChatConfirm=!1}} slot=footer-end>${this._translations.cancel}</calcite-button><calcite-button appearance=solid kind=danger @click=${()=>{this._telemetry?.logEvent({category:Tn.ASSISTANT,action:"New Chat",dimensions:["With Design Discard"]}),this._showNewChatConfirm=!1,window.dispatchEvent(new CustomEvent("requestBuilderDiscard"))}} slot=footer-end>${this._translations.discard}</calcite-button></calcite-dialog>`||""}<calcite-action icon=x id=closeAssistantButton .label=${this._translations.tooltips.close} @click=${()=>{this.closeAssistant.emit(!0)}} slot=header-actions-end .text=${this._translations.tooltips.close}></calcite-action><calcite-tooltip placement=bottom reference-element=closeAssistantButton><span>${this._translations.tooltips.close}</span></calcite-tooltip></calcite-panel>`}_clearConversation(){this._conversationId=void 0,this._lastTurnAgent=void 0,this._suggestedPrompts=[],this._hasInteracted=!1,this._assistantRef.value?.clearChatHistory()}_sendFeedback(e,r,n,s){let o=`https://survey123.arcgis.com/share/6e349a50b4504ca6b6107216d568db5f?field:_source=${encodeURIComponent("Solutions Assistant")}&field:user_evaluation=${encodeURIComponent(n)}&field:question=${encodeURIComponent(r)}&field:answer=${encodeURIComponent(e)}&field:context=${encodeURIComponent(JSON.stringify({agent:s}))}&field:version=${encodeURIComponent("v2")}`;window.open(o,"_blank")}async _loadUserFirstName(){try{let e=await this._configContextConsumer.value?.userSession?.getUser();if(e?.fullName){let r=e.fullName.split(" ")[0];this.userFirstName=r}}catch{}}_parseAgentPickedAndTask(e){let r=Array.from(this._assistantRef.value?.messages||[]),n=e.log||[],s=[...r].sort((p,m)=>m.id-p.id).find(p=>p.role==="user"&&p.id<=e.id)?.content||null,o=n.find(p=>typeof p=="string"&&p.includes("Agent picked:"))??null;if(!o)return{agentPicked:null,taskAssigned:null,userMessage:s};let i=/Agent picked:\s*(.*?)\s*(?:\\n|\r?\n)\s*Task Assigned:\s*([\s\S]*)$/i,a=o.match(i);if(!a)return{agentPicked:null,taskAssigned:null,userMessage:s};let u=a[1].trim(),l=a[2].trim();return{agentPicked:u,taskAssigned:l,userMessage:s}}_emitItemIdFromAI(e){let r=new CustomEvent("solutionIDFromAssistant",{detail:e,bubbles:!0,composed:!0});window.dispatchEvent(r)}};Pa("arcgis-solutions-assistant",ca);return ca},"config","identity/IdentityManager","portal/Portal","core/reactiveUtils","layers/FeatureLayer","request","portal/Portal","portal/PortalItem",a,b)
|
|
90
|
+
`:return"\\n";case"\r":return"\\r";case" ":return"\\t";default:return"\\u"+U.charCodeAt(0).toString(16).padStart(4,"0")}});try{return JSON.parse(D)}catch{return k}}},l=[...a.map(k=>({op:k.op,path:k.path.replace(/\/+$/,""),...k.value!=null&&k.value!==""?{value:u(k.value)}:{},...k.from!=null&&k.from!==""?{from:k.from}:{}}))].sort((k,D)=>k.op!=="remove"||D.op!=="remove"?0:D.path.localeCompare(k.path,void 0,{numeric:!0})),p=structuredClone(Wo(r));try{vn(p,l,!0)}catch(k){console.warn("[SolutionBuilder] updateDesign JSON patch failed:",{error:k,llmResponse:o,patches:l,patchTarget:p});let D=Q("applyChangeFailed",e);return{outputMessage:D,summary:D,status:"success"}}let m=Yt({response:"",...p},{itemId:r.solution?.itemId??null}),_=pa.safeParse(m);if(!_.success){console.warn("[SolutionBuilder] updateDesign schema validation failed:",{errors:_.error.issues,llmResponse:o,patchedDesign:m});let k=Q("applyChangeFailed",e);return{outputMessage:k,summary:k,status:"success"}}let{response:h,featureLayer:b,...I}=_.data,R=Jo(b,r.featureLayer),g=Yt({...I,featureLayer:R},{itemId:r.solution?.itemId,sourceBuildSolution:r.sourceBuildSolution,templateId:r.templateId??t.selectedTemplate??null,params:r.params??null}),w=On(t.selectedTemplate);if(w?.initialTemplate||(await ma(e),w=On(t.selectedTemplate)),q(e))return{};if(!w?.initialTemplate)throw new Error("No hydrated templates are available for solution design.");let O=new To(g,w.initialTemplate,!1);if(!O.isValid){console.warn("[SolutionBuilder] updateDesign validation failed:",{issues:O.issues,llmResponse:o,patchedDesign:g});let k=await Uh({query:n,validationIssues:O.issues,recentMessages:s,fallbackMessage:Q("applyChangeFailed",e),promptModules:Gt});return{outputMessage:k,summary:k,status:"success"}}let L=g.sourceBuildSolution,W=Xc(g,L);if(!W.ok){console.warn("[SolutionBuilder] updateDesign Esri JSON conversion failed:",{error:W.error,llmResponse:o,design:g});let k=Q("applyChangeFailed",e);return{outputMessage:k,summary:k,status:"success"}}return q(e)?{}:(Yc(g),{outputMessage:i,summary:i,status:"success",currentDesign:g})},dg=t=>t.currentDesign!==null?"assessUpdateRequest":"assessBuildRequest",mg=t=>!t.updateAssessment||!t.updateAssessment.isValidUpdate?"invalidUpdateExit":"updateDesign",fg=t=>!t.assessment||!t.assessment.isValidUseCase?"invalidBuildExit":!t.selectedTemplate&&t.assessment.matchedTemplates.length>1?"selectTemplateHIL":"findExistingSolutions",hg=t=>t.existingMatches.length>0?"confirmContinueBuildingHIL":"designSolution",gg=t=>t.continueBuilding===!1?"declineContinueBuildingExit":"designSolution",_g=()=>new er(tg).addNode("syncCurrentDesignFromContext",rg).addNode("assessBuildRequest",ng).addNode("assessUpdateRequest",og).addNode("invalidBuildExit",sg).addNode("invalidUpdateExit",ig).addNode("selectTemplateHIL",ag).addNode("findExistingSolutions",lg).addNode("confirmContinueBuildingHIL",ug).addNode("declineContinueBuildingExit",cg).addNode("designSolution",sp).addNode("updateDesign",pg).addEdge(Xt,"syncCurrentDesignFromContext").addConditionalEdges("syncCurrentDesignFromContext",dg,{assessUpdateRequest:"assessUpdateRequest",assessBuildRequest:"assessBuildRequest"}).addConditionalEdges("assessUpdateRequest",mg,{invalidUpdateExit:"invalidUpdateExit",updateDesign:"updateDesign"}).addConditionalEdges("assessBuildRequest",fg,{invalidBuildExit:"invalidBuildExit",selectTemplateHIL:"selectTemplateHIL",findExistingSolutions:"findExistingSolutions"}).addEdge("invalidBuildExit",pe).addEdge("invalidUpdateExit",pe).addEdge("selectTemplateHIL","findExistingSolutions").addConditionalEdges("findExistingSolutions",hg,{confirmContinueBuildingHIL:"confirmContinueBuildingHIL",designSolution:"designSolution"}).addConditionalEdges("confirmContinueBuildingHIL",gg,{declineContinueBuildingExit:"declineContinueBuildingExit",designSolution:"designSolution"}).addEdge("declineContinueBuildingExit",pe).addEdge("designSolution",pe).addEdge("updateDesign",pe);await he(Gt,"description");var yg=A.object({tool:A.enum(["explorer","builder","other"]).describe("The selected tool based on the user's query."),confidence:A.number().min(0).max(1).describe("A confidence score (0.00\u20131.00)."),rationale:A.string().min(1).describe("A brief rationale for the tool choice (\u2264140 characters)")}),fa=Object.assign({"./prompts/assistantResponse.md":()=>import("./632J5NXN.js").then(t=>t.default),"./prompts/classifyIntent.md":()=>import("./JDI57IEI.js").then(t=>t.default),"./prompts/description.md":()=>import("./ENLFOYSI.js").then(t=>t.default)}),ha=(t,e)=>{let r=t?.configurable?.context?.setLastTurnAgent;typeof r=="function"&&r(e);let n=new CustomEvent("assistantProcessing",{detail:{finished:!0,agent:e}});window.dispatchEvent(n)},op=z.Root({...ho(),selectedTool:z({reducer:(t,e)=>e??null,default:()=>null}),intentRationale:z({reducer:(t,e)=>e??null,default:()=>null})}),wg=async(t,e)=>{if(e?.configurable?.abortSignal?.aborted)return{};let r=Co(e);await Te({text:r?.builderMessages.understandingRequest},e);let n=t.agentExecutionContext.userRequest,s=t.agentExecutionContext.messages.slice(-11),o=e?.configurable?.context?.solutionDesignJson,i=!1;if(typeof o=="string"&&o.trim())try{i=JSON.parse(o).solution!=null}catch{i=!1}let a=await he(fa,"classifyIntent"),u=await Ve({promptText:a,modelTier:"advanced",temperature:0,schema:yg,messages:s,inputVariables:{query:n,activeSolutionDesign:i}});return{selectedTool:u.tool,intentRationale:u.rationale}},Ag=async(t,e)=>{if(e?.configurable?.abortSignal?.aborted)return{};let r=await wh().compile().invoke(t,e);return ha(e,"explorer"),r},bg=async(t,e)=>{if(e?.configurable?.abortSignal?.aborted)return{};let r=await _g().compile().invoke(t,e);return ha(e,"builder"),r},Ig=async(t,e)=>{if(e?.configurable?.abortSignal?.aborted)return{};let r=Co(e),n=t.agentExecutionContext.userRequest,s=t.intentRationale??"No rationale available.";await Te({text:r?.executingSolutionsAssistantAgent},e);let o=await he(fa,"assistantResponse"),i=t.agentExecutionContext.messages.slice(-11),a=await Uc({promptText:o,modelTier:"advanced",temperature:0,messages:i,inputVariables:{query:n,rationale:s}});return ha(e,"assistant"),{outputMessage:a,summary:a,status:"success"}},xg=t=>t.selectedTool??"other",vg=()=>new er(op).addNode("classifyIntent",wg).addNode("routeToExplorer",Ag).addNode("routeToBuilder",bg).addNode("assistantResponse",Ig).addEdge(Xt,"classifyIntent").addConditionalEdges("classifyIntent",xg,{explorer:"routeToExplorer",builder:"routeToBuilder",other:"assistantResponse"}).addEdge("routeToExplorer",pe).addEdge("routeToBuilder",pe).addEdge("assistantResponse",pe),Tg=await he(fa,"description"),Cg={id:"solutionsAssistant",name:"Solutions Assistant Agent",description:Tg,createGraph:vg,workspace:op},Pg="https://links.esri.com/solutions/agol-organizational-account",Og="https://links.esri.com/solutions/configure-assistants",ca=class extends Ca{constructor(){super(),this.open=!1,this.userFirstName="",this.builderVisible=!1,this.hasActiveBuilderDesign=!1,this._conversationId=void 0,this._lastTurnAgent=void 0,this._orgSettings={aiAssistantsEnabled:!1,blockBetaApps:!0,colocateCompute:!1},this._suggestedPrompts=[],this._hasInteracted=!1,this._isMobile=window.innerWidth<=800,this._translations=Oa({name:"arcgis-solutions-assistant",blocking:!0}),this._builderWidth=48,this._solutionDesignJson='{ "solution": null }',this._isAssistantBusy=!1,this._isBuilderBusy=!1,this._preChatCheck=!1,this._showNewChatConfirm=!1,this._assistantRef=va(),this._configContextConsumer=Eo({context:ka,subscribe:!0,callback:e=>{e?.portalURL&&(aa.portalUrl=e.portalURL),e?.userSession&&!this.userFirstName&&this._loadUserFirstName(),e?.authentication?.PortalSubset?.orgSettings&&(this._orgSettings=e?.authentication?.PortalSubset?.orgSettings)}}),this._builderDesignContextConsumer=Eo({context:Sa,subscribe:!0,callback:e=>{e?.design&&(this._solutionDesignJson=JSON.stringify(e.design,null,2))}}),this._handleResize=()=>{this._isMobile=window.innerWidth<=800},this._chatStartTime=null,this._handleAssistantProcessingFinished=e=>{let r=e;if(r.detail?.finished&&this._chatStartTime!==null){let n=Ma(this._chatStartTime);this._telemetry?.logEvent({category:Tn.ASSISTANT,action:"Chat",dimensions:[r.detail.agent],metrics:[n]}),this._chatStartTime=null,this.assistantProcessing.emit(!1)}},this.closeAssistant=ko(),this.assistantProcessing=ko(),this._handleAssistantLinkClick=e=>{let r=e.composedPath().find(n=>n instanceof HTMLAnchorElement);if(r?.href)if(e.preventDefault(),r.target.indexOf("solutionId:")>-1){let n=r.target.split("solutionId:")[1];this._emitItemIdFromAI(n)}else window.open(r.href,"_blank","noopener,noreferrer")},this._onSolutionDesignUpdate=e=>{let r=e.detail;this._solutionDesignJson=r?JSON.stringify(r,null,2):'{ "solution": null }'},this._handleSignIn=()=>{this._configContextConsumer.value?.authentication?.signIn("aiOpen")},this._checkURLOpenParameter=()=>{this.open=this._configContextConsumer.value?.authentication?.SignInParam==="aiOpen"||this.open},this.listenOn(window,"arcgisFeedback",e=>{let r=e.detail,{agentPicked:n,taskAssigned:s,userMessage:o}=this._parseAgentPickedAndTask(r);this._sendFeedback(r.content,o??s??"",r.feedback?.positive?"Good":r.feedback?.positive=="Bad"?"Bad":"N/A",n??"")}),this.listenOn(window,"clearAssistantConversation",()=>{this._clearConversation()})}static{this.properties={open:5,userFirstName:1,builderVisible:5,hasActiveBuilderDesign:5,_conversationId:16,_lastTurnAgent:16,_orgSettings:16,_suggestedPrompts:16,_hasInteracted:16,_isMobile:16,_translations:16,_builderWidth:16,_solutionDesignJson:16,_isAssistantBusy:16,_isBuilderBusy:16,_preChatCheck:16,_showNewChatConfirm:16}}static{this.styles=ch}get _telemetry(){return this._configContextConsumer.value?.telemetrySession}connectedCallback(){super.connectedCallback(),window.addEventListener("arcgis-solution-design-update",this._onSolutionDesignUpdate),this.el.addEventListener("click",this._handleAssistantLinkClick),window.addEventListener("resize",this._handleResize),window.addEventListener("assistantProcessing",this._handleAssistantProcessingFinished),this._builderDesignContextConsumer}disconnectedCallback(){window.removeEventListener("arcgis-solution-design-update",this._onSolutionDesignUpdate),this.el.removeEventListener("click",this._handleAssistantLinkClick),window.removeEventListener("resize",this._handleResize),window.removeEventListener("assistantProcessing",this._handleAssistantProcessingFinished),super.disconnectedCallback()}loaded(){this._checkURLOpenParameter()}load(){aa.applicationName="Solutions",this._configContextConsumer.value?.portalURL&&(aa.portalUrl=this._configContextConsumer.value.portalURL)}firstUpdated(e){this._loadUserFirstName()}willUpdate(e){e.has("open")&&this.open&&window.dispatchEvent(new CustomEvent("openAssistant")),this._configContextConsumer.value?.authentication&&this._configContextConsumer.value?.userSession?.token&&(this._preChatCheck||(Zc(this._configContextConsumer.value?.authentication.Portal,this._configContextConsumer.value?.userSession?.token,this._configContextConsumer.value?.locale??"en"),this._preChatCheck=!0)),this._configContextConsumer.value?.userSession?.token&&this._configContextConsumer.value?.authentication?.CanUseAI}_renderNoSign(){return Ze`<calcite-notice class="margin-lg" open scale=m icon=effects kind=info><div slot=message>${this._translations.signInMessage}</div><calcite-link @click=${this._handleSignIn} slot=link title=${this._translations.signInMessage??So} class="padding-top-10">${this._translations.signIn}</calcite-link></calcite-notice>`}_renderNoPermission(){return Ze`<calcite-notice class="margin-lg" open scale=m icon=effects kind=info><div slot=title>${this._translations.noPermissionTitle}</div><div slot=message class="padding-top-10">${Xa(this._translations.noPermissionMessage.replace("{{orgUrl}}",Pg).replace("{{configAI}}",Og))}</div></calcite-notice>`}render(){let e=this._suggestedPrompts.length>0?this._suggestedPrompts:this._hasInteracted?[]:Object.values(this._translations.defaultFollowUpQuestions);return this._suggestedPrompts.length>0?e=this._suggestedPrompts:this._hasInteracted||(e=[...Object.values(this._translations.defaultFollowUpQuestions)]),Ze`<calcite-panel class="chat-panel"><div class="header-content" slot=header-content><span class="header-title">${this._translations.solutionAssistantTitle}</span></div>${this._configContextConsumer.value?.userSession?.token?this._configContextConsumer.value?.authentication?.CanUseAI?Ze`${!this._isMobile&&Ze`<calcite-action id=solutionBuilderAction icon=pencil-square .text=${this._translations.tooltips.builder} text-enabled .indicator=${this.hasActiveBuilderDesign} .disabled=${!this.hasActiveBuilderDesign} .active=${this.builderVisible} selection-appearance=highlight @click=${()=>{this._telemetry?.logEvent({category:Tn.ASSISTANT,action:"Toggle Builder Panel",dimensions:[this.builderVisible?"Close":"Open"]}),window.dispatchEvent(new CustomEvent("toggleSolutionBuilder"))}} scale=m slot=header-actions-end></calcite-action>`||""}${!this._isMobile&&Ze`<calcite-tooltip placement=bottom reference-element=solutionBuilderAction><span>${this._translations.tooltips.solutionBuilder}</span></calcite-tooltip>`||""}<arcgis-assistant reference-element copy-enabled feedback-enabled heading description entry-message=${this._translations.defaultStartUpMessage??So} .suggestedPrompts=${e} @arcgisSubmit=${r=>{console.log("arcgis submit: ",r.detail),this._suggestedPrompts=[],e=[],this._hasInteracted=!0,this._chatStartTime=Date.now(),this.assistantProcessing.emit(!0)}} @arcgisFeedback=${r=>{r.detail}} ${Ta(this._assistantRef)}><calcite-button appearance=transparent id=newChatButton icon-start=speech-bubble-plus kind=neutral .label=${this._translations.tooltips.newChat} @click=${()=>{this.hasActiveBuilderDesign?this._showNewChatConfirm=!0:(this._telemetry?.logEvent({category:Tn.ASSISTANT,action:"New Chat",dimensions:["No Active Design"]}),this._clearConversation())}} round scale=m slot=entry-actions-start>${this._translations.tooltips.newChat}</calcite-button><arcgis-assistant-agent .agent=${Cg} .context=${{token:this._configContextConsumer.value?.userSession?.token,configContext:this._configContextConsumer.value,convoId:this._conversationId,portal:this._configContextConsumer.value?.authentication.Portal,assistantRef:this._assistantRef,translations:this._translations,solutionDesignJson:this._solutionDesignJson,lastTurnAgent:this._lastTurnAgent,setConversationId:r=>{this._conversationId=r},setLastTurnAgent:r=>{this._lastTurnAgent=r},clearSuggestedPrompts:()=>{this._suggestedPrompts=[]}}}></arcgis-assistant-agent></arcgis-assistant><div slot=footer class="disclaimer-div width-100"><calcite-chip class="beta-chip" appearance=solid kind=neutral .label=${this._translations.betaTag} scale=s>${this._translations.betaTag}</calcite-chip><span>${this._translations.disclaimerMessage} <a href=https://links.esri.com/solutions/security-concern rel="noopener noreferrer" target=_blank>${this._translations.reportConcern}</a></span></div>`:this._renderNoPermission():this._renderNoSign()}${this._showNewChatConfirm&&Ze`<calcite-dialog close-disabled escape-disabled .heading=${this._translations.newConversationConfirmTitle} modal open outside-close-disabled>${this._translations.builderMessages.discardMessage}<calcite-button appearance=outline @click=${()=>{this._showNewChatConfirm=!1}} slot=footer-end>${this._translations.cancel}</calcite-button><calcite-button appearance=solid kind=danger @click=${()=>{this._telemetry?.logEvent({category:Tn.ASSISTANT,action:"New Chat",dimensions:["With Design Discard"]}),this._showNewChatConfirm=!1,window.dispatchEvent(new CustomEvent("requestBuilderDiscard"))}} slot=footer-end>${this._translations.discard}</calcite-button></calcite-dialog>`||""}<calcite-action icon=x id=closeAssistantButton .label=${this._translations.tooltips.close} @click=${()=>{this.closeAssistant.emit(!0)}} slot=header-actions-end .text=${this._translations.tooltips.close}></calcite-action><calcite-tooltip placement=bottom reference-element=closeAssistantButton><span>${this._translations.tooltips.close}</span></calcite-tooltip></calcite-panel>`}_clearConversation(){this._conversationId=void 0,this._lastTurnAgent=void 0,this._suggestedPrompts=[],this._hasInteracted=!1,this._assistantRef.value?.clearChatHistory()}_sendFeedback(e,r,n,s){let o=`https://survey123.arcgis.com/share/6e349a50b4504ca6b6107216d568db5f?field:_source=${encodeURIComponent("Solutions Assistant")}&field:user_evaluation=${encodeURIComponent(n)}&field:question=${encodeURIComponent(r)}&field:answer=${encodeURIComponent(e)}&field:context=${encodeURIComponent(JSON.stringify({agent:s}))}&field:version=${encodeURIComponent("v2")}`;window.open(o,"_blank")}async _loadUserFirstName(){try{let e=await this._configContextConsumer.value?.userSession?.getUser();if(e?.fullName){let r=e.fullName.split(" ")[0];this.userFirstName=r}}catch{}}_parseAgentPickedAndTask(e){let r=Array.from(this._assistantRef.value?.messages||[]),n=e.log||[],s=[...r].sort((p,m)=>m.id-p.id).find(p=>p.role==="user"&&p.id<=e.id)?.content||null,o=n.find(p=>typeof p=="string"&&p.includes("Agent picked:"))??null;if(!o)return{agentPicked:null,taskAssigned:null,userMessage:s};let i=/Agent picked:\s*(.*?)\s*(?:\\n|\r?\n)\s*Task Assigned:\s*([\s\S]*)$/i,a=o.match(i);if(!a)return{agentPicked:null,taskAssigned:null,userMessage:s};let u=a[1].trim(),l=a[2].trim();return{agentPicked:u,taskAssigned:l,userMessage:s}}_emitItemIdFromAI(e){let r=new CustomEvent("solutionIDFromAssistant",{detail:e,bubbles:!0,composed:!0});window.dispatchEvent(r)}};Pa("arcgis-solutions-assistant",ca);return ca},"config","identity/IdentityManager","portal/Portal","core/reactiveUtils","layers/FeatureLayer","request","portal/Portal","portal/PortalItem",a,b)
|
|
@@ -19,6 +19,13 @@ Always prioritize the latest User Query over chat history when there is a confli
|
|
|
19
19
|
- Set response_language = detected language\r
|
|
20
20
|
- ALL parts of the response MUST be in response_language\r
|
|
21
21
|
\r
|
|
22
|
+
# Allowed Sensitive Use Cases\r
|
|
23
|
+
-Assume requests are made from a legitimate government, utility, public safety, defense, or intelligence perspective unless explicitly stated otherwise.\r
|
|
24
|
+
-Requests involving sensitive topics (e.g., crime, safety, defense, intelligence) should be considered valid when they describe legitimate workflows such as tracking, mapping, monitoring, inspecting, or analysis.\r
|
|
25
|
+
-Do not reject a request solely due to sensitive terminology. Evaluate the operational intent.\r
|
|
26
|
+
-Interpret subjects (e.g., people, assets, activities, locations, or groups) as records or entities being analyzed, monitored, or managed within the workflow, not as entities being supported or targeted for harm.\r
|
|
27
|
+
-When requests involve individuals or sensitive statuses, interpret them as lawful records or official data managed under legal or organizational authority.\r
|
|
28
|
+
\r
|
|
22
29
|
# Step 1: Hard Exclusion Rules\r
|
|
23
30
|
Immediately fail the request if ANY of the following are present:\r
|
|
24
31
|
- Including/excluding specific ArcGIS products, apps, or capabilities\r
|
|
@@ -26,8 +33,6 @@ Immediately fail the request if ANY of the following are present:\r
|
|
|
26
33
|
- Implementation details (symbology, pop-ups, labels, spatial reference)\r
|
|
27
34
|
- Using existing solutions, feature services, or geodatabases\r
|
|
28
35
|
- Fetching or ingesting external data (files, URLs, APIs)\r
|
|
29
|
-
- Content that is harmful, hateful, unsafe, or biased.\r
|
|
30
|
-
- Do not reject requests based solely on domain; evaluate what is being requested.\r
|
|
31
36
|
\r
|
|
32
37
|
## Step 2: Use Case Validation\r
|
|
33
38
|
A valid use case MUST clearly describe a concrete use case used to design the solution.\r
|
|
@@ -68,7 +68,7 @@ Use this tool when the user:\r
|
|
|
68
68
|
- Updating solution metadata (title, description, tags)\r
|
|
69
69
|
- Adding, updating, or removing layers, fields, or domains\r
|
|
70
70
|
\r
|
|
71
|
-
You MUST select \`builder\` regardless of domain relevance or realism.\r
|
|
71
|
+
You MUST select \`builder\` including when it includes for harmful or unsafe content and regardless of domain relevance or realism.\r
|
|
72
72
|
\r
|
|
73
73
|
## explorer\r
|
|
74
74
|
Select \`explorer\` when the user is discovering, understanding, or evaluating existing ArcGIS Solutions using official documentation.\r
|
|
@@ -92,7 +92,6 @@ Select \`other\` when:\r
|
|
|
92
92
|
- The request is instructing the assistant to provide or create data for a solution\r
|
|
93
93
|
- The request is a meta question about the assistant itself (Who are you?, What do you do?, What can I do here?)\r
|
|
94
94
|
- The request is ambiguous or cannot be confidently classified\r
|
|
95
|
-
- The request includes harmful, hateful, biased, or otherwise inappropriate content for an organization to engage with\r
|
|
96
95
|
- The message is conversational and does not introduce a new task\r
|
|
97
96
|
\r
|
|
98
97
|
# User Query\r
|
package/dist/cdn/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{a}from"./2I5LGZNX.js";import{u as e}from"./FFF5HUPM.js";import"./EXBEKVP5.js";var o=e(a,{"arcgis-solutions-assistant":[()=>import("./T6BYV326.js"),"_translations:,builderVisible,hasActiveBuilderDesign,open,userFirstName"],"buffer-tools":[()=>import("./VTAQ6NBB.js"),"_translations:,appearance,disabled,distance,geometries:,max,min,sliderTicks,unionResults,unit;getTranslatedUnit"],"card-manager":[()=>import("./MISU75DC.js"),"_translations:,allowedPasteLayerIds:,createBtnLabel,customInfoText,enableCreateFeatures,enableEditGeometry,enableSnapping,isMobile,layerOrTable:,mapComponentId,mapView:,pasteEnabled,selectedFeaturesIds:,selectingFeatureFromMap,showCopyPasteActions,showSketchWidgets,zoomAndScrollToSelected"],"consent-manager":[()=>import("./KTRKTBPS.js"),"_translations:,amazonAppId,amazonAppName,amazonUserPoolID,amazonVersion,firstUseVar,measurementIds:,portal:;getInstance"],"create-feature":[()=>import("./O7VRD3Z3.js"),"_translations:,aiImageExtraction:,aiTextExtraction:,allowMultipleCreation,appName,customizeSubmit,enableMessageLocation,enablePhotoLocation,enableSearch,enableSnapping,floorLevel,formElements,isMobile,mapView:,popupEnabled,reportingArea,reportingAreaLayer,reportingAreaMessage,searchConfiguration:,selectedLayerId,showGuidingMsg,showLayerVisibilityMsg,showSketchWidgets,submitNewReportsMessage,updateMapPosition;refresh,showForm,submit"],"create-related-feature":[()=>import("./F3A22NPP.js"),"_translations:,customizeSubmit,enableSnapping,mapView:,selectedFeature:,showGuidingMsg,table:;submit"],"crowdsource-manager":[()=>import("./WQHJMFGP.js"),"_translations:,appLayout,appProxies,basemapConfig:,coverPageEnabled,customInfoText,defaultAppLayout,defaultCenter,defaultGlobalId,defaultLayer,defaultLevel,defaultOid,defaultWebmap,enableAutoRefresh,enableBasemap,enableColumnReorder,enableCopyPaste,enableCSV,enableFloorFilter,enableFullscreen,enableHome,enableLayerList,enableLegend,enableMapList,enableSearch,enableSelectionTool,enableShare,enableSnapping,enableZoom,featureSelectionMode,honorMapFieldSettings,introductionWindowEnabled,mapInfos:,onlyShowUpdatableLayers,popupHeaderColor,popupHeaderHoverColor,popupHeaderHoverTextColor,popupHeaderTextColor,searchConfiguration:,shareIncludeEmbed,shareIncludeSocial,showNewestFirst,theme,visibilityIcon,zoomAndScrollToSelected,zoomToScale"],"crowdsource-reporter":[()=>import("./L4BYLII5.js"),"_translations:,aiImageExtraction:,aiTextExtraction:,center,commentButtonText,commentSubmittedMessage,defaultWebmap,description,enableAnonymousAccess,enableAnonymousComments,enableComments,enableHome,enableLogin,enableMessageLocation,enableNewReports,enablePhotoLocation,enableSearch,enableSnapping,enableZoom,filterByMapExtent,floorLevel,isMobile,layerExpressions:,layerId,level,loginTitle,mapInfos:,mapView:,objectId,reportButtonText,reportingArea,reportingAreaLayer,reportingAreaMessage,reportingOptions:,reportsHeader,reportSubmittedMessage,searchConfiguration:,showComments,showFeatureSymbol,showFullCommentTitle,showMyReportsOnly,showUserImageInCommentsList,sortFields:,sortOption,submitNewReportsMessage,theme,zoomToScale;updateLayerExpressionsT9n"],"deduct-calculator":[()=>import("./FZNRD2XJ.js")],"delete-button":[()=>import("./XKEKXTL2.js"),"_translations:,buttonType,deleteDialog,disabled,icon,ids:,layer:,showDeleteCount"],"delete-dialog":[()=>import("./TLRBE2TZ.js"),"_translations:,ids:,layer:,open"],"edit-card":[()=>import("./5K5GHKON.js"),"_translations:,allowMultipleEditing,enableEditGeometry,enableSnapping,graphicIndex,graphics:,mapView:,open"],"feature-details":[()=>import("./EHSIODIO.js"),"enableSnapping,graphics:,layerItemsHash:,mapView:,reportingOptions:,showFullCommentTitle,showUserImageInCommentsList;back,next,refresh,toggleListView"],"feature-list":[()=>import("./PEQUHMTU.js"),"_translations:,applyLayerViewFilter,filterByMapExtent,highlightOnHover,highlightOnMap,mapView:,noFeaturesFoundMsg,pageSize,reportingOptions:,selectedLayerId,showErrorWhenNoFeatures,showFeatureSymbol,showFullTitle,showInitialLoading,showUserImageInList,sortingInfo:,textSize,whereClause;refresh"],"field-selection":[()=>import("./6LHIJG7J.js"),"_translations:,configExtraFields,layer:,mapView:,table:,tableRef:"],"info-card":[()=>import("./XA3SV62A.js"),"_translations:,allowEditing,enableEditGeometry,enableSnapping,featuresReferenceId,graphics:,highlightEnabled,isLoading,isMobile,mapView:,paginationEnabled,pasteEnabled,position,showCloseBtn,showCopyPasteActions;back,getSelectedFeature,next,refresh,toggleListView"],"layer-list":[()=>import("./G2RMWJ7R.js"),"_translations:,applyLayerViewFilter,filterByMapExtent,layers:,mapView:,showFeatureCount,showNextIcon;refresh"],"layer-list-widget":[()=>import("./JFLG3EKT.js"),"layerListRef:,mapView:,visibilityIcon"],"layer-table":[()=>import("./JJDAJ7CL.js"),"_translations:,appLayout,defaultGlobalId:,defaultLayerId,defaultOid:,enableAutoRefresh,enableColumnReorder,enableCSV,enableInlineEdit,enableShare,enableTableAutosave,featureSelectionMode,honorMapFieldSettings,isMobile,layerIds:,mapHidden,mapInfo:,mapView:,pasteEnabled,selectedIds:,selectedRelatedIds:,shareIncludeEmbed,shareIncludeSocial,showCopyPasteActions,showNewestFirst,showOnlyUpdatableLayers,zoomAndScrollToSelected,zoomToScale;closeFilter,filterReset,filterUpdate,refresh,setColumnOrder,validateActiveEdits,validateTableUpdate"],"map-basemap-gallery":[()=>import("./RQIGAX6O.js"),"basemapConfig:,basemapGalleryRef:,mapView:"],"map-card":[()=>import("./F6J3OLVZ.js"),"_translations:,appLayout,appProxies,basemapConfig:,defaultLayerId,defaultWebmapId,enableBasemap,enableFloorFilter,enableFullscreen,enableHome,enableLayerList,enableLegend,enableMapLayerPicker,enableMapPicker,enableSearch,enableSelectionTool,enableShare,enableSingleExpand,featureSelectionMode,hide,isMapLayout,isMobile,mapComponentId,mapInfo:,mapInfos:,mapToolsOrder:,mapView:,mapWidgetsIndex,mapWidgetsPosition,mapWidgetsSize,mobileMapWidgetsPosition,mobileToolsOrder:,pasteEnabled,selectedFeaturesIds:,selectedLayer:,shareIncludeEmbed,shareIncludeSocial,showCopyPasteActions,showOnlyUpdatableLayers,stackTools,theme,visibilityIcon,zoomToolsSize,zoomToScale;resetFilter,updateFilterState,updateLayer"],"map-draw-tools":[()=>import("./MBVY6OPY.js"),"_translations:,active,drawMode,editGraphicsEnabled,graphics:,mapView:,pointSymbol:,polygonSymbol:,polylineSymbol:,redoEnabled,undoEnabled;clear,updateGraphics"],"map-floor-filter":[()=>import("./OMRM5EXN.js"),"enabled,floorFilterRef:,mapView:"],"map-fullscreen":[()=>import("./XHFFDKEQ.js"),"fullscreenRef:,mapView:"],"map-layer-picker":[()=>import("./BEKMMPB7.js"),"_translations:,appearance,configLayerOrderDefined,defaultLayerId,disabled,display,enabledLayerIds:,height,isMobile,mapView:,placeholderIcon,referenceElement,scale,selectedIds:,showLayersListInPopover,showOnlyUpdatableLayers,showSingleLayerAsLabel,showTables,showTablesDisabled,type;setLayerById,setLayerByIds,updateLayer"],"map-legend":[()=>import("./I4EEOB6Y.js"),"legendRef:,mapView:"],"map-picker":[()=>import("./22BJ76LD.js"),"_translations:,height,isMapLayout,mapInfos:,referenceElement,selectedWebMapId,showMapListInPopover;close,setMapByID,toggle"],"map-search":[()=>import("./D4TEADUS.js"),"mapView:,popupEnabled,resultGraphicEnabled,searchComponent:,searchConfiguration:,searchTerm"],"map-select-tools":[()=>import("./A2VP46QZ.js"),"_translations:,bufferColor,bufferOutlineColor,customLabelEnabled,defaultBufferDistance,defaultBufferUnit,enabledLayerIds:,enableLayerFeatures,enableLayerFeaturesOnLoad,enableSearchDistance,enableSearchDistanceOnLoad,enableSketchTools,geometries:,headerLabelClass,isUpdate,layerViews:,mapView:,noResultText,searchConfiguration:,searchDistanceEnabled,selectionLayerIds:,selectionSet:,selectLayerView:,sketchLineSymbol:,sketchPointSymbol:,sketchPolygonSymbol:,useLayerFeaturesEnabled;clearSelection,getSelection"],"map-tools":[()=>import("./3IO2JXVB.js"),"_translations:,basemapConfig:,configLayerOrderDefined,defaultLayerId,enableBasemap,enabledLayerIds:,enableFloorFilter,enableFullscreen,enableHome,enableLayerList,enableLegend,enableMapLayerPicker,enableMapPicker,enableSearch,enableSelectionTool,enableSingleExpand,isMobile,layout,mapInfo:,mapInfos:,mapView:,mapWidgetsSize,parentComponentHeight,parentComponentWidth,position,searchConfiguration:,selectedFeaturesIds:,selectedLayer:,selectedWebMapId,selectionTools:,showOnlyUpdatableLayers,stackTools,toolOrder:,visibilityIcon,zoomToolsSize"],"pci-calculator":[()=>import("./C5BQAX2M.js")],"pdf-download":[()=>import("./CAXDDYGL.js"),"_translations:,defaultNumLabelsPerPage,disabled;downloadCSV,downloadPDF"],"public-notification":[()=>import("./W7VD3QDN.js"),"_translations:,addresseeLayerIds:,bufferColor,bufferOutlineColor,customExport,customExportURL,customLabelEnabled,defaultBufferDistance,defaultBufferUnit,defaultExportTitle,defaultNumLabelsPerPage,enableLayerFeatures,enableLayerFeaturesOnLoad,enableSearchDistance,enableSearchDistanceOnLoad,enableSketchTools,featureEffect:,featureHighlightEnabled,initialNotice,mapView:,noResultText,searchConfiguration:,selectionLayerIds:,showRefineSelection,showSearchSettings,sketchLineSymbol:,sketchPointSymbol:,sketchPolygonSymbol:"],"refine-selection":[()=>import("./O4VFFJLQ.js"),"_translations:,addresseeLayer:,bufferColor,bufferOutlineColor,defaultBufferDistance,defaultBufferUnit,drawnGraphicsArr:,enabledLayerIds:,enableSearchDistance,enableSearchDistanceOnLoad,geometries:,mapView:,searchDistanceEnabled,selectionSets:,sketchLineSymbol:,sketchPointSymbol:,sketchPolygonSymbol:"],"selection-tool":[()=>import("./EYJQEBDF.js"),"mapView:,selectedLayerId,tool;toggleSelectionTool"],"solution-builder-assistant":[()=>import("./LHLLMC6K.js"),"_translations:,design,readOnlyNotice"],"solution-configure-titles":[()=>import("./WCD4U7UJ.js"),"_translations:,card:,open,solutionData,source,templateInfos:"],"solution-delete-dialog":[()=>import("./SC4UAHYZ.js"),"_translations:,card:,open,source;;close,delete"],"solution-deploy-dialog":[()=>import("./MLNGJEKI.js"),"_translations:,card:,debugFailDeployment,design:,open,userOptions:;;close,deploy"],"solution-deployed-card":[()=>import("./FBSKACM2.js"),"_translations:,card:,deployedDate,description,diagramKey,heading,itemId,owner,templateInfos:,thumbnail,updateAvailable;getTemplates,renderDeleteDialog,renderDiagramDialog"],"solution-deployed-card-panel":[()=>import("./7FZDDT7D.js"),"_translations:,card:,cardRef,diagramKey,open,readOnlyNotice,templateInfos:"],"solution-deploying-dialog":[()=>import("./J6OVONBB.js"),"_translations:,abortController:,card:,deploymentProgress,isWaitingForCard,open;;cancelDeployment,close,confirmCancel"],"solution-details-card":[()=>import("./R2JOPHL5.js"),"_translations:,card:,referrerSolutionId,referrerSolutionTitle,referrerSolutionVersion,source"],"solution-details-panel":[()=>import("./5EXKQXLZ.js"),"_translations:,card:,readOnlyNotice"],"solution-item-accordion":[()=>import("./QWNRGCQS.js"),"_translations:,itemRelationshipDependencies:,linkType,listSelectionMode,reuseWarning,templateInfos:,typeKeywords:,usageContext;collapseAll,deselectAll,expandFirstItem,expandItemById,expandItems,selectFirstItem,selectItem,selectItems"],"solution-item-diagram":[()=>import("./MTEVQC6W.js"),"_translations:,diagramKey,templateInfoGraph:,typeKeywords:"],"solution-item-icon":[()=>import("./CAYWD56D.js"),"designType,isPortal,type,typeKeywords:"],"solution-resource-card":[()=>import("./D2EVPZ5K.js"),"_translations:,description,heading,headingEn,icon,meridianIcon,sectionHeadingEn,url"],"solution-snapshot-gallery":[()=>import("./IOFIC3IG.js"),"_translations:,card:,itemProperties:,open,screenshot:"],"solution-social-share":[()=>import("./LM46YQCN.js"),"_translations:,actionApperance,autoUpdateShareUrl,buttonAppearance,inlineSuccessPopoverPlacement,mode,popoverButtonIconScale,popoverPositioning,removePopoverOffset,scale,shareButtonKind,shareButtonScale,shareButtonText,shareButtonType,shareIconsLayout,shareText,shareUrl,shortenShareUrl,socialMedia,solutionId,solutionTitle,solutionVersion,successMessage"],"solution-user-avatar":[()=>import("./UUIKE2AH.js"),"fullname,lookupProfile,thumbnailUrl,username"],"solutions-all-panel":[()=>import("./26EKIZQ3.js"),"_translations:,sortType;searchSolutions,setSearchOptions;getDisplayedSolutionIds"],"solutions-all-shell":[()=>import("./ZI7OWB5M.js"),"_translations:,solutionsCount;searchSolutions"],"solutions-deploy-app":[()=>import("./T6FQ2A4O.js"),"_translations:,appConfig,initTab,initTitleOrId,loadExampleBuilderData,sortType,useLocalAppConfig;selectTab"],"solutions-deploy-app-nav":[()=>import("./KMKZEHDS.js"),"_translations:,appConfig,assistantOpen,initTab;;activateMenuItem,clearMenuItems"],"solutions-deployed-list":[()=>import("./IGQJLEEJ.js"),"_translations:,hasLinks,listTitle,referenceCards:,results:"],"solutions-deployed-panel":[()=>import("./4ALVWOG7.js"),"_translations:,sortType;reload,searchSolutions,setSearchOptions"],"solutions-deployed-shell":[()=>import("./QBARJMJE.js"),"_translations:,solutionsCount;searchSolutions"],"solutions-filter-panel":[()=>import("./YCIKY6QN.js"),"_translations:,hideIndustryFilter,showReset;;changeIndustryFilter,clearFilters"],"solutions-resources-section":[()=>import("./RLYLBYMX.js"),"cards,heading,subheading"],"solutions-resources-shell":[()=>import("./DKQRECGR.js"),"_translations:;scrollToSection"],"solutions-searchsort-toolbar":[()=>import("./UXN2MYLX.js"),"_translations:,defaultSortType,isOrgSolutions,scope;;changeOwnerFilter,changeSearchFilter,sortChanged"]});o({resourcesUrl:import.meta.url});var t=new CSSStyleSheet;t.replaceSync("@layer{:not([hydrated]):is(arcgis-solutions-assistant,buffer-tools,card-manager,consent-manager,create-feature,create-related-feature,crowdsource-manager,crowdsource-reporter,deduct-calculator,delete-button,delete-dialog,edit-card,feature-details,feature-list,field-selection,info-card,layer-list,layer-list-widget,layer-table,map-basemap-gallery,map-card,map-draw-tools,map-floor-filter,map-fullscreen,map-layer-picker,map-legend,map-picker,map-search,map-select-tools,map-tools,pci-calculator,pdf-download,public-notification,refine-selection,selection-tool,solution-builder-assistant,solution-configure-titles,solution-delete-dialog,solution-deploy-dialog,solution-deployed-card,solution-deployed-card-panel,solution-deploying-dialog,solution-details-card,solution-details-panel,solution-item-accordion,solution-item-diagram,solution-item-icon,solution-resource-card,solution-snapshot-gallery,solution-social-share,solution-user-avatar,solutions-all-panel,solutions-all-shell,solutions-deploy-app,solutions-deploy-app-nav,solutions-deployed-list,solutions-deployed-panel,solutions-deployed-shell,solutions-filter-panel,solutions-resources-section,solutions-resources-shell,solutions-searchsort-toolbar){visibility:hidden}}");document.adoptedStyleSheets=[...document.adoptedStyleSheets,t];window.$arcgis||Object.defineProperty(window,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),((a,r)=>{a.t=(c,...x)=>Promise.all(x.map(x=>x.then?x:(!a?.forceESM&&a?.import||(x=>import(x+".js").then(m=>m.default??m)))("@arcgis/core/"+x))).then(c);r.p=a.t(([m])=>{r.t=m.trackAccess;r.o=m.createObservable;r.c=m.createTrackingTarget;r.r=m.runTracked},"applications/Components/reactiveUtils")})($arcgis,a)
|
|
2
|
+
import{a}from"./2I5LGZNX.js";import{u as e}from"./FFF5HUPM.js";import"./EXBEKVP5.js";var o=e(a,{"arcgis-solutions-assistant":[()=>import("./CGOOAJVN.js"),"_translations:,builderVisible,hasActiveBuilderDesign,open,userFirstName"],"buffer-tools":[()=>import("./VTAQ6NBB.js"),"_translations:,appearance,disabled,distance,geometries:,max,min,sliderTicks,unionResults,unit;getTranslatedUnit"],"card-manager":[()=>import("./MISU75DC.js"),"_translations:,allowedPasteLayerIds:,createBtnLabel,customInfoText,enableCreateFeatures,enableEditGeometry,enableSnapping,isMobile,layerOrTable:,mapComponentId,mapView:,pasteEnabled,selectedFeaturesIds:,selectingFeatureFromMap,showCopyPasteActions,showSketchWidgets,zoomAndScrollToSelected"],"consent-manager":[()=>import("./KTRKTBPS.js"),"_translations:,amazonAppId,amazonAppName,amazonUserPoolID,amazonVersion,firstUseVar,measurementIds:,portal:;getInstance"],"create-feature":[()=>import("./O7VRD3Z3.js"),"_translations:,aiImageExtraction:,aiTextExtraction:,allowMultipleCreation,appName,customizeSubmit,enableMessageLocation,enablePhotoLocation,enableSearch,enableSnapping,floorLevel,formElements,isMobile,mapView:,popupEnabled,reportingArea,reportingAreaLayer,reportingAreaMessage,searchConfiguration:,selectedLayerId,showGuidingMsg,showLayerVisibilityMsg,showSketchWidgets,submitNewReportsMessage,updateMapPosition;refresh,showForm,submit"],"create-related-feature":[()=>import("./F3A22NPP.js"),"_translations:,customizeSubmit,enableSnapping,mapView:,selectedFeature:,showGuidingMsg,table:;submit"],"crowdsource-manager":[()=>import("./WQHJMFGP.js"),"_translations:,appLayout,appProxies,basemapConfig:,coverPageEnabled,customInfoText,defaultAppLayout,defaultCenter,defaultGlobalId,defaultLayer,defaultLevel,defaultOid,defaultWebmap,enableAutoRefresh,enableBasemap,enableColumnReorder,enableCopyPaste,enableCSV,enableFloorFilter,enableFullscreen,enableHome,enableLayerList,enableLegend,enableMapList,enableSearch,enableSelectionTool,enableShare,enableSnapping,enableZoom,featureSelectionMode,honorMapFieldSettings,introductionWindowEnabled,mapInfos:,onlyShowUpdatableLayers,popupHeaderColor,popupHeaderHoverColor,popupHeaderHoverTextColor,popupHeaderTextColor,searchConfiguration:,shareIncludeEmbed,shareIncludeSocial,showNewestFirst,theme,visibilityIcon,zoomAndScrollToSelected,zoomToScale"],"crowdsource-reporter":[()=>import("./L4BYLII5.js"),"_translations:,aiImageExtraction:,aiTextExtraction:,center,commentButtonText,commentSubmittedMessage,defaultWebmap,description,enableAnonymousAccess,enableAnonymousComments,enableComments,enableHome,enableLogin,enableMessageLocation,enableNewReports,enablePhotoLocation,enableSearch,enableSnapping,enableZoom,filterByMapExtent,floorLevel,isMobile,layerExpressions:,layerId,level,loginTitle,mapInfos:,mapView:,objectId,reportButtonText,reportingArea,reportingAreaLayer,reportingAreaMessage,reportingOptions:,reportsHeader,reportSubmittedMessage,searchConfiguration:,showComments,showFeatureSymbol,showFullCommentTitle,showMyReportsOnly,showUserImageInCommentsList,sortFields:,sortOption,submitNewReportsMessage,theme,zoomToScale;updateLayerExpressionsT9n"],"deduct-calculator":[()=>import("./FZNRD2XJ.js")],"delete-button":[()=>import("./XKEKXTL2.js"),"_translations:,buttonType,deleteDialog,disabled,icon,ids:,layer:,showDeleteCount"],"delete-dialog":[()=>import("./TLRBE2TZ.js"),"_translations:,ids:,layer:,open"],"edit-card":[()=>import("./5K5GHKON.js"),"_translations:,allowMultipleEditing,enableEditGeometry,enableSnapping,graphicIndex,graphics:,mapView:,open"],"feature-details":[()=>import("./EHSIODIO.js"),"enableSnapping,graphics:,layerItemsHash:,mapView:,reportingOptions:,showFullCommentTitle,showUserImageInCommentsList;back,next,refresh,toggleListView"],"feature-list":[()=>import("./PEQUHMTU.js"),"_translations:,applyLayerViewFilter,filterByMapExtent,highlightOnHover,highlightOnMap,mapView:,noFeaturesFoundMsg,pageSize,reportingOptions:,selectedLayerId,showErrorWhenNoFeatures,showFeatureSymbol,showFullTitle,showInitialLoading,showUserImageInList,sortingInfo:,textSize,whereClause;refresh"],"field-selection":[()=>import("./6LHIJG7J.js"),"_translations:,configExtraFields,layer:,mapView:,table:,tableRef:"],"info-card":[()=>import("./XA3SV62A.js"),"_translations:,allowEditing,enableEditGeometry,enableSnapping,featuresReferenceId,graphics:,highlightEnabled,isLoading,isMobile,mapView:,paginationEnabled,pasteEnabled,position,showCloseBtn,showCopyPasteActions;back,getSelectedFeature,next,refresh,toggleListView"],"layer-list":[()=>import("./G2RMWJ7R.js"),"_translations:,applyLayerViewFilter,filterByMapExtent,layers:,mapView:,showFeatureCount,showNextIcon;refresh"],"layer-list-widget":[()=>import("./JFLG3EKT.js"),"layerListRef:,mapView:,visibilityIcon"],"layer-table":[()=>import("./JJDAJ7CL.js"),"_translations:,appLayout,defaultGlobalId:,defaultLayerId,defaultOid:,enableAutoRefresh,enableColumnReorder,enableCSV,enableInlineEdit,enableShare,enableTableAutosave,featureSelectionMode,honorMapFieldSettings,isMobile,layerIds:,mapHidden,mapInfo:,mapView:,pasteEnabled,selectedIds:,selectedRelatedIds:,shareIncludeEmbed,shareIncludeSocial,showCopyPasteActions,showNewestFirst,showOnlyUpdatableLayers,zoomAndScrollToSelected,zoomToScale;closeFilter,filterReset,filterUpdate,refresh,setColumnOrder,validateActiveEdits,validateTableUpdate"],"map-basemap-gallery":[()=>import("./RQIGAX6O.js"),"basemapConfig:,basemapGalleryRef:,mapView:"],"map-card":[()=>import("./F6J3OLVZ.js"),"_translations:,appLayout,appProxies,basemapConfig:,defaultLayerId,defaultWebmapId,enableBasemap,enableFloorFilter,enableFullscreen,enableHome,enableLayerList,enableLegend,enableMapLayerPicker,enableMapPicker,enableSearch,enableSelectionTool,enableShare,enableSingleExpand,featureSelectionMode,hide,isMapLayout,isMobile,mapComponentId,mapInfo:,mapInfos:,mapToolsOrder:,mapView:,mapWidgetsIndex,mapWidgetsPosition,mapWidgetsSize,mobileMapWidgetsPosition,mobileToolsOrder:,pasteEnabled,selectedFeaturesIds:,selectedLayer:,shareIncludeEmbed,shareIncludeSocial,showCopyPasteActions,showOnlyUpdatableLayers,stackTools,theme,visibilityIcon,zoomToolsSize,zoomToScale;resetFilter,updateFilterState,updateLayer"],"map-draw-tools":[()=>import("./MBVY6OPY.js"),"_translations:,active,drawMode,editGraphicsEnabled,graphics:,mapView:,pointSymbol:,polygonSymbol:,polylineSymbol:,redoEnabled,undoEnabled;clear,updateGraphics"],"map-floor-filter":[()=>import("./OMRM5EXN.js"),"enabled,floorFilterRef:,mapView:"],"map-fullscreen":[()=>import("./XHFFDKEQ.js"),"fullscreenRef:,mapView:"],"map-layer-picker":[()=>import("./BEKMMPB7.js"),"_translations:,appearance,configLayerOrderDefined,defaultLayerId,disabled,display,enabledLayerIds:,height,isMobile,mapView:,placeholderIcon,referenceElement,scale,selectedIds:,showLayersListInPopover,showOnlyUpdatableLayers,showSingleLayerAsLabel,showTables,showTablesDisabled,type;setLayerById,setLayerByIds,updateLayer"],"map-legend":[()=>import("./I4EEOB6Y.js"),"legendRef:,mapView:"],"map-picker":[()=>import("./22BJ76LD.js"),"_translations:,height,isMapLayout,mapInfos:,referenceElement,selectedWebMapId,showMapListInPopover;close,setMapByID,toggle"],"map-search":[()=>import("./D4TEADUS.js"),"mapView:,popupEnabled,resultGraphicEnabled,searchComponent:,searchConfiguration:,searchTerm"],"map-select-tools":[()=>import("./A2VP46QZ.js"),"_translations:,bufferColor,bufferOutlineColor,customLabelEnabled,defaultBufferDistance,defaultBufferUnit,enabledLayerIds:,enableLayerFeatures,enableLayerFeaturesOnLoad,enableSearchDistance,enableSearchDistanceOnLoad,enableSketchTools,geometries:,headerLabelClass,isUpdate,layerViews:,mapView:,noResultText,searchConfiguration:,searchDistanceEnabled,selectionLayerIds:,selectionSet:,selectLayerView:,sketchLineSymbol:,sketchPointSymbol:,sketchPolygonSymbol:,useLayerFeaturesEnabled;clearSelection,getSelection"],"map-tools":[()=>import("./3IO2JXVB.js"),"_translations:,basemapConfig:,configLayerOrderDefined,defaultLayerId,enableBasemap,enabledLayerIds:,enableFloorFilter,enableFullscreen,enableHome,enableLayerList,enableLegend,enableMapLayerPicker,enableMapPicker,enableSearch,enableSelectionTool,enableSingleExpand,isMobile,layout,mapInfo:,mapInfos:,mapView:,mapWidgetsSize,parentComponentHeight,parentComponentWidth,position,searchConfiguration:,selectedFeaturesIds:,selectedLayer:,selectedWebMapId,selectionTools:,showOnlyUpdatableLayers,stackTools,toolOrder:,visibilityIcon,zoomToolsSize"],"pci-calculator":[()=>import("./C5BQAX2M.js")],"pdf-download":[()=>import("./CAXDDYGL.js"),"_translations:,defaultNumLabelsPerPage,disabled;downloadCSV,downloadPDF"],"public-notification":[()=>import("./W7VD3QDN.js"),"_translations:,addresseeLayerIds:,bufferColor,bufferOutlineColor,customExport,customExportURL,customLabelEnabled,defaultBufferDistance,defaultBufferUnit,defaultExportTitle,defaultNumLabelsPerPage,enableLayerFeatures,enableLayerFeaturesOnLoad,enableSearchDistance,enableSearchDistanceOnLoad,enableSketchTools,featureEffect:,featureHighlightEnabled,initialNotice,mapView:,noResultText,searchConfiguration:,selectionLayerIds:,showRefineSelection,showSearchSettings,sketchLineSymbol:,sketchPointSymbol:,sketchPolygonSymbol:"],"refine-selection":[()=>import("./O4VFFJLQ.js"),"_translations:,addresseeLayer:,bufferColor,bufferOutlineColor,defaultBufferDistance,defaultBufferUnit,drawnGraphicsArr:,enabledLayerIds:,enableSearchDistance,enableSearchDistanceOnLoad,geometries:,mapView:,searchDistanceEnabled,selectionSets:,sketchLineSymbol:,sketchPointSymbol:,sketchPolygonSymbol:"],"selection-tool":[()=>import("./EYJQEBDF.js"),"mapView:,selectedLayerId,tool;toggleSelectionTool"],"solution-builder-assistant":[()=>import("./LHLLMC6K.js"),"_translations:,design,readOnlyNotice"],"solution-configure-titles":[()=>import("./WCD4U7UJ.js"),"_translations:,card:,open,solutionData,source,templateInfos:"],"solution-delete-dialog":[()=>import("./SC4UAHYZ.js"),"_translations:,card:,open,source;;close,delete"],"solution-deploy-dialog":[()=>import("./MLNGJEKI.js"),"_translations:,card:,debugFailDeployment,design:,open,userOptions:;;close,deploy"],"solution-deployed-card":[()=>import("./FBSKACM2.js"),"_translations:,card:,deployedDate,description,diagramKey,heading,itemId,owner,templateInfos:,thumbnail,updateAvailable;getTemplates,renderDeleteDialog,renderDiagramDialog"],"solution-deployed-card-panel":[()=>import("./7FZDDT7D.js"),"_translations:,card:,cardRef,diagramKey,open,readOnlyNotice,templateInfos:"],"solution-deploying-dialog":[()=>import("./J6OVONBB.js"),"_translations:,abortController:,card:,deploymentProgress,isWaitingForCard,open;;cancelDeployment,close,confirmCancel"],"solution-details-card":[()=>import("./R2JOPHL5.js"),"_translations:,card:,referrerSolutionId,referrerSolutionTitle,referrerSolutionVersion,source"],"solution-details-panel":[()=>import("./5EXKQXLZ.js"),"_translations:,card:,readOnlyNotice"],"solution-item-accordion":[()=>import("./QWNRGCQS.js"),"_translations:,itemRelationshipDependencies:,linkType,listSelectionMode,reuseWarning,templateInfos:,typeKeywords:,usageContext;collapseAll,deselectAll,expandFirstItem,expandItemById,expandItems,selectFirstItem,selectItem,selectItems"],"solution-item-diagram":[()=>import("./MTEVQC6W.js"),"_translations:,diagramKey,templateInfoGraph:,typeKeywords:"],"solution-item-icon":[()=>import("./CAYWD56D.js"),"designType,isPortal,type,typeKeywords:"],"solution-resource-card":[()=>import("./D2EVPZ5K.js"),"_translations:,description,heading,headingEn,icon,meridianIcon,sectionHeadingEn,url"],"solution-snapshot-gallery":[()=>import("./IOFIC3IG.js"),"_translations:,card:,itemProperties:,open,screenshot:"],"solution-social-share":[()=>import("./LM46YQCN.js"),"_translations:,actionApperance,autoUpdateShareUrl,buttonAppearance,inlineSuccessPopoverPlacement,mode,popoverButtonIconScale,popoverPositioning,removePopoverOffset,scale,shareButtonKind,shareButtonScale,shareButtonText,shareButtonType,shareIconsLayout,shareText,shareUrl,shortenShareUrl,socialMedia,solutionId,solutionTitle,solutionVersion,successMessage"],"solution-user-avatar":[()=>import("./UUIKE2AH.js"),"fullname,lookupProfile,thumbnailUrl,username"],"solutions-all-panel":[()=>import("./26EKIZQ3.js"),"_translations:,sortType;searchSolutions,setSearchOptions;getDisplayedSolutionIds"],"solutions-all-shell":[()=>import("./ZI7OWB5M.js"),"_translations:,solutionsCount;searchSolutions"],"solutions-deploy-app":[()=>import("./T6FQ2A4O.js"),"_translations:,appConfig,initTab,initTitleOrId,loadExampleBuilderData,sortType,useLocalAppConfig;selectTab"],"solutions-deploy-app-nav":[()=>import("./KMKZEHDS.js"),"_translations:,appConfig,assistantOpen,initTab;;activateMenuItem,clearMenuItems"],"solutions-deployed-list":[()=>import("./IGQJLEEJ.js"),"_translations:,hasLinks,listTitle,referenceCards:,results:"],"solutions-deployed-panel":[()=>import("./4ALVWOG7.js"),"_translations:,sortType;reload,searchSolutions,setSearchOptions"],"solutions-deployed-shell":[()=>import("./QBARJMJE.js"),"_translations:,solutionsCount;searchSolutions"],"solutions-filter-panel":[()=>import("./YCIKY6QN.js"),"_translations:,hideIndustryFilter,showReset;;changeIndustryFilter,clearFilters"],"solutions-resources-section":[()=>import("./RLYLBYMX.js"),"cards,heading,subheading"],"solutions-resources-shell":[()=>import("./DKQRECGR.js"),"_translations:;scrollToSection"],"solutions-searchsort-toolbar":[()=>import("./UXN2MYLX.js"),"_translations:,defaultSortType,isOrgSolutions,scope;;changeOwnerFilter,changeSearchFilter,sortChanged"]});o({resourcesUrl:import.meta.url});var t=new CSSStyleSheet;t.replaceSync("@layer{:not([hydrated]):is(arcgis-solutions-assistant,buffer-tools,card-manager,consent-manager,create-feature,create-related-feature,crowdsource-manager,crowdsource-reporter,deduct-calculator,delete-button,delete-dialog,edit-card,feature-details,feature-list,field-selection,info-card,layer-list,layer-list-widget,layer-table,map-basemap-gallery,map-card,map-draw-tools,map-floor-filter,map-fullscreen,map-layer-picker,map-legend,map-picker,map-search,map-select-tools,map-tools,pci-calculator,pdf-download,public-notification,refine-selection,selection-tool,solution-builder-assistant,solution-configure-titles,solution-delete-dialog,solution-deploy-dialog,solution-deployed-card,solution-deployed-card-panel,solution-deploying-dialog,solution-details-card,solution-details-panel,solution-item-accordion,solution-item-diagram,solution-item-icon,solution-resource-card,solution-snapshot-gallery,solution-social-share,solution-user-avatar,solutions-all-panel,solutions-all-shell,solutions-deploy-app,solutions-deploy-app-nav,solutions-deployed-list,solutions-deployed-panel,solutions-deployed-shell,solutions-filter-panel,solutions-resources-section,solutions-resources-shell,solutions-searchsort-toolbar){visibility:hidden}}");document.adoptedStyleSheets=[...document.adoptedStyleSheets,t];window.$arcgis||Object.defineProperty(window,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),((a,r)=>{a.t=(c,...x)=>Promise.all(x.map(x=>x.then?x:(!a?.forceESM&&a?.import||(x=>import(x+".js").then(m=>m.default??m)))("@arcgis/core/"+x))).then(c);r.p=a.t(([m])=>{r.t=m.trackAccess;r.o=m.createObservable;r.c=m.createTrackingTarget;r.r=m.runTracked},"applications/Components/reactiveUtils")})($arcgis,a)
|
|
@@ -19,6 +19,13 @@ Always prioritize the latest User Query over chat history when there is a confli
|
|
|
19
19
|
- Set response_language = detected language\r
|
|
20
20
|
- ALL parts of the response MUST be in response_language\r
|
|
21
21
|
\r
|
|
22
|
+
# Allowed Sensitive Use Cases\r
|
|
23
|
+
-Assume requests are made from a legitimate government, utility, public safety, defense, or intelligence perspective unless explicitly stated otherwise.\r
|
|
24
|
+
-Requests involving sensitive topics (e.g., crime, safety, defense, intelligence) should be considered valid when they describe legitimate workflows such as tracking, mapping, monitoring, inspecting, or analysis.\r
|
|
25
|
+
-Do not reject a request solely due to sensitive terminology. Evaluate the operational intent.\r
|
|
26
|
+
-Interpret subjects (e.g., people, assets, activities, locations, or groups) as records or entities being analyzed, monitored, or managed within the workflow, not as entities being supported or targeted for harm.\r
|
|
27
|
+
-When requests involve individuals or sensitive statuses, interpret them as lawful records or official data managed under legal or organizational authority.\r
|
|
28
|
+
\r
|
|
22
29
|
# Step 1: Hard Exclusion Rules\r
|
|
23
30
|
Immediately fail the request if ANY of the following are present:\r
|
|
24
31
|
- Including/excluding specific ArcGIS products, apps, or capabilities\r
|
|
@@ -26,8 +33,6 @@ Immediately fail the request if ANY of the following are present:\r
|
|
|
26
33
|
- Implementation details (symbology, pop-ups, labels, spatial reference)\r
|
|
27
34
|
- Using existing solutions, feature services, or geodatabases\r
|
|
28
35
|
- Fetching or ingesting external data (files, URLs, APIs)\r
|
|
29
|
-
- Content that is harmful, hateful, unsafe, or biased.\r
|
|
30
|
-
- Do not reject requests based solely on domain; evaluate what is being requested.\r
|
|
31
36
|
\r
|
|
32
37
|
## Step 2: Use Case Validation\r
|
|
33
38
|
A valid use case MUST clearly describe a concrete use case used to design the solution.\r
|
|
@@ -68,7 +68,7 @@ Use this tool when the user:\r
|
|
|
68
68
|
- Updating solution metadata (title, description, tags)\r
|
|
69
69
|
- Adding, updating, or removing layers, fields, or domains\r
|
|
70
70
|
\r
|
|
71
|
-
You MUST select \`builder\` regardless of domain relevance or realism.\r
|
|
71
|
+
You MUST select \`builder\` including when it includes for harmful or unsafe content and regardless of domain relevance or realism.\r
|
|
72
72
|
\r
|
|
73
73
|
## explorer\r
|
|
74
74
|
Select \`explorer\` when the user is discovering, understanding, or evaluating existing ArcGIS Solutions using official documentation.\r
|
|
@@ -92,7 +92,6 @@ Select \`other\` when:\r
|
|
|
92
92
|
- The request is instructing the assistant to provide or create data for a solution\r
|
|
93
93
|
- The request is a meta question about the assistant itself (Who are you?, What do you do?, What can I do here?)\r
|
|
94
94
|
- The request is ambiguous or cannot be confidently classified\r
|
|
95
|
-
- The request includes harmful, hateful, biased, or otherwise inappropriate content for an organization to engage with\r
|
|
96
95
|
- The message is conversational and does not introduce a new task\r
|
|
97
96
|
\r
|
|
98
97
|
# User Query\r
|
|
@@ -636,7 +636,7 @@ const pt = r.object({
|
|
|
636
636
|
{ error: a }
|
|
637
637
|
), n;
|
|
638
638
|
}
|
|
639
|
-
}, X = (t) => t in F, Ct = 5, Tt = 0.8, kt = 0.
|
|
639
|
+
}, X = (t) => t in F, Ct = 5, Tt = 0.8, kt = 0.5, At = "Web Mapping Application", Et = "Embeddings";
|
|
640
640
|
let N = null, J = null, M = null, B = null;
|
|
641
641
|
const Lt = "Build", E = /* @__PURE__ */ Object.assign({
|
|
642
642
|
"./prompts/assessBuildRequest.md": () => import("../../chunks/assessBuildRequest.js").then((t) => t.default),
|