@frontmcp/sdk 1.12.3 → 1.13.0-rc.1
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.
- package/agent/agent.instance.d.ts +2 -0
- package/agent/agent.instance.d.ts.map +1 -1
- package/app/instances/app.lazy.instance.d.ts.map +1 -1
- package/auth/flows/auth.verify.flow.d.ts.map +1 -1
- package/auth/flows/session.verify.flow.d.ts.map +1 -1
- package/auth/instances/instance.remote-primary-auth.d.ts +2 -1
- package/auth/instances/instance.remote-primary-auth.d.ts.map +1 -1
- package/auth/transparent-audience.d.ts +21 -0
- package/auth/transparent-audience.d.ts.map +1 -0
- package/browser/agent/agent.instance.mjs +9 -1
- package/browser/app/instances/app.lazy.instance.mjs +1 -0
- package/browser/auth/flows/session.verify.flow.mjs +10 -4
- package/browser/auth/instances/instance.remote-primary-auth.mjs +13 -5
- package/browser/auth/transparent-audience.mjs +52 -0
- package/browser/common/interfaces/tool.interface.mjs +4 -0
- package/browser/common/metadata/app.metadata.mjs +2 -0
- package/browser/common/metadata/front-mcp.metadata.mjs +4 -0
- package/browser/common/metadata/input-policy.mjs +12 -0
- package/browser/common/metadata/output-policy.mjs +1 -0
- package/browser/common/metadata/tool.metadata.mjs +3 -1
- package/browser/common/tokens/app.tokens.mjs +1 -0
- package/browser/common/tokens/front-mcp.tokens.mjs +1 -0
- package/browser/common/tokens/tool.tokens.mjs +2 -1
- package/browser/context/frontmcp-context.mjs +2 -2
- package/browser/elicitation/questions/ask-question.mjs +1 -2
- package/browser/elicitation/questions/question.store.mjs +22 -8
- package/browser/elicitation/send-elicitation-result.tool.mjs +11 -6
- package/browser/index.cjs +5017 -4157
- package/browser/notification/notification.service.mjs +1 -0
- package/browser/remote-mcp/factories/record-builders.mjs +2 -0
- package/browser/resource/flows/read-resource.flow.mjs +33 -10
- package/browser/scope/scope.instance.mjs +3 -1
- package/browser/server/security/resolve-allowed-hosts.mjs +3 -2
- package/browser/task/store/storage-task.store.mjs +69 -20
- package/browser/task/store/task-session-index.mjs +300 -0
- package/browser/task/store/task-store.factory.mjs +4 -1
- package/browser/tool/flows/call-tool.flow.mjs +103 -21
- package/browser/tool/flows/tools-list.flow.mjs +49 -8
- package/browser/tool/tool-output-policy.mjs +14 -3
- package/browser/tool/tool.instance.mjs +9 -2
- package/browser/tool/tool.utils.mjs +90 -3
- package/browser/tool/ui/app-only-tools.mjs +17 -0
- package/browser/tool/undeclared-arguments-message.mjs +61 -0
- package/browser/tool/undeclared-arguments.mjs +35 -0
- package/browser/transport/flows/handle.mcp-20260728.flow.mjs +12 -16
- package/common/entries/tool.entry.d.ts +12 -1
- package/common/entries/tool.entry.d.ts.map +1 -1
- package/common/interfaces/tool.interface.d.ts +17 -0
- package/common/interfaces/tool.interface.d.ts.map +1 -1
- package/common/metadata/app.metadata.d.ts +19 -0
- package/common/metadata/app.metadata.d.ts.map +1 -1
- package/common/metadata/front-mcp.metadata.d.ts +161 -9
- package/common/metadata/front-mcp.metadata.d.ts.map +1 -1
- package/common/metadata/index.d.ts +1 -0
- package/common/metadata/index.d.ts.map +1 -1
- package/common/metadata/input-policy.d.ts +22 -0
- package/common/metadata/input-policy.d.ts.map +1 -0
- package/common/metadata/output-policy.d.ts +21 -3
- package/common/metadata/output-policy.d.ts.map +1 -1
- package/common/metadata/tool.metadata.d.ts +20 -1
- package/common/metadata/tool.metadata.d.ts.map +1 -1
- package/common/records/app.record.d.ts +2 -1
- package/common/records/app.record.d.ts.map +1 -1
- package/common/tokens/app.tokens.d.ts.map +1 -1
- package/common/tokens/front-mcp.tokens.d.ts.map +1 -1
- package/common/tokens/tool.tokens.d.ts +1 -0
- package/common/tokens/tool.tokens.d.ts.map +1 -1
- package/elicitation/elicitation.types.d.ts +2 -0
- package/elicitation/elicitation.types.d.ts.map +1 -1
- package/elicitation/questions/ask-question.d.ts.map +1 -1
- package/elicitation/questions/question.store.d.ts +5 -0
- package/elicitation/questions/question.store.d.ts.map +1 -1
- package/esm/index.mjs +31 -31
- package/index.d.ts +15 -15
- package/index.js +40 -40
- package/notification/notification.service.d.ts.map +1 -1
- package/package.json +10 -10
- package/remote-mcp/factories/record-builders.d.ts.map +1 -1
- package/resource/flows/read-resource.flow.d.ts +13 -1
- package/resource/flows/read-resource.flow.d.ts.map +1 -1
- package/scope/scope.instance.d.ts.map +1 -1
- package/server/security/resolve-allowed-hosts.d.ts +4 -2
- package/server/security/resolve-allowed-hosts.d.ts.map +1 -1
- package/task/store/storage-task.store.d.ts +19 -2
- package/task/store/storage-task.store.d.ts.map +1 -1
- package/task/store/task-session-index.d.ts +100 -0
- package/task/store/task-session-index.d.ts.map +1 -0
- package/task/store/task-store.factory.d.ts +5 -0
- package/task/store/task-store.factory.d.ts.map +1 -1
- package/task/task.types.d.ts +6 -0
- package/task/task.types.d.ts.map +1 -1
- package/tool/flows/call-tool.flow.d.ts +13 -1
- package/tool/flows/call-tool.flow.d.ts.map +1 -1
- package/tool/flows/tools-list.flow.d.ts +8 -1
- package/tool/flows/tools-list.flow.d.ts.map +1 -1
- package/tool/tool-output-policy.d.ts +6 -1
- package/tool/tool-output-policy.d.ts.map +1 -1
- package/tool/tool.instance.d.ts +2 -0
- package/tool/tool.instance.d.ts.map +1 -1
- package/tool/tool.utils.d.ts +12 -0
- package/tool/tool.utils.d.ts.map +1 -1
- package/tool/ui/app-only-tools.d.ts +9 -0
- package/tool/ui/app-only-tools.d.ts.map +1 -0
- package/tool/undeclared-arguments-message.d.ts +13 -0
- package/tool/undeclared-arguments-message.d.ts.map +1 -0
- package/tool/undeclared-arguments.d.ts +7 -0
- package/tool/undeclared-arguments.d.ts.map +1 -0
- package/transport/flows/handle.mcp-20260728.flow.d.ts.map +1 -1
package/tool/tool.utils.d.ts
CHANGED
|
@@ -10,7 +10,19 @@ export declare function isExternalToolRecord(record: ToolRecord): record is Tool
|
|
|
10
10
|
* - CLASS_TOKEN: deps come from the class constructor
|
|
11
11
|
*/
|
|
12
12
|
export declare function toolDiscoveryDeps(rec: ToolRecord): Token[];
|
|
13
|
+
/**
|
|
14
|
+
* Check if a value is already a valid CallToolResult.
|
|
15
|
+
* Remote tools return CallToolResult directly, so we should pass it through as-is.
|
|
16
|
+
*/
|
|
17
|
+
export declare function isCallToolResult(value: unknown): value is ParsedToolResult;
|
|
13
18
|
export declare function buildParsedToolResult(descriptor: any, raw: unknown, options?: OutputParseOptions): ParsedToolResult;
|
|
19
|
+
/**
|
|
20
|
+
* Whether `raw` is a `CallToolResult` the tool returned, not its own data: a value with an empty `content` list and no
|
|
21
|
+
* `structuredContent` that the tool's object `outputSchema` accepts is the tool's data.
|
|
22
|
+
*/
|
|
23
|
+
export declare function isReturnedCallToolResult(descriptor: unknown, raw: unknown): raw is ParsedToolResult;
|
|
24
|
+
/** Mark `answer` as the SDK's elicitation fallback, which `outputSchema` validation leaves as it is. */
|
|
25
|
+
export declare function asElicitationFallback<Answer extends object>(answer: Answer): Answer;
|
|
14
26
|
/**
|
|
15
27
|
* Build agent tool definitions from tool entries.
|
|
16
28
|
*
|
package/tool/tool.utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool.utils.d.ts","sourceRoot":"","sources":["../../src/tool/tool.utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAiD,KAAK,KAAK,EAAa,MAAM,cAAc,CAAC;AAKpG,OAAO,EAQL,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EAErB,KAAK,SAAS,EACd,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,QAAQ,EACd,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"tool.utils.d.ts","sourceRoot":"","sources":["../../src/tool/tool.utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAiD,KAAK,KAAK,EAAa,MAAM,cAAc,CAAC;AAKpG,OAAO,EAQL,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EAErB,KAAK,SAAS,EACd,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,QAAQ,EACd,MAAM,WAAW,CAAC;AAYnB,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,QAAQ,GAAG,YAAY,CAa/D;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,GAAG,GAAG,UAAU,CA4CnD;AAED,2GAA2G;AAC3G,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,IAAI,kBAAkB,CAErF;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,UAAU,GAAG,KAAK,EAAE,CAW1D;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,gBAAgB,CAoB1E;AAED,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,GAAG,EACf,GAAG,EAAE,OAAO,EACZ,OAAO,GAAE,kBAAuB,GAC/B,gBAAgB,CAsFlB;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,gBAAgB,CAInG;AAKD,wGAAwG;AACxG,wBAAgB,qBAAqB,CAAC,MAAM,SAAS,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAGnF;AA6ZD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,mBAAmB,EAAE,CAEnF;AAED,gGAAgG;AAChG,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,SAAS,GAAG,mBAAmB,CAQ7E"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Whether a tool is for its MCP Apps page only: its `_meta.ui.visibility` (SEP-1865) leaves out `'model'`. */
|
|
2
|
+
export declare function isAppOnlyTool(metadata: {
|
|
3
|
+
_meta?: Record<string, unknown>;
|
|
4
|
+
}): boolean;
|
|
5
|
+
/** The first platform known for the caller, in the order given: what it negotiated before a user-agent guess. */
|
|
6
|
+
export declare function knownPlatformOf(...platforms: Array<string | undefined>): string | undefined;
|
|
7
|
+
/** Whether a client on this platform renders MCP Apps pages, so a tool for the page alone is listed and callable. */
|
|
8
|
+
export declare function rendersAppPages(platformType: string | undefined): boolean;
|
|
9
|
+
//# sourceMappingURL=app-only-tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-only-tools.d.ts","sourceRoot":"","sources":["../../../src/tool/ui/app-only-tools.ts"],"names":[],"mappings":"AAEA,+GAA+G;AAC/G,wBAAgB,aAAa,CAAC,QAAQ,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,GAAG,OAAO,CAIpF;AAED,iHAAiH;AACjH,wBAAgB,eAAe,CAAC,GAAG,SAAS,EAAE,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,GAAG,MAAM,GAAG,SAAS,CAE3F;AAED,qHAAqH;AACrH,wBAAgB,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAEzE"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ArgumentKeyPath } from './undeclared-arguments';
|
|
2
|
+
/** The `INVALID_INPUT` message of a call refused under `input.undeclaredKeys: 'fail'`. */
|
|
3
|
+
export declare function undeclaredArgumentsRefusal(keyPaths: readonly ArgumentKeyPath[], declaredKeys: readonly string[]): string;
|
|
4
|
+
/** The last text line of an answer under `input.undeclaredKeys: 'warn'`, for the model that called. */
|
|
5
|
+
export declare function undeclaredArgumentsNote(keyPaths: readonly ArgumentKeyPath[], declaredKeys: readonly string[]): string;
|
|
6
|
+
/** The server warning under `input.undeclaredKeys: 'warn'`, naming the key paths not reported for the tool before. */
|
|
7
|
+
export declare function undeclaredArgumentsWarning(toolName: string, newKeyPaths: readonly string[]): string;
|
|
8
|
+
/**
|
|
9
|
+
* Each undeclared argument, quoted, with the declared key it is closest to when one is close enough to be a slip: the
|
|
10
|
+
* first {@link MAX_NAMED_ARGUMENTS}, each cut to {@link MAX_KEY_LENGTH} characters, then how many more there are.
|
|
11
|
+
*/
|
|
12
|
+
export declare function describeUndeclaredArguments(keyPaths: readonly ArgumentKeyPath[], declaredKeys: readonly string[]): string;
|
|
13
|
+
//# sourceMappingURL=undeclared-arguments-message.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"undeclared-arguments-message.d.ts","sourceRoot":"","sources":["../../src/tool/undeclared-arguments-message.ts"],"names":[],"mappings":"AACA,OAAO,EAAiB,KAAK,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAE7E,0FAA0F;AAC1F,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,SAAS,eAAe,EAAE,EACpC,YAAY,EAAE,SAAS,MAAM,EAAE,GAC9B,MAAM,CAER;AAED,uGAAuG;AACvG,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,SAAS,eAAe,EAAE,EAAE,YAAY,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAErH;AAED,sHAAsH;AACtH,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAKnG;AAWD;;;GAGG;AACH,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,SAAS,eAAe,EAAE,EACpC,YAAY,EAAE,SAAS,MAAM,EAAE,GAC9B,MAAM,CAOR"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** A key path as its segments, `[]` standing for the items of an array, so a key named `a.b` stays one segment. */
|
|
2
|
+
export type ArgumentKeyPath = readonly string[];
|
|
3
|
+
/** The argument key paths parsing dropped, sorted and unique; below a field with a transform none are compared. */
|
|
4
|
+
export declare function findUndeclaredArguments(shape: Readonly<Record<string, unknown>>, sent: unknown, parsed: unknown): ArgumentKeyPath[];
|
|
5
|
+
/** A key path as people read it: `filter.owner`, `lines[].margin`. */
|
|
6
|
+
export declare function formatKeyPath(keyPath: ArgumentKeyPath): string;
|
|
7
|
+
//# sourceMappingURL=undeclared-arguments.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"undeclared-arguments.d.ts","sourceRoot":"","sources":["../../src/tool/undeclared-arguments.ts"],"names":[],"mappings":"AAGA,mHAAmH;AACnH,MAAM,MAAM,eAAe,GAAG,SAAS,MAAM,EAAE,CAAC;AAEhD,mHAAmH;AACnH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EACxC,IAAI,EAAE,OAAO,EACb,MAAM,EAAE,OAAO,GACd,eAAe,EAAE,CAmBnB;AAED,sEAAsE;AACtE,wBAAgB,aAAa,CAAC,OAAO,EAAE,eAAe,GAAG,MAAM,CAK9D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handle.mcp-20260728.flow.d.ts","sourceRoot":"","sources":["../../../src/transport/flows/handle.mcp-20260728.flow.ts"],"names":[],"mappings":"AA0BA,OAAO,EAGL,QAAQ,EAER,eAAe,EACf,gBAAgB,EAKhB,KAAK,cAAc,EAEpB,MAAM,cAAc,CAAC;AAOtB,OAAO,EAKL,yBAAyB,EAEzB,WAAW,EACX,UAAU,EAKX,MAAM,iBAAiB,CAAC;AAGzB,eAAO,MAAM,IAAI;;;;;CAKoB,CAAC;AAEtC;;;;;;;GAOG;AACH,qHAAqH;AACrH,eAAO,MAAM,0BAA0B,OAAO,CAAC;AAqB/C,eAAO,MAAM,WAAW;;;;;;;;;;gCAOtB,CAAC;AAEH,QAAA,MAAM,IAAI,EAAG,yBAAkC,CAAC;AAGhD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,WAAW;QACnB,yBAAyB,EAAE,cAAc,CACvC,qBAAqB,EACrB,OAAO,IAAI,EACX,OAAO,eAAe,EAC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