-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
192 lines (177 loc) · 4.48 KB
/
Copy pathtypes.ts
File metadata and controls
192 lines (177 loc) · 4.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
/**
* Agent Script Types
* Based on Salesforce Agent Script Recipes
* @see https://developer.salesforce.com/sample-apps/agent-script-recipes/getting-started/overview
*/
/**
* Agent Script Config Block
* Defines agent metadata and configuration
*/
export interface AgentScriptConfig {
agent_name?: string
developer_name: string
default_agent_user?: string
description?: string
}
/**
* Agent Script System Block
* Defines global settings and instructions
*/
export interface AgentScriptSystemBlock {
instructions: string
messages?: {
welcome?: string
error?: string
[key: string]: string | undefined
}
system_instructions?: string
}
/**
* Agent Script Variable Declaration
* Defines state management
*/
export interface AgentScriptVariable {
type: "string" | "number" | "boolean" | "object" | "array"
mutable: boolean
linked?: boolean
default?: string | number | boolean | Record<string, unknown> | unknown[]
description?: string
}
/**
* Agent Script Language Block
* Defines locale configuration
*/
export interface AgentScriptLanguageBlock {
default_locale: string
additional_locales?: string
all_additional_locales?: boolean
}
/**
* Agent Script Action Definition
* Defines external integrations (Flow, Apex, API)
*/
export interface AgentScriptActionDefinition {
description: string
inputs?: Record<string, string>
outputs?: Record<
string,
string | { description?: string; [key: string]: unknown }
>
target: string // flow://, apex://, or API endpoint
}
/**
* Agent Script Reasoning Action
* Actions available to LLM in reasoning block
*/
export interface AgentScriptReasoningAction {
action?: string // Action reference like @actions.action_name
description?: string
available_when?: string // Conditional availability
with?: Record<string, unknown> // Input bindings
set?: Record<string, unknown> // Output mappings
}
/**
* Agent Script Reasoning Block
* Defines topic behavior and available actions
*/
export interface AgentScriptReasoningBlock {
instructions?: string | string[] // Can use -> for procedural instructions
actions?: Record<string, AgentScriptReasoningAction | string>
before_reasoning?: string // Lifecycle hook
after_reasoning?: string // Lifecycle hook
}
/**
* Agent Script Topic Block
* Defines individual topics with reasoning and actions
*/
export interface AgentScriptTopicBlock {
description: string
reasoning?: AgentScriptReasoningBlock
actions?: Record<string, AgentScriptActionDefinition>
system_instructions?: string // Topic-specific system override
}
/**
* Complete Agent Script Structure
* Following official Salesforce Agent Script format
*/
export interface AgentScriptStructure {
config: AgentScriptConfig
system: AgentScriptSystemBlock
variables?: Record<string, AgentScriptVariable>
language?: AgentScriptLanguageBlock
start_agent?: AgentScriptTopicBlock
[topicName: string]: unknown // Dynamic topic blocks
}
/**
* Agent Script Generation Options
*/
export interface AgentScriptGenerationOptions {
includeComments?: boolean
includeExamples?: boolean
yamlIndent?: number
generateVariables?: boolean
includeLanguageConfig?: boolean
}
/**
* Abstract interfaces for planner data structures
* These replace the Salesforce model dependencies
*/
/**
* Represents a variable/attribute definition
*/
export interface PlannerVariable {
Id?: string
DeveloperName?: string
parameterName?: string
mappingType?: string
description?: string
}
/**
* Represents an action/function definition
*/
export interface PlannerAction {
Id?: string
DeveloperName?: string
MasterLabel?: string
Description?: string
InvocationTarget?: string
InvocationTargetType?: string
Source?: string
Metadata?: {
inputs?: Record<string, string>
outputs?: Record<string, string | Record<string, unknown>>
[key: string]: unknown
}
}
/**
* Represents a topic/plugin definition
*/
export interface PlannerTopic {
Id?: string
DeveloperName?: string
MasterLabel?: string
Description?: string
Scope?: string
actions?: PlannerAction[]
Metadata?: {
description?: string
scope?: string
[key: string]: unknown
}
}
/**
* Represents a planner definition
* This is the main input to the generator
*/
export interface PlannerDefinition {
Id?: string
MasterLabel?: string
DeveloperName?: string
topics?: PlannerTopic[]
actions?: PlannerAction[]
variables?: PlannerVariable[]
Metadata?: {
description?: string
[key: string]: unknown
}
}