@arcgis/ai-orchestrator 5.0.0-next.133

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/LICENSE.md +17 -0
  2. package/README.md +11 -0
  3. package/dist/commonFunctions/vectorSearchFields.d.ts +2 -0
  4. package/dist/commonFunctions/vectorSearchLayers.d.ts +4 -0
  5. package/dist/dispatcherAgent/dispatcherGraph.d.ts +3 -0
  6. package/dist/dispatcherAgent/nodes/executeRegisteredAgent.d.ts +3 -0
  7. package/dist/dispatcherAgent/nodes/exit.d.ts +3 -0
  8. package/dist/dispatcherAgent/nodes/ingestInput.d.ts +3 -0
  9. package/dist/dispatcherAgent/nodes/intentDispatcher.d.ts +2 -0
  10. package/dist/dispatcherAgent/nodes/intentLLM.d.ts +3 -0
  11. package/dist/dispatcherAgent/reducers/commonReducers.d.ts +1 -0
  12. package/dist/dispatcherAgent/state/dispatcherGraphState.d.ts +8 -0
  13. package/dist/embeddings.worker-19IRaTB4.js +23 -0
  14. package/dist/field_descriptions_prompt-haMV_aoG.js +111 -0
  15. package/dist/hitl/InterruptHandler.d.ts +30 -0
  16. package/dist/hitl/types.d.ts +24 -0
  17. package/dist/index.d.ts +6 -0
  18. package/dist/index.js +8328 -0
  19. package/dist/intent_prompt-BjOozjFv.js +20 -0
  20. package/dist/layer_descriptions_prompt-NAaKWdJi.js +58 -0
  21. package/dist/llm/generateFieldDescriptions.d.ts +8 -0
  22. package/dist/llm/generateLayerAndFieldDescription.d.ts +7 -0
  23. package/dist/llm/generateLayerDescriptions.d.ts +22 -0
  24. package/dist/models/modelConfig.d.ts +28 -0
  25. package/dist/models/types.d.ts +2 -0
  26. package/dist/orchestrator/orchestrator.d.ts +70 -0
  27. package/dist/orchestrator/orchestratorEvents.d.ts +60 -0
  28. package/dist/prompts/getPrompt.d.ts +6 -0
  29. package/dist/providers/arcgis/aiUtilityService.d.ts +3 -0
  30. package/dist/providers/azure/azureChat.d.ts +6 -0
  31. package/dist/providers/azure/promptChain.d.ts +32 -0
  32. package/dist/providers/azure/sanitizedFetch.d.ts +5 -0
  33. package/dist/registry/agentRegistry.d.ts +26 -0
  34. package/dist/services/fieldSearch.d.ts +20 -0
  35. package/dist/services/layerSearch.d.ts +20 -0
  36. package/dist/signals/index.d.ts +24 -0
  37. package/dist/types/types.d.ts +55 -0
  38. package/dist/utils/cleanHistory.d.ts +2 -0
  39. package/dist/utils/contextSelectors.d.ts +10 -0
  40. package/dist/workers/embeddings.worker.d.ts +1 -0
  41. package/dist/workers/embeddingsWorkerSetup.d.ts +6 -0
  42. package/package.json +27 -0
