agentlang 0.0.18 → 0.0.20

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 (104) hide show
  1. package/out/cli/main.d.ts.map +1 -1
  2. package/out/cli/main.js +35 -6
  3. package/out/cli/main.js.map +1 -1
  4. package/out/language/generated/ast.d.ts +23 -4
  5. package/out/language/generated/ast.d.ts.map +1 -1
  6. package/out/language/generated/ast.js +29 -1
  7. package/out/language/generated/ast.js.map +1 -1
  8. package/out/language/generated/grammar.d.ts.map +1 -1
  9. package/out/language/generated/grammar.js +251 -171
  10. package/out/language/generated/grammar.js.map +1 -1
  11. package/out/language/main.cjs +271 -172
  12. package/out/language/main.cjs.map +2 -2
  13. package/out/language/parser.d.ts +1 -0
  14. package/out/language/parser.d.ts.map +1 -1
  15. package/out/language/parser.js +25 -9
  16. package/out/language/parser.js.map +1 -1
  17. package/out/runtime/agents/common.d.ts +1 -1
  18. package/out/runtime/agents/common.d.ts.map +1 -1
  19. package/out/runtime/agents/common.js +4 -1
  20. package/out/runtime/agents/common.js.map +1 -1
  21. package/out/runtime/agents/impl/anthropic.d.ts +54 -0
  22. package/out/runtime/agents/impl/anthropic.d.ts.map +1 -1
  23. package/out/runtime/agents/impl/anthropic.js +109 -3
  24. package/out/runtime/agents/impl/anthropic.js.map +1 -1
  25. package/out/runtime/auth/cognito.d.ts +1 -1
  26. package/out/runtime/auth/cognito.d.ts.map +1 -1
  27. package/out/runtime/auth/cognito.js +1 -1
  28. package/out/runtime/auth/cognito.js.map +1 -1
  29. package/out/runtime/defs.d.ts +4 -0
  30. package/out/runtime/defs.d.ts.map +1 -1
  31. package/out/runtime/defs.js +8 -0
  32. package/out/runtime/defs.js.map +1 -1
  33. package/out/runtime/interpreter.d.ts.map +1 -1
  34. package/out/runtime/interpreter.js +87 -25
  35. package/out/runtime/interpreter.js.map +1 -1
  36. package/out/runtime/jsmodules.d.ts +0 -1
  37. package/out/runtime/jsmodules.d.ts.map +1 -1
  38. package/out/runtime/jsmodules.js +26 -34
  39. package/out/runtime/jsmodules.js.map +1 -1
  40. package/out/runtime/loader.d.ts.map +1 -1
  41. package/out/runtime/loader.js +58 -50
  42. package/out/runtime/loader.js.map +1 -1
  43. package/out/runtime/module.d.ts +2 -2
  44. package/out/runtime/module.d.ts.map +1 -1
  45. package/out/runtime/module.js +19 -3
  46. package/out/runtime/module.js.map +1 -1
  47. package/out/runtime/modules/ai.d.ts +1 -0
  48. package/out/runtime/modules/ai.d.ts.map +1 -1
  49. package/out/runtime/modules/ai.js +7 -1
  50. package/out/runtime/modules/ai.js.map +1 -1
  51. package/out/runtime/modules/core.js +1 -1
  52. package/out/runtime/modules/core.js.map +1 -1
  53. package/out/runtime/openapi.d.ts +16 -0
  54. package/out/runtime/openapi.d.ts.map +1 -0
  55. package/out/runtime/openapi.js +51 -0
  56. package/out/runtime/openapi.js.map +1 -0
  57. package/out/runtime/resolvers/interface.d.ts.map +1 -1
  58. package/out/runtime/resolvers/interface.js +11 -5
  59. package/out/runtime/resolvers/interface.js.map +1 -1
  60. package/out/runtime/resolvers/registry.d.ts +1 -2
  61. package/out/runtime/resolvers/registry.d.ts.map +1 -1
  62. package/out/runtime/resolvers/registry.js +2 -1
  63. package/out/runtime/resolvers/registry.js.map +1 -1
  64. package/out/runtime/state.d.ts +23 -0
  65. package/out/runtime/state.d.ts.map +1 -1
  66. package/out/runtime/state.js +7 -0
  67. package/out/runtime/state.js.map +1 -1
  68. package/out/runtime/util.d.ts +1 -0
  69. package/out/runtime/util.d.ts.map +1 -1
  70. package/out/runtime/util.js +20 -0
  71. package/out/runtime/util.js.map +1 -1
  72. package/out/syntaxes/agentlang.monarch.js +1 -1
  73. package/out/syntaxes/agentlang.monarch.js.map +1 -1
  74. package/package.json +3 -6
  75. package/src/cli/main.ts +34 -6
  76. package/src/language/agentlang.langium +9 -3
  77. package/src/language/generated/ast.ts +55 -4
  78. package/src/language/generated/grammar.ts +251 -171
  79. package/src/language/parser.ts +30 -9
  80. package/src/runtime/agents/common.ts +4 -1
  81. package/src/runtime/agents/impl/anthropic.ts +190 -4
  82. package/src/runtime/auth/cognito.ts +1 -1
  83. package/src/runtime/defs.ts +12 -0
  84. package/src/runtime/interpreter.ts +87 -24
  85. package/src/runtime/jsmodules.ts +26 -37
  86. package/src/runtime/loader.ts +63 -55
  87. package/src/runtime/module.ts +27 -3
  88. package/src/runtime/modules/ai.ts +8 -2
  89. package/src/runtime/modules/core.ts +1 -1
  90. package/src/runtime/openapi.ts +74 -0
  91. package/src/runtime/resolvers/interface.ts +14 -9
  92. package/src/runtime/resolvers/registry.ts +3 -2
  93. package/src/runtime/state.ts +9 -0
  94. package/src/runtime/util.ts +22 -0
  95. package/src/syntaxes/agentlang.monarch.ts +1 -1
  96. package/out/cli/docs.d.ts +0 -2
  97. package/out/cli/docs.d.ts.map +0 -1
  98. package/out/cli/docs.js +0 -236
  99. package/out/cli/docs.js.map +0 -1
  100. package/out/cli/openapi-docs.yml +0 -695
  101. package/out/index.d.ts +0 -19
  102. package/out/index.d.ts.map +0 -1
  103. package/out/index.js +0 -25
  104. package/out/index.js.map +0 -1
@@ -7,5 +7,6 @@ export declare function parseModule(moduleDef: string): Promise<ModuleDefinition
7
7
  export declare function parseStatement(stmt: string): Promise<Statement>;
8
8
  export declare function parseStatements(stmts: string[]): Promise<Statement[]>;
9
9
  export declare function parseWorkflow(workflowDef: string): Promise<WorkflowDefinition>;
