@frontmcp/sdk 1.12.2 → 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/app/lazy/lazy-app.rules.d.ts +5 -0
- package/app/lazy/lazy-app.rules.d.ts.map +1 -1
- package/auth/flows/auth.verify.flow.d.ts.map +1 -1
- package/auth/flows/oauth.authorize.flow.d.ts +2 -0
- package/auth/flows/oauth.authorize.flow.d.ts.map +1 -1
- package/auth/flows/oauth.callback.flow.d.ts +1 -0
- package/auth/flows/oauth.callback.flow.d.ts.map +1 -1
- package/auth/flows/oauth.provider-callback.flow.d.ts +1 -0
- package/auth/flows/oauth.provider-callback.flow.d.ts.map +1 -1
- package/auth/flows/session.verify.flow.d.ts +2 -0
- package/auth/flows/session.verify.flow.d.ts.map +1 -1
- package/auth/instances/instance.local-primary-auth.d.ts +9 -4
- package/auth/instances/instance.local-primary-auth.d.ts.map +1 -1
- package/auth/instances/instance.remote-primary-auth.d.ts +3 -0
- package/auth/instances/instance.remote-primary-auth.d.ts.map +1 -1
- package/auth/session-scope-identity.d.ts +5 -3
- package/auth/session-scope-identity.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 +10 -2
- package/browser/app/lazy/lazy-app.rules.mjs +11 -1
- package/browser/auth/flows/oauth.authorize.flow.mjs +7 -1
- package/browser/auth/flows/oauth.callback.flow.mjs +6 -2
- package/browser/auth/flows/oauth.provider-callback.flow.mjs +8 -4
- package/browser/auth/flows/session.verify.flow.mjs +27 -18
- package/browser/auth/instances/instance.local-primary-auth.mjs +46 -12
- package/browser/auth/instances/instance.remote-primary-auth.mjs +21 -1
- package/browser/auth/session-scope-identity.mjs +6 -1
- package/browser/auth/transparent-audience.mjs +52 -0
- package/browser/common/interfaces/flow.interface.mjs +7 -1
- 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/common/types/auth/session.types.mjs +2 -1
- package/browser/common/utils/auth-info.utils.mjs +3 -2
- 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/flows/flow.instance.mjs +43 -5
- package/browser/hooks/hooks.utils.mjs +10 -4
- package/browser/index.cjs +6138 -5052
- package/browser/notification/notification.service.mjs +29 -4
- package/browser/notification/resource-update-access.mjs +22 -0
- package/browser/plugin/enforced-metadata.check.mjs +2 -1
- package/browser/prompt/flows/get-prompt.flow.mjs +13 -0
- package/browser/remote-mcp/factories/record-builders.mjs +2 -0
- package/browser/remote-mcp/mcp-client.service.mjs +26 -13
- package/browser/remote-mcp/remote-request-headers.mjs +6 -3
- package/browser/resource/flows/read-resource.flow.mjs +52 -32
- package/browser/resource/flows/subscribe-resource.flow.mjs +9 -4
- 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/ui/ui-shared.mjs +9 -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 +21 -19
- package/browser/transport/mcp-20260728/index.mjs +1 -1
- package/browser/transport/mcp-20260728/subscriptions.mjs +8 -6
- package/common/entries/tool.entry.d.ts +12 -1
- package/common/entries/tool.entry.d.ts.map +1 -1
- package/common/interfaces/flow.interface.d.ts +4 -1
- package/common/interfaces/flow.interface.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 +35 -16
- package/common/metadata/app.metadata.d.ts.map +1 -1
- package/common/metadata/front-mcp.metadata.d.ts +198 -46
- 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/common/types/auth/session.types.d.ts +6 -0
- package/common/types/auth/session.types.d.ts.map +1 -1
- package/common/types/options/http/interfaces.d.ts +4 -1
- package/common/types/options/http/interfaces.d.ts.map +1 -1
- package/common/utils/auth-info.utils.d.ts +1 -0
- package/common/utils/auth-info.utils.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 +32 -32
- package/flows/flow.instance.d.ts.map +1 -1
- package/hooks/hooks.utils.d.ts +2 -4
- package/hooks/hooks.utils.d.ts.map +1 -1
- package/index.d.ts +20 -20
- package/index.js +42 -42
- package/notification/notification.service.d.ts +7 -2
- package/notification/notification.service.d.ts.map +1 -1
- package/notification/resource-update-access.d.ts +9 -0
- package/notification/resource-update-access.d.ts.map +1 -0
- package/package.json +10 -10
- package/plugin/enforced-metadata.check.d.ts +3 -1
- package/plugin/enforced-metadata.check.d.ts.map +1 -1
- package/prompt/flows/get-prompt.flow.d.ts +3 -1
- package/prompt/flows/get-prompt.flow.d.ts.map +1 -1
- package/remote-mcp/factories/record-builders.d.ts.map +1 -1
- package/remote-mcp/mcp-client.service.d.ts.map +1 -1
- package/remote-mcp/mcp-client.types.d.ts.map +1 -1
- package/remote-mcp/remote-request-headers.d.ts +22 -8
- package/remote-mcp/remote-request-headers.d.ts.map +1 -1
- package/resource/flows/read-resource.flow.d.ts +15 -1
- package/resource/flows/read-resource.flow.d.ts.map +1 -1
- package/resource/flows/subscribe-resource.flow.d.ts.map +1 -1
- package/scope/flows/http.request.flow.d.ts +1 -0
- package/scope/flows/http.request.flow.d.ts.map +1 -1
- package/scope/scope.instance.d.ts.map +1 -1
- package/server/adapters/express.host.adapter.d.ts +3 -2
- package/server/adapters/express.host.adapter.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/shared/shared-endpoint.d.ts +5 -1
- package/shared/shared-endpoint.d.ts.map +1 -1
- package/shared/unix-socket-fetch.d.ts +7 -0
- package/shared/unix-socket-fetch.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/ui/ui-shared.d.ts +4 -0
- package/tool/ui/ui-shared.d.ts.map +1 -1
- 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/transport/mcp-20260728/subscriptions.d.ts +5 -3
- package/transport/mcp-20260728/subscriptions.d.ts.map +1 -1
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { type NamespacedStorage, type TypedStorage } from '@frontmcp/utils';
|
|
2
|
+
import { type TaskRecord } from '../task.types';
|
|
3
|
+
/** What the index reads from the task store: a session's stored task ids by scan, its records, and one live task. */
|
|
4
|
+
export interface TaskSessionIndexSource {
|
|
5
|
+
records: TypedStorage<TaskRecord>;
|
|
6
|
+
recordKey(sessionId: string, taskId: string): string;
|
|
7
|
+
scanSessionTaskIds(sessionId: string): Promise<string[]>;
|
|
8
|
+
readTask(taskId: string, sessionId: string): Promise<TaskRecord | null>;
|
|
9
|
+
}
|
|
10
|
+
/** One page of the index, or none while another request backfills the session (the caller then scans). */
|
|
11
|
+
export type TaskIndexPage = {
|
|
12
|
+
tasks: TaskRecord[];
|
|
13
|
+
endPosition: number;
|
|
14
|
+
positionsUsed: number;
|
|
15
|
+
} | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Each session's tasks numbered in the order they were written, beside the task records: `index:{session}:{n}` holds
|
|
18
|
+
* the id of the `n`th task (kept an hour past it), `index-of:{session}:{taskId}` its number (gone with the task, so a
|
|
19
|
+
* position whose task has none is gone for good), `index-count:{session}` the numbers used, `index-start:{session}`
|
|
20
|
+
* the leading numbers whose tasks are gone, `index-skip:{session}:{n}` the last of the numbers after `n` whose tasks
|
|
21
|
+
* are gone (both `{generation}:{number}`, for the count they were read under), `index-settled:{session}` a number
|
|
22
|
+
* every position up to which had been written when the note was set (`{generation}:{number}`), and
|
|
23
|
+
* `index-ready:{session}` that the session's earlier tasks were indexed (`done:{generation}:{count}`).
|
|
24
|
+
*/
|
|
25
|
+
export declare class TaskSessionIndex {
|
|
26
|
+
private readonly source;
|
|
27
|
+
private readonly positions;
|
|
28
|
+
private readonly positionOf;
|
|
29
|
+
private readonly counts;
|
|
30
|
+
private readonly starts;
|
|
31
|
+
private readonly skips;
|
|
32
|
+
private readonly settled;
|
|
33
|
+
private readonly readiness;
|
|
34
|
+
/** The longest a task lives, plus the grace: the count outlives every position it numbered. */
|
|
35
|
+
private readonly countTtlSeconds;
|
|
36
|
+
constructor(storage: NamespacedStorage, source: TaskSessionIndexSource, maxTaskTtlSeconds: number);
|
|
37
|
+
/** Give a task written now the session's next number; the session's earlier tasks are indexed when it is listed. */
|
|
38
|
+
add(record: TaskRecord, ttlSeconds: number): Promise<void>;
|
|
39
|
+
/** The count exists with a TTL before it is incremented: kept `ttlSeconds` longer, or created at 0 with it. */
|
|
40
|
+
private ensureCount;
|
|
41
|
+
/**
|
|
42
|
+
* Keep a task's index entry as long as its record lives, `ttlSeconds` from now, never shortening it, so the same
|
|
43
|
+
* call can be repeated after one that failed halfway.
|
|
44
|
+
*/
|
|
45
|
+
extend(record: TaskRecord, ttlSeconds: number): Promise<void>;
|
|
46
|
+
/** Keep the session's count at least `ttlSeconds` longer, never shorter: it outlives every position it numbered. */
|
|
47
|
+
private keepCountAlive;
|
|
48
|
+
/** Mark a deleted task gone for good, so a first page may start after its position. */
|
|
49
|
+
remove(record: TaskRecord): Promise<void>;
|
|
50
|
+
/**
|
|
51
|
+
* The live tasks of a page from `startPosition` on (after the leading gone ones for a first page). Only a first page
|
|
52
|
+
* waits for the session's earlier tasks to be indexed; a continuation reads the positions its first page numbered.
|
|
53
|
+
*/
|
|
54
|
+
page(sessionId: string, startPosition: number, pageSize: number): Promise<TaskIndexPage>;
|
|
55
|
+
/** The generation of the session's indexed count, or none while its earlier tasks are not indexed. */
|
|
56
|
+
private generationOf;
|
|
57
|
+
/** The count the session's ready marker was published at; 0 without one. */
|
|
58
|
+
private publishedCount;
|
|
59
|
+
/**
|
|
60
|
+
* Where a list goes on after `anchor`: past the run of positions gone for good it remembered there, if any, and only
|
|
61
|
+
* when it was remembered under this generation of the count.
|
|
62
|
+
*/
|
|
63
|
+
private skippedTo;
|
|
64
|
+
/** The positions after `anchor` up to `goneUpTo` hold tasks gone for good: a list jumps them from now on. */
|
|
65
|
+
private rememberSkip;
|
|
66
|
+
/**
|
|
67
|
+
* The last position every write had finished by: the count a list noted under this generation of the count at least
|
|
68
|
+
* {@link POSITION_WRITE_SECONDS} ago, the note's age read from its remaining TTL. A list notes the count it sees when
|
|
69
|
+
* there is no such note or it is that old; a note from another generation counts as none.
|
|
70
|
+
*/
|
|
71
|
+
private writtenUpTo;
|
|
72
|
+
/** Record the task's number: its `index-of` key first, so a position a list can see always has one while it lives. */
|
|
73
|
+
private number;
|
|
74
|
+
/**
|
|
75
|
+
* Index the session's tasks no number lists yet, written before the store kept an index, once per generation of its
|
|
76
|
+
* count: one request claims it, numbers what is missing and, while the claim is still its own, marks the session
|
|
77
|
+
* ready. The generation, or none while another request does (the caller then lists from the scan).
|
|
78
|
+
*/
|
|
79
|
+
private ensureBackfilled;
|
|
80
|
+
/**
|
|
81
|
+
* Renew the claim every third of its TTL for as long as the backfill runs, its scan included; `held` turns false once
|
|
82
|
+
* a renewal finds it lost. The timer never holds the process open.
|
|
83
|
+
*/
|
|
84
|
+
private holdClaim;
|
|
85
|
+
/** Hold the backfill claim for another {@link BACKFILL_CLAIM_TTL_SECONDS}; false once it is no longer this request's. */
|
|
86
|
+
private renewClaim;
|
|
87
|
+
/**
|
|
88
|
+
* Number the session's live tasks that no position lists: those with no `index-of` key, or one whose position does
|
|
89
|
+
* not hold the task (a request that died between the two). The records are scanned before those are read, and the
|
|
90
|
+
* claim stays held while it runs. The count it leaves, or none, numbering nothing more, once the claim was lost.
|
|
91
|
+
*/
|
|
92
|
+
private backfill;
|
|
93
|
+
/**
|
|
94
|
+
* Number an earlier task unless another request already did (its `index-of` key is set only where none is, after
|
|
95
|
+
* dropping `staleNumber`, the number of a position that does not hold it), then read the task again: an update that
|
|
96
|
+
* moved its expiry later before its `index-of` key existed found nothing to extend.
|
|
97
|
+
*/
|
|
98
|
+
private numberEarlierTask;
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=task-session-index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-session-index.d.ts","sourceRoot":"","sources":["../../../src/task/store/task-session-index.ts"],"names":[],"mappings":"AACA,OAAO,EAA8B,KAAK,iBAAiB,EAAE,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAExG,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AAqChD,qHAAqH;AACrH,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,YAAY,CAAC,UAAU,CAAC,CAAC;IAClC,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IAC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AC,IAAI,CAAC;IAI/C;;;OAGG;IACG,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IA+C9F,sGAAsG;YACxF,YAAY;IAI1B,4EAA4E;YAC9D,cAAc;IAI5B;;;OAGG;YACW,SAAS;IAQvB,6GAA6G;YAC/F,YAAY;IAgB1B;;;;OAIG;YACW,WAAW;IAazB,sHAAsH;YACxG,MAAM;IAQpB;;;;OAIG;YACW,gBAAgB;IAsB9B;;;OAGG;IACH,OAAO,CAAC,SAAS;IAmBjB,yHAAyH;YAC3G,UAAU;IAIxB;;;;OAIG;YACW,QAAQ;IA2CtB;;;;OAIG;YACW,iBAAiB;CAkBhC"}
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import { type RootStorage, type StorageConfig } from '@frontmcp/utils';
|
|
13
13
|
import { type FrontMcpLogger, type RedisOptionsInput } from '../../common';
|
|
14
|
+
import { type TaskListSource } from '../task.types';
|
|
14
15
|
import { type TaskStore } from './task.store';
|
|
15
16
|
export declare class TaskStoreNotSupportedError extends Error {
|
|
16
17
|
constructor(message: string);
|
|
@@ -26,6 +27,10 @@ export interface TaskStoreOptions {
|
|
|
26
27
|
logger?: FrontMcpLogger;
|
|
27
28
|
/** Edge runtime mode — requires distributed storage. */
|
|
28
29
|
isEdgeRuntime?: boolean;
|
|
30
|
+
/** Where `tasks/list` reads a session's tasks (not the SQLite store, which queries by session). Default `'index'`. */
|
|
31
|
+
listFrom?: TaskListSource;
|
|
32
|
+
/** The longest a task lives (`tasks.maxTtlMs`), which the session index keeps its count for. */
|
|
33
|
+
maxTtlMs?: number;
|
|
29
34
|
/**
|
|
30
35
|
* SQLite backend options. When provided, the factory returns a
|
|
31
36
|
* `SqliteTaskStore` instead of the utils-backed implementation.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task-store.factory.d.ts","sourceRoot":"","sources":["../../../src/task/store/task-store.factory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAA8C,KAAK,WAAW,EAAE,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEnH,OAAO,EAAsB,KAAK,cAAc,EAAE,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"task-store.factory.d.ts","sourceRoot":"","sources":["../../../src/task/store/task-store.factory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAA8C,KAAK,WAAW,EAAE,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEnH,OAAO,EAAsB,KAAK,cAAc,EAAE,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAI/F,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAGpD,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,qBAAa,0BAA2B,SAAQ,KAAK;gBACvC,OAAO,EAAE,MAAM;CAI5B;AAED,MAAM,WAAW,gBAAgB;IAC/B,8CAA8C;IAC9C,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,wFAAwF;IACxF,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC1B,yDAAyD;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc;IACd,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,wDAAwD;IACxD,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,sHAAsH;IACtH,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,gGAAgG;IAChG,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,MAAM,CAAC,EAAE;QACP,IAAI,EAAE,MAAM,CAAC;QACb,UAAU,CAAC,EAAE;YAAE,MAAM,EAAE,MAAM,CAAA;SAAE,CAAC;QAChC,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,oBAAoB,CAAC,EAAE,MAAM,CAAC;QAC9B,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB,CAAC;CACH;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,SAAS,CAAC;IACjB,IAAI,EAAE,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAC;IACzD;;;OAGG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;CACvB;AAyBD,OAAO,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AAErE,wBAAsB,eAAe,CAAC,OAAO,GAAE,gBAAqB,GAAG,OAAO,CAAC,eAAe,CAAC,CAyF9F;AAED,8DAA8D;AAC9D,wBAAgB,qBAAqB,CAAC,OAAO,GAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,cAAc,CAAA;CAAO,GAAG,eAAe,CAIpH"}
|
package/task/task.types.d.ts
CHANGED
|
@@ -23,6 +23,12 @@ export declare const TASK_DEFAULTS: {
|
|
|
23
23
|
readonly defaultPollIntervalMs: 2000;
|
|
24
24
|
readonly maxConcurrentPerSession: 16;
|
|
25
25
|
};
|
|
26
|
+
/**
|
|
27
|
+
* Where `tasks/list` reads a session's tasks: `'index'` (the default since 1.13) the per-session index every task write
|
|
28
|
+
* keeps, `'scan'` every stored task key. A task an instance from before the index writes has no index entry, so a
|
|
29
|
+
* deployment upgrading from such a version lists from `'scan'` until every instance writes the index.
|
|
30
|
+
*/
|
|
31
|
+
export type TaskListSource = 'scan' | 'index';
|
|
26
32
|
/** Upper bound of `tasks.maxConcurrentPerSession`: a capped task creation reads that many slot keys in one MGET. */
|
|
27
33
|
export declare const MAX_CONCURRENT_TASKS_PER_SESSION = 1000;
|
|
28
34
|
/**
|
package/task/task.types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task.types.d.ts","sourceRoot":"","sources":["../../src/task/task.types.ts"],"names":[],"mappings":"AAAA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,MAAM,WAAW,WAAW;IAC1B,mFAAmF;IACnF,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,4DAA4D;IAC5D,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,mDAAmD;IACnD,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAE/B,2HAA2H;IAC3H,uBAAuB,CAAC,EAAE,MAAM,CAAC;IAEjC,sDAAsD;IACtD,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;OAIG;IACH,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAE1B;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;;;;;;;;;OAUG;IACH,MAAM,CAAC,EAAE,YAAY,GAAG,KAAK,CAAC;IAE9B;;;;OAIG;IACH,MAAM,CAAC,EAAE;QACP,wCAAwC;QACxC,IAAI,EAAE,MAAM,CAAC;QACb,wDAAwD;QACxD,UAAU,CAAC,EAAE;YAAE,MAAM,EAAE,MAAM,CAAA;SAAE,CAAC;QAChC,gDAAgD;QAChD,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,2DAA2D;QAC3D,oBAAoB,CAAC,EAAE,MAAM,CAAC;QAC9B,yFAAyF;QACzF,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB,CAAC;IAEF;;;;;;;;;;;;OAYG;IACH,gBAAgB,CAAC,EAAE;QACjB,GAAG,EAAE,MAAM,CAAC;QACZ,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;KACjB,CAAC;CACH"}
|
|
@@ -231,6 +231,7 @@ declare const stateSchema: import("@frontmcp/lazy-zod").ZodObject<{
|
|
|
231
231
|
flowError: import("@frontmcp/lazy-zod").ZodOptional<import("zod").ZodInstanceOf<Error>>;
|
|
232
232
|
uiResult: z.ZodType<ToolResponseContent | undefined>;
|
|
233
233
|
uiMeta: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodRecord<import("@frontmcp/lazy-zod").ZodString, import("@frontmcp/lazy-zod").ZodUnknown>>;
|
|
234
|
+
undeclaredArgumentsNote: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodString>;
|
|
234
235
|
resultMeta: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodRecord<import("@frontmcp/lazy-zod").ZodString, import("@frontmcp/lazy-zod").ZodUnknown>>;
|
|
235
236
|
progressToken: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodUnion<readonly [import("@frontmcp/lazy-zod").ZodString, import("@frontmcp/lazy-zod").ZodNumber]>>;
|
|
236
237
|
jsonRpcRequestId: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodUnion<readonly [import("@frontmcp/lazy-zod").ZodString, import("@frontmcp/lazy-zod").ZodNumber]>>;
|
|
@@ -242,7 +243,7 @@ declare const stateSchema: import("@frontmcp/lazy-zod").ZodObject<{
|
|
|
242
243
|
}, import("zod/v4/core").$loose>>;
|
|
243
244
|
}, import("zod/v4/core").$strip>;
|
|
244
245
|
declare const plan: {
|
|
245
|
-
readonly pre: ["parseInput", "checkSkillsOnlyMode", "ensureRemoteCapabilities", "checkSurface", "findTool", "checkEnabled", "checkAppLoaded", "checkPublicAccess", "checkToolAuthorization", "checkEntryAuthorities", "createTaskIfRequested", "createToolCallContext", "checkToolCredentials", "acquireQuota", "acquireSemaphore"];
|
|
246
|
+
readonly pre: ["parseInput", "checkSkillsOnlyMode", "ensureRemoteCapabilities", "checkSurface", "findTool", "useToolHooks", "checkEnabled", "checkAppLoaded", "checkPublicAccess", "checkToolAuthorization", "checkEntryAuthorities", "createTaskIfRequested", "createToolCallContext", "checkToolCredentials", "acquireQuota", "acquireSemaphore"];
|
|
246
247
|
readonly execute: ["validateInput", "execute", "validateOutput"];
|
|
247
248
|
readonly finalize: ["releaseSemaphore", "releaseQuota", "applyUI", "finalize", "fitAnswer", "shapeAnswer", "meterAnswer"];
|
|
248
249
|
};
|
|
@@ -260,6 +261,8 @@ export default class CallToolFlow extends FlowBase<typeof name> {
|
|
|
260
261
|
/** The class of the tool the call names, whose `static` hooks run from `parseInput` on (#701). */
|
|
261
262
|
static resolveHookEntryClass(rawInput: unknown, scope: ScopeEntry): Token | undefined;
|
|
262
263
|
logger: import("../../common").FrontMcpLogger;
|
|
264
|
+
/** The output the UI renders, parsed once per call (see {@link uiOutput}). */
|
|
265
|
+
private declaredUiOutput?;
|
|
263
266
|
/** The tool's name (its `id`, else its `name`) once `findTool` resolved it, else the name the call asks for. */
|
|
264
267
|
get toolName(): string;
|
|
265
268
|
/** The arguments the call passes to the tool, as `Will` hooks left them. */
|
|
@@ -284,6 +287,8 @@ export default class CallToolFlow extends FlowBase<typeof name> {
|
|
|
284
287
|
*/
|
|
285
288
|
checkSurface(): Promise<void>;
|
|
286
289
|
findTool(): Promise<void>;
|
|
290
|
+
/** The settled tool's hooks run from here on, in place of the requested one's when a hook switched it. */
|
|
291
|
+
useToolHooks(): Promise<void>;
|
|
287
292
|
/** A tool whose `enabled` is off is refused with `FEATURE_OFF` and the remedy of its source. */
|
|
288
293
|
checkEnabled(): Promise<void>;
|
|
289
294
|
/** A lazy app's tool that is on and still a placeholder is answered `LAZY_APP_LOAD_FAILED`: its app did not load. */
|
|
@@ -368,6 +373,8 @@ export default class CallToolFlow extends FlowBase<typeof name> {
|
|
|
368
373
|
acquireQuota(): Promise<void>;
|
|
369
374
|
acquireSemaphore(): Promise<void>;
|
|
370
375
|
validateInput(): Promise<void>;
|
|
376
|
+
/** `input.undeclaredKeys` for the arguments the `inputSchema` does not declare, which parsing dropped. */
|
|
377
|
+
private applyInputPolicy;
|
|
371
378
|
execute(): Promise<void>;
|
|
372
379
|
validateOutput(): Promise<void>;
|
|
373
380
|
releaseSemaphore(): Promise<void>;
|
|
@@ -415,11 +422,16 @@ export default class CallToolFlow extends FlowBase<typeof name> {
|
|
|
415
422
|
* request's client info, else the notification service's; 'unknown' when none was recognized.
|
|
416
423
|
*/
|
|
417
424
|
private callerPlatformType;
|
|
425
|
+
/** The caller's platform for a tool meant for the MCP Apps page: what it negotiated before a user-agent guess. */
|
|
426
|
+
private appPagePlatform;
|
|
418
427
|
private callerProfile;
|
|
419
428
|
/** Whether the caller is listed the tool's `outputSchema` and gets `structuredContent`, so it may validate it. */
|
|
420
429
|
private clientValidatesStructuredContent;
|
|
421
430
|
/** Whether `tools/list` lists the tool's `outputSchema`, so a client can read `structuredContent` alone. */
|
|
422
431
|
private listsOutputSchema;
|
|
432
|
+
/** What the UI renders and echoes: what the `outputSchema` declares, and undeclared keys under 'keep'; parsed once. */
|
|
433
|
+
private uiOutput;
|
|
434
|
+
private warnInvalidStructuredContentOnce;
|
|
423
435
|
private warnUndeclaredKeysOnce;
|
|
424
436
|
}
|
|
425
437
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"call-tool.flow.d.ts","sourceRoot":"","sources":["../../../src/tool/flows/call-tool.flow.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,IAAI,CAAC,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAA+C,KAAK,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAChG,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AA0BrE,OAAO,EAIL,QAAQ,EASR,WAAW,EACX,SAAS,EAIT,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,KAAK,EACX,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"call-tool.flow.d.ts","sourceRoot":"","sources":["../../../src/tool/flows/call-tool.flow.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,IAAI,CAAC,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAA+C,KAAK,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAChG,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B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,YAAY,CAAC,GAAG,KAAK;IAM7D,yGAAyG;IACzG,YAAY,IAAI,OAAO;IAKvB;;;OAGG;IACH,OAAO,CAAC,kBAAkB;IAW1B,kHAAkH;IAClH,OAAO,CAAC,eAAe;IAUvB,OAAO,CAAC,aAAa;IAQrB,kHAAkH;IAClH,OAAO,CAAC,gCAAgC;IAIxC,4GAA4G;IAC5G,OAAO,CAAC,iBAAiB;IAOzB,uHAAuH;IACvH,OAAO,CAAC,QAAQ;IAShB,OAAO,CAAC,gCAAgC;IAUxC,OAAO,CAAC,sBAAsB;CAQ/B"}
|
|
@@ -92,7 +92,7 @@ declare const stateSchema: import("@frontmcp/lazy-zod").ZodObject<{
|
|
|
92
92
|
}, import("zod/v4/core").$strip>;
|
|
93
93
|
declare const plan: {
|
|
94
94
|
readonly pre: ["parseInput", "ensureRemoteCapabilities"];
|
|
95
|
-
readonly execute: ["findTools", "filterByEnabled", "filterByAuthorities", "filterByPublicAccess", "resolveConflicts"];
|
|
95
|
+
readonly execute: ["findTools", "filterByEnabled", "filterByAuthorities", "filterByPublicAccess", "filterByAppVisibility", "resolveConflicts"];
|
|
96
96
|
readonly post: ["parseTools"];
|
|
97
97
|
};
|
|
98
98
|
declare global {
|
|
@@ -103,6 +103,8 @@ declare global {
|
|
|
103
103
|
declare const name: "tools:list-tools";
|
|
104
104
|
export default class ToolsListFlow extends FlowBase<typeof name> {
|
|
105
105
|
logger: import("../../common").FrontMcpLogger;
|
|
106
|
+
/** The names hooks asked `removeTool` to leave out, applied to the tools whenever `findTools` finds them. */
|
|
107
|
+
private readonly removedToolNames;
|
|
106
108
|
private sample;
|
|
107
109
|
/**
|
|
108
110
|
* Determine if pagination should be applied based on tool count and config.
|
|
@@ -131,6 +133,11 @@ export default class ToolsListFlow extends FlowBase<typeof name> {
|
|
|
131
133
|
filterByAuthorities(): Promise<void>;
|
|
132
134
|
/** An anonymous caller sees only the tools `publicAccess` lists. */
|
|
133
135
|
filterByPublicAccess(): Promise<void>;
|
|
136
|
+
/** Leave a tool out of this listing, by its listed or its own name: for a hook on any stage up to `parseTools`. */
|
|
137
|
+
removeTool(name: string): void;
|
|
138
|
+
private isRemoved;
|
|
139
|
+
/** A tool for the MCP Apps page only (`_meta.ui.visibility: ['app']`) is listed only to a client that renders it. */
|
|
140
|
+
filterByAppVisibility(): Promise<void>;
|
|
134
141
|
resolveConflicts(): Promise<void>;
|
|
135
142
|
parseTools(): Promise<void>;
|
|
136
143
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools-list.flow.d.ts","sourceRoot":"","sources":["../../../src/tool/flows/tools-list.flow.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,QAAQ,EAOR,SAAS,EAGT,KAAK,cAAc,EACpB,MAAM,cAAc,CAAC;AAEtB,OAAO,kBAAkB,CAAC;AAE1B,OAAO,EAAE,SAAS,IAAI,CAAC,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAiD,KAAK,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAClG,OAAO,KAAK,EAAE,mBAAmB,IAAI,cAAc,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"tools-list.flow.d.ts","sourceRoot":"","sources":["../../../src/tool/flows/tools-list.flow.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,QAAQ,EAOR,SAAS,EAGT,KAAK,cAAc,EACpB,MAAM,cAAc,CAAC;AAEtB,OAAO,kBAAkB,CAAC;AAE1B,OAAO,EAAE,SAAS,IAAI,CAAC,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAiD,KAAK,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAClG,OAAO,KAAK,EAAE,mBAAmB,IAAI,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAiBvF,QAAA,MAAM,WAAW;;;;;;;;;;;;;;gCAGf,CAAC;AAEH,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAAwB,CAAC;AAE3C,QAAA,MAAM,WAAW;;cAIM,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;kBACD,CAAC,CAAC,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;gCAuB5E,CAAC;AAkBH,QAAA,MAAM,IAAI;;;;CAW2B,CAAC;AAEtC,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,WAAW;QACnB,kBAAkB,EAAE,cAAc,CAChC,aAAa,EACb,OAAO,IAAI,EACX,OAAO,WAAW,EAClB,OAAO,YAAY,EACnB,OAAO,WAAW,CACnB,CAAC;KACH;CACF;AAED,QAAA,MAAM,IAAI,EAAG,kBAA2B,CAAC;AAUzC,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,QAAQ,CAAC,OAAO,IAAI,CAAC;IAC9D,MAAM,wCAA2C;IAEjD,6GAA6G;IAC7G,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAqB;IAEtD,OAAO,CAAC,MAAM;IAId;;OAEG;IACH,OAAO,CAAC,cAAc;IAoBtB,6FAA6F;YAC/E,kBAAkB;IAKhC,gHAAgH;IAChH,OAAO,CAAC,aAAa;IAOf,UAAU;IA+ChB;;;;OAIG;IAEG,wBAAwB;IA2CxB,SAAS;IA4Df,mEAAmE;IAE7D,eAAe;IAQrB;;;;;OAKG;IAEG,mBAAmB;IAgCzB,oEAAoE;IAE9D,oBAAoB;IAW1B,mHAAmH;IACnH,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAS9B,OAAO,CAAC,SAAS;IAKjB,qHAAqH;IAE/G,qBAAqB;IAgBrB,gBAAgB;IAqChB,UAAU;CA0RjB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type EntryLineage, type OutputPolicy, type ScopeEntry, type ToolEntry } from '../common';
|
|
1
|
+
import { type EntryLineage, type InputPolicy, type OutputPolicy, type ScopeEntry, type StructuredContentValidation, type ToolEntry } from '../common';
|
|
2
2
|
/** A tool's `output` policies, most specific first, for the `resolve*` cascades in `output-policy.ts`. */
|
|
3
3
|
export type ToolOutputPolicies = [tool?: OutputPolicy, app?: OutputPolicy, server?: OutputPolicy];
|
|
4
4
|
/** The parts of a tool the output-policy lookup reads. */
|
|
@@ -7,6 +7,7 @@ type OutputPolicyTool = Pick<ToolEntry, 'metadata' | 'owner'>;
|
|
|
7
7
|
export interface OutputPolicyScope<Tool extends OutputPolicyTool = ToolEntry> {
|
|
8
8
|
readonly metadata: {
|
|
9
9
|
readonly output?: OutputPolicy;
|
|
10
|
+
readonly input?: InputPolicy;
|
|
10
11
|
};
|
|
11
12
|
readonly apps: Pick<ScopeEntry['apps'], 'getApps'>;
|
|
12
13
|
readonly tools: {
|
|
@@ -19,6 +20,10 @@ export interface OutputPolicyScope<Tool extends OutputPolicyTool = ToolEntry> {
|
|
|
19
20
|
* `tools/list` and `tools/call` both read it, so a tool is listed and answered under one policy.
|
|
20
21
|
*/
|
|
21
22
|
export declare function toolOutputPolicies<Tool extends OutputPolicyTool>(tool: Tool, scope: OutputPolicyScope<Tool>): ToolOutputPolicies;
|
|
23
|
+
/** Resolve how a returned `CallToolResult`'s `structuredContent` is validated: Tool > App > server > 'enforce'. */
|
|
24
|
+
export declare function resolveStructuredContentValidation(tool?: OutputPolicy, app?: OutputPolicy, server?: OutputPolicy): StructuredContentValidation;
|
|
25
|
+
/** The `input` policies that apply to `tool`, most specific first: its own, its app's and the server's. */
|
|
26
|
+
export declare function toolInputPolicies<Tool extends OutputPolicyTool>(tool: Tool, scope: OutputPolicyScope<Tool>): [tool?: InputPolicy, app?: InputPolicy, server?: InputPolicy];
|
|
22
27
|
/**
|
|
23
28
|
* One startup warning for each listed tool whose declared `outputSchema` tools/list has to leave
|
|
24
29
|
* out, naming the tool and the reason. A tool whose `output.schemaMode` resolves to `'none'` asked
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-output-policy.d.ts","sourceRoot":"","sources":["../../src/tool/tool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C,EAAE,WAAW,CAAA;KAAE,CAAC;IACpF,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC,CAAC;IACnD,QAAQ,CAAC,KAAK,EAAE;QAAE,SAAS,CAAC,KAAK,EAAE,IAAI,GAAG,YAAY,GAAG,SAAS,CAAA;KAAE,CAAC;CACtE;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,SAAS,gBAAgB,EAC9D,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,iBAAiB,CAAC,IAAI,CAAC,GAC7B,kBAAkB,CAIpB;AAED,mHAAmH;AACnH,wBAAgB,kCAAkC,CAChD,IAAI,CAAC,EAAE,YAAY,EACnB,GAAG,CAAC,EAAE,YAAY,EAClB,MAAM,CAAC,EAAE,YAAY,GACpB,2BAA2B,CAI7B;AAED,2GAA2G;AAC3G,wBAAgB,iBAAiB,CAAC,IAAI,SAAS,gBAAgB,EAC7D,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,iBAAiB,CAAC,IAAI,CAAC,GAC7B,CAAC,IAAI,CAAC,EAAE,WAAW,EAAE,GAAG,CAAC,EAAE,WAAW,EAAE,MAAM,CAAC,EAAE,WAAW,CAAC,CAG/D;AAQD;;;;GAIG;AACH,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,iBAAiB,GAAG;IAAE,QAAQ,CAAC,KAAK,EAAE;QAAE,QAAQ,IAAI,SAAS,EAAE,CAAA;KAAE,CAAA;CAAE,GACzE,MAAM,EAAE,CASV"}
|
package/tool/tool.instance.d.ts
CHANGED
|
@@ -58,5 +58,7 @@ export declare class ToolInstance<InSchema extends ToolInputType = ToolInputType
|
|
|
58
58
|
*/
|
|
59
59
|
parseOutput(raw: Out | Partial<Out> | any, options?: OutputParseOptions): ParsedToolResult;
|
|
60
60
|
safeParseOutput(raw: Out | Partial<Out> | any, options?: OutputParseOptions): SafeTransformResult<ParsedToolResult>;
|
|
61
|
+
/** The caller's options, with the tool's own `validateStructuredContent` (Tool > App > server) where it passes none. */
|
|
62
|
+
private withOwnOutputPolicy;
|
|
61
63
|
}
|
|
62
64
|
//# sourceMappingURL=tool.instance.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool.instance.d.ts","sourceRoot":"","sources":["../../src/tool/tool.instance.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D,OAAO,EACL,WAAW,EACX,SAAS,EAET,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,aAAa,EAGlB,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,UAAU,EAChB,MAAM,WAAW,CAAC;AAKnB,OAAO,KAAK,YAAY,MAAM,wBAAwB,CAAC;AAEvD,OAAO,KAAK,gBAAgB,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"tool.instance.d.ts","sourceRoot":"","sources":["../../src/tool/tool.instance.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D,OAAO,EACL,WAAW,EACX,SAAS,EAET,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,aAAa,EAGlB,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,UAAU,EAChB,MAAM,WAAW,CAAC;AAKnB,OAAO,KAAK,YAAY,MAAM,wBAAwB,CAAC;AAEvD,OAAO,KAAK,gBAAgB,MAAM,+BAA+B,CAAC;AAOlE;;;;;;;GAOG;AACH,qBAAa,YAAY,CAC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AAG,GAAG,EAC7B,OAAO,CAAC,EAAE,kBAAkB,GAC3B,mBAAmB,CAAC,gBAAgB,CAAC;IASxC,wHAAwH;IACxH,OAAO,CAAC,mBAAmB;CAK5B"}
|
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,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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"}
|
package/tool/ui/ui-shared.d.ts
CHANGED
|
@@ -91,6 +91,10 @@ export declare class ToolUIRegistry {
|
|
|
91
91
|
}>;
|
|
92
92
|
/** The tool that advertised `uri` as its custom `ui.resourceUri`. */
|
|
93
93
|
resolveCustomUri(uri: string): string | undefined;
|
|
94
|
+
/** Whether only a tool's widget answers `uri`: the `ui://widget/` namespace or a tool's custom `ui.resourceUri`. */
|
|
95
|
+
holdsWidgetUri(uri: string): boolean;
|
|
96
|
+
/** Whether `uri` names the widget of a tool that declared a UI. */
|
|
97
|
+
hasWidget(uri: string): boolean;
|
|
94
98
|
/**
|
|
95
99
|
* Whether `name` (or its app-qualified form `app:name`) is a tool with a UI.
|
|
96
100
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui-shared.d.ts","sourceRoot":"","sources":["../../../src/tool/ui/ui-shared.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAC3E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAKhE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExD,2HAA2H;AAC3H,eAAO,MAAM,oBAAoB,wBAAwB,CAAC;AAE1D,wBAAgB,WAAW,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAIlD;AAQD,iEAAiE;AACjE,MAAM,WAAW,qBAAqB;IACpC,yEAAyE;IACzE,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,yEAAyE;IACzE,MAAM,CAAC,EAAE,yBAAyB,CAAC,QAAQ,CAAC,CAAC;CAC9C;AAED,sFAAsF;AACtF,MAAM,WAAW,cAAc;IAC7B;;;;OAIG;IACH,GAAG,CAAC,EAAE;QAAE,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;QAAC,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IACzF;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,mFAAmF;IACnF,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,qFAAqF;IACrF,MAAM,CAAC,EAAE,MAAM,CAAC;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AAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAKvE,wBAAwB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAiB/E,2BAA2B,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;IAclG;;;;;;OAMG;IACG,sBAAsB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,CAAC;CAqC3G;AAsBD,eAAO,MAAM,kBAAkB,OAAO,CAAC;AAEvC,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAEpD;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAEtD;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAoBD,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI,CAMlE;AAUD,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE7D"}
|
|
@@ -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;
|
|
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,IAA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
19
19
|
import { type Scope } from '../../scope';
|
|
20
|
+
/** Whether a listener may be told of an update: its credentials unexpired both before and after the async check. */
|
|
21
|
+
export declare function listenerMayReceive(isExpired: () => boolean, mayRead: () => Promise<boolean>): Promise<boolean>;
|
|
20
22
|
export interface SubscriptionStreamOptions {
|
|
21
23
|
scope: Scope;
|
|
22
24
|
/** JSON-RPC id of the `subscriptions/listen` request; doubles as the stream id. */
|
|
@@ -31,10 +33,10 @@ export interface SubscriptionStreamOptions {
|
|
|
31
33
|
/** Fires when the client disconnects so the registry listeners are released. */
|
|
32
34
|
signal?: AbortSignal;
|
|
33
35
|
/**
|
|
34
|
-
* Whether the stream may be told of an update to `uri`,
|
|
35
|
-
*
|
|
36
|
+
* Whether the stream may be told of an update to `uri`, under the acknowledged `watchedUri` (the longest that
|
|
37
|
+
* matches), asked again for each update, so a caller that lost access stops hearing of it. Without it, all are sent.
|
|
36
38
|
*/
|
|
37
|
-
mayReceiveUpdate?: (uri: string) => Promise<boolean>;
|
|
39
|
+
mayReceiveUpdate?: (uri: string, watchedUri: string) => Promise<boolean>;
|
|
38
40
|
}
|
|
39
41
|
/**
|
|
40
42
|
* Narrow the client's filter to what this scope can actually deliver.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscriptions.d.ts","sourceRoot":"","sources":["../../../src/transport/mcp-20260728/subscriptions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAwD,KAAK,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAInH,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"subscriptions.d.ts","sourceRoot":"","sources":["../../../src/transport/mcp-20260728/subscriptions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAwD,KAAK,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAInH,OAAO,EAAE,KAAK,KAAK,EAAE,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