@@ -0,0 +1,111 @@
1
+ const e = `You are a knowledgeable GIS expert.
2
+
3
+ You are given a Feature Service description and title.
4
+
5
+ {existingItemTitle}
6
+ {existingItemDescription}
7
+
8
+ You are given Feature Layer descriptions and title.
9
+
10
+ {existingLayerTitle}
11
+ {existingLayerDescription}
12
+
13
+ ## Existing field descriptions:
14
+
15
+ Here is an extensive list of fields with their existing descriptions. These fields together represent a summary of the data contained in this feature layer. NOTE that these field descriptions are not final and may need to be improved.
16
+ Some fields will have summary statistics, which are also included in the field descriptions. Statistics can help you decipher the type of data better.
17
+
18
+ {fieldInformation}
19
+
20
+ Your task is to generate the following for each field:
21
+
22
+ 1. field_description: A short description of the field.
23
+ 2. field_value_type: Field Value Type
24
+ 3. field_alias: A display name that concisely conveys the field contents to help readers understand the data
25
+
26
+ ## Instructions to generate Field Description:
27
+
28
+ - You must generate a field description for each field in the feature layer.
29
+ - You must not skip any field.
30
+ - If you think the existing field description is good, you must still add it in your response.
31
+ - If the existing field description is empty, you must generate a new field description.
32
+ - The field description should be a short description of the field.
33
+ - If the existing field description has units, you should include them in the new field description.
34
+ - If the existing field description is not clear, you should improve it.
35
+ - Do not have duplicate field descriptions. Always keep the one that is the best.
36
+
37
+ ## Instructions to determine Field Value Type:
38
+
39
+ Following is a list of field value types you can assign to a field in a feature layer. Each field value type is used to define the kind of data that can be stored in that field. The field value type you choose for a field should be based on the kind of data stored in that field.
40
+
41
+ - NAME_OR_TITLE:
42
+ Text that represents a name, title, label, or keyword for each feature.
43
+
44
+ - DESCRIPTION:
45
+ Text that provides a longer description of the feature, more than just a name or title.
46
+
47
+ For example, if you have a layer to collect information from the public regarding issues in the community, a field in that layer that allows people to specify the nature of the issue can be defined with the Description field value type.
48
+
49
+ - TYPE_OR_CATEGORY:
50
+ Field values represent types or categories for group features that are based on a common characteristic, for example, soil type, zoning code, species, or asset type.
51
+
52
+ - COUNT_OR_AMOUNT:
53
+ Integers (no decimal) that represent the quantity of a specific attribute.
54
+
55
+ - PERCENTAGE_OR_RATIO:
56
+ Number values in this field reflect the relationship between different quantities, for example, the percentage of males in a population or the ratio between the number of males and females.
57
+
58
+ - MEASUREMENT:
59
+ A number that reflects a characteristic that you can precisely measure, for example, elevation, distance, temperature, or age.
60
+
61
+ - CURRENCY:
62
+ A number that represents monetary values.
63
+
64
+ - UNIQUE_IDENTIFIER:
65
+ The values in this field are used to positively distinguish one feature or entity from another, for example, an assessor's parcel number, a membership ID, or an invoice number.
66
+
67
+ Each value per entity must be unique, but that does not necessarily mean all the values in this field will be unique for the layer.
68
+
69
+ For example, if you have two layers—one for employees and one for job sites—both can contain an employee ID unique identifier field. In the employees layer, the employee ID field should contain unique values. In the job sites layer, the employee ID field can contain duplicate values, as an employee may work at multiple job sites. The employee ID field in the job sites layer is still a unique identifier because it distinguishes one employee from another, even though the field does not contain unique values in the job sites layer.
70
+
71
+ - PHONE_NUMBER:
72
+ This field stores phone numbers.
73
+
74
+ - EMAIL_ADDRESS:
75
+ This field stores email address strings.
76
+
77
+ - ORDERED_OR_RANKED_LIST:
78
+ The values in this field represent a feature's status in an ordered or ranked list. For example, a feature can be one of the following:
79
+
80
+ Small, medium, or large
81
+ First, second, third, or fourth
82
+ Informational, warning, error, or failure
83
+
84
+ - BINARY
85
+ Only one of two values are possible for each feature. Examples include the following:
86
+
87
+ On or off
88
+ Yes or no
89
+ True or false
90
+ Inhabited or vacant
91
+
92
+ - LOCATION_OR_PLACE_NAME:
93
+ Values in this field represent a geographic location. Examples include a street address, city name, region, building name (such as A.K. Smiley Public Library), attraction name (such as Alameda County Fairgrounds or Cairngorms National Park), postal code, or country.
94
+
95
+ - COORDINATE:
96
+ These fields store a geographic coordinate value such as x, y, z, latitude, or longitude.
97
+
98
+ - DATE_AND_TIME:
99
+ Values in this field store explicit dates and times or date references such as days of the week, months, or years.
100
+
101
+ - OTHER:
102
+ If a field does not fit any of the above categories, you can assign it to the "OTHER" category.
103
+
104
+ If a field already has a field value type assigned, you MUST use that value type.
105
+ If a field already has a field description assigned, you MUST use it in order to determine a fitting field value type and field alias. You can improve the field description if you think it is necessary.
106
+ If a field already has a field alias assigned, you must use it in order to determine a fitting field description. You can improve the field alias if you think it is necessary.
107
+ If a field does not have a field description, field value type, or field alias assigned, you must generate them based on the field name and the data type of the field. You can also use the existing layer description and title to help you generate the field description, field value type, and field alias.
108
+ `;
109
+ export {
110
+ e as default
111
+ };
@@ -0,0 +1,30 @@
1
+ import { RunnableConfig } from '@langchain/core/runnables';
2
+ import { StreamEvent } from '@langchain/core/tracers/log_stream';
3
+ import { CompiledGraph } from '@langchain/langgraph';
4
+ import { UiInterrupt } from './types';
5
+ /**
6
+ * Handles human-in-the-loop interruptions and resumes a compiled LangGraph
7
+ * once the UI provides a response.
8
+ */
9
+ export declare class InterruptHandler<T extends string = string> {
10
+ private graph;
11
+ private readonly config;
12
+ private resolveWait?;
13
+ private rejectWait?;
14
+ /**
15
+ * Create a new InterruptHandler tied to a specific compiled graph and config.
16
+ */
17
+ constructor(graph: CompiledGraph<T>, config: RunnableConfig);
18
+ /**
19
+ * Returns a promise that resolves when the user provides a HITL response.
20
+ */
21
+ waitForUser(): Promise<AsyncIterable<StreamEvent>>;
22
+ /**
23
+ * Resume graph execution after the UI responds to an interrupt.
24
+ */
25
+ handle(interrupt: UiInterrupt, payload: unknown): void;
26
+ /**
27
+ * Abort the HITL wait and reject any pending continuation.
28
+ */
29
+ cancel(): void;
30
+ }
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Represents a user-facing interruption emitted by an agent that requires
3
+ * input before execution can continue.
4
+ *
5
+ * Used to pause an agent flow and request clarification, confirmation,
6
+ * or additional information from the user.
7
+ */
8
+ export interface UiInterrupt {
9
+ /** Unique identifier for this interrupt instance */
10
+ id: string;
11
+ /** Identifier of the agent requesting input (e.g. "navigation", "layerFilter") */
12
+ agentId: string;
13
+ /** Type of input being requested */
14
+ kind: "booleanChoice" | "multipleSelection" | "singleSelection" | "textInput";
15
+ /** Optional message shown to the user */
16
+ message?: string;
17
+ /** Additional data required to render or handle the interrupt */
18
+ metadata?: unknown;
19
+ }
20
+ export interface HITLResponse {
21
+ id: string;
22
+ agentId: string;
23
+ payload: unknown;
24
+ }
@@ -0,0 +1,6 @@
1
+ export { Orchestrator } from './orchestrator/orchestrator';
2
+ export { sendTraceMessage, sendUXSuggestion } from './signals';
3
+ export { invokeTextPrompt, invokeStructuredPrompt, invokeToolPrompt } from './providers/azure/promptChain';
4
+ export type { CustomConfigurableType, VectorSearchFieldResults, LayersAndFieldsRegistry, Services, FieldInfo, FieldStatistics, ChatHistory, } from './types/types';
5
+ export type { UiInterrupt } from './hitl/types';
6
+ export type { AgentRegistration, AgentWithContext } from './registry/agentRegistry';