@tbox.cn/app-agent-sdk-server 0.3.8 → 1.0.0-alpha.10

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.
@@ -1,15 +1,16 @@
1
- import { HandlerRegistry, ServerContext, HandlerResult, LocalSkill, PreToolDef, RegistryTool, PreToolHistoryTurn, PreToolRouting, WsAuthenticator, ScopeSessionRegistry, AuthRuntime, TboxTtsClient } from '@tbox.cn/app-sdk-server';
1
+ import { HandlerRegistry, ServerContext, HandlerResult, LocalSkill, PreToolDef, RegistryTool, PreToolHistoryTurn, PreToolRouting, WsAuthenticator, ScopeSessionRegistry, RegisteredModuleAction, AuthRuntime, TboxTtsClient } from '@tbox.cn/app-sdk-server';
2
2
  export * from '@tbox.cn/app-sdk-server';
3
3
  export { LocalSkill, TtsVoiceConfig } from '@tbox.cn/app-sdk-server';
4
4
  export { InferModuleCards } from '@tbox.cn/app-sdk-core';
5
5
  import * as _tbox_cn_app_contracts from '@tbox.cn/app-contracts';
6
- import { SendMessageMediaItem, SkillRecord, ServerEvent, PreToolRecord, MemoryKind, MemoryRecord, MemoryStore, MemoryStoreCapabilities, MemoryErrorCode, RequestContext as RequestContext$1, CardMeta, CardSnapshot, Identity, ExternalCredentials, HelloAckChatConfig, TboxCardPayload } from '@tbox.cn/app-contracts';
6
+ import { SendMessageMediaItem, SkillRecord, ServerEvent, PreToolRecord, MemoryKind, MemoryRecord, MemoryStore, MemoryStoreCapabilities, MemoryErrorCode, RequestContext as RequestContext$1, CardMeta, CardSnapshot, Identity, ExternalCredentials, HelloAckChatConfig, CardView, cardViewSchema, CardActionResult, TboxCardPayload } from '@tbox.cn/app-contracts';
7
7
  import * as _mastra_core_tools from '@mastra/core/tools';
8
- import { Tool } from '@mastra/core/tools';
8
+ import { Tool, createTool } from '@mastra/core/tools';
9
9
  export { Tool, createTool } from '@mastra/core/tools';
10
10
  import { ObservabilityExporter, TracingEvent, SpanType } from '@mastra/core/observability';
11
11
  import { ModelMessage, LanguageModel } from 'ai';
12
- import { AsyncLocalStorage } from 'node:async_hooks';
12
+ import { P as PoolEntry, C as CardPool, T as ToolCardSpec } from '../app-primitives-DYbywZcQ.js';
13
+ export { a as CARD_EMISSION_HINT_ACTIONS, b as CARD_EMISSION_HINT_BASE, c as CARD_EMISSION_HINT_KEYWORD, d as CardPoolOptions, e as CreateUserStateOptions, R as RegisteredUserState, f as TOOL_CARDS_FIELD, g as TOOL_CARD_DESCRIPTOR_SCHEMA, h as ToolCardDescriptor, i as ToolExecContextLike, j as ToolRunMetadata, U as UserState, k as captureToolCards, l as cardOf, m as createCardPool, n as createToolExecContext, o as createUserState, p as defineCardMeta, q as getToolRequestContext, r as getToolRunMetadata, s as requireToolRequestContext, t as toolCardScope, v as toolUser, u as userStates, w as wrapToolsForCardCapture } from '../app-primitives-DYbywZcQ.js';
13
14
  import { ZodTypeAny, z } from 'zod';
14
15
  import { SkillInput } from '@mastra/core/skills';
15
16
  import { RequestContext } from '@mastra/core/request-context';
@@ -21,6 +22,7 @@ import * as node_modules__tbox_cn_app_sdk_server_src_upstream from 'node_modules
21
22
  import { Router, Express } from 'express';
22
23
  import * as _tbox_cn_agent_plugin from '@tbox.cn/agent-plugin';
23
24
  import { ConfiguredPluginToolReference, PluginRunResult } from '@tbox.cn/agent-plugin';
25
+ import 'node:async_hooks';
24
26
 
