@animalabs/agent-framework 0.6.8 → 0.7.0

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 (49) hide show
  1. package/dist/src/agent.d.ts +6 -0
  2. package/dist/src/agent.d.ts.map +1 -1
  3. package/dist/src/agent.js +11 -1
  4. package/dist/src/agent.js.map +1 -1
  5. package/dist/src/framework.d.ts +129 -15
  6. package/dist/src/framework.d.ts.map +1 -1
  7. package/dist/src/framework.js +967 -113
  8. package/dist/src/framework.js.map +1 -1
  9. package/dist/src/mcpl/channel-registry.d.ts +87 -7
  10. package/dist/src/mcpl/channel-registry.d.ts.map +1 -1
  11. package/dist/src/mcpl/channel-registry.js +329 -49
  12. package/dist/src/mcpl/channel-registry.js.map +1 -1
  13. package/dist/src/modules/workspace/index.d.ts +10 -0
  14. package/dist/src/modules/workspace/index.d.ts.map +1 -1
  15. package/dist/src/modules/workspace/index.js +61 -6
  16. package/dist/src/modules/workspace/index.js.map +1 -1
  17. package/dist/src/modules/workspace/types.d.ts +2 -0
  18. package/dist/src/modules/workspace/types.d.ts.map +1 -1
  19. package/dist/src/modules/workspace/types.js.map +1 -1
  20. package/dist/src/modules/workspace/watcher.d.ts +17 -0
  21. package/dist/src/modules/workspace/watcher.d.ts.map +1 -1
  22. package/dist/src/modules/workspace/watcher.js +143 -7
  23. package/dist/src/modules/workspace/watcher.js.map +1 -1
  24. package/dist/src/types/agent.d.ts +32 -0
  25. package/dist/src/types/agent.d.ts.map +1 -1
  26. package/dist/src/types/trace.d.ts +32 -0
  27. package/dist/src/types/trace.d.ts.map +1 -1
  28. package/dist/test/channel-registry-routing.test.js +186 -10
  29. package/dist/test/channel-registry-routing.test.js.map +1 -1
  30. package/dist/test/explicit-prose-routing.test.d.ts +11 -0
  31. package/dist/test/explicit-prose-routing.test.d.ts.map +1 -0
  32. package/dist/test/explicit-prose-routing.test.js +247 -0
  33. package/dist/test/explicit-prose-routing.test.js.map +1 -0
  34. package/dist/test/present-while-acting.test.js +85 -8
  35. package/dist/test/present-while-acting.test.js.map +1 -1
  36. package/dist/test/trunk-channel-routing.test.js +7 -3
  37. package/dist/test/trunk-channel-routing.test.js.map +1 -1
  38. package/dist/test/workspace-watcher.test.js +161 -9
  39. package/dist/test/workspace-watcher.test.js.map +1 -1
  40. package/dist/tsconfig.tsbuildinfo +1 -1
  41. package/package.json +3 -3
  42. package/src/agent.ts +11 -1
  43. package/src/framework.ts +1037 -116
  44. package/src/mcpl/channel-registry.ts +401 -54
  45. package/src/modules/workspace/index.ts +60 -6
  46. package/src/modules/workspace/types.ts +2 -0
  47. package/src/modules/workspace/watcher.ts +160 -7
  48. package/src/types/agent.ts +35 -0
  49. package/src/types/trace.ts +47 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@animalabs/agent-framework",
3
- "version": "0.6.8",
3
+ "version": "0.7.0",
4
4
  "description": "Multi-agent framework with pluggable modules, persistent state, and concurrent tool execution",
5
5
  "repository": {
6
6
  "type": "git",
@@ -46,8 +46,8 @@
46
46
  "license": "MIT",
47
47
  "dependencies": {
48
48
  "@animalabs/chronicle": "^0.2.2",
49
- "@animalabs/context-manager": "^0.5.13",
50
- "@animalabs/membrane": "^0.5.73",
49
+ "@animalabs/context-manager": "^0.6.0",
50
+ "@animalabs/membrane": "^0.5.75",
51
51
  "chokidar": "^4.0.3",
52
52
  "discord.js": "^14.25.1",
53
53
  "ws": "^8.18.0"
package/src/agent.ts CHANGED
@@ -62,8 +62,14 @@ export class Agent {
62
62
  readonly thinking: AgentConfig['thinking'];
63
63
  /** Refusal auto-rewind policy (see AgentConfig.refusalHandling). */
64
64
  readonly refusalHandling: AgentConfig['refusalHandling'];
65
+ /** Prose delivery mode (see AgentConfig.proseRouting). Default 'locus'. */
66
+ readonly proseRouting: 'locus' | 'explicit';
65
67
  /** Prompt-cache TTL forwarded to the provider (see AgentConfig.cacheTtl). */
66
68
  readonly cacheTtl: NonNullable<AgentConfig['cacheTtl']>;
69
+ /** Emit prompt-cache markers on requests (see AgentConfig.promptCaching). */
70
+ readonly promptCaching: boolean;
71
+ /** Prefill scaffold user message (see AgentConfig.prefillUserMessage). */
72
+ readonly prefillUserMessage?: string;
67
73
  /** Provider-specific request parameters forwarded unchanged by Membrane. */
68
74
  readonly providerParams?: Record<string, unknown>;
69
75
  readonly sameRoundThinkTextPolicy: AgentConfig['sameRoundThinkTextPolicy'];
@@ -100,7 +106,10 @@ export class Agent {
100
106
  this.temperature = config.temperature;
101
107
  this.thinking = config.thinking;
102
108
  this.refusalHandling = config.refusalHandling;
109
+ this.proseRouting = config.proseRouting ?? 'locus';
103
110
  this.cacheTtl = config.cacheTtl ?? '1h';
111
+ this.promptCaching = config.promptCaching ?? true;
112
+ this.prefillUserMessage = config.prefillUserMessage;
104
113
  this.providerParams = config.providerParams;
105
114
  this.sameRoundThinkTextPolicy = config.sameRoundThinkTextPolicy;
106
115
  this.maxStreamTokens = config.maxStreamTokens ?? 150_000;
@@ -638,8 +647,9 @@ export class Agent {
638
647
  ...(this.thinking !== undefined && { thinking: this.thinking }),
639
648
  },
640
649
  tools: availableTools.length > 0 ? availableTools : undefined,
641
- promptCaching: true,
650
+ promptCaching: this.promptCaching,
642
651
  cacheTtl: this.cacheTtl,
652
+ ...(this.prefillUserMessage && { prefillUserMessage: this.prefillUserMessage }),
643
653
  ...(this.providerParams && { providerParams: this.providerParams }),
644
654
  assistantParticipant: this.name,
645
655
  };