@futdevpro/nts-dynamo 1.15.463 → 1.15.465

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 (85) hide show
  1. package/build/_modules/ai/_collections/ai-agent-context.util.d.ts +43 -0
  2. package/build/_modules/ai/_collections/ai-agent-context.util.d.ts.map +1 -0
  3. package/build/_modules/ai/_collections/ai-agent-context.util.js +96 -0
  4. package/build/_modules/ai/_collections/ai-agent-context.util.js.map +1 -0
  5. package/build/_modules/ai/_collections/ai-field-assist.util.d.ts +54 -0
  6. package/build/_modules/ai/_collections/ai-field-assist.util.d.ts.map +1 -0
  7. package/build/_modules/ai/_collections/ai-field-assist.util.js +163 -0
  8. package/build/_modules/ai/_collections/ai-field-assist.util.js.map +1 -0
  9. package/build/_modules/ai/_enums/dynts-ai-field-assist-mode.type-enum.d.ts +8 -0
  10. package/build/_modules/ai/_enums/dynts-ai-field-assist-mode.type-enum.d.ts.map +1 -0
  11. package/build/_modules/ai/_enums/dynts-ai-field-assist-mode.type-enum.js +12 -0
  12. package/build/_modules/ai/_enums/dynts-ai-field-assist-mode.type-enum.js.map +1 -0
  13. package/build/_modules/ai/_models/interfaces/dynts-ai-agent-context-item.interface.d.ts +21 -0
  14. package/build/_modules/ai/_models/interfaces/dynts-ai-agent-context-item.interface.d.ts.map +1 -0
  15. package/build/_modules/ai/_models/interfaces/dynts-ai-agent-context-item.interface.js +3 -0
  16. package/build/_modules/ai/_models/interfaces/dynts-ai-agent-context-item.interface.js.map +1 -0
  17. package/build/_modules/ai/_models/interfaces/dynts-ai-agent-context-provider.interface.d.ts +17 -0
  18. package/build/_modules/ai/_models/interfaces/dynts-ai-agent-context-provider.interface.d.ts.map +1 -0
  19. package/build/_modules/ai/_models/interfaces/dynts-ai-agent-context-provider.interface.js +3 -0
  20. package/build/_modules/ai/_models/interfaces/dynts-ai-agent-context-provider.interface.js.map +1 -0
  21. package/build/_modules/ai/_models/interfaces/dynts-ai-agent-context-report.interface.d.ts +12 -0
  22. package/build/_modules/ai/_models/interfaces/dynts-ai-agent-context-report.interface.d.ts.map +1 -0
  23. package/build/_modules/ai/_models/interfaces/dynts-ai-agent-context-report.interface.js +3 -0
  24. package/build/_modules/ai/_models/interfaces/dynts-ai-agent-context-report.interface.js.map +1 -0
  25. package/build/_modules/ai/_models/interfaces/dynts-ai-agent-context-seed.interface.d.ts +19 -0
  26. package/build/_modules/ai/_models/interfaces/dynts-ai-agent-context-seed.interface.d.ts.map +1 -0
  27. package/build/_modules/ai/_models/interfaces/dynts-ai-agent-context-seed.interface.js +3 -0
  28. package/build/_modules/ai/_models/interfaces/dynts-ai-agent-context-seed.interface.js.map +1 -0
  29. package/build/_modules/ai/_models/interfaces/dynts-ai-agent-draft.interface.d.ts +17 -0
  30. package/build/_modules/ai/_models/interfaces/dynts-ai-agent-draft.interface.d.ts.map +1 -0
  31. package/build/_modules/ai/_models/interfaces/dynts-ai-agent-draft.interface.js +3 -0
  32. package/build/_modules/ai/_models/interfaces/dynts-ai-agent-draft.interface.js.map +1 -0
  33. package/build/_modules/ai/_models/interfaces/dynts-ai-agent-llm.interface.d.ts +21 -0
  34. package/build/_modules/ai/_models/interfaces/dynts-ai-agent-llm.interface.d.ts.map +1 -0
  35. package/build/_modules/ai/_models/interfaces/dynts-ai-agent-llm.interface.js +3 -0
  36. package/build/_modules/ai/_models/interfaces/dynts-ai-agent-llm.interface.js.map +1 -0
  37. package/build/_modules/ai/_models/interfaces/dynts-ai-agent-rendered-context.interface.d.ts +12 -0
  38. package/build/_modules/ai/_models/interfaces/dynts-ai-agent-rendered-context.interface.d.ts.map +1 -0
  39. package/build/_modules/ai/_models/interfaces/dynts-ai-agent-rendered-context.interface.js +3 -0
  40. package/build/_modules/ai/_models/interfaces/dynts-ai-agent-rendered-context.interface.js.map +1 -0
  41. package/build/_modules/ai/_models/interfaces/dynts-ai-agent-result.interface.d.ts +12 -0
  42. package/build/_modules/ai/_models/interfaces/dynts-ai-agent-result.interface.d.ts.map +1 -0
  43. package/build/_modules/ai/_models/interfaces/dynts-ai-agent-result.interface.js +3 -0
  44. package/build/_modules/ai/_models/interfaces/dynts-ai-agent-result.interface.js.map +1 -0
  45. package/build/_modules/ai/_models/interfaces/dynts-ai-agent-settings.interface.d.ts +20 -0
  46. package/build/_modules/ai/_models/interfaces/dynts-ai-agent-settings.interface.d.ts.map +1 -0
  47. package/build/_modules/ai/_models/interfaces/dynts-ai-agent-settings.interface.js +3 -0
  48. package/build/_modules/ai/_models/interfaces/dynts-ai-agent-settings.interface.js.map +1 -0
  49. package/build/_modules/ai/_models/interfaces/dynts-ai-agent-tool-run.interface.d.ts +16 -0
  50. package/build/_modules/ai/_models/interfaces/dynts-ai-agent-tool-run.interface.d.ts.map +1 -0
  51. package/build/_modules/ai/_models/interfaces/dynts-ai-agent-tool-run.interface.js +3 -0
  52. package/build/_modules/ai/_models/interfaces/dynts-ai-agent-tool-run.interface.js.map +1 -0
  53. package/build/_modules/ai/_models/interfaces/dynts-ai-agent-tool.interface.d.ts +13 -0
  54. package/build/_modules/ai/_models/interfaces/dynts-ai-agent-tool.interface.d.ts.map +1 -0
  55. package/build/_modules/ai/_models/interfaces/dynts-ai-agent-tool.interface.js +3 -0
  56. package/build/_modules/ai/_models/interfaces/dynts-ai-agent-tool.interface.js.map +1 -0
  57. package/build/_modules/ai/_models/interfaces/dynts-ai-agent-turn.interface.d.ts +23 -0
  58. package/build/_modules/ai/_models/interfaces/dynts-ai-agent-turn.interface.d.ts.map +1 -0
  59. package/build/_modules/ai/_models/interfaces/dynts-ai-agent-turn.interface.js +3 -0
  60. package/build/_modules/ai/_models/interfaces/dynts-ai-agent-turn.interface.js.map +1 -0
  61. package/build/_modules/ai/_models/interfaces/dynts-ai-field-assist-complete.type.d.ts +8 -0
  62. package/build/_modules/ai/_models/interfaces/dynts-ai-field-assist-complete.type.d.ts.map +1 -0
  63. package/build/_modules/ai/_models/interfaces/dynts-ai-field-assist-complete.type.js +3 -0
  64. package/build/_modules/ai/_models/interfaces/dynts-ai-field-assist-complete.type.js.map +1 -0
  65. package/build/_modules/ai/_models/interfaces/dynts-ai-field-assist-messages.interface.d.ts +6 -0
  66. package/build/_modules/ai/_models/interfaces/dynts-ai-field-assist-messages.interface.d.ts.map +1 -0
  67. package/build/_modules/ai/_models/interfaces/dynts-ai-field-assist-messages.interface.js +3 -0
  68. package/build/_modules/ai/_models/interfaces/dynts-ai-field-assist-messages.interface.js.map +1 -0
  69. package/build/_modules/ai/_models/interfaces/dynts-ai-field-assist-request.interface.d.ts +21 -0
  70. package/build/_modules/ai/_models/interfaces/dynts-ai-field-assist-request.interface.d.ts.map +1 -0
  71. package/build/_modules/ai/_models/interfaces/dynts-ai-field-assist-request.interface.js +3 -0
  72. package/build/_modules/ai/_models/interfaces/dynts-ai-field-assist-request.interface.js.map +1 -0
  73. package/build/_modules/ai/_models/interfaces/dynts-ai-field-assist-result.interface.d.ts +15 -0
  74. package/build/_modules/ai/_models/interfaces/dynts-ai-field-assist-result.interface.d.ts.map +1 -0
  75. package/build/_modules/ai/_models/interfaces/dynts-ai-field-assist-result.interface.js +3 -0
  76. package/build/_modules/ai/_models/interfaces/dynts-ai-field-assist-result.interface.js.map +1 -0
  77. package/build/_modules/ai/_services/ai-agent.control-service.d.ts +104 -0
  78. package/build/_modules/ai/_services/ai-agent.control-service.d.ts.map +1 -0
  79. package/build/_modules/ai/_services/ai-agent.control-service.js +266 -0
  80. package/build/_modules/ai/_services/ai-agent.control-service.js.map +1 -0
  81. package/build/_modules/ai/index.d.ts +20 -0
  82. package/build/_modules/ai/index.d.ts.map +1 -1
  83. package/build/_modules/ai/index.js +22 -0
  84. package/build/_modules/ai/index.js.map +1 -1
  85. package/package.json +1 -1
