@arcgis/portal-components 6.0.0-next.42 → 6.0.0-next.44
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/FFTXNKIV.js +2 -0
- package/dist/cdn/K3Z2K3M4.js +100 -0
- package/dist/cdn/LH47JYFW.js +2 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.en.json +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/createPortalTool.js +32 -12
- package/dist/components/arcgis-portal-ai-assistant/customElement.d.ts +2 -0
- package/dist/components/arcgis-portal-ai-assistant/customElement.js +446 -403
- package/dist/components/arcgis-portal-ai-assistant/types/assistantTools.d.ts +38 -5
- package/dist/components/arcgis-portal-extent-picker/customElement.d.ts +2 -0
- package/dist/components/arcgis-portal-extent-picker/customElement.js +288 -236
- package/dist/components/arcgis-portal-extent-picker/index.js +3 -2
- package/dist/components/arcgis-portal-extent-picker-coord-field/customElement.js +28 -27
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/index.js +69 -69
- package/dist/loader.js +1 -1
- package/package.json +8 -8
- package/dist/cdn/OXF2WDSW.js +0 -2
- package/dist/cdn/QKRLO5CJ.js +0 -2
- package/dist/cdn/SCIZKRKA.js +0 -93
|
@@ -24,15 +24,37 @@ export interface PortalAssistantToolMemoryOptions {
|
|
|
24
24
|
cachePolicy?: PortalAssistantToolCachePolicy;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
/** Controls whether a tool call pauses for user approval before execution. */
|
|
28
|
+
export interface PortalAssistantToolApprovalOptions<TInput extends Record<string, unknown>> {
|
|
29
|
+
/**
|
|
30
|
+
* Requires explicit user approval before this tool executes.
|
|
31
|
+
* Defaults to `true`; set to `false` for read-only tools.
|
|
32
|
+
*
|
|
33
|
+
* @default true
|
|
34
|
+
*/
|
|
35
|
+
requiresApproval?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Creates the confirmation message shown to the user. Defaults to a generic
|
|
38
|
+
* confirmation question.
|
|
39
|
+
*
|
|
40
|
+
* @param input - The validated input for the tool call.
|
|
41
|
+
*/
|
|
42
|
+
approvalMessage?: (input: TInput) => string;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** Portal-owned execution and conversation-memory options for a tool. */
|
|
46
|
+
export interface PortalAssistantToolMetadata<TInput extends Record<string, unknown> = Record<string, unknown>> extends PortalAssistantToolApprovalOptions<TInput>, PortalAssistantToolMemoryOptions {}
|
|
47
|
+
|
|
27
48
|
/**
|
|
28
49
|
* Factory that creates tools made available to the Portal assistant.
|
|
29
50
|
*
|
|
30
51
|
* The Portal-provided `tool` and `requestPortalAssistantUiAction` helpers
|
|
31
52
|
* avoid consumer imports for those capabilities.
|
|
32
53
|
* Tool result payloads are stored generically in conversation state and may be
|
|
33
|
-
* supplied as previously retrieved reference data. Tools default to `cachePolicy: "no-cache"`;
|
|
34
|
-
* opt read tools into `cachePolicy: "normal"`. Writes and UI actions should remain uncached. Fresh tool calls always
|
|
35
|
-
* run normally.
|
|
54
|
+
* supplied as previously retrieved reference data. Tools default to `metadata.cachePolicy: "no-cache"`;
|
|
55
|
+
* opt read tools into `metadata.cachePolicy: "normal"`. Writes and UI actions should remain uncached. Fresh tool calls always
|
|
56
|
+
* run normally. Tools created with `tool` require approval by default; set
|
|
57
|
+
* `metadata.requiresApproval: false` for read-only tools. Resource-wide refresh orchestration is not implemented yet.
|
|
36
58
|
*
|
|
37
59
|
* @param context
|
|
38
60
|
*/
|
|
@@ -41,7 +63,7 @@ export type PortalAssistantTools = (context: PortalAssistantToolsContext) => rea
|
|
|
41
63
|
export interface PortalAssistantToolsContext {
|
|
42
64
|
/** Requests a constrained UI action without exposing its callback to the model. */
|
|
43
65
|
requestPortalAssistantUiAction: (action: PortalAssistantUiAction, config?: RunnableConfig) => Promise<boolean>;
|
|
44
|
-
/** Creates a native function tool and registers its Portal-owned
|
|
66
|
+
/** Creates a native function tool and registers its Portal-owned metadata separately. */
|
|
45
67
|
tool: <TInput extends Record<string, unknown>, TOutput = unknown>(properties: PortalAssistantToolProperties<TInput, TOutput>) => FunctionTool<TInput, TOutput>;
|
|
46
68
|
}
|
|
47
69
|
|
|
@@ -50,7 +72,18 @@ export type PortalAssistantUiAction = InlineButtonUiAction | InlineLinkUiAction
|
|
|
50
72
|
|
|
51
73
|
/** Properties accepted by the Portal-provided tool helper. \@public */
|
|
52
74
|
export type PortalAssistantToolProperties<TInput extends Record<string, unknown>, TOutput = unknown> = FunctionToolConstructProperties<TInput, TOutput>
|
|
53
|
-
&
|
|
75
|
+
& {
|
|
76
|
+
/**
|
|
77
|
+
* Portal-owned metadata, kept separate from the native tool and its model-visible schema.
|
|
78
|
+
* Defaults to requiring approval and retaining no results in conversation memory.
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* ```ts
|
|
82
|
+
* metadata: { cachePolicy: "normal", requiresApproval: false }
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
85
|
+
metadata?: PortalAssistantToolMetadata<TInput>;
|
|
86
|
+
};
|
|
54
87
|
|
|
55
88
|
/** A user-clickable inline button rendered by the assistant. */
|
|
56
89
|
export interface InlineButtonUiAction {
|
|
@@ -62,6 +62,7 @@ export abstract class ArcgisPortalExtentPicker extends LitElement {
|
|
|
62
62
|
bottomLessThanTop: string;
|
|
63
63
|
topGreaterThanBottom: string;
|
|
64
64
|
overDateLine: string;
|
|
65
|
+
revertSuccess: string;
|
|
65
66
|
}> & T9nMeta<{
|
|
66
67
|
close: string;
|
|
67
68
|
setExtent: string;
|
|
@@ -94,6 +95,7 @@ export abstract class ArcgisPortalExtentPicker extends LitElement {
|
|
|
94
95
|
bottomLessThanTop: string;
|
|
95
96
|
topGreaterThanBottom: string;
|
|
96
97
|
overDateLine: string;
|
|
98
|
+
revertSuccess: string;
|
|
97
99
|
}>;
|
|
98
100
|
/** Optional; Portal instance */
|
|
99
101
|
accessor portal: Portal | undefined;
|