agentlang 0.3.7 → 0.3.8

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 (73) hide show
  1. package/README.md +20 -16
  2. package/out/extension/main.cjs +250 -250
  3. package/out/extension/main.cjs.map +2 -2
  4. package/out/language/agentlang-validator.d.ts.map +1 -1
  5. package/out/language/agentlang-validator.js +1 -0
  6. package/out/language/agentlang-validator.js.map +1 -1
  7. package/out/language/generated/ast.d.ts +21 -1
  8. package/out/language/generated/ast.d.ts.map +1 -1
  9. package/out/language/generated/ast.js +31 -2
  10. package/out/language/generated/ast.js.map +1 -1
  11. package/out/language/generated/grammar.d.ts.map +1 -1
  12. package/out/language/generated/grammar.js +306 -127
  13. package/out/language/generated/grammar.js.map +1 -1
  14. package/out/language/main.cjs +833 -632
  15. package/out/language/main.cjs.map +3 -3
  16. package/out/language/parser.d.ts +3 -2
  17. package/out/language/parser.d.ts.map +1 -1
  18. package/out/language/parser.js +1 -1
  19. package/out/language/parser.js.map +1 -1
  20. package/out/language/syntax.d.ts +7 -0
  21. package/out/language/syntax.d.ts.map +1 -1
  22. package/out/language/syntax.js +15 -0
  23. package/out/language/syntax.js.map +1 -1
  24. package/out/runtime/agents/common.d.ts +7 -2
  25. package/out/runtime/agents/common.d.ts.map +1 -1
  26. package/out/runtime/agents/common.js +22 -8
  27. package/out/runtime/agents/common.js.map +1 -1
  28. package/out/runtime/auth/cognito.d.ts +2 -0
  29. package/out/runtime/auth/cognito.d.ts.map +1 -1
  30. package/out/runtime/auth/cognito.js +84 -0
  31. package/out/runtime/auth/cognito.js.map +1 -1
  32. package/out/runtime/auth/interface.d.ts +1 -0
  33. package/out/runtime/auth/interface.d.ts.map +1 -1
  34. package/out/runtime/loader.d.ts.map +1 -1
  35. package/out/runtime/loader.js +64 -20
  36. package/out/runtime/loader.js.map +1 -1
  37. package/out/runtime/module.d.ts.map +1 -1
  38. package/out/runtime/module.js +26 -16
  39. package/out/runtime/module.js.map +1 -1
  40. package/out/runtime/modules/ai.d.ts.map +1 -1
  41. package/out/runtime/modules/ai.js +6 -1
  42. package/out/runtime/modules/ai.js.map +1 -1
  43. package/out/runtime/modules/auth.d.ts +1 -0
  44. package/out/runtime/modules/auth.d.ts.map +1 -1
  45. package/out/runtime/modules/auth.js +33 -1
  46. package/out/runtime/modules/auth.js.map +1 -1
  47. package/out/runtime/modules/files.d.ts +18 -0
  48. package/out/runtime/modules/files.d.ts.map +1 -0
  49. package/out/runtime/modules/files.js +116 -0
  50. package/out/runtime/modules/files.js.map +1 -0
  51. package/out/setupClassic.d.ts +98 -0
  52. package/out/setupClassic.d.ts.map +1 -0
  53. package/out/setupClassic.js +38 -0
  54. package/out/setupClassic.js.map +1 -0
  55. package/out/setupCommon.d.ts +2 -0
  56. package/out/setupCommon.d.ts.map +1 -0
  57. package/out/setupCommon.js +33 -0
  58. package/out/setupCommon.js.map +1 -0
  59. package/out/setupExtended.d.ts +40 -0
  60. package/out/setupExtended.d.ts.map +1 -0
  61. package/out/setupExtended.js +67 -0
  62. package/out/setupExtended.js.map +1 -0
  63. package/package.json +1 -1
  64. package/src/language/agentlang-validator.ts +1 -0
  65. package/src/language/agentlang.langium +7 -3
  66. package/src/language/generated/ast.ts +54 -4
  67. package/src/language/generated/grammar.ts +306 -127
  68. package/src/language/parser.ts +1 -1
  69. package/src/language/syntax.ts +21 -0
  70. package/src/runtime/agents/common.ts +30 -9
  71. package/src/runtime/loader.ts +64 -18
  72. package/src/runtime/module.ts +25 -16
  73. package/src/runtime/modules/ai.ts +5 -1