@@ -0,0 +1,12 @@
1
+ import { DyNTS_AI_Agent_ContextItem_Interface } from './dynts-ai-agent-context-item.interface';
2
+ import { DyNTS_AI_Agent_ContextReport_Interface } from './dynts-ai-agent-context-report.interface';
3
+ /** BFR-MYASSISTANT-026 — the context block of a message, as it is sent. */
4
+ export interface DyNTS_AI_Agent_RenderedContext_Interface {
5
+ /** The block in front of the message (empty: no context goes). */
6
+ text: string;
7
+ /** What happened to each item. */
8
+ report: DyNTS_AI_Agent_ContextReport_Interface;
9
+ /** The items as they went (a cut item with its cut text). */
10
+ sentItems: DyNTS_AI_Agent_ContextItem_Interface[];
11
+ }
12
+ //# sourceMappingURL=dynts-ai-agent-rendered-context.interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dynts-ai-agent-rendered-context.interface.d.ts","sourceRoot":"","sources":["../../../../../src/_modules/ai/_models/interfaces/dynts-ai-agent-rendered-context.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oCAAoC,EAAE,MAAM,yCAAyC,CAAC;AAC/F,OAAO,EAAE,sCAAsC,EAAE,MAAM,2CAA2C,CAAC;AAEnG,2EAA2E;AAC3E,MAAM,WAAW,wCAAwC;IACvD,kEAAkE;IAClE,IAAI,EAAE,MAAM,CAAC;IACb,kCAAkC;IAClC,MAAM,EAAE,sCAAsC,CAAC;IAC/C,6DAA6D;IAC7D,SAAS,EAAE,oCAAoC,EAAE,CAAC;CACnD"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=dynts-ai-agent-rendered-context.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dynts-ai-agent-rendered-context.interface.js","sourceRoot":"","sources":["../../../../../src/_modules/ai/_models/interfaces/dynts-ai-agent-rendered-context.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,12 @@
1
+ import { DyNTS_AI_Agent_ContextReport_Interface } from './dynts-ai-agent-context-report.interface';
2
+ import { DyNTS_AI_Agent_Turn_Interface } from './dynts-ai-agent-turn.interface';
3
+ /** BFR-MYASSISTANT-026 — the answer of a `run`: the turn to store, and what happened to the context. */
4
+ export interface DyNTS_AI_Agent_Result_Interface {
5
+ /** The final answer (= `turn.answer`). */
6
+ answer: string;
7
+ /** The exchange to append to the history. */
8
+ turn: DyNTS_AI_Agent_Turn_Interface;
9
+ /** Which context items were sent, cut, dropped or switched off. */
10
+ contextReport: DyNTS_AI_Agent_ContextReport_Interface;
11
+ }
12
+ //# sourceMappingURL=dynts-ai-agent-result.interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dynts-ai-agent-result.interface.d.ts","sourceRoot":"","sources":["../../../../../src/_modules/ai/_models/interfaces/dynts-ai-agent-result.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sCAAsC,EAAE,MAAM,2CAA2C,CAAC;AACnG,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAEhF,wGAAwG;AACxG,MAAM,WAAW,+BAA+B;IAC9C,0CAA0C;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,6CAA6C;IAC7C,IAAI,EAAE,6BAA6B,CAAC;IACpC,mEAAmE;IACnE,aAAa,EAAE,sCAAsC,CAAC;CACvD"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=dynts-ai-agent-result.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dynts-ai-agent-result.interface.js","sourceRoot":"","sources":["../../../../../src/_modules/ai/_models/interfaces/dynts-ai-agent-result.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,20 @@
1
+ import { DyFM_AI_CallSettings } from '@futdevpro/fsm-dynamo/ai';
2
+ import { DyNTS_AI_Agent_Llm_Interface } from './dynts-ai-agent-llm.interface';
3
+ /** BFR-MYASSISTANT-026 — the setup of a `DyNTS_AI_Agent_ControlService`. */
4
+ export interface DyNTS_AI_Agent_Settings_Interface {
5
+ /** The model (any `DyNTS_AI_LLM_ServiceBase` provider). */
6
+ llm: DyNTS_AI_Agent_Llm_Interface;
7
+ /** The agent's instructions (default: the call settings' own system prompt). */
8
+ systemPrompt?: string;
9
+ /** The call settings (default: the provider's `defaultSettings`). */
10
+ callSettings?: DyFM_AI_CallSettings;
11
+ /** The most tool rounds of one answer (default 8). */
12
+ maxIterations?: number;
13
+ /** How many earlier turns are sent (default 20, the latest ones). */
14
+ historyLimit?: number;
15
+ /** The most context characters sent with a message (default 12 000). */
16
+ maxContextLength?: number;
17
+ /** The most characters of one tool result given to the model (default 20 000). */
18
+ maxToolResultLength?: number;
19
+ }
20
+ //# sourceMappingURL=dynts-ai-agent-settings.interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dynts-ai-agent-settings.interface.d.ts","sourceRoot":"","sources":["../../../../../src/_modules/ai/_models/interfaces/dynts-ai-agent-settings.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAE9E,4EAA4E;AAC5E,MAAM,WAAW,iCAAiC;IAChD,2DAA2D;IAC3D,GAAG,EAAE,4BAA4B,CAAC;IAClC,gFAAgF;IAChF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qEAAqE;IACrE,YAAY,CAAC,EAAE,oBAAoB,CAAC;IACpC,sDAAsD;IACtD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,qEAAqE;IACrE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,wEAAwE;IACxE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,kFAAkF;IAClF,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=dynts-ai-agent-settings.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dynts-ai-agent-settings.interface.js","sourceRoot":"","sources":["../../../../../src/_modules/ai/_models/interfaces/dynts-ai-agent-settings.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,16 @@
1
+ /** BFR-MYASSISTANT-026 — the record of one tool run in an answer (for the UI and the audit). */
2
+ export interface DyNTS_AI_Agent_ToolRun_Interface {
3
+ /** The tool's name. */
4
+ toolName: string;
5
+ /** The arguments the model gave. */
6
+ arguments: Record<string, unknown>;
7
+ /** The handler threw (the model got an `ERROR …` result). */
8
+ isError: boolean;
9
+ /** How long the handler ran. */
10
+ durationMs: number;
11
+ /** The length of the handler's result (before any cut). */
12
+ resultLength: number;
13
+ /** The result was longer than `maxToolResultLength`: the model got the first part only. */
14
+ isResultTruncated: boolean;
15
+ }
16
+ //# sourceMappingURL=dynts-ai-agent-tool-run.interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dynts-ai-agent-tool-run.interface.d.ts","sourceRoot":"","sources":["../../../../../src/_modules/ai/_models/interfaces/dynts-ai-agent-tool-run.interface.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,MAAM,WAAW,gCAAgC;IAC/C,uBAAuB;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,oCAAoC;IACpC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,6DAA6D;IAC7D,OAAO,EAAE,OAAO,CAAC;IACjB,gCAAgC;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,2DAA2D;IAC3D,YAAY,EAAE,MAAM,CAAC;IACrB,2FAA2F;IAC3F,iBAAiB,EAAE,OAAO,CAAC;CAC5B"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=dynts-ai-agent-tool-run.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dynts-ai-agent-tool-run.interface.js","sourceRoot":"","sources":["../../../../../src/_modules/ai/_models/interfaces/dynts-ai-agent-tool-run.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,13 @@
1
+ import { DyFM_AI_Tool, DyFM_AI_ToolHandler } from '@futdevpro/fsm-dynamo/ai';
2
+ /**
3
+ * BFR-MYASSISTANT-026 — one custom tool of a `DyNTS_AI_Agent_ControlService`: the definition the model sees
4
+ * (`name`, `description`, `parameters` JSON Schema) and the handler that runs it, in ONE object.
5
+ *
6
+ * The handler gets the parsed arguments and returns the result text (fed back to the model). A thrown error becomes
7
+ * an `ERROR …` result for the model (the loop goes on); it never reaches the user as a technical message.
8
+ */
9
+ export interface DyNTS_AI_Agent_Tool_Interface extends DyFM_AI_Tool {
10
+ /** Runs the tool. */
11
+ handler: DyFM_AI_ToolHandler;
12
+ }
13
+ //# sourceMappingURL=dynts-ai-agent-tool.interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dynts-ai-agent-tool.interface.d.ts","sourceRoot":"","sources":["../../../../../src/_modules/ai/_models/interfaces/dynts-ai-agent-tool.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE7E;;;;;;GAMG;AACH,MAAM,WAAW,6BAA8B,SAAQ,YAAY;IACjE,qBAAqB;IACrB,OAAO,EAAE,mBAAmB,CAAC;CAC9B"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=dynts-ai-agent-tool.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dynts-ai-agent-tool.interface.js","sourceRoot":"","sources":["../../../../../src/_modules/ai/_models/interfaces/dynts-ai-agent-tool.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,23 @@
1
+ import { DyNTS_AI_Agent_ContextItem_Interface } from './dynts-ai-agent-context-item.interface';
2
+ import { DyNTS_AI_Agent_ToolRun_Interface } from './dynts-ai-agent-tool-run.interface';
3
+ /**
4
+ * BFR-MYASSISTANT-026 — one finished exchange, as the project stores it. The next request's history is built from
5
+ * `message` + `answer` only: the `context` stays bound to this message (shown / audited), it is NOT resent.
6
+ */
7
+ export interface DyNTS_AI_Agent_Turn_Interface {
8
+ /** The user's message, without the context. */
9
+ message: string;
10
+ /** The final answer. */
11
+ answer: string;
12
+ /** The context items that went with the message (as sent; empty: none). */
13
+ context: DyNTS_AI_Agent_ContextItem_Interface[];
14
+ /** The tools that ran for this answer. */
15
+ toolRuns: DyNTS_AI_Agent_ToolRun_Interface[];
16
+ /** The model that answered. */
17
+ model?: string;
18
+ /** The tokens of the FINAL model call (the loop does not sum the earlier tool rounds). */
19
+ finalCallTokens?: number;
20
+ /** When it was answered (epoch ms). */
21
+ createdAt: number;
22
+ }
23
+ //# sourceMappingURL=dynts-ai-agent-turn.interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dynts-ai-agent-turn.interface.d.ts","sourceRoot":"","sources":["../../../../../src/_modules/ai/_models/interfaces/dynts-ai-agent-turn.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oCAAoC,EAAE,MAAM,yCAAyC,CAAC;AAC/F,OAAO,EAAE,gCAAgC,EAAE,MAAM,qCAAqC,CAAC;AAEvF;;;GAGG;AACH,MAAM,WAAW,6BAA6B;IAC5C,+CAA+C;IAC/C,OAAO,EAAE,MAAM,CAAC;IAChB,wBAAwB;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,2EAA2E;IAC3E,OAAO,EAAE,oCAAoC,EAAE,CAAC;IAChD,0CAA0C;IAC1C,QAAQ,EAAE,gCAAgC,EAAE,CAAC;IAC7C,+BAA+B;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0FAA0F;IAC1F,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,uCAAuC;IACvC,SAAS,EAAE,MAAM,CAAC;CACnB"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=dynts-ai-agent-turn.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dynts-ai-agent-turn.interface.js","sourceRoot":"","sources":["../../../../../src/_modules/ai/_models/interfaces/dynts-ai-agent-turn.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ import { DyFM_AI_LLM_Response } from '@futdevpro/fsm-dynamo/ai';
2
+ import { DyNTS_AI_FieldAssist_Messages_Interface } from './dynts-ai-field-assist-messages.interface';
3
+ /**
4
+ * BFR-MYASSISTANT-009 — the project's LLM call (its provider, its key, its token accounting): two messages in, the
5
+ * normalized response out (`content`, `usage`, `model`).
6
+ */
7
+ export type DyNTS_AI_FieldAssist_Complete = (messages: DyNTS_AI_FieldAssist_Messages_Interface) => Promise<DyFM_AI_LLM_Response>;
8
+ //# sourceMappingURL=dynts-ai-field-assist-complete.type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dynts-ai-field-assist-complete.type.d.ts","sourceRoot":"","sources":["../../../../../src/_modules/ai/_models/interfaces/dynts-ai-field-assist-complete.type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE,OAAO,EAAE,uCAAuC,EAAE,MAAM,4CAA4C,CAAC;AAErG;;;GAGG;AACH,MAAM,MAAM,6BAA6B,GACvC,CAAC,QAAQ,EAAE,uCAAuC,KAAK,OAAO,CAAC,oBAAoB,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=dynts-ai-field-assist-complete.type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dynts-ai-field-assist-complete.type.js","sourceRoot":"","sources":["../../../../../src/_modules/ai/_models/interfaces/dynts-ai-field-assist-complete.type.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ /** BFR-MYASSISTANT-009 — the two messages of a field-assist call (for any provider's simple request). */
2
+ export interface DyNTS_AI_FieldAssist_Messages_Interface {
3
+ systemMessage: string;
4
+ userMessage: string;
5
+ }
6
+ //# sourceMappingURL=dynts-ai-field-assist-messages.interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dynts-ai-field-assist-messages.interface.d.ts","sourceRoot":"","sources":["../../../../../src/_modules/ai/_models/interfaces/dynts-ai-field-assist-messages.interface.ts"],"names":[],"mappings":"AAAA,yGAAyG;AACzG,MAAM,WAAW,uCAAuC;IACtD,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;CACrB"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=dynts-ai-field-assist-messages.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dynts-ai-field-assist-messages.interface.js","sourceRoot":"","sources":["../../../../../src/_modules/ai/_models/interfaces/dynts-ai-field-assist-messages.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,21 @@
1
+ import { DyNTS_AI_FieldAssistMode_Type } from '../../_enums/dynts-ai-field-assist-mode.type-enum';
2
+ /**
3
+ * BFR-MYASSISTANT-009 — a field-assist request as the client sends it (the field names of the ngx-dynamo
4
+ * `DyNX_AiFieldAssist_Request_Interface`, so the app's endpoint passes the body on as it is).
5
+ */
6
+ export interface DyNTS_AI_FieldAssist_Request_Interface {
7
+ mode: DyNTS_AI_FieldAssistMode_Type | `${DyNTS_AI_FieldAssistMode_Type}`;
8
+ /** What the field is (e.g. "Description"). */
9
+ fieldLabel: string;
10
+ /** What the field is for (optional context). */
11
+ purpose?: string;
12
+ /** Write: what the user wants to see. Improve: an optional hint. */
13
+ instruction?: string;
14
+ /** The field's current text. */
15
+ currentText?: string;
16
+ /** The field's length limit (characters). */
17
+ maxLength?: number;
18
+ /** The page language (`hu` / `en` / …). */
19
+ language?: string;
20
+ }
21
+ //# sourceMappingURL=dynts-ai-field-assist-request.interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dynts-ai-field-assist-request.interface.d.ts","sourceRoot":"","sources":["../../../../../src/_modules/ai/_models/interfaces/dynts-ai-field-assist-request.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,mDAAmD,CAAC;AAElG;;;GAGG;AACH,MAAM,WAAW,sCAAsC;IACrD,IAAI,EAAE,6BAA6B,GAAG,GAAG,6BAA6B,EAAE,CAAC;IACzE,8CAA8C;IAC9C,UAAU,EAAE,MAAM,CAAC;IACnB,gDAAgD;IAChD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,oEAAoE;IACpE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gCAAgC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6CAA6C;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=dynts-ai-field-assist-request.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dynts-ai-field-assist-request.interface.js","sourceRoot":"","sources":["../../../../../src/_modules/ai/_models/interfaces/dynts-ai-field-assist-request.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * BFR-MYASSISTANT-009 — what the server returns to the client (the ngx-dynamo
3
+ * `DyNX_AiFieldAssist_Result_Interface`).
4
+ */
5
+ export interface DyNTS_AI_FieldAssist_Result_Interface {
6
+ /** The cleaned field content. */
7
+ text: string;
8
+ /** The answer was longer than `maxLength` and was cut at a word boundary. */
9
+ isTruncated: boolean;
10
+ /** The tokens the call used (when the provider reports them). */
11
+ totalTokens?: number;
12
+ /** The model that answered. */
13
+ model?: string;
14
+ }
15
+ //# sourceMappingURL=dynts-ai-field-assist-result.interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dynts-ai-field-assist-result.interface.d.ts","sourceRoot":"","sources":["../../../../../src/_modules/ai/_models/interfaces/dynts-ai-field-assist-result.interface.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,qCAAqC;IACpD,iCAAiC;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,6EAA6E;IAC7E,WAAW,EAAE,OAAO,CAAC;IACrB,iEAAiE;IACjE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,+BAA+B;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=dynts-ai-field-assist-result.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dynts-ai-field-assist-result.interface.js","sourceRoot":"","sources":["../../../../../src/_modules/ai/_models/interfaces/dynts-ai-field-assist-result.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,104 @@
1
+ import { DyFM_AI_CallSettings, DyFM_AI_Message } from '@futdevpro/fsm-dynamo/ai';
2
+ import { DyNTS_AI_Agent_ContextProvider_Interface } from '../_models/interfaces/dynts-ai-agent-context-provider.interface';
3
+ import { DyNTS_AI_Agent_Draft_Interface } from '../_models/interfaces/dynts-ai-agent-draft.interface';
4
+ import { DyNTS_AI_Agent_RenderedContext_Interface } from '../_models/interfaces/dynts-ai-agent-rendered-context.interface';
5
+ import { DyNTS_AI_Agent_Result_Interface } from '../_models/interfaces/dynts-ai-agent-result.interface';
6
+ import { DyNTS_AI_Agent_Settings_Interface } from '../_models/interfaces/dynts-ai-agent-settings.interface';
7
+ import { DyNTS_AI_Agent_Tool_Interface } from '../_models/interfaces/dynts-ai-agent-tool.interface';
8
+ import { DyNTS_AI_Agent_Turn_Interface } from '../_models/interfaces/dynts-ai-agent-turn.interface';
9
+ /**
10
+ * BFR-MYASSISTANT-026 — a plain, general agentic loop: the project gives the tools and the context providers, the
11
+ * model (any `DyNTS_AI_LLM_ServiceBase` provider) runs the tool loop.
12
+ *
13
+ * - **tools:** `addTool({ name, description, parameters, handler })` — the definition and the handler in one object;
14
+ * a tool's error becomes an `ERROR …` result for the model, a long result is cut (`maxToolResultLength`);
15
+ * - **context bound to the user message, NOT to the history:** `prepare` runs the context providers (e.g. RAG) for a
16
+ * message and gives a draft; the user adjusts it (switches items off, edits, reorders, adds); `run` sends the
17
+ * message with exactly that context. The history sent later holds only the messages and the answers — the context
18
+ * stays in the turn (shown / audited), it is not resent;
19
+ * - the context is sent as DATA between markers (`DyNTS_AI_AgentContext_Util`), within `maxContextLength`, and the
20
+ * result reports which item was sent, cut, dropped or switched off;
21
+ * - stateless between requests: the project stores the turns; one instance serves any number of requests.
22
+ *
23
+ * @example
24
+ * ```ts
25
+ * const agent = new DyNTS_AI_Agent_ControlService({ llm: openAiService, systemPrompt: 'You are the order assistant.' })
26
+ * .addTool({ name: 'find_order', description: 'Finds an order by id.', parameters: orderIdSchema,
27
+ * handler: (args) => this.orders.describe(`${args.id}`) })
28
+ * .addContextProvider({ name: 'docs', provide: ({ message }) => this.rag.search(message) });
29
+ *
30
+ * const draft = await agent.prepare({ message: text, history: turns }); // ⇒ to the client, adjusted there
31
+ * const result = await agent.run({ draft: adjustedDraft, history: turns, issuer: accountId });
32
+ * turns.push(result.turn);
33
+ * ```
34
+ */
35
+ export declare class DyNTS_AI_Agent_ControlService {
36
+ private readonly settings;
37
+ /** The longest user message accepted (characters). */
38
+ static readonly maxMessageLength: number;
39
+ /** The most context items of one message. */
40
+ static readonly maxContextItems: number;
41
+ /** A tool name the providers accept (OpenAI / Anthropic / Gemini). */
42
+ static readonly toolNamePattern: RegExp;
43
+ /** The defaults of the optional settings. */
44
+ static readonly defaults: {
45
+ maxIterations: number;
46
+ historyLimit: number;
47
+ maxContextLength: number;
48
+ maxToolResultLength: number;
49
+ };
50
+ /** The tools, by name. */
51
+ private readonly tools;
52
+ /** The context providers, in their order. */
53
+ private readonly contextProviders;
54
+ /** An agent with its model and limits; the tools and the context providers are added after. */
55
+ constructor(settings: DyNTS_AI_Agent_Settings_Interface);
56
+ /** The registered tools' names. */
57
+ getToolNames(): string[];
58
+ /** The registered context providers' names. */
59
+ getContextProviderNames(): string[];
60
+ /** Adds a tool (a unique, provider-safe name). */
61
+ addTool(tool: DyNTS_AI_Agent_Tool_Interface): this;
62
+ /** Adds a context provider (a unique name). */
63
+ addContextProvider(provider: DyNTS_AI_Agent_ContextProvider_Interface): this;
64
+ /** Runs the context providers for a message ⇒ the draft to adjust before sending. */
65
+ prepare(set: {
66
+ message: string;
67
+ history?: DyNTS_AI_Agent_Turn_Interface[];
68
+ }): Promise<DyNTS_AI_Agent_Draft_Interface>;
69
+ /** Sends the (adjusted) draft: the tool loop until the final answer ⇒ the turn to store. */
70
+ run(set: {
71
+ draft: DyNTS_AI_Agent_Draft_Interface;
72
+ history?: DyNTS_AI_Agent_Turn_Interface[];
73
+ issuer: string;
74
+ signal?: AbortSignal;
75
+ }): Promise<DyNTS_AI_Agent_Result_Interface>;
76
+ /** `prepare` + `run` in one step (no adjusting): the providers' context is sent as it came. */
77
+ ask(set: {
78
+ message: string;
79
+ history?: DyNTS_AI_Agent_Turn_Interface[];
80
+ issuer: string;
81
+ signal?: AbortSignal;
82
+ }): Promise<DyNTS_AI_Agent_Result_Interface>;
83
+ /**
84
+ * What `run` sends (for a preview / a test): the history as plain messages + answers, then the message with its
85
+ * context block; the call settings with the agent's system prompt (+ the context rule when context goes).
86
+ */
87
+ build(set: {
88
+ draft: DyNTS_AI_Agent_Draft_Interface;
89
+ history: DyNTS_AI_Agent_Turn_Interface[];
90
+ }): {
91
+ conversation: DyFM_AI_Message[];
92
+ settings: DyFM_AI_CallSettings;
93
+ context: DyNTS_AI_Agent_RenderedContext_Interface;
94
+ };
95
+ /** The handlers of one run: each records its run, and cuts a long result. */
96
+ private handlers;
97
+ /** The message, trimmed (a 400 when empty or too long). */
98
+ private static validMessage;
99
+ /** The draft's context, checked (it comes back from the client). */
100
+ private static validContext;
101
+ /** The reason the user sees (the error's user message, or a plain one); the technical text goes to the log. */
102
+ private static reason;
103
+ }
104
+ //# sourceMappingURL=ai-agent.control-service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-agent.control-service.d.ts","sourceRoot":"","sources":["../../../../src/_modules/ai/_services/ai-agent.control-service.ts"],"names":[],"mappings":"AACA,OAAO,EACL,oBAAoB,EAAwB,eAAe,EAE5D,MAAM,0BAA0B,CAAC;AAIlC,OAAO,EACL,wCAAwC,EACzC,MAAM,iEAAiE,CAAC;AAEzE,OAAO,EAAE,8BAA8B,EAAE,MAAM,sDAAsD,CAAC;AACtG,OAAO,EACL,wCAAwC,EACzC,MAAM,iEAAiE,CAAC;AACzE,OAAO,EAAE,+BAA+B,EAAE,MAAM,uDAAuD,CAAC;AACxG,OAAO,EAAE,iCAAiC,EAAE,MAAM,yDAAyD,CAAC;AAC5G,OAAO,EAAE,6BAA6B,EAAE,MAAM,qDAAqD,CAAC;AAEpG,OAAO,EAAE,6BAA6B,EAAE,MAAM,qDAAqD,CAAC;AAEpG;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,qBAAa,6BAA6B;IAmB5B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAlBrC,sDAAsD;IACtD,MAAM,CAAC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAS;IACjD,6CAA6C;IAC7C,MAAM,CAAC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAM;IAC7C,sEAAsE;IACtE,MAAM,CAAC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAA2B;IAElE,6CAA6C;IAC7C,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE;QACxB,aAAa,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAC;QAAC,gBAAgB,EAAE,MAAM,CAAC;QAAC,mBAAmB,EAAE,MAAM,CAAC;KACpG,CAA+F;IAEhG,0BAA0B;IAC1B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAgG;IACtH,6CAA6C;IAC7C,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAkD;IAEnF,+FAA+F;gBAClE,QAAQ,EAAE,iCAAiC;IAExE,mCAAmC;IACnC,YAAY,IAAI,MAAM,EAAE;IAIxB,+CAA+C;IAC/C,uBAAuB,IAAI,MAAM,EAAE;IAInC,kDAAkD;IAClD,OAAO,CAAC,IAAI,EAAE,6BAA6B,GAAG,IAAI;IAiBlD,+CAA+C;IAC/C,kBAAkB,CAAC,QAAQ,EAAE,wCAAwC,GAAG,IAAI;IAqB5E,qFAAqF;IAC/E,OAAO,CAAC,GAAG,EAAE;QACjB,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,CAAC,EAAE,6BAA6B,EAAE,CAAC;KAC3C,GAAG,OAAO,CAAC,8BAA8B,CAAC;IA8B3C,4FAA4F;IACtF,GAAG,CAAC,GAAG,EAAE;QACb,KAAK,EAAE,8BAA8B,CAAC;QACtC,OAAO,CAAC,EAAE,6BAA6B,EAAE,CAAC;QAC1C,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,WAAW,CAAC;KACtB,GAAG,OAAO,CAAC,+BAA+B,CAAC;IAyC5C,+FAA+F;IACzF,GAAG,CAAC,GAAG,EAAE;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,CAAC,EAAE,6BAA6B,EAAE,CAAC;QAC1C,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,WAAW,CAAC;KACtB,GAAG,OAAO,CAAC,+BAA+B,CAAC;IAM5C;;;OAGG;IACH,KAAK,CAAC,GAAG,EAAE;QAAE,KAAK,EAAE,8BAA8B,CAAC;QAAC,OAAO,EAAE,6BAA6B,EAAE,CAAA;KAAE,GAAG;QAC/F,YAAY,EAAE,eAAe,EAAE,CAAC;QAAC,QAAQ,EAAE,oBAAoB,CAAC;QAAC,OAAO,EAAE,wCAAwC,CAAC;KACpH;IA6BD,6EAA6E;IAC7E,OAAO,CAAC,QAAQ;IAuChB,2DAA2D;IAC3D,OAAO,CAAC,MAAM,CAAC,YAAY;IAiB3B,oEAAoE;IACpE,OAAO,CAAC,MAAM,CAAC,YAAY;IA0B3B,+GAA+G;IAC/G,OAAO,CAAC,MAAM,CAAC,MAAM;CAStB"}