25
27
  declare class TboxTraceExporter implements ObservabilityExporter {
26
28
  name: string;
@@ -118,18 +120,6 @@ declare function loadLocalSkills(dir: string): Promise<LocalSkill[]>;
118
120
  * references 内存化(__referenceContents),运行期零文件系统暴露。
119
121
  */
120
122
  declare function toMastraSkill(skill: LocalSkill): SkillInput;
121
- /**
122
- * 模块包级文件 skill 加载(009 模块文件化能力,底层下沉):
123
- * 包名解析定位模块包根 → 包根/skills 目录(SKILL.md 格式,复用 loadLocalSkills)。
124
- * dev / dist / 发布态 / 应用 bundle 形态路径恒等(单一策略,零包名形态约定):
125
- * - createRequire 以调用方文件为基准向上解析消费方 node_modules——
126
- * dev(workspace link)、模块 dist、应用 build dist(bundle 内联后仍从 bundle
127
- * 位置向上解析)、发布态(node_modules 内模块位置)均命中;
128
- * - 前置:目标模块 package.json exports 须含 `"./package.json"`(标准惯例,
129
- * doctor pack-exports 兼容;codegen 展开与本地骨架已默认保留)。
130
- * - 恒 resolve(失败降级 [] + 可行动诊断 warn,不 throw):模块顶层 await 调用时
131
- * 不会因加载失败中断应用启动链。
132
- */
133
123
  declare function loadModuleSkills(packageName: string, importMetaUrl: string): Promise<LocalSkill[]>;
134
124
 
135
125
  /** 默认文件 URL 前缀(可被 createChatEngine 的 fileUrlPrefix 覆盖) */
@@ -317,6 +307,11 @@ declare const EARLY_EXECUTION_MARKER: unique symbol;
317
307
  * (单例铁律,002 §10.1)。@mastra/core 由 app-sdk 唯一持有(dependencies),
318
308
  * 经本文件 re-export,模块只需依赖 @tbox.cn/app-sdk。
319
309
  */
310
+ /**
311
+ * 定义工具(mastra createTool 的公开入口)。
312
+ *
313
+ * @agentApi tool
314
+ */
320
315
 
321
316
  /**
322
317
  * 任意具体化实例的 Mastra Tool(泛型擦除别名,agent 侧专用)。
@@ -389,6 +384,11 @@ declare function omitInternal<T extends object>(tools: Record<string, T>): Recor
389
384
  * 自行描述出卡机制(标签语法/cardType 目录——机制归平台段单源)。
390
385
  * 浅拷贝(getOwnPropertyDescriptors)不改原实例;id/execute/inputSchema 引用保持。
391
386
  */
387
+ /**
388
+ * 给出卡工具的 description 追加「命中数据时结果附可展示卡片(cards)。」。
389
+ *
390
+ * @agentApi tool-emits-card
391
+ */
392
392
  declare function withCardEmissionHint<T extends {
393
393
  description?: string;
394
394
  }>(tool: T, opts?: {
@@ -1478,100 +1478,6 @@ declare function createStreamTagEngine(specs: readonly TagSpec[], opts?: {
1478
1478
  track?: TagTrack;
1479
1479
  }): StreamTagEngine;
1480
1480
 
1481
- /**
1482
- * 工具出卡协议单源(v2)。
1483
- *
1484
- * 作者契约:工具 execute 返回 `{ ...顶层答话事实, cards: [{cardType, data, note?}] }`——
1485
- * `cards` 字段名为平台保留字(非出卡工具禁用此字段名承载其他语义)。
1486
- *
1487
- * capture 后模型可见面(模型上下文 / TOOL_CALL_RESULT 事件 / preTool reminder /
1488
- * inputs.preTools 落库)四面统一为 stripped 形态:
1489
- * `{ ...顶层, cards: [{id:"cN", cardType, note}] }`
1490
- * 同一工具同一产出,模型 tool-result 与 preTool reminder 两路所见 payload 同构——
1491
- * 由单点包装(wrapToolsForCardCapture)构造保证:两路执行同一 wrapped execute。
1492
- *
1493
- * 两层 id:
1494
- * - ref(c1..cN):线程内单调的 occurrence 引用(descriptor.id 即 ref,按设计出现在上述四个
1495
- * 模型可见面);不进出卡 payload(CUSTOM tbox:card)与历史快照;
1496
- * - 实例 id(card_<ts>_<rand>):emit 时生成(CardEmitter 现状),出卡实例身份与历史快照主键。
1497
- */
1498
-
1499
- /** 出参 cards 字段名(平台保留字) */
1500
- declare const TOOL_CARDS_FIELD = "cards";
1501
- /** 出卡工具 description 标注关键词(平台段预告句共享——跨文件钉死断言防漂移) */
1502
- declare const CARD_EMISSION_HINT_KEYWORD = "\u53EF\u5C55\u793A\u5361\u7247";
1503
- /** 出卡工具 description 标注句基础形(withCardEmissionHint 单源) */
1504
- declare const CARD_EMISSION_HINT_BASE = "\u547D\u4E2D\u6570\u636E\u65F6\u7ED3\u679C\u9644\u53EF\u5C55\u793A\u5361\u7247\uFF08cards\uFF09\u3002";
1505
- /** 出卡工具 description 标注句动作卡后缀(卡上承载操作入口时追加) */
1506
- declare const CARD_EMISSION_HINT_ACTIONS = "\u64CD\u4F5C\u5165\u53E3\u5728\u5361\u7247\u4E0A\u3002";
1507
- /** descriptor 形状恒定(capture 后模型可见形态;供 outputSchema 组合,可选导出) */
1508
- declare const TOOL_CARD_DESCRIPTOR_SCHEMA: z.ZodObject<{
1509
- id: z.ZodString;
1510
- cardType: z.ZodString;
1511
- note: z.ZodString;
1512
- }, "strip", z.ZodTypeAny, {
1513
- id: string;
1514
- cardType: string;
1515
- note: string;
1516
- }, {
1517
- id: string;
1518
- cardType: string;
1519
- note: string;
1520
- }>;
1521
- /** 作者侧:工具 execute 出参中的卡条目 */
1522
- interface ToolCardSpec {
1523
- cardType: string;
1524
- data: Record<string, unknown>;
1525
- note?: string;
1526
- }
1527
- /** 模型侧:stripped 出参中的卡描述符 */
1528
- interface ToolCardDescriptor {
1529
- id: string;
1530
- cardType: string;
1531
- note: string;
1532
- }
1533
- /** 池条目(不可变:每个合法 cards occurrence 都是独立候选) */
1534
- interface PoolEntry {
1535
- ref: string;
1536
- cardType: string;
1537
- data: Record<string, unknown>;
1538
- note: string;
1539
- }
1540
- interface CardPoolOptions {
1541
- /** ChatEngine 使用线程级单调 ref;缺省时池内从 c1 开始。 */
1542
- allocateRef?: () => string;
1543
- }
1544
- interface CardPool {
1545
- /** 校验 + 注入;每个合法 occurrence 都创建独立 ref,校验失败 → null */
1546
- add(spec: ToolCardSpec, registry: Record<string, CardMeta>): ToolCardDescriptor | null;
1547
- /** ref 精确查找(大小写不敏感) */
1548
- byRef(ref: string): PoolEntry | undefined;
1549
- entries(): readonly PoolEntry[];
1550
- size(): number;
1551
- }
1552
- /** 候选池工厂(每 run 一个;每个 occurrence 独立 ref) */
1553
- declare function createCardPool(options?: CardPoolOptions): CardPool;
1554
- /**
1555
- * capture:校验 + 池注入 + 剥离(单函数三合一)。
1556
- * - raw 非对象或无 cards 字段 → 原样返回(no-op,不出卡工具零开销);
1557
- * - cards 非数组 → warn + 原样返回;
1558
- * - 逐条校验(非对象 / cardType 非 string / 未注册 / dataSchema 失败 → skip + warn);
1559
- * - 有效 ≥1 → `{ ...raw, cards: descriptors }`;全无效 → 浅拷贝删除 cards 键;
1560
- * - 条目数 > CARDS_WARN_LIMIT → warn(不截断)。
1561
- */
1562
- declare function captureToolCards(raw: unknown, pool: CardPool, registry: Record<string, CardMeta>): unknown;
1563
- /** run 级卡片池 ALS 上下文(chat/submitForm run 开始进入,finally 退出) */
1564
- declare const toolCardScope: AsyncLocalStorage<{
1565
- pool: CardPool;
1566
- }>;
1567
- /**
1568
- * 单点包装:浅拷贝每个 tool 仅替换 execute(禁变异原实例);无 execute 的原样保留。
1569
- * wrapped execute:双参 + 接收者透传(mastra 契约),产出经 captureToolCards
1570
- * (ALS 无池 → 引擎外直调原样返回)。模型路径(Agent.tools)与 preTool 路径
1571
- * (engine 按 id 替换执行体)共用同一 wrapped execute → 两路同构由构造保证。
1572
- */
1573
- declare function wrapToolsForCardCapture(tools: Record<string, Tool>, registry: Record<string, CardMeta>): Record<string, Tool>;
1574
-
1575
1481
  /**
1576
1482
  * 出卡决策协议(候选池 → 模型标签决策 → 多卡下发)。
1577
1483
  *
@@ -1980,6 +1886,161 @@ interface CreateCardToolOptions<TSchema extends ZodTypeAny> {
1980
1886
  }
1981
1887
  declare function createCardTool<TSchema extends ZodTypeAny>(opts: CreateCardToolOptions<TSchema>): _mastra_core_tools.Tool<TSchema extends _mastra_core_schema.PublicSchema<any> ? _mastra_core_schema.InferPublicSchema<TSchema> : unknown, unknown, unknown, unknown, _mastra_core_tools.ToolExecutionContext<unknown, unknown, unknown>, string, unknown>;
1982
1888
 
1889
+ /**
1890
+ * defineViewCard:一张卡只有服务端一个文件。
1891
+ *
1892
+ * - 卡的 data 就是视图 JSON(CardView),dataSchema = cardViewSchema;
1893
+ * - 样例由 view(state) 派生,不再手写大段 sampleData;
1894
+ * - app-build 见到 meta 上的 view 标记时,自动派生客户端 stub(ViewCard),
1895
+ * 不再要求 apps/client/src/cards/<id>.card.tsx 成对文件。
1896
+ */
1897
+
1898
+ interface ViewCardSampleState<T> {
1899
+ /** 样本名(考察点短标签) */
1900
+ label: string;
1901
+ /** 考察点说明 */
1902
+ note?: string;
1903
+ /** 该状态的领域数据;渲染前经 view() 转成视图 JSON */
1904
+ state: T;
1905
+ }
1906
+ interface DefineViewCardOptions<T> {
1907
+ cardType: string;
1908
+ displayName: string;
1909
+ description: string;
1910
+ /** 领域数据 -> 视图 JSON(纯函数:不读 IO、不依赖 React) */
1911
+ view: (data: T) => CardView;
1912
+ /** 基准态领域数据(sampleData 由它派生) */
1913
+ sampleState: T;
1914
+ /** 附加状态样本 */
1915
+ samples?: ViewCardSampleState<T>[];
1916
+ schemaVersion?: number;
1917
+ }
1918
+ type ViewCardMeta<T> = Omit<CardMeta<typeof cardViewSchema>, 'view'> & {
1919
+ view: (data: T) => CardView;
1920
+ };
1921
+ declare function defineViewCard<T>(options: DefineViewCardOptions<T>): ViewCardMeta<T>;
1922
+ /**
1923
+ * 出卡:领域数据 -> 视图 JSON -> 出卡条目。
1924
+ * 生产侧先 normalize(截断超预算),再交给 tool-cards 的统一校验,不整张卡丢弃。
1925
+ */
1926
+ declare function cardOfView<T>(meta: ViewCardMeta<T>, data: T, note: string): ToolCardSpec;
1927
+
1928
+ /**
1929
+ * 应用级卡片动作:把「点了按钮之后确定要发生什么」从模型手里拿走。
1930
+ *
1931
+ * 与工具的分工:
1932
+ * - 工具走模型:需要理解、需要上下文、需要多步判断;
1933
+ * - 动作走确定性通道:入参确定、结果确定、用户点击即执行,不经模型。
1934
+ *
1935
+ * 声明落在 `apps/server/src/actions/*.action.ts`,由 app-build 扫描进 registry,
1936
+ * 运行时注册到 `ctx.cardActions`;卡片上的 `invoke(actionId)` 触发,令牌由平台签发。
1937
+ */
1938
+
1939
+ interface ActionDefinition<TSchema extends z.ZodTypeAny> {
1940
+ /** 动作 id,全局唯一;卡片按钮用同一个字符串调用 */
1941
+ id: string;
1942
+ /** 动作绑定哪张卡片(单卡或数组;出卡时按 cardType 匹配并签发令牌) */
1943
+ cardType: string | string[];
1944
+ /** 入参 schema(无参写 z.object({})) */
1945
+ inputSchema: TSchema;
1946
+ /** 按钮文案(缺省用 id) */
1947
+ label?: string;
1948
+ /** 一次性:执行成功后令牌作废,防重复提交 */
1949
+ singleUse?: boolean;
1950
+ /** 按钮样式 */
1951
+ style?: 'primary' | 'secondary' | 'link';
1952
+ /** 执行体:返回值可直接原地更新卡片(`update`)或出结果卡(`card`) */
1953
+ execute: (input: z.infer<TSchema>, ctx: {
1954
+ userId: string;
1955
+ cardId?: string;
1956
+ cardType?: string;
1957
+ }) => Promise<CardActionResult>;
1958
+ }
1959
+ /** 扫描与注册共用的形态:`moduleId` 固定 `app`,把声明映射成平台动作记录。 */
1960
+ interface DefinedAction<TSchema extends z.ZodTypeAny> extends RegisteredModuleAction {
1961
+ definition: ActionDefinition<TSchema>;
1962
+ }
1963
+ /**
1964
+ * 声明一个应用级动作。
1965
+ *
1966
+ * 迁移说明:`execute` 收到的 `ctx.userId` 来自授权令牌绑定的会话身份,
1967
+ * 不要在这里信任客户端传上来的 userId。
1968
+ */
1969
+ /**
1970
+ * 声明一个应用级卡片动作(点击直接执行,不过模型)。
1971
+ *
1972
+ * @agentApi card-action
1973
+ */
1974
+ declare function defineAction<TSchema extends z.ZodTypeAny>(definition: ActionDefinition<TSchema>): DefinedAction<TSchema>;
1975
+
1976
+ /**
1977
+ * 应用级工具的作者入口:与 `defineAction` 对称。
1978
+ *
1979
+ * 收口三件容易写错的事:
1980
+ * - 身份:`execute(input, { userId, identity })` 由平台注入,不需要自己拼 `requireToolRequestContext`;
1981
+ * - 出卡提示:声明了 `cards` 就自动补「命中数据时结果附可展示卡片(cards)」,不再手写 `Object.assign`;
1982
+ * - 声明式卡片清单:`cards` 同时是能力图的来源(哪个工具会出哪张卡)。
1983
+ *
1984
+ * 需要 suspend / resume 等高级能力时仍用 `createTool`。
1985
+ */
1986
+
1987
+ interface DefineToolIdentity {
1988
+ userId: string;
1989
+ source: string;
1990
+ displayName?: string;
1991
+ avatar?: string;
1992
+ }
1993
+ interface DefineToolContext {
1994
+ userId: string;
1995
+ identity: DefineToolIdentity;
1996
+ }
1997
+ interface DefineToolOptions<TSchema extends z.ZodTypeAny, TOutput> {
1998
+ id: string;
1999
+ description: string;
2000
+ inputSchema: TSchema;
2001
+ /** 会出的卡片:自动补出卡提示,并作为能力图的声明来源 */
2002
+ cards?: readonly CardMeta<z.ZodTypeAny>[];
2003
+ execute: (input: z.infer<TSchema>, ctx: DefineToolContext) => Promise<TOutput>;
2004
+ }
2005
+ /**
2006
+ * 声明一个应用级工具。
2007
+ *
2008
+ * @agentApi tool
2009
+ */
2010
+ declare function defineTool<TSchema extends z.ZodTypeAny, TOutput>(options: DefineToolOptions<TSchema, TOutput>): ReturnType<typeof createTool>;
2011
+
2012
+ /**
2013
+ * 动作结果构造器:把「本卡状态变了用 update、另一类结果用 card、只要一句提示用 notice」
2014
+ * 从配方里的判据变成签名——`update` / `card` 都要求对应的卡片声明,提示文字不混进两者。
2015
+ *
2016
+ * 直接返回对象字面量仍然合法,由门禁的同源校验兜底。
2017
+ */
2018
+
2019
+ /** 原地刷新被点击的卡片;`data` 必须能过该卡的 schema。
2020
+ *
2021
+ * @agentApi card-action
2022
+ */
2023
+ declare function updateResult<S extends z.ZodTypeAny>(_meta: CardMeta<S>, data: z.input<S>): CardActionResult;
2024
+ /** 出一张结果卡;`cardType` 取自已声明的卡片。
2025
+ *
2026
+ * @agentApi card-action
2027
+ */
2028
+ declare function cardResult<S extends z.ZodTypeAny>(meta: CardMeta<S>, data: z.input<S>): CardActionResult;
2029
+ /** 只给一句提示(没有 update / card 时才会下发到界面)。
2030
+ *
2031
+ * @agentApi card-action
2032
+ */
2033
+ declare function noticeResult(text: string): CardActionResult;
2034
+ /** 三种结果的构造器集合(update / card / notice)。
2035
+ *
2036
+ * @agentApi card-action
2037
+ */
2038
+ declare const actionResult: {
2039
+ update: typeof updateResult;
2040
+ card: typeof cardResult;
2041
+ notice: typeof noticeResult;
2042
+ };
2043
+
1983
2044
  /**
1984
2045
  * 表单提交虚拟 tool 的 id。
1985
2046
  * 单一来源,跨 chat-engine / registry / 客户端过滤逻辑共用。
@@ -2084,39 +2145,6 @@ interface LoadedAgentPromptConfig {
2084
2145
  }
2085
2146
  declare function loadAgentPromptConfig(configDir: string): LoadedAgentPromptConfig;
2086
2147
 
2087
- /** 工具 execute 第二参的结构型投影(只声明读取器消费的形状) */
2088
- interface ToolExecContextLike {
2089
- requestContext?: {
2090
- get(key: string): unknown;
2091
- };
2092
- toolCallId?: string;
2093
- agent?: {
2094
- toolCallId?: string;
2095
- };
2096
- }
2097
- interface ToolRunMetadata {
2098
- runId: string;
2099
- threadKey: string;
2100
- toolCallId: string;
2101
- }
2102
- /** Read trusted producer metadata from the execute context, never from model arguments. */
2103
- declare function getToolRunMetadata(execCtx: ToolExecContextLike | undefined): Readonly<ToolRunMetadata> | undefined;
2104
- /**
2105
- * 从工具 execute 第二参读取运行上下文(散键组装)。
2106
- * 返回 undefined 当 requestContext 缺失或 identity 键缺失(引擎外直调/匿名无身份)。
2107
- */
2108
- declare function getToolRequestContext(execCtx: ToolExecContextLike | undefined): Readonly<RequestContext$1> | undefined;
2109
- /**
2110
- * 严格变体:运行上下文缺失时抛 AUTH_FORBIDDEN(fail-visible——显式正确性优于静默降级)。
2111
- * @param toolId 诊断信息(缺失文案指明哪个工具、怎么修)
2112
- */
2113
- declare function requireToolRequestContext(execCtx: ToolExecContextLike | undefined, toolId?: string): Readonly<RequestContext$1>;
2114
- /**
2115
- * 测试/直调助手:由 plain RequestContext 构造工具 execute 第二参形态。
2116
- * 散键写入与引擎 buildRunRequestContext 同构(往返由 context-concurrency.test C2 锁定)。
2117
- */
2118
- declare function createToolExecContext(reqCtx: RequestContext$1): ToolExecContextLike;
2119
-
2120
2148
  interface SaveMessageParams {
2121
2149
  conversationId: string;
2122
2150
  agentId: string;
@@ -2342,4 +2370,4 @@ interface SampleShapeReport {
2342
2370
  */
2343
2371
  declare function findSampleShapeViolations(meta: CardMeta): SampleShapeReport;
2344
2372
 
2345
- export { type AnyTool, BROAD_ROUTING_TERMS, BUILTIN_HYGIENE_NAMES, type BootstrapMemoryKbOptions, type BootstrapMemoryKbResult, type BuildEngineOptions, CARDS_SPEC, CARD_DECISION_HOLD_LIMIT, CARD_DECISION_TAG, CARD_EMISSION_HINT_ACTIONS, CARD_EMISSION_HINT_BASE, CARD_EMISSION_HINT_KEYWORD, type CardDecisionPlan, type CardDecisionStripper, type CardPersistenceBackend, type CardPool, type CardPoolOptions, type ChatEngine, type ChatEngineOptions, type ContentPart, type ContentTagHygiene, type ConversationRouterDeps, ConversationService, DECISION_HOLD_LIMIT, DEFAULT_INSTRUCTIONS, DEFAULT_KNOWLEDGE_MEMORY_CAPABILITIES, DEFAULT_LIST_TTL_MS, DEFAULT_LLM_PROVIDER_CONFIG_PATH, DEFAULT_MAX_CARDS_PER_TURN, DEFAULT_MAX_ENTRIES, DEFAULT_MAX_PRE_TOOLS_PER_RUN, DEFAULT_MEMORY_MAX_CHARS_PER_RECORD, DEFAULT_MEMORY_RECALL_TIMEOUT_MS, DEFAULT_MEMORY_TOP_K, DEFAULT_MEMORY_VALIDATE_TIMEOUT_MS, DEFAULT_PRE_TOOL_TIMEOUT_MS, DEFAULT_SKILL_MODE, DROP_BODY_SOFT_LIMIT, EARLY_EXECUTION_MARKER, type EngineModelStepInput, type EnginePreModelActivityAttestation, type EngineRunEndInput, type EngineRunInput, type EngineStepControlFactory, type EngineStepControlInput, type EngineStepController, type EngineStepResultInput, type EngineStepToolChoice, type EngineToolCallInput, type EngineToolResultInput, FORM_SUBMIT_TOOL_ID, FileCardPersistenceBackend, HYGIENE_TAG_NORMALIZE, type HygieneTagFamily, INTERNAL_TOOL, type InstallTboxDevDeps, type IntentRoute, KB_SCOPE_GLOBAL, KNOWLEDGE_DEFAULT_BASE_URL, KnowledgeBootstrapError, type KnowledgeMemoryStoreOptions, KnowledgeOpenapiError, type KnowledgeOpenapiTransportOptions, type KnowledgeTransport, type LoadedAgentPromptConfig, type LoadedChatConfig, type LoadedPluginTools, MEMORY_IMPORTANCE_BASE, MEMORY_KB_INDEX_COLUMNS, MEMORY_KB_SCHEMA, MEMORY_KB_SEED_CSV, MEMORY_LIST_DEFAULT_LIMIT, MEMORY_LIST_MAX_LIMIT, MEMORY_MAX_PER_USER, type MemoryEngineOptions, type MemoryFilterColumn, type MemoryGuardDeps, type MemoryGuardEnv, type MemoryPromptCaps, type MemoryRouterDeps, type MemoryStoreEnv, MemoryStoreUnsupportedError, type MemoryToolDeps, MemoryUnavailableError, type MemoryValidateMode, type MemoryValidationOutcome, MessageEmbeddedBackend, type ModelProviderOptions, PRE_TOOL_HISTORY_LIMIT, type ParallelToolCallsControl, type PlatformApiRouterDeps, type PluginIntegrationOptions, type PoolEntry, type PreFilterTerm, type PreToolExecContext, PreToolTimeoutError, PreviewActionError, type QuickCommand, RAW_TOOL_INPUT_BOUNDARY, type RawToolInputBoundary, type RawToolInputBoundaryResult, type RecallCacheOptions, type RecallCacheState, type ResolvedRuntimeContextOptions, type ResolvedTagSpecs, type RuntimeContextOptions, type RuntimeTemporalContext, type RuntimeTemporalContextSnapshot, type SampleShapeBlindSpot, type SampleShapeReport, type SampleShapeViolation, type SdkRuntimeOptions, type SdkToolRuntime, type SegmentHit, type SkillInjectionDecision, type SkillMode, type SortTerm, type StoredMemoryRecord, type StreamTagEngine, DEFAULT_FILE_URL_PREFIX as TBOX_FILE_URL_PREFIX, THINK_SPECS, TOOL_CALL_TEXT_SPECS, TOOL_CARDS_FIELD, TOOL_CARD_DESCRIPTOR_SCHEMA, type TagBodyPolicy, type TagEngineFinish, type TagHit, type TagSeal, type TagSource, type TagSpec, type TagTrack, TboxTraceExporter, type ThinkingControl, type ToolCardDescriptor, type ToolCardSpec, type ToolExecContextLike, type ToolRunMetadata, type TurnReminderBlocks, applySkillReminder, bootstrapMemoryKnowledgeBase, buildCardDecisionReminder, buildInjectedUserContent, buildMemoryRecallToolCallEvents, buildMemoryReminder, buildMessageInputs, buildPlatformInstructions, buildPreToolCallEndEvents, buildPreToolCallStartEvents, buildPreToolDirectives, buildRecapUserContent, buildSkillRecapReminder, buildSkillReminder, buildSkillToolCallEvents, buildUserContent, captureToolCards, clampMaxCards, clampMemoryMaxChars, clampMemoryTopK, coerceStringifiedFields, composeTurnUserContent, createCardDecisionStripper, createCardPool, createCardTool, createChatEngine, createConversationRouter, createEngineFromContext, createGatedMemoryStore, createInMemoryMemoryStore, createIntentDispatcher, createKnowledgeMemoryStore, createKnowledgeOpenapiTransport, createMemoryRouter, createMemoryTools, createModelProvider, createPlatformApiRouter, createPluginIntegration, createRuntimeTemporalContext, createSdkToolRuntime, createStreamTagEngine, createToolExecContext, createTtsProxy, createWsServer, decideCards, decideSkillInjection, definePreTool, envelopeTag, executePreTool, extractImageUrls, findSampleShapeViolations, formSubmitTool, generateMemoryId, getLastRecallCacheState, getToolRequestContext, getToolRunMetadata, getTtsClient, hardenToolsForLlm, hashContent, healthRouter, hygieneXmlTag, installTboxDev, internalTool, isCleanPreModelActivityAttestation, loadAgentPromptConfig, loadChatConfig, loadLocalSkills, loadModuleSkills, matchIntent, memoryStoreCapabilities, mergePreTools, mergeSkills, normalizePreTools, omitInternal, pickFallbackCard, projectHistory, recallMemories, requireToolRequestContext, resetTtsClient, resolveEarlyToolExecution, resolveMaxSteps, resolveMemoryEngineOptions, resolveMemoryRecallTimeout, resolveMemoryStore, resolveMemoryStoreGuarded, resolveMemoryValidateMode, resolveMemoryValidateTimeout, resolvePreToolTimeout, resolveRuntimeContextOptions, resolveSkillMode, resolveTagSpecs, resolveToolDebug, restoreCardSnapshot, sanitizeLlmToolInput, scanInjectedSkills, scopeToKey, selectPreTools, selectSkill, stableStringify, stripSystemReminderBlocks, router as tboxSessionRouter, tboxTraceExporter, toCardSnapshot, toMastraSkill, toWsChatConfig, tokenizeTagBody, toolCardScope, validateMemoryKnowledgeBase, withCardEmissionHint, withDeadline, withEarlyExecution, withLlmInputSanitize, withRawToolInputBoundary, withRecallCache, wrapToolsForCardCapture, xmlTag, xmlTagDecision };
2373
+ export { type ActionDefinition, type AnyTool, BROAD_ROUTING_TERMS, BUILTIN_HYGIENE_NAMES, type BootstrapMemoryKbOptions, type BootstrapMemoryKbResult, type BuildEngineOptions, CARDS_SPEC, CARD_DECISION_HOLD_LIMIT, CARD_DECISION_TAG, type CardDecisionPlan, type CardDecisionStripper, type CardPersistenceBackend, CardPool, type ChatEngine, type ChatEngineOptions, type ContentPart, type ContentTagHygiene, type ConversationRouterDeps, ConversationService, DECISION_HOLD_LIMIT, DEFAULT_INSTRUCTIONS, DEFAULT_KNOWLEDGE_MEMORY_CAPABILITIES, DEFAULT_LIST_TTL_MS, DEFAULT_LLM_PROVIDER_CONFIG_PATH, DEFAULT_MAX_CARDS_PER_TURN, DEFAULT_MAX_ENTRIES, DEFAULT_MAX_PRE_TOOLS_PER_RUN, DEFAULT_MEMORY_MAX_CHARS_PER_RECORD, DEFAULT_MEMORY_RECALL_TIMEOUT_MS, DEFAULT_MEMORY_TOP_K, DEFAULT_MEMORY_VALIDATE_TIMEOUT_MS, DEFAULT_PRE_TOOL_TIMEOUT_MS, DEFAULT_SKILL_MODE, DROP_BODY_SOFT_LIMIT, type DefineToolContext, type DefineToolIdentity, type DefineToolOptions, type DefineViewCardOptions, type DefinedAction, EARLY_EXECUTION_MARKER, type EngineModelStepInput, type EnginePreModelActivityAttestation, type EngineRunEndInput, type EngineRunInput, type EngineStepControlFactory, type EngineStepControlInput, type EngineStepController, type EngineStepResultInput, type EngineStepToolChoice, type EngineToolCallInput, type EngineToolResultInput, FORM_SUBMIT_TOOL_ID, FileCardPersistenceBackend, HYGIENE_TAG_NORMALIZE, type HygieneTagFamily, INTERNAL_TOOL, type InstallTboxDevDeps, type IntentRoute, KB_SCOPE_GLOBAL, KNOWLEDGE_DEFAULT_BASE_URL, KnowledgeBootstrapError, type KnowledgeMemoryStoreOptions, KnowledgeOpenapiError, type KnowledgeOpenapiTransportOptions, type KnowledgeTransport, type LoadedAgentPromptConfig, type LoadedChatConfig, type LoadedPluginTools, MEMORY_IMPORTANCE_BASE, MEMORY_KB_INDEX_COLUMNS, MEMORY_KB_SCHEMA, MEMORY_KB_SEED_CSV, MEMORY_LIST_DEFAULT_LIMIT, MEMORY_LIST_MAX_LIMIT, MEMORY_MAX_PER_USER, type MemoryEngineOptions, type MemoryFilterColumn, type MemoryGuardDeps, type MemoryGuardEnv, type MemoryPromptCaps, type MemoryRouterDeps, type MemoryStoreEnv, MemoryStoreUnsupportedError, type MemoryToolDeps, MemoryUnavailableError, type MemoryValidateMode, type MemoryValidationOutcome, MessageEmbeddedBackend, type ModelProviderOptions, PRE_TOOL_HISTORY_LIMIT, type ParallelToolCallsControl, type PlatformApiRouterDeps, type PluginIntegrationOptions, PoolEntry, type PreFilterTerm, type PreToolExecContext, PreToolTimeoutError, PreviewActionError, type QuickCommand, RAW_TOOL_INPUT_BOUNDARY, type RawToolInputBoundary, type RawToolInputBoundaryResult, type RecallCacheOptions, type RecallCacheState, type ResolvedRuntimeContextOptions, type ResolvedTagSpecs, type RuntimeContextOptions, type RuntimeTemporalContext, type RuntimeTemporalContextSnapshot, type SampleShapeBlindSpot, type SampleShapeReport, type SampleShapeViolation, type SdkRuntimeOptions, type SdkToolRuntime, type SegmentHit, type SkillInjectionDecision, type SkillMode, type SortTerm, type StoredMemoryRecord, type StreamTagEngine, DEFAULT_FILE_URL_PREFIX as TBOX_FILE_URL_PREFIX, THINK_SPECS, TOOL_CALL_TEXT_SPECS, type TagBodyPolicy, type TagEngineFinish, type TagHit, type TagSeal, type TagSource, type TagSpec, type TagTrack, TboxTraceExporter, type ThinkingControl, ToolCardSpec, type TurnReminderBlocks, type ViewCardMeta, type ViewCardSampleState, actionResult, applySkillReminder, bootstrapMemoryKnowledgeBase, buildCardDecisionReminder, buildInjectedUserContent, buildMemoryRecallToolCallEvents, buildMemoryReminder, buildMessageInputs, buildPlatformInstructions, buildPreToolCallEndEvents, buildPreToolCallStartEvents, buildPreToolDirectives, buildRecapUserContent, buildSkillRecapReminder, buildSkillReminder, buildSkillToolCallEvents, buildUserContent, cardOfView, cardResult, clampMaxCards, clampMemoryMaxChars, clampMemoryTopK, coerceStringifiedFields, composeTurnUserContent, createCardDecisionStripper, createCardTool, createChatEngine, createConversationRouter, createEngineFromContext, createGatedMemoryStore, createInMemoryMemoryStore, createIntentDispatcher, createKnowledgeMemoryStore, createKnowledgeOpenapiTransport, createMemoryRouter, createMemoryTools, createModelProvider, createPlatformApiRouter, createPluginIntegration, createRuntimeTemporalContext, createSdkToolRuntime, createStreamTagEngine, createTtsProxy, createWsServer, decideCards, decideSkillInjection, defineAction, definePreTool, defineTool, defineViewCard, envelopeTag, executePreTool, extractImageUrls, findSampleShapeViolations, formSubmitTool, generateMemoryId, getLastRecallCacheState, getTtsClient, hardenToolsForLlm, hashContent, healthRouter, hygieneXmlTag, installTboxDev, internalTool, isCleanPreModelActivityAttestation, loadAgentPromptConfig, loadChatConfig, loadLocalSkills, loadModuleSkills, matchIntent, memoryStoreCapabilities, mergePreTools, mergeSkills, normalizePreTools, noticeResult, omitInternal, pickFallbackCard, projectHistory, recallMemories, resetTtsClient, resolveEarlyToolExecution, resolveMaxSteps, resolveMemoryEngineOptions, resolveMemoryRecallTimeout, resolveMemoryStore, resolveMemoryStoreGuarded, resolveMemoryValidateMode, resolveMemoryValidateTimeout, resolvePreToolTimeout, resolveRuntimeContextOptions, resolveSkillMode, resolveTagSpecs, resolveToolDebug, restoreCardSnapshot, sanitizeLlmToolInput, scanInjectedSkills, scopeToKey, selectPreTools, selectSkill, stableStringify, stripSystemReminderBlocks, router as tboxSessionRouter, tboxTraceExporter, toCardSnapshot, toMastraSkill, toWsChatConfig, tokenizeTagBody, updateResult, validateMemoryKnowledgeBase, withCardEmissionHint, withDeadline, withEarlyExecution, withLlmInputSanitize, withRawToolInputBoundary, withRecallCache, xmlTag, xmlTagDecision };