maestro-core 0.2.3 → 0.2.4

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.
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Anti-narration system-prompt fragment.
3
+ *
4
+ * Anthropic models sometimes emit BOTH structured `tool_use` blocks
5
+ * AND a prose narration of the same call using the legacy
6
+ * `<function_calls>` / `<invoke>` XML format from their training
7
+ * corpus. Tools execute correctly either way — the AI SDK only acts
8
+ * on the structured blocks — but the XML leaks into the user-visible
9
+ * answer and the chat bubble looks broken.
10
+ *
11
+ * The default behaviour can be suppressed by an explicit instruction
12
+ * in the system prompt. Compose this constant into your
13
+ * `systemPrompt.static`:
14
+ *
15
+ * ```ts
16
+ * import { ANTI_TOOL_NARRATION_RULE } from 'maestro-core/runtime'
17
+ *
18
+ * runChatTurn({
19
+ * systemPrompt: {
20
+ * static: `${persona}\n\n${ANTI_TOOL_NARRATION_RULE}\n\n${corpus}`,
21
+ * },
22
+ * // ...
23
+ * })
24
+ * ```
25
+ *
26
+ * Hosts that already have a long multi-segment system prompt with
27
+ * explicit guidance on tool/UI rendering (barbeiro's legacy route,
28
+ * for example) often don't need this — the existing prose pre-empts
29
+ * the narration bias. Short prompts (the common case when extracting
30
+ * a kernel) re-surface it.
31
+ *
32
+ * See [[ai_sdk_tools_function_calls_xml_in_prose]] memory note for
33
+ * the full trap catalog.
34
+ */
35
+ export declare const ANTI_TOOL_NARRATION_RULE: string;
36
+ //# sourceMappingURL=anti-narration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"anti-narration.d.ts","sourceRoot":"","sources":["../../src/runtime/anti-narration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,wBAAwB,QAMf,CAAA"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Anti-narration system-prompt fragment.
3
+ *
4
+ * Anthropic models sometimes emit BOTH structured `tool_use` blocks
5
+ * AND a prose narration of the same call using the legacy
6
+ * `<function_calls>` / `<invoke>` XML format from their training
7
+ * corpus. Tools execute correctly either way — the AI SDK only acts
8
+ * on the structured blocks — but the XML leaks into the user-visible
9
+ * answer and the chat bubble looks broken.
10
+ *
11
+ * The default behaviour can be suppressed by an explicit instruction
12
+ * in the system prompt. Compose this constant into your
13
+ * `systemPrompt.static`:
14
+ *
15
+ * ```ts
16
+ * import { ANTI_TOOL_NARRATION_RULE } from 'maestro-core/runtime'
17
+ *
18
+ * runChatTurn({
19
+ * systemPrompt: {
20
+ * static: `${persona}\n\n${ANTI_TOOL_NARRATION_RULE}\n\n${corpus}`,
21
+ * },
22
+ * // ...
23
+ * })
24
+ * ```
25
+ *
26
+ * Hosts that already have a long multi-segment system prompt with
27
+ * explicit guidance on tool/UI rendering (barbeiro's legacy route,
28
+ * for example) often don't need this — the existing prose pre-empts
29
+ * the narration bias. Short prompts (the common case when extracting
30
+ * a kernel) re-surface it.
31
+ *
32
+ * See [[ai_sdk_tools_function_calls_xml_in_prose]] memory note for
33
+ * the full trap catalog.
34
+ */
35
+ export const ANTI_TOOL_NARRATION_RULE = 'When you call tools, do NOT narrate the call or include any ' +
36
+ '`<function_calls>`, `<invoke>`, or similar XML in your text ' +
37
+ 'output. The tool runs structurally; your reply must contain ' +
38
+ 'only the natural-language answer derived from the tool ' +
39
+ 'results. Never repeat the tool name, parameters, or any XML ' +
40
+ 'markup in prose.';
41
+ //# sourceMappingURL=anti-narration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"anti-narration.js","sourceRoot":"","sources":["../../src/runtime/anti-narration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,CAAC,MAAM,wBAAwB,GACjC,8DAA8D;IAC9D,8DAA8D;IAC9D,8DAA8D;IAC9D,yDAAyD;IACzD,8DAA8D;IAC9D,kBAAkB,CAAA"}
@@ -1,3 +1,4 @@
1
+ export { ANTI_TOOL_NARRATION_RULE } from './anti-narration.js';
1
2
  export { decideEmptyRecovery, type DecideEmptyRecoveryArgs, type EmptyRecoveryDecision, type EmptyRecoveryMode, } from './empty-recovery.js';
2
3
  export { formatMemoryBlock, loadMemoryBlock } from './memory.js';
3
4
  export { mapModelIdToOpenAI, shouldFallback } from './providers.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,mBAAmB,EACnB,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,GACzB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAChE,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AACnE,OAAO,EACH,kBAAkB,EAClB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,eAAe,EACf,mBAAmB,GACtB,MAAM,YAAY,CAAA;AACnB,OAAO,EACH,WAAW,EACX,KAAK,eAAe,EACpB,KAAK,gBAAgB,GACxB,MAAM,oBAAoB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAA;AAC9D,OAAO,EACH,mBAAmB,EACnB,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,GACzB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAChE,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AACnE,OAAO,EACH,kBAAkB,EAClB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,eAAe,EACf,mBAAmB,GACtB,MAAM,YAAY,CAAA;AACnB,OAAO,EACH,WAAW,EACX,KAAK,eAAe,EACpB,KAAK,gBAAgB,GACxB,MAAM,oBAAoB,CAAA"}
@@ -1,3 +1,4 @@
1
+ export { ANTI_TOOL_NARRATION_RULE } from './anti-narration.js';
1
2
  export { decideEmptyRecovery, } from './empty-recovery.js';
2
3
  export { formatMemoryBlock, loadMemoryBlock } from './memory.js';
3
4
  export { mapModelIdToOpenAI, shouldFallback } from './providers.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,mBAAmB,GAItB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAChE,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AACnE,OAAO,EACH,kBAAkB,EAGlB,eAAe,EACf,mBAAmB,GACtB,MAAM,YAAY,CAAA;AACnB,OAAO,EACH,WAAW,GAGd,MAAM,oBAAoB,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAA;AAC9D,OAAO,EACH,mBAAmB,GAItB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAChE,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AACnE,OAAO,EACH,kBAAkB,EAGlB,eAAe,EACf,mBAAmB,GACtB,MAAM,YAAY,CAAA;AACnB,OAAO,EACH,WAAW,GAGd,MAAM,oBAAoB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "maestro-core",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "Runtime kernel for the Maestro agent platform — tool envelope, tool definition factory, base context, port interfaces, and AI-SDK + MCP adapters.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Costa Software",