10
+ export declare function maybeGetValidationErrors(document: LangiumDocument): string[] | undefined;
10
11
  export declare function introspect(s: string): Promise<BasePattern[]>;
11
12
  //# sourceMappingURL=parser.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../src/language/parser.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAmB,mBAAmB,EAAE,eAAe,EAAO,MAAM,SAAS,CAAC;AAC9F,OAAO,EAgBL,gBAAgB,EAShB,SAAS,EACT,kBAAkB,EACnB,MAAM,oB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CAgB/D;AAGD,eAAO,MAAM,KAAK,UAnBP,MAAM,YAAY,GAAG,+CAmBsC,CAAC;AAEvE,wBAAsB,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAI9E;AAED,wBAAsB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,CAarE;AAED,wBAAsB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC,CAG3E;AAED,wBAAsB,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAOpF;AAED,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,eAAe,GAAG,MAAM,EAAE,GAAG,SAAS,CAyBxF;AASD,wBAAsB,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CA2BlE"}
@@ -52,16 +52,32 @@ export async function parseWorkflow(workflowDef) {
52
52
  throw new Error(`Failed to generate workflow from ${workflowDef}`);
53
53
  }
54
54
  }
55
+ export function maybeGetValidationErrors(document) {
56
+ var _a;
57
+ const validationErrors = ((_a = document.diagnostics) !== null && _a !== void 0 ? _a : []).filter(e => e.severity === 1);
58
+ const sls = new Set();
59
+ const scs = new Set();
60
+ if (validationErrors.length > 0) {
61
+ const lineErrs = new Array();
62
+ for (const validationError of validationErrors) {
63
+ if (!sls.has(validationError.range.start.line) &&
64
+ !scs.has(validationError.range.start.character)) {
65
+ const s = document.textDocument.getText(validationError.range);
66
+ lineErrs.push(`Error on line ${validationError.range.start.line + 1}, column ${validationError.range.start.character + 1}, unexpected token(s) '${s}'`);
67
+ sls.add(validationError.range.start.line);
68
+ scs.add(validationError.range.start.character);
69
+ }
70
+ }
71
+ return lineErrs;
72
+ }
73
+ else {
74
+ return undefined;
75
+ }
76
+ }
55
77
  function maybeRaiseParserErrors(document) {
56
- if (document.parseResult.lexerErrors.length > 0 || document.parseResult.parserErrors.length > 0) {
57
- const errs = [];
58
- document.parseResult.lexerErrors.forEach((v) => {
59
- errs.push(v.message);
60
- });
61
- document.parseResult.parserErrors.forEach((v) => {
62
- errs.push(v.message);
63
- });
64
- throw new Error(`There were parser errors: \n ${errs.join('\n')}`);
78
+ const errs = maybeGetValidationErrors(document);
79
+ if (errs) {
80
+ throw new Error(errs.join('\n'));
65
81
  }
66
82
  }
67
83
  export async function introspect(s) {
@@ -1 +1 @@
1
- {"version":3,"file":"parser.js","sourceRoot":"","sources":["../../src/language/parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAW,eAAe,EAAwC,GAAG,EAAE,MAAM,SAAS,CAAC;AAC9F,OAAO,EAQL,MAAM,EACN,OAAO,EACP,SAAS,EACT,SAAS,EACT,SAAS,EACT,UAAU,EACV,oBAAoB,GAarB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjF,OAAO,EAEL,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,cAAc,EACd,mBAAmB,EACnB,sBAAsB,EACtB,SAAS,EACT,cAAc,EACd,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,aAAa,CAAC;AAErB,IAAI,cAAc,GAAG,CAAC,CAAC;AAEvB,MAAM,UAAU,WAAW,CACzB,QAA6B;IAE7B,MAAM,QAAQ,GAAG,QAAQ,CAAC,gBAAgB,CAAC;IAC3C,MAAM,eAAe,GAAG,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,eAAe,CAAC;IAClE,OAAO,KAAK,EAAE,KAAa,EAAE,OAAa,EAAE,EAAE;;QAC5C,MAAM,GAAG,GAAG,GAAG,CAAC,KAAK,CACnB,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,mCAAI,WAAW,cAAc,EAAE,GAAG,MAAA,Q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H,CAAC;IACJ,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,SAAS,gBAAgB,CAAC,SAAiB;IACzC,OAAO,IAAI,aAAa,CAAC,iBAAiB,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC;AACjE,CAAC"}
@@ -1,2 +1,2 @@
1
- export declare const PlannerInstructions = "Agentlang is a very-high-level declarative language that makes it easy to define business applications as 'models'.\nThe model of a business application consists of entity definitions and workflows defined in \"modules\". \nA module is be encoded in a syntax inspired by JavaScript and JSON. Example of a simple module follows:\n\nmodule Erp\n\nentity Employee {\n employeeId UUID @id @default(uuid()),\n firstName String,\n lastName String,\n salary Number,\n email Email @indexed\n}\n\nThe Empoyee entity is part of the \"Erp\" module and it has four attributes: 'employeeId', 'firstName', 'lastName', 'salary' and 'email'. \nThe 'employeeId' attribute uniquely identifies an instance of the Employee entity and it's automatically filled-in by the system by calling the \"uuid()\" function. \nIn the place of the keyword 'entity', the keyword 'record' may also be used. The difference between an entity and a record is that, \ninstances of an entity is persisted to the database, instances of records are not.\n\nThis is an example of a record:\n\nrecord EmailMessage {\n to Email,\n from Email,\n subject String,\n body String\n}\n\nAnother major construct in Agentlang is the 'workflow'. Workflows contains JSON \"patterns\" that perform CRUD operations on entities. \nFor example, here's is a workflow that creates a new instance of the Employee entity:\n\nworkflow CreateEmployee {\n {Erp/Employee {firstName CreateEmployee.firstName,\n lastName CreateEmployee.lastName,\n salary CreateEmployee.salary,\n email CreateEmployee.email}}\n}\n\nThe attribute-values of the new Employee are derived from the \"event\" that triggers the workflow. In this example the event is called \"CreateEmployee\".\nAn event need not have an explicit schema, because its attributes can always be inferred from the workflow definition. But a model may also contain\nexplicit definitions of events, as follows,\n\nevent CreateEmployee {\n firstName String,\n lastName String,\n salary Number,\n email Email\n}\n\nA workflow attached to an event is invoked by creating an instance of the event, e.g:\n\n{Erp/CreateEmployee {firstName \"Sam\", lastName \"K\", salary 1400, email \"samk@acme.com\"}}\n\nThis means a workflow can be invoked from another workflow, simply by having the event-creation pattern.\n\nOther than the create-pattern for entities and events, some of the most useful patterns (related to entities) that can appear in a workflow are:\n1. Query - e.g: '{Erp/Employee {employeeId? \"56392e13-0d9a-42f7-b556-0d7cd9468a24\"}}'. The attributes by which the query happens must end with a '?' character.\n To lookup all instances of an entity, use the syntax: '{EntityName?: {}}'.\n2. Update - e.g: '{Erp/Employee {employeeId? \"56392e13-0d9a-42f7-b556-0d7cd9468a24\", firstName \"Joe\"}}'. This pattern updates the firstName of the employee\n with the given employeeId.\n3. Upsert - e.g: '{Erp/Employee {employeeId \"56392e13-0d9a-42f7-b556-0d7cd9468a24\", firstName \"Joe\"}, @upsert}'. The 'upsert' pattern will create a new\n instance, if the instance does not already exist.\n4. Delete - e.g: 'delete {Erp/Employee {employeeId? \"56392e13-0d9a-42f7-b556-0d7cd9468a24\"}}'\n\nThe default query operator is '=' (equals). So an expression like 'employeeId? \"56392e13-0d9a-42f7-b556-0d7cd9468a24\"' means,\n'where employeeId equals \"56392e13-0d9a-42f7-b556-0d7cd9468a24\"'. Other comparison operators has to be specified explicitly, as in\n'{age?< 50}' - which means 'where age less-than 50'. The comparison operators supported by a query pattern are:\n\n= - equals\n!= - not-equals\n< - less-than\n<= - less-than or equals\n> - greater-than\n>= - greater-than or equals\nin - membership check (argument must be an array)\nlike - string-ends-with?\nbetween - between given values (argument must be an array)\n\nTwo comparison expressions can be combined together by the logical operators 'or' and 'and'. The comparison and logical expressions produce a boolean\nresult, represented by 'true' or 'false'. A boolean value can be inversed by using the 'not' expression, e.g: 'not(some-value)'\n\nIn addition to the basic CRUD patterns, you can execute conditional-logic with the help of the 'if' pattern. An example follows,\n\nworkflow IncrementSalary {\n if (IncrementSalary.percentage > 10) {\n {Erp/Employee {employeeId IncrementSalary.employeeId, salary salary + salary * IncrementSalary.percentage}}\n } else {\n {Erp/Employee {employeeId IncrementSalary.employeeId, salary salary + 1500}}\n }\n}\n\nNote the value passed to the 'salary' attribute - it's an arithmetic expression. All normal arithmetic expressions are supported by workflow patterns.\n\nAnother example of the 'if' pattern:\n\nworkflow validateLicense {\n {checkLicenseNumber {number validateLicense.number}} @as response;\n if (response = \"ok\") {\n {license {number? validateLicense.number, status \"active\"}}\n } else {\n {license {number? validateLicense.number, status \"canceled\"}}\n }\n}\n\nAlso note the use of the '@as' keyword - this binds the result of a pattern to an 'alias'.\n\nA successful query pattern will return an array of instances. The 'for' pattern can be used to iterate over an array. An example follows:\n\nworkflow NotifyEmployees {\n {Erp/Employee {salary?> 1000}} @as employees;\n for emp in employees {\n {Erp/SendMail {email emp.email, body \"You are selected for an increment!\"}}\n }\n}\n\nHere the result of the query is bound to the alias named 'employees'. Any pattern can have an alias, including 'if' and 'for'. An alias can be used to refer to the attributes of the instance, \nvia the dot(.) notation. Aliases can also be used to destructure a query result - here's an example:\n\nworkflow FindFirstTwoEmployees {\n {Erp/Employee {salary?> 1000}} @as [emp1, emp2];\n [emp1, emp2]\n}\n\nThis alias will bind the first two instances to 'a' and 'b' and the rest of the instances to an array named 'xs':\n\n{SomeEntity {id?> 1}} @as [a, b, _, xs]\n\nExamples of binding aliases to 'if' and 'for':\n\nif (IncrementSalary.percentage > 10) {\n {Erp/Employee {employeeId IncrementSalary.employeeId, salary salary + salary * IncrementSalary.percentage}}\n} else {\n {Erp/Employee {employeeId IncrementSalary.employeeId, salary salary + 1500}}\n} @as emp\n\nfor emp in employees {\n {Erp/SendMail {email emp.email, body \"You are selected for an increment!\"}}\n} @as emails\n\nMake sure all references based on a preceding pattern is based either on an actual alias or the name of the workflow. For example, the following sequence of patterns\nare invalid, because the alias 'employee' is not defined:\n\n{Employee {id? 101}};\n{SendEmail {to employee.email, body \"hello\"}}\n\nA fix for the reference-error is shown below:\n\n{Employee {id? 101}} @as employee;\n{SendEmail {to employee.email, body \"hello\"}}\n\nKeep in mind that the only valid syntax for the 'if' condition is:\n\nif (<expr>) {\n <patterns>\n} else if (<expr>) {\n <patterns>\n} else {\n <patterns>\n}\n\nThe following usage is NOT valid:\n\n<pattern> if (<expr>)\n\nA pattern may execute asynchronously and its eventual result can be handled by patterns provided in the '@then' clause. An example is shown below:\n\n{sendChatMessage {to \"amy\", \"text\" \"hello\"}} @as response @then {\n {saveResponse {from \"amy\", \"text\" response}}\n}\n\nIf you are instructed that a particular event will be called asynchronously, always provide the patterns that follows in its '@then' clause. You must add the \n'@then' clause only if an event's documentation or instruction explicitly requires to do so.\n\nEntities in a module can be connected together in relationships. There are two types of relationships - 'contains' and 'between'.\n'Contains' relationship is for hierarchical data, as in a Library entity containing Books. 'Between' relationship is for graph-like data,\nlike two Profiles in a social media app is connected as friends. A 'between' relationship can be one of the following three types - 'one_one' (one-to-one),\n'one_many' (one-to-many) and 'many_many' (many-to-many), which is the default.\n\nThe following example shows how additional profile data for an employee could be defined as a new entity and attached to the Employee entity as a between-relationship:\n\nentity Profile {\n id UUID @id @default(uuid()),\n address String @optional,\n photo URL @optional,\n dateOfBirth DateTime @optional\n}\n\nrelationship EmployeeProfile between (Erp/Employee, Erp/Profile) @one_one\n\nThe '@one_one' annotation means exactly one Employee and Profile can be related to each other via 'EmployeeProfile'.\n\nHere's the 'CreateEmployee' workflow updated to create the Employee with the his/her Profile attached:\n\nworkflow CreateEmployee {\n {Erp/Employee {firstName CreateEmployee.firstName,\n lastName CreateEmployee.lastName,\n salary CreateEmployee.salary,\n email CreateEmployee.email},\n Erp/EmployeeProfile {Erp/Profile {address CreateEmployee.address,\n photo CreateEmployee.photo,\n dateOfBirth CreateEmployee.dateOfBirth}}}\n}\n\nThe following pattern can be user to query an Employee along with his Profile:\n\n{Erp/Employee {employeeId? \"56392e13-0d9a-42f7-b556-0d7cd9468a24\"},\n Erp/EmployeeProfile {Erp/Profile? {}}}\n\nAs an example of 'contains' relaionships, consider modelling task-assignments for an Employee as folllows:\n\nentity TaskAssignment {\n id UUID @id @default(uuid()),\n description String,\n assignmentDate DateTime @default(now())\n}\n\nrelationship EmployeeTaskAssignment contains (Erp/Employee, Erp/TaskAssignment)\n\nThe following workflow shows how to assign a new task to an Employee:\n\nworkflow AssignNewTask {\n {Erp/Employee {employeeId? AssignNewTask.employeeId},\n Erp/EmployeeTaskAssignment {Erp/TaskAssignment {description AssignNewTask.description}}}\n}\n\nThe following workflow queries an Employee along with all his tasks:\n\nworkflow GetEmployeeTaskAssignments {\n {Erp/Employee {employeeId? GetEmployeeTaskAssignments.employeeId},\n Erp/EmployeeTaskAssignment {Erp/TaskAssignment? {}}}\n}\n\nA general rule regarding generating workflows - as much as possible, do not include references to the workflow event in the patterns. Try to\nfill-in values from the available context. For example, if your instruction is \"create a workflow to send an email to employee 101 with this message - \n'please call me as soon as possible'\", the best workflow to return is:\n\nworkflow sendEmail {\n {employee {id? 101}} @as emp;\n {email {to emp.email body \"please call me as soon as possible\"}}\n}\n\nbecause all the information needed is available in the context. If the instruction is \"create a workflow to send an email by employee-id with this message - \n'please call me as soon as possible'\", then you can return:\n\nworkflow sendEmail {\n {employee {id? sendEmail.employeeId}} @as emp;\n {email {to emp.email body \"please call me as soon as possible\"}}\n}\n\nThe point is use the immediate context to fill-in values in generated patterns, as much as possible.\n\nAlso generate a workflow only if required explicitly by the user or the contextual information is incomplete. Otherwise, just return an array of patterns.\nAs an example, if the user request is \"send an email to employee 101 with this message - 'please call me as soon as possible'\", you must return:\n\n[{employee {id? 101}} @as emp;\n {email {to emp.email, body \"please call me as soon as possible\"}}]\n\nYou MUST separate each pattern in the array with a semi-colon (;) and never use a comma (,) for this purpose.\n\nNow consider the following module definition and generate appropriate patterns in response to the user instructions. You must return only valid patterns or workflows,\nno other descriptive text or comments are needed.\n";
1
+ export declare const PlannerInstructions = "Agentlang is a very-high-level declarative language that makes it easy to define business applications as 'models'.\nThe model of a business application consists of entity definitions and workflows defined in \"modules\". \nA module is be encoded in a syntax inspired by JavaScript and JSON. Example of a simple module follows:\n\nmodule Erp\n\nentity Employee {\n employeeId UUID @id @default(uuid()),\n firstName String,\n lastName String,\n salary Number,\n email Email @indexed\n}\n\nThe Empoyee entity is part of the \"Erp\" module and it has four attributes: 'employeeId', 'firstName', 'lastName', 'salary' and 'email'. \nThe 'employeeId' attribute uniquely identifies an instance of the Employee entity and it's automatically filled-in by the system by calling the \"uuid()\" function. \nIn the place of the keyword 'entity', the keyword 'record' may also be used. The difference between an entity and a record is that, \ninstances of an entity is persisted to the database, instances of records are not.\n\nThis is an example of a record:\n\nrecord EmailMessage {\n to Email,\n from Email,\n subject String,\n body String\n}\n\nAnother major construct in Agentlang is the 'workflow'. Workflows contains JSON \"patterns\" that perform CRUD operations on entities. \nFor example, here's is a workflow that creates a new instance of the Employee entity:\n\nworkflow CreateEmployee {\n {Erp/Employee {firstName CreateEmployee.firstName,\n lastName CreateEmployee.lastName,\n salary CreateEmployee.salary,\n email CreateEmployee.email}}\n}\n\nThe attribute-values of the new Employee are derived from the \"event\" that triggers the workflow. In this example the event is called \"CreateEmployee\".\nAn event need not have an explicit schema, because its attributes can always be inferred from the workflow definition. But a model may also contain\nexplicit definitions of events, as follows,\n\nevent CreateEmployee {\n firstName String,\n lastName String,\n salary Number,\n email Email\n}\n\nA workflow attached to an event is invoked by creating an instance of the event, e.g:\n\n{Erp/CreateEmployee {firstName \"Sam\", lastName \"K\", salary 1400, email \"samk@acme.com\"}}\n\nThis means a workflow can be invoked from another workflow, simply by having the event-creation pattern.\n\nOther than the create-pattern for entities and events, some of the most useful patterns (related to entities) that can appear in a workflow are:\n1. Query - e.g: '{Erp/Employee {employeeId? \"56392e13-0d9a-42f7-b556-0d7cd9468a24\"}}'. The attributes by which the query happens must end with a '?' character.\n To lookup all instances of an entity, use the syntax: '{EntityName?: {}}'.\n2. Update - e.g: '{Erp/Employee {employeeId? \"56392e13-0d9a-42f7-b556-0d7cd9468a24\", firstName \"Joe\"}}'. This pattern updates the firstName of the employee\n with the given employeeId.\n3. Upsert - e.g: '{Erp/Employee {employeeId \"56392e13-0d9a-42f7-b556-0d7cd9468a24\", firstName \"Joe\"}, @upsert}'. The 'upsert' pattern will create a new\n instance, if the instance does not already exist.\n4. Delete - e.g: 'delete {Erp/Employee {employeeId? \"56392e13-0d9a-42f7-b556-0d7cd9468a24\"}}'\n\nThe default query operator is '=' (equals). So an expression like 'employeeId? \"56392e13-0d9a-42f7-b556-0d7cd9468a24\"' means,\n'where employeeId equals \"56392e13-0d9a-42f7-b556-0d7cd9468a24\"'. Other comparison operators has to be specified explicitly, as in\n'{age?< 50}' - which means 'where age less-than 50'. The comparison operators supported by a query pattern are:\n\n= - equals\n!= - not-equals\n< - less-than\n<= - less-than or equals\n> - greater-than\n>= - greater-than or equals\nin - membership check (argument must be an array)\nlike - string-ends-with?\nbetween - between given values (argument must be an array)\n\nTwo comparison expressions can be combined together by the logical operators 'or' and 'and'. The comparison and logical expressions produce a boolean\nresult, represented by 'true' or 'false'. A boolean value can be inversed by using the 'not' expression, e.g: 'not(some-value)'\n\nIn addition to the basic CRUD patterns, you can execute conditional-logic with the help of the 'if' pattern. An example follows,\n\nworkflow IncrementSalary {\n if (IncrementSalary.percentage > 10) {\n {Erp/Employee {employeeId IncrementSalary.employeeId, salary salary + salary * IncrementSalary.percentage}}\n } else {\n {Erp/Employee {employeeId IncrementSalary.employeeId, salary salary + 1500}}\n }\n}\n\nNote the value passed to the 'salary' attribute - it's an arithmetic expression. All normal arithmetic expressions are supported by workflow patterns.\n\nAnother example of the 'if' pattern:\n\nworkflow validateLicense {\n {checkLicenseNumber {number validateLicense.number}} @as response;\n if (response = \"ok\") {\n {license {number? validateLicense.number, status \"active\"}}\n } else {\n {license {number? validateLicense.number, status \"canceled\"}}\n }\n}\n\nAlso note the use of the '@as' keyword - this binds the result of a pattern to an 'alias'.\n\nA successful query pattern will return an array of instances. The 'for' pattern can be used to iterate over an array. An example follows:\n\nworkflow NotifyEmployees {\n {Erp/Employee {salary?> 1000}} @as employees;\n for emp in employees {\n {Erp/SendMail {email emp.email, body \"You are selected for an increment!\"}}\n }\n}\n\nHere the result of the query is bound to the alias named 'employees'. Any pattern can have an alias, including 'if' and 'for'. An alias can be used to refer to the attributes of the instance, \nvia the dot(.) notation. Aliases can also be used to destructure a query result - here's an example:\n\nworkflow FindFirstTwoEmployees {\n {Erp/Employee {salary?> 1000}} @as [emp1, emp2];\n [emp1, emp2]\n}\n\nThis alias will bind the first two instances to 'a' and 'b' and the rest of the instances to an array named 'xs':\n\n{SomeEntity {id?> 1}} @as [a, b, _, xs]\n\nExamples of binding aliases to 'if' and 'for':\n\nif (IncrementSalary.percentage > 10) {\n {Erp/Employee {employeeId IncrementSalary.employeeId, salary salary + salary * IncrementSalary.percentage}}\n} else {\n {Erp/Employee {employeeId IncrementSalary.employeeId, salary salary + 1500}}\n} @as emp\n\nfor emp in employees {\n {Erp/SendMail {email emp.email, body \"You are selected for an increment!\"}}\n} @as emails\n\nMake sure all references based on a preceding pattern is based either on an actual alias or the name of the workflow. For example, the following sequence of patterns\nare invalid, because the alias 'employee' is not defined:\n\n{Employee {id? 101}};\n{SendEmail {to employee.email, body \"hello\"}}\n\nA fix for the reference-error is shown below:\n\n{Employee {id? 101}} @as [employee];\n{SendEmail {to employee.email, body \"hello\"}}\n\nNote that the alias for the query is '[employee]' so that the resultset is destructured to select exactly one instance of Employee \nselected into the reference. You must follow this pattern if your goal is to select exactly a single instance.\n\nKeep in mind that the only valid syntax for the 'if' condition is:\n\nif (<expr>) {\n <patterns>\n} else if (<expr>) {\n <patterns>\n} else {\n <patterns>\n}\n\nThe following usage is NOT valid:\n\n<pattern> if (<expr>)\n\nA pattern may execute asynchronously and its eventual result can be handled by patterns provided in the '@then' clause. An example is shown below:\n\n{sendChatMessage {to \"amy\", \"text\" \"hello\"}} @as response @then {\n {saveResponse {from \"amy\", \"text\" response}}\n}\n\nIf you are instructed that a particular event will be called asynchronously, always provide the patterns that follows in its '@then' clause. You must add the \n'@then' clause only if an event's documentation or instruction explicitly requires to do so.\n\nEntities in a module can be connected together in relationships. There are two types of relationships - 'contains' and 'between'.\n'Contains' relationship is for hierarchical data, as in a Library entity containing Books. 'Between' relationship is for graph-like data,\nlike two Profiles in a social media app is connected as friends. A 'between' relationship can be one of the following three types - 'one_one' (one-to-one),\n'one_many' (one-to-many) and 'many_many' (many-to-many), which is the default.\n\nThe following example shows how additional profile data for an employee could be defined as a new entity and attached to the Employee entity as a between-relationship:\n\nentity Profile {\n id UUID @id @default(uuid()),\n address String @optional,\n photo URL @optional,\n dateOfBirth DateTime @optional\n}\n\nrelationship EmployeeProfile between (Erp/Employee, Erp/Profile) @one_one\n\nThe '@one_one' annotation means exactly one Employee and Profile can be related to each other via 'EmployeeProfile'.\n\nHere's the 'CreateEmployee' workflow updated to create the Employee with the his/her Profile attached:\n\nworkflow CreateEmployee {\n {Erp/Employee {firstName CreateEmployee.firstName,\n lastName CreateEmployee.lastName,\n salary CreateEmployee.salary,\n email CreateEmployee.email},\n Erp/EmployeeProfile {Erp/Profile {address CreateEmployee.address,\n photo CreateEmployee.photo,\n dateOfBirth CreateEmployee.dateOfBirth}}}\n}\n\nThe following pattern can be user to query an Employee along with his Profile:\n\n{Erp/Employee {employeeId? \"56392e13-0d9a-42f7-b556-0d7cd9468a24\"},\n Erp/EmployeeProfile {Erp/Profile? {}}}\n\nAs an example of 'contains' relaionships, consider modelling task-assignments for an Employee as folllows:\n\nentity TaskAssignment {\n id UUID @id @default(uuid()),\n description String,\n assignmentDate DateTime @default(now())\n}\n\nrelationship EmployeeTaskAssignment contains (Erp/Employee, Erp/TaskAssignment)\n\nThe following workflow shows how to assign a new task to an Employee:\n\nworkflow AssignNewTask {\n {Erp/Employee {employeeId? AssignNewTask.employeeId},\n Erp/EmployeeTaskAssignment {Erp/TaskAssignment {description AssignNewTask.description}}}\n}\n\nThe following workflow queries an Employee along with all his tasks:\n\nworkflow GetEmployeeTaskAssignments {\n {Erp/Employee {employeeId? GetEmployeeTaskAssignments.employeeId},\n Erp/EmployeeTaskAssignment {Erp/TaskAssignment? {}}}\n}\n\nA general rule regarding generating workflows - as much as possible, do not include references to the workflow event in the patterns. Try to\nfill-in values from the available context. For example, if your instruction is \"create a workflow to send an email to employee 101 with this message - \n'please call me as soon as possible'\", the best workflow to return is:\n\nworkflow sendEmail {\n {employee {id? 101}} @as emp;\n {email {to emp.email body \"please call me as soon as possible\"}}\n}\n\nbecause all the information needed is available in the context. If the instruction is \"create a workflow to send an email by employee-id with this message - \n'please call me as soon as possible'\", then you can return:\n\nworkflow sendEmail {\n {employee {id? sendEmail.employeeId}} @as emp;\n {email {to emp.email body \"please call me as soon as possible\"}}\n}\n\nThe point is use the immediate context to fill-in values in generated patterns, as much as possible.\n\nAlso generate a workflow only if required explicitly by the user or the contextual information is incomplete. Otherwise, just return an array of patterns.\nAs an example, if the user request is \"send an email to employee 101 with this message - 'please call me as soon as possible'\", you must return:\n\n[{employee {id? 101}} @as emp;\n {email {to emp.email, body \"please call me as soon as possible\"}}]\n\nYou MUST separate each pattern in the array with a semi-colon (;) and never use a comma (,) for this purpose.\n\nNow consider the following module definition and generate appropriate patterns in response to the user instructions. You must return only valid patterns or workflows,\nno other descriptive text or comments are needed.\n";
2
2
  //# sourceMappingURL=common.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/runtime/agents/common.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,o5XAqQ/B,CAAC"}
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/runtime/agents/common.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,6oYAwQ/B,CAAC"}
@@ -145,9 +145,12 @@ are invalid, because the alias 'employee' is not defined:
145
145
 
146
146
  A fix for the reference-error is shown below:
147
147
 
148
- {Employee {id? 101}} @as employee;
148
+ {Employee {id? 101}} @as [employee];
149
149
  {SendEmail {to employee.email, body "hello"}}
150
150
 
151
+ Note that the alias for the query is '[employee]' so that the resultset is destructured to select exactly one instance of Employee
152
+ selected into the reference. You must follow this pattern if your goal is to select exactly a single instance.
153
+
151
154
  Keep in mind that the only valid syntax for the 'if' condition is:
152
155
 
153
156
  if (<expr>) {
@@ -1 +1 @@
1
- {"version":3,"file":"common.js","sourceRoot":"","sources":["../../../src/runtime/agents/common.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,mBAAmB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqQlC,CAAC"}
1
+ {"version":3,"file":"common.js","sourceRoot":"","sources":["../../../src/runtime/agents/common.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,mBAAmB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwQlC,CAAC"}
@@ -10,8 +10,57 @@ export interface AnthropicConfig {
10
10
  defaultHeaders?: Record<string, string>;
11
11
  [key: string]: any;
12
12
  };
13
+ /**
14
+ * Enable prompt caching to reuse context across API calls.
15
+ * This reduces latency and costs by caching static portions of prompts.
16
+ * Cache has a 5-minute lifetime by default, refreshed on each use.
17
+ * Minimum cacheable length: 1024 tokens for Claude 3.5+, 2048 for Haiku.
18
+ * Beta header: prompt-caching-2024-07-31
19
+ * @see https://docs.anthropic.com/en/docs/build-with-claude/prompt-caching
20
+ */
13
21
  enablePromptCaching?: boolean;
22
+ /**
23
+ * Cache control type for prompt caching.
24
+ * Currently only 'ephemeral' is supported with 5-minute TTL.
25
+ * Can be extended to 1-hour with extended-cache-ttl-2025-04-11 beta.
26
+ */
14
27
  cacheControl?: 'ephemeral';
28
+ /**
29
+ * Enable extended thinking mode for Claude to show its reasoning process.
30
+ * When enabled, responses include thinking blocks showing Claude's thought process.
31
+ * Requires minimum budgetTokens of 1024 and counts towards maxTokens.
32
+ * Useful for complex reasoning, problem-solving, and transparency.
33
+ * @see https://docs.anthropic.com/en/docs/build-with-claude/extended-thinking
34
+ */
35
+ enableThinking?: boolean;
36
+ /**
37
+ * Token budget for thinking mode (minimum 1024).
38
+ * Determines how many tokens Claude can use for internal reasoning.
39
+ * Larger budgets enable more thorough analysis for complex problems.
40
+ * Must be less than maxTokens.
41
+ */
42
+ budgetTokens?: number;
43
+ /**
44
+ * Enable extended output to generate up to 128,000 tokens in a single response.
45
+ * Useful for long-form content, detailed reports, extensive code generation.
46
+ * Beta header: output-128k-2025-02-19
47
+ * Note: Use streaming to avoid timeouts with long outputs.
48
+ */
49
+ enableExtendedOutput?: boolean;
50
+ /**
51
+ * Enable interleaved thinking to see Claude's reasoning in real-time during streaming.
52
+ * When combined with extended thinking, thinking blocks are streamed alongside content.
53
+ * Provides transparency into Claude's problem-solving process as it happens.
54
+ * Beta header: interleaved-thinking-2025-05-14
55
+ */
56
+ enableInterleavedThinking?: boolean;
57
+ /**
58
+ * Enable fine-grained tool streaming for more responsive tool use.
59
+ * Streams partial JSON updates and character-by-character tool parameters.
60
+ * Improves UI responsiveness when Claude invokes tools.
61
+ * Beta header: fine-grained-tool-streaming-2025-05-14
62
+ */
63
+ enableFineGrainedToolStreaming?: boolean;
15
64
  }
16
65
  export declare class AnthropicProvider implements AgentServiceProvider {
17
66
  private model;
@@ -19,6 +68,11 @@ export declare class AnthropicProvider implements AgentServiceProvider {
19
68
  constructor(config?: Map<string, any>);
20
69
  private parseConfig;
21
70
  invoke(messages: BaseMessage[]): Promise<AIResponse>;
71
+ /**
72
+ * Apply cache control to messages for prompt caching optimization.
73
+ * Caches system messages with substantial content (>1000 chars) to reduce costs.
74
+ * Cache hits cost 90% less than regular input tokens.
75
+ */
22
76
  private applyCacheControl;
23
77
  getConfig(): AnthropicConfig;
24
78
  updateConfig(newConfig: Partial<AnthropicConfig>): void;
@@ -1 +1 @@
1
- {"version":3,"file":"anthropic.d.ts","sourceRoot":"","sources":["../../../../src/runtime/agents/impl/anthropic.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,UAAU,EAAgB,MAAM,gBAAgB,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,MAAM,WAAW,eAAe;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE;QACd,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACxC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACpB,CAAC;IACF,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,YAAY,CAAC,EAAE,WAAW,CAAC;CAC5B;AAED,qBAAa,iBAAkB,YAAW,oBAAoB;IAC5D,OAAO,CAAC,KAAK,CAAgB;IAC7B,OAAO,CAAC,MAAM,CAAkB;gBAEpB,MAAM,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC;IA+BrC,OAAO,CAAC,WAAW;IAmCb,MAAM,CAAC,QAAQ,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;IAgB1D,OAAO,CAAC,iBAAiB;IA2BzB,SAAS,IAAI,eAAe;IAI5B,YAAY,CAAC,SAAS,E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AAG,OAAO,CAAC,UAAU,CAAC;IA2B1D;;;;OAIG;IACH,OAAO,CAAC,iBAAiB;IA2BzB,SAAS,IAAI,eAAe;IAI5B,YAAY,CAAC,SAAS,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,IAAI;CAwExD"}
@@ -16,8 +16,41 @@ export class AnthropicProvider {
16
16
  if (this.config.clientOptions) {
17
17
  chatConfig.clientOptions = this.config.clientOptions;
18
18
  }
19
+ // Configure beta headers based on enabled features
20
+ const betaFeatures = [];
21
+ // Prompt caching: Reuse static content across API calls
22
+ // Reduces costs by 90% for cached content, improves latency
19
23
  if (this.config.enablePromptCaching) {
20
- chatConfig.clientOptions = Object.assign(Object.assign({}, chatConfig.clientOptions), { defaultHeaders: Object.assign(Object.assign({}, (_a = chatConfig.clientOptions) === null || _a === void 0 ? void 0 : _a.defaultHeaders), { 'anthropic-beta': 'prompt-caching-2024-07-31' }) });
24
+ betaFeatures.push('prompt-caching-2024-07-31');
25
+ }
26
+ // Extended output: Generate up to 128k tokens (vs standard 8k)
27
+ // Essential for long-form content generation
28
+ if (this.config.enableExtendedOutput) {
29
+ betaFeatures.push('output-128k-2025-02-19');
30
+ }
31
+ // Interleaved thinking: Stream thinking blocks alongside regular content
32
+ // Shows Claude's reasoning process in real-time during streaming
33
+ if (this.config.enableInterleavedThinking) {
34
+ betaFeatures.push('interleaved-thinking-2025-05-14');
35
+ }
36
+ // Fine-grained tool streaming: Stream partial tool parameters
37
+ // Provides character-by-character updates for better UX
38
+ if (this.config.enableFineGrainedToolStreaming) {
39
+ betaFeatures.push('fine-grained-tool-streaming-2025-05-14');
40
+ }
41
+ if (betaFeatures.length > 0) {
42
+ chatConfig.clientOptions = Object.assign(Object.assign({}, chatConfig.clientOptions), { defaultHeaders: Object.assign(Object.assign({}, (_a = chatConfig.clientOptions) === null || _a === void 0 ? void 0 : _a.defaultHeaders), { 'anthropic-beta': betaFeatures.join(',') }) });
43
+ }
44
+ // Validate thinking configuration if enabled
45
+ // Thinking mode requires careful token budget management
46
+ if (this.config.enableThinking) {
47
+ // Validate budget tokens (minimum 1024 required by API)
48
+ const budgetTokens = Math.max(1024, this.config.budgetTokens || 1024);
49
+ // Ensure budget tokens don't exceed max tokens
50
+ // This prevents API errors and ensures proper token allocation
51
+ if (budgetTokens >= (this.config.maxTokens || 8192)) {
52
+ throw new Error(`budgetTokens (${budgetTokens}) must be less than maxTokens (${this.config.maxTokens || 8192})`);
53
+ }
21
54
  }
22
55
  this.model = new ChatAnthropic(chatConfig);
23
56
  }
@@ -30,6 +63,11 @@ export class AnthropicProvider {
30
63
  maxRetries: 2,
31
64
  enablePromptCaching: false,
32
65
  cacheControl: 'ephemeral',
66
+ enableThinking: false,
67
+ budgetTokens: 1024, // Minimum budget tokens for thinking mode
68
+ enableExtendedOutput: false,
69
+ enableInterleavedThinking: false,
70
+ enableFineGrainedToolStreaming: false,
33
71
  };
34
72
  if (!config) {
35
73
  return Object.assign(Object.assign({}, defaultConfig), { apiKey: process.env.ANTHROPIC_API_KEY });
@@ -44,6 +82,26 @@ export class AnthropicProvider {
44
82
  config.get('enable_prompt_caching') ||
45
83
  defaultConfig.enablePromptCaching,
46
84
  cacheControl: config.get('cacheControl') || config.get('cache_control') || defaultConfig.cacheControl,
85
+ enableThinking: config.get('enableThinking') ||
86
+ config.get('enable_thinking') ||
87
+ config.get('thinking') ||
88
+ defaultConfig.enableThinking,
89
+ budgetTokens: config.get('budgetTokens') ||
90
+ config.get('budget_tokens') ||
91
+ config.get('thinking_budget') ||
92
+ defaultConfig.budgetTokens,
93
+ enableExtendedOutput: config.get('enableExtendedOutput') ||
94
+ config.get('enable_extended_output') ||
95
+ config.get('extendedOutput') ||
96
+ defaultConfig.enableExtendedOutput,
97
+ enableInterleavedThinking: config.get('enableInterleavedThinking') ||
98
+ config.get('enable_interleaved_thinking') ||
99
+ config.get('interleavedThinking') ||
100
+ defaultConfig.enableInterleavedThinking,
101
+ enableFineGrainedToolStreaming: config.get('enableFineGrainedToolStreaming') ||
102
+ config.get('enable_fine_grained_tool_streaming') ||
103
+ config.get('fineGrainedToolStreaming') ||
104
+ defaultConfig.enableFineGrainedToolStreaming,
47
105
  apiKey,
48
106
  clientOptions: config.get('clientOptions') || config.get('client_options'),
49
107
  };
@@ -56,8 +114,23 @@ export class AnthropicProvider {
56
114
  if (this.config.enablePromptCaching && messages.length > 0) {
57
115
  processedMessages = this.applyCacheControl(messages);
58
116
  }
59
- return asAIResponse(await this.model.invoke(processedMessages));
117
+ // Add thinking configuration to the invoke options if enabled
118
+ // Thinking mode is passed as a parameter during invocation, not in constructor
119
+ const invokeOptions = {};
120
+ if (this.config.enableThinking) {
121
+ const budgetTokens = Math.max(1024, this.config.budgetTokens || 1024);
122
+ invokeOptions.thinking = {
123
+ type: 'enabled',
124
+ budget_tokens: budgetTokens,
125
+ };
126
+ }
127
+ return asAIResponse(await this.model.invoke(processedMessages, invokeOptions));
60
128
  }
129
+ /**
130
+ * Apply cache control to messages for prompt caching optimization.
131
+ * Caches system messages with substantial content (>1000 chars) to reduce costs.
132
+ * Cache hits cost 90% less than regular input tokens.
133
+ */
61
134
  applyCacheControl(messages) {
62
135
  // Apply cache control to the last system message if present
63
136
  // This follows Anthropic's recommendation to cache long context at the end of system messages
@@ -97,8 +170,41 @@ export class AnthropicProvider {
97
170
  if (this.config.clientOptions) {
98
171
  chatConfig.clientOptions = this.config.clientOptions;
99
172
  }
173
+ // Configure beta headers based on enabled features
174
+ const betaFeatures = [];
175
+ // Prompt caching: Reuse static content across API calls
176
+ // Reduces costs by 90% for cached content, improves latency
100
177
  if (this.config.enablePromptCaching) {
101
- chatConfig.clientOptions = Object.assign(Object.assign({}, chatConfig.clientOptions), { defaultHeaders: Object.assign(Object.assign({}, (_a = chatConfig.clientOptions) === null || _a === void 0 ? void 0 : _a.defaultHeaders), { 'anthropic-beta': 'prompt-caching-2024-07-31' }) });
178
+ betaFeatures.push('prompt-caching-2024-07-31');
179
+ }
180
+ // Extended output: Generate up to 128k tokens (vs standard 8k)
181
+ // Essential for long-form content generation
182
+ if (this.config.enableExtendedOutput) {
183
+ betaFeatures.push('output-128k-2025-02-19');
184
+ }
185
+ // Interleaved thinking: Stream thinking blocks alongside regular content
186
+ // Shows Claude's reasoning process in real-time during streaming
187
+ if (this.config.enableInterleavedThinking) {
188
+ betaFeatures.push('interleaved-thinking-2025-05-14');
189
+ }
190
+ // Fine-grained tool streaming: Stream partial tool parameters
191
+ // Provides character-by-character updates for better UX
192
+ if (this.config.enableFineGrainedToolStreaming) {
193
+ betaFeatures.push('fine-grained-tool-streaming-2025-05-14');
194
+ }
195
+ if (betaFeatures.length > 0) {
196
+ chatConfig.clientOptions = Object.assign(Object.assign({}, chatConfig.clientOptions), { defaultHeaders: Object.assign(Object.assign({}, (_a = chatConfig.clientOptions) === null || _a === void 0 ? void 0 : _a.defaultHeaders), { 'anthropic-beta': betaFeatures.join(',') }) });
197
+ }
198
+ // Validate thinking configuration if enabled
199
+ // Thinking mode requires careful token budget management
200
+ if (this.config.enableThinking) {
201
+ // Validate budget tokens (minimum 1024 required by API)
202
+ const budgetTokens = Math.max(1024, this.config.budgetTokens || 1024);
203
+ // Ensure budget tokens don't exceed max tokens
204
+ // This prevents API errors and ensures proper token allocation
205
+ if (budgetTokens >= (this.config.maxTokens || 8192)) {
206
+ throw new Error(`budgetTokens (${budgetTokens}) must be less than maxTokens (${this.config.maxTokens || 8192})`);
207
+ }
102
208
  }
103
209
  this.model = new ChatAnthropic(chatConfig);
104
210
  }
@@ -1 +1 @@
1
- {"version":3,"file":"anthropic.js","sourceRoot":"","sources":["../../../../src/runtime/agents/impl/anthropic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAoC,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAiBhF,MAAM,OAAO,iBAAiB;IAI5B,YAAY,MAAyB;;QACnC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,C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C,YAAY,IAAI,IAAI,CAAC,CAAC;YAEtE,+CAA+C;YAC/C,+DAA+D;YAC/D,IAAI,YAAY,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,IAAI,IAAI,CAAC,EAAE,CAAC;gBACpD,MAAM,IAAI,KAAK,CACb,iBAAiB,YAAY,kCAAkC,IAAI,CAAC,MAAM,CAAC,SAAS,IAAI,IAAI,GAAG,CAChG,CAAC;YACJ,CAAC;QACH,CAAC;QAED,IAAI,CAAC,KAAK,GAAG,IAAI,aAAa,CAAC,UAAU,CAAC,CAAC;IAC7C,CAAC;CACF"}
@@ -9,7 +9,7 @@ export declare class CognitoAuth implements AgentlangAuth {
9
9
  fetchClientId(): string;
10
10
  private fetchConfig;
11
11
  signUp(firstName: string, lastName: string, username: string, password: string, userData: Map<string, string> | undefined, env: Environment, cb: SignUpCallback): Promise<void>;
12
- confirmSignup(username: string, confirmationCode: string, env: Environment): Promise<void>;
12
+ confirmSignup(username: string, confirmationCode: string, _: Environment): Promise<void>;
13
13
  forgotPassword(username: string, _env: Environment): Promise<void>;
14
14
  confirmForgotPassword(username: string, confirmationCode: string, newPassword: string, _env: Environment): Promise<void>;
15
15
  login(username: string, password: string, env: Environment, cb: LoginCallback): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"cognito.d.ts","sourceRoot":"","sources":["../../../src/runtime/auth/cognito.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,aAAa,EACb,cAAc,EACd,WAAW,EACX,cAAc,EACd,QAAQ,EACT,MAAM,gBAAgB,CAAC;AAYxB,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AA4PhD,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CA0B1D;AAED,qBAAa,WAAY,YAAW,aAAa;IAC/C,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IACxC,QAAQ,EAAE,GAAG,CAAC;g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,OAAO,CAAC,IAAI,CAAC;IAkBxF,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAiBlE,qBAAqB,CACzB,QAAQ,EAAE,MAAM,EAChB,gBAAgB,EAAE,MAAM,EACxB,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,WAAW,GAChB,OAAO,CAAC,IAAI,CAAC;IAqBV,KAAK,CACT,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,WAAW,EAChB,EAAE,EAAE,aAAa,GAChB,OAAO,CAAC,IAAI,CAAC;IAyKV,MAAM,CAAC,WAAW,EAAE,WAAW,EAAE,GAAG,EAAE,WAAW,EAAE,EAAE,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAsDtF,cAAc,CAClB,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,EACnB,GAAG,EAAE,WAAW,GACf,OAAO,CAAC,OAAO,CAAC;IAuCnB,OAAO,CAAC,aAAa;IAOf,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAoCzC,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,GAAG,OAAO,CAAC,QAAQ,CAAC;IAiE5D,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,GAAG,OAAO,CAAC,QAAQ,CAAC;IAiElE,YAAY,CAAC,kBAAkB,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;CAkEvF"}
@@ -317,7 +317,7 @@ export class CognitoAuth {
317
317
  handleCognitoError(err, 'signUp');
318
318
  }
319
319
  }
320
- async confirmSignup(username, confirmationCode, env) {
320
+ async confirmSignup(username, confirmationCode, _) {
321
321
  try {
322
322
  const client = new CognitoIdentityProviderClient({
323
323
  region: process.env.AWS_REGION || 'us-west-2',