package/README.md CHANGED
@@ -136,7 +136,9 @@ agent TicketFlow {
136
136
  }
137
137
 
138
138
  directive TicketFlow {
139
- "if": "the context indicates the ticket as handled", "then": "set status to done"
139
+ if ("the context indicates the ticket as handled") {
140
+ "set status to done"
141
+ }
140
142
  }
141
143
  ```
142
144
 
@@ -203,8 +205,8 @@ agent salaryHikeAgent {
203
205
  tools acme/employee
204
206
  }
205
207
 
206
- directive salaryHikeAgent.hike5p {"if": "employee sales exceeded 5000", "then": "Give a salary hike of 5 percent"}
207
- directive salaryHikeAgent.hike2p {"if": "sales is more than 2000 but less than 5000", "then": "hike salary by 2 percent"}
208
+ directive salaryHikeAgent.hike5p { if ("employee sales exceeded 5000") { "Give a salary hike of 5 percent" }}
209
+ directive salaryHikeAgent.hike2p { if ("sales is more than 2000 but less than 5000") { "hike salary by 2 percent" }}
208
210
  ```
209
211
 
210
212
  As the `salaryHikeAgent` tries to compute the salary-increment for a particular employee, the directives will guide it to take a more accurate decision based on specific conditions.
@@ -219,14 +221,16 @@ agent salaryHikeAgent {
219
221
  tools acme/employee
220
222
  }
221
223
 
222
- directive salaryHikeAgent.hike5p {"if": "employee sales exceeded 5000", "then": "Give a salary hike of 5 percent"}
223
- directive salaryHikeAgent.hike2p {"if": "sales is more than 2000 but less than 5000", "then": "hike salary by 2 percent"}
224
+ directive salaryHikeAgent.hike5p { if ("employee sales exceeded 5000") { "Give a salary hike of 5 percent" }}
225
+ directive salaryHikeAgent.hike2p { if ("sales is more than 2000 but less than 5000") { "hike salary by 2 percent" }}
224
226
 
225
227
  scenario salaryHikeAgent.outperform {
226
- user "Jake's sale exceeded 5000"
228
+ if ("Jake's sale exceeded 5000") {
229
+ handleOutperform
230
+ }
227
231
  }
228
232
 
229
- workflow salaryHikeAgent.outperform {
233
+ workflow handleOutperform {
230
234
  {acme/employee {email? "jake@acme.com"}} @as [employee];
231
235
  {acme/employee {id? employee.id,
232
236
  salary employee.salary + employee.salary * 0.5}}
@@ -247,21 +251,21 @@ agent campaignAnalyzer {
247
251
  }
248
252
 
249
253
  glossaryEntry campaignAnalyzer.entry1 {
250
- "name": "outstanding",
251
- "meaning": "CTR ≥ 5%, Conversion Rate ≥ 10%, ROI ≥ 50%",
252
- "synonyms": "exceptional, high-impact"
254
+ word "outstanding",
255
+ meaning "CTR ≥ 5%, Conversion Rate ≥ 10%, ROI ≥ 50%",
256
+ synonyms "exceptional, high-impact"
253
257
  }
254
258
 
255
259
  glossaryEntry campaignAnalyzer.entry2 {
256
- "name": "satisfactory",
257
- "meaning": "CTR 2-4.9%, Conversion Rate 5-9.9%, ROI 20-49%",
258
- "synonyms": "solid, effective"
260
+ word "satisfactory",
261
+ meaning "CTR 2-4.9%, Conversion Rate 5-9.9%, ROI 20-49%",
262
+ synonyms "solid, effective"
259
263
  }
260
264
 
261
265
  glossaryEntry campaignAnalyzer.entry3 {
262
- "name": "underperforming",
263
- "meaning": "CTR < 2%, Conversion Rate < 5%, ROI < 20%",
264
- "synonyms": "needs improvement, low-impact"
266
+ word "underperforming",
267
+ meaning "CTR < 2%, Conversion Rate < 5%, ROI < 20%",
268
+ synonyms "needs improvement, low-impact"
265
269
  }
266
270
  ```
267
271