@rockhopper-co/mcp-server 2.0.1 → 2.1.1-staging.2786a25
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/README.md +2 -1
- package/dist/api-client.d.ts +136 -2
- package/dist/api-client.d.ts.map +1 -1
- package/dist/api-client.js +185 -2
- package/dist/api-client.js.map +1 -1
- package/dist/capabilities.d.ts +5 -6
- package/dist/capabilities.d.ts.map +1 -1
- package/dist/capabilities.js +6 -9
- package/dist/capabilities.js.map +1 -1
- package/dist/drive-search.d.ts +182 -0
- package/dist/drive-search.d.ts.map +1 -0
- package/dist/drive-search.js +210 -0
- package/dist/drive-search.js.map +1 -0
- package/dist/enrollment.d.ts +121 -0
- package/dist/enrollment.d.ts.map +1 -0
- package/dist/enrollment.js +247 -0
- package/dist/enrollment.js.map +1 -0
- package/dist/prompts/index.d.ts.map +1 -1
- package/dist/prompts/index.js +3 -2
- package/dist/prompts/index.js.map +1 -1
- package/dist/resources/orchestration-guide.md +62 -8
- package/dist/tools/connect-microsoft.d.ts +21 -0
- package/dist/tools/connect-microsoft.d.ts.map +1 -0
- package/dist/tools/connect-microsoft.js +138 -0
- package/dist/tools/connect-microsoft.js.map +1 -0
- package/dist/tools/drive-search-lanes.d.ts +65 -0
- package/dist/tools/drive-search-lanes.d.ts.map +1 -0
- package/dist/tools/drive-search-lanes.js +95 -0
- package/dist/tools/drive-search-lanes.js.map +1 -0
- package/dist/tools/drive-search.contract.d.ts +165 -0
- package/dist/tools/drive-search.contract.d.ts.map +1 -0
- package/dist/tools/drive-search.contract.js +376 -0
- package/dist/tools/drive-search.contract.js.map +1 -0
- package/dist/tools/drive-search.d.ts +31 -0
- package/dist/tools/drive-search.d.ts.map +1 -0
- package/dist/tools/drive-search.js +236 -0
- package/dist/tools/drive-search.js.map +1 -0
- package/dist/tools/enroll-file.contract.d.ts +52 -0
- package/dist/tools/enroll-file.contract.d.ts.map +1 -0
- package/dist/tools/enroll-file.contract.js +105 -0
- package/dist/tools/enroll-file.contract.js.map +1 -0
- package/dist/tools/enroll-file.d.ts +4 -0
- package/dist/tools/enroll-file.d.ts.map +1 -0
- package/dist/tools/enroll-file.js +184 -0
- package/dist/tools/enroll-file.js.map +1 -0
- package/dist/tools/get-versions.d.ts.map +1 -1
- package/dist/tools/get-versions.js +6 -1
- package/dist/tools/get-versions.js.map +1 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +12 -0
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/search.d.ts.map +1 -1
- package/dist/tools/search.js +25 -2
- package/dist/tools/search.js.map +1 -1
- package/dist/tools/write-files.d.ts.map +1 -1
- package/dist/tools/write-files.js +5 -0
- package/dist/tools/write-files.js.map +1 -1
- package/dist/tools/write-versions.d.ts.map +1 -1
- package/dist/tools/write-versions.js +2 -1
- package/dist/tools/write-versions.js.map +1 -1
- package/dist/types.d.ts +150 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/version-format.d.ts +32 -0
- package/dist/version-format.d.ts.map +1 -0
- package/dist/version-format.js +35 -0
- package/dist/version-format.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ENG-2204 — how the confirmation question reaches a human, given a client
|
|
3
|
+
* that may support one, two or three ways of asking one.
|
|
4
|
+
*
|
|
5
|
+
* There are three lanes and they are not alternatives to pick between — they
|
|
6
|
+
* are a ladder, and every client can climb at least the bottom rung:
|
|
7
|
+
*
|
|
8
|
+
* 1. **The tool result** (universal). The answer says "ask the user which one,
|
|
9
|
+
* then call again with their number". Works on every client that has ever
|
|
10
|
+
* spoken MCP, because it is just text.
|
|
11
|
+
* 2. **`elicitation/create`** (2025-era sessions that advertise it). The client
|
|
12
|
+
* renders a real picker; the server waits for the answer inside the call.
|
|
13
|
+
* 3. **`InputRequiredResult`** (2026-07-28 sessions). Elicitation is gone from
|
|
14
|
+
* that revision as a server→client request; the same question rides back as
|
|
15
|
+
* a result the client fulfils and retries.
|
|
16
|
+
*
|
|
17
|
+
* The ladder matters more than any one rung. A client that supports none of
|
|
18
|
+
* the richer lanes still gets a usable question — it does NOT get an enrolment
|
|
19
|
+
* it never confirmed, and it does not get an error. Degrading is the design.
|
|
20
|
+
*/
|
|
21
|
+
import { type ServerContext } from '@modelcontextprotocol/server';
|
|
22
|
+
/** The key both richer lanes carry the confirmation under. */
|
|
23
|
+
export declare const CONFIRM_KEY = "confirm_file";
|
|
24
|
+
export type ConfirmationLane = 'input_required' | 'elicitation' | 'tool_result';
|
|
25
|
+
/**
|
|
26
|
+
* Whether this REQUEST is on the 2026-07-28 wire.
|
|
27
|
+
*
|
|
28
|
+
* Read off the request envelope rather than off the connection, because that
|
|
29
|
+
* is where the SDK puts it: `_meta['io.modelcontextprotocol/protocolVersion']`
|
|
30
|
+
* arrives on every modern request, and `stdio-2026-07-28.e2e.test.ts` drives
|
|
31
|
+
* exactly that shape.
|
|
32
|
+
*/
|
|
33
|
+
export declare function isModernEra(ctx: ServerContext | undefined): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Whether the client said it can render an elicitation.
|
|
36
|
+
*
|
|
37
|
+
* Two sources, checked in this order and for different reasons. A modern
|
|
38
|
+
* request carries the client's capabilities in its own envelope, which is the
|
|
39
|
+
* authority for THAT request. A 2025-era session declared them once at
|
|
40
|
+
* `initialize`, and the connection is the only place that survives.
|
|
41
|
+
*
|
|
42
|
+
* ABSENT means NO. A client that never said it can ask a question is not
|
|
43
|
+
* assumed to be able to — the cost of guessing wrong is a call that hangs
|
|
44
|
+
* waiting for an answer nobody will ever be shown.
|
|
45
|
+
*/
|
|
46
|
+
export declare function advertisesElicitation(ctx: ServerContext | undefined, connectionCapabilities: Record<string, unknown> | undefined): boolean;
|
|
47
|
+
/**
|
|
48
|
+
* The best rung this request can climb.
|
|
49
|
+
*
|
|
50
|
+
* Lane 2 is deliberately unreachable on the modern era even when the client
|
|
51
|
+
* advertises `elicitation`: the SDK's `ctx.mcpReq.elicitInput` THROWS on a
|
|
52
|
+
* 2026-07-28 request, so treating the capability as sufficient would turn the
|
|
53
|
+
* richest client into the only one that fails.
|
|
54
|
+
*/
|
|
55
|
+
export declare function selectLane(ctx: ServerContext | undefined, connectionCapabilities: Record<string, unknown> | undefined): ConfirmationLane;
|
|
56
|
+
/**
|
|
57
|
+
* The nonce a retried modern request is echoing back.
|
|
58
|
+
*
|
|
59
|
+
* Untrusted by construction — it round-trips through the client, nothing signs
|
|
60
|
+
* it, and the SDK hands back whatever arrived. It is used as a Map key and for
|
|
61
|
+
* nothing else: an unrecognised one finds no candidate set, which is the same
|
|
62
|
+
* answer as a malicious one.
|
|
63
|
+
*/
|
|
64
|
+
export declare function readRequestState(ctx: ServerContext | undefined): string | null;
|
|
65
|
+
//# sourceMappingURL=drive-search-lanes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drive-search-lanes.d.ts","sourceRoot":"","sources":["../../src/tools/drive-search-lanes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAGL,KAAK,aAAa,EACnB,MAAM,8BAA8B,CAAC;AAKtC,8DAA8D;AAC9D,eAAO,MAAM,WAAW,iBAAiB,CAAC;AAE1C,MAAM,MAAM,gBAAgB,GAAG,gBAAgB,GAAG,aAAa,GAAG,aAAa,CAAC;AAQhF;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,aAAa,GAAG,SAAS,GAAG,OAAO,CAEnE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,aAAa,GAAG,SAAS,EAC9B,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GAC1D,OAAO,CAMT;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CACxB,GAAG,EAAE,aAAa,GAAG,SAAS,EAC9B,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GAC1D,gBAAgB,CAIlB;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,aAAa,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAS9E"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ENG-2204 — how the confirmation question reaches a human, given a client
|
|
3
|
+
* that may support one, two or three ways of asking one.
|
|
4
|
+
*
|
|
5
|
+
* There are three lanes and they are not alternatives to pick between — they
|
|
6
|
+
* are a ladder, and every client can climb at least the bottom rung:
|
|
7
|
+
*
|
|
8
|
+
* 1. **The tool result** (universal). The answer says "ask the user which one,
|
|
9
|
+
* then call again with their number". Works on every client that has ever
|
|
10
|
+
* spoken MCP, because it is just text.
|
|
11
|
+
* 2. **`elicitation/create`** (2025-era sessions that advertise it). The client
|
|
12
|
+
* renders a real picker; the server waits for the answer inside the call.
|
|
13
|
+
* 3. **`InputRequiredResult`** (2026-07-28 sessions). Elicitation is gone from
|
|
14
|
+
* that revision as a server→client request; the same question rides back as
|
|
15
|
+
* a result the client fulfils and retries.
|
|
16
|
+
*
|
|
17
|
+
* The ladder matters more than any one rung. A client that supports none of
|
|
18
|
+
* the richer lanes still gets a usable question — it does NOT get an enrolment
|
|
19
|
+
* it never confirmed, and it does not get an error. Degrading is the design.
|
|
20
|
+
*/
|
|
21
|
+
import { CLIENT_CAPABILITIES_META_KEY, PROTOCOL_VERSION_META_KEY, } from '@modelcontextprotocol/server';
|
|
22
|
+
/** The protocol revision on which lane 3 is the only richer lane there is. */
|
|
23
|
+
const MRTR_PROTOCOL_VERSION = '2026-07-28';
|
|
24
|
+
/** The key both richer lanes carry the confirmation under. */
|
|
25
|
+
export const CONFIRM_KEY = 'confirm_file';
|
|
26
|
+
/** Read one key off the per-request envelope, which is typed as an open bag. */
|
|
27
|
+
function envelopeValue(ctx, key) {
|
|
28
|
+
const envelope = ctx?.mcpReq?.envelope;
|
|
29
|
+
return envelope?.[key];
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Whether this REQUEST is on the 2026-07-28 wire.
|
|
33
|
+
*
|
|
34
|
+
* Read off the request envelope rather than off the connection, because that
|
|
35
|
+
* is where the SDK puts it: `_meta['io.modelcontextprotocol/protocolVersion']`
|
|
36
|
+
* arrives on every modern request, and `stdio-2026-07-28.e2e.test.ts` drives
|
|
37
|
+
* exactly that shape.
|
|
38
|
+
*/
|
|
39
|
+
export function isModernEra(ctx) {
|
|
40
|
+
return envelopeValue(ctx, PROTOCOL_VERSION_META_KEY) === MRTR_PROTOCOL_VERSION;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Whether the client said it can render an elicitation.
|
|
44
|
+
*
|
|
45
|
+
* Two sources, checked in this order and for different reasons. A modern
|
|
46
|
+
* request carries the client's capabilities in its own envelope, which is the
|
|
47
|
+
* authority for THAT request. A 2025-era session declared them once at
|
|
48
|
+
* `initialize`, and the connection is the only place that survives.
|
|
49
|
+
*
|
|
50
|
+
* ABSENT means NO. A client that never said it can ask a question is not
|
|
51
|
+
* assumed to be able to — the cost of guessing wrong is a call that hangs
|
|
52
|
+
* waiting for an answer nobody will ever be shown.
|
|
53
|
+
*/
|
|
54
|
+
export function advertisesElicitation(ctx, connectionCapabilities) {
|
|
55
|
+
const fromEnvelope = envelopeValue(ctx, CLIENT_CAPABILITIES_META_KEY);
|
|
56
|
+
if (fromEnvelope && typeof fromEnvelope === 'object') {
|
|
57
|
+
return 'elicitation' in fromEnvelope;
|
|
58
|
+
}
|
|
59
|
+
return !!connectionCapabilities && 'elicitation' in connectionCapabilities;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* The best rung this request can climb.
|
|
63
|
+
*
|
|
64
|
+
* Lane 2 is deliberately unreachable on the modern era even when the client
|
|
65
|
+
* advertises `elicitation`: the SDK's `ctx.mcpReq.elicitInput` THROWS on a
|
|
66
|
+
* 2026-07-28 request, so treating the capability as sufficient would turn the
|
|
67
|
+
* richest client into the only one that fails.
|
|
68
|
+
*/
|
|
69
|
+
export function selectLane(ctx, connectionCapabilities) {
|
|
70
|
+
if (isModernEra(ctx))
|
|
71
|
+
return 'input_required';
|
|
72
|
+
if (advertisesElicitation(ctx, connectionCapabilities))
|
|
73
|
+
return 'elicitation';
|
|
74
|
+
return 'tool_result';
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* The nonce a retried modern request is echoing back.
|
|
78
|
+
*
|
|
79
|
+
* Untrusted by construction — it round-trips through the client, nothing signs
|
|
80
|
+
* it, and the SDK hands back whatever arrived. It is used as a Map key and for
|
|
81
|
+
* nothing else: an unrecognised one finds no candidate set, which is the same
|
|
82
|
+
* answer as a malicious one.
|
|
83
|
+
*/
|
|
84
|
+
export function readRequestState(ctx) {
|
|
85
|
+
try {
|
|
86
|
+
const state = ctx?.mcpReq?.requestState?.();
|
|
87
|
+
return typeof state === 'string' ? state : null;
|
|
88
|
+
}
|
|
89
|
+
catch {
|
|
90
|
+
// A configured verify hook rejecting the state is a refusal, not a crash:
|
|
91
|
+
// the caller treats "no usable nonce" and "a nonce we do not know" alike.
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=drive-search-lanes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drive-search-lanes.js","sourceRoot":"","sources":["../../src/tools/drive-search-lanes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EACL,4BAA4B,EAC5B,yBAAyB,GAE1B,MAAM,8BAA8B,CAAC;AAEtC,8EAA8E;AAC9E,MAAM,qBAAqB,GAAG,YAAY,CAAC;AAE3C,8DAA8D;AAC9D,MAAM,CAAC,MAAM,WAAW,GAAG,cAAc,CAAC;AAI1C,gFAAgF;AAChF,SAAS,aAAa,CAAC,GAA8B,EAAE,GAAW;IAChE,MAAM,QAAQ,GAAG,GAAG,EAAE,MAAM,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split from everything it
|
|
3
|
+
* DOES (`drive-search.ts`), on the seam ENG-2200 cut for `enroll_file`.
|
|
4
|
+
*
|
|
5
|
+
* This half is the only interface a language model ever sees: it cannot read
|
|
6
|
+
* the handler, so the tool description and the schema descriptions ARE the
|
|
7
|
+
* contract, and a wrong word here is a behaviour bug no type checks. Keeping
|
|
8
|
+
* it apart means a person can review it as prose — deciding whether a model
|
|
9
|
+
* would do the right thing — without the lane branching in the way.
|
|
10
|
+
*/
|
|
11
|
+
import type { ElicitRequestFormParams } from '@modelcontextprotocol/server';
|
|
12
|
+
import { z } from 'zod';
|
|
13
|
+
import { type Candidate, type DriveSearchOutcome } from '../drive-search.js';
|
|
14
|
+
export declare const DRIVE_SEARCH_INPUT_SCHEMA: z.ZodObject<{
|
|
15
|
+
query: z.ZodOptional<z.ZodString>;
|
|
16
|
+
scope: z.ZodOptional<z.ZodEnum<{
|
|
17
|
+
search: "search";
|
|
18
|
+
recent: "recent";
|
|
19
|
+
}>>;
|
|
20
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
21
|
+
confirm_index: z.ZodOptional<z.ZodNumber>;
|
|
22
|
+
confirm_token: z.ZodOptional<z.ZodString>;
|
|
23
|
+
}, z.core.$strip>;
|
|
24
|
+
export declare const DRIVE_SEARCH_DESCRIPTION: string;
|
|
25
|
+
export declare const DRIVE_SEARCH_ANNOTATIONS: {
|
|
26
|
+
readonly readOnlyHint: true;
|
|
27
|
+
readonly openWorldHint: true;
|
|
28
|
+
};
|
|
29
|
+
/** The machine-readable half of every answer, so a model can branch on it. */
|
|
30
|
+
export interface DriveSearchAnswer {
|
|
31
|
+
outcome: DriveSearchOutcome;
|
|
32
|
+
text: string;
|
|
33
|
+
isError?: boolean;
|
|
34
|
+
detail?: Record<string, unknown>;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Render an answer as a tool result: prose for the human, then one JSON line
|
|
38
|
+
* for the model. Both, because prose alone invites the model to paraphrase a
|
|
39
|
+
* refusal into a success, and JSON alone gives the user nothing to read.
|
|
40
|
+
* Same shape as `enroll_file`'s, so the two tools read alike in a transcript.
|
|
41
|
+
*/
|
|
42
|
+
export declare function toolResult(answer: DriveSearchAnswer): {
|
|
43
|
+
isError?: true | undefined;
|
|
44
|
+
content: {
|
|
45
|
+
type: "text";
|
|
46
|
+
text: string;
|
|
47
|
+
}[];
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* How one candidate reads to a user, without its identifiers.
|
|
51
|
+
*
|
|
52
|
+
* ENG-2787 — the enrolment marking comes FIRST, and that ordering is the whole
|
|
53
|
+
* fix. The flag was already on the wire; the client truncated it off the END of
|
|
54
|
+
* the row, so ten candidates rendered as
|
|
55
|
+
* `RE_Forecast.xlsx · /drives/b!YmtA8jQX3OSHJRQ88O…` and the tool
|
|
56
|
+
* description's promise that "each candidate comes back marked as already in
|
|
57
|
+
* Rockhopper or not" was true of the payload and false of the screen. A marking
|
|
58
|
+
* whose position depends on the length of a customer's file name is not
|
|
59
|
+
* visible; one at position zero always is.
|
|
60
|
+
*
|
|
61
|
+
* `lastModifiedAt` and `parentPath` are dropped for the same reason they did
|
|
62
|
+
* harm: an ISO timestamp and a raw `/drives/b!…` id are forty characters
|
|
63
|
+
* nobody can read, sitting in front of the one phrase that decides whether
|
|
64
|
+
* this row is worth picking. Both still appear in the prompt's own message,
|
|
65
|
+
* which wraps instead of truncating.
|
|
66
|
+
*/
|
|
67
|
+
export declare function candidateLabel(candidate: Candidate): string;
|
|
68
|
+
/** The numbered list the user picks from, and the model quotes back. */
|
|
69
|
+
export declare function renderCandidates(candidates: readonly Candidate[]): string;
|
|
70
|
+
/** The question the model puts to the user when no richer lane exists. */
|
|
71
|
+
export declare function confirmationPrompt(candidates: readonly Candidate[], token: string): string;
|
|
72
|
+
/**
|
|
73
|
+
* The elicitation form both richer lanes send.
|
|
74
|
+
*
|
|
75
|
+
* NOTHING IS REQUIRED, and that is deliberate (ENG-2789). A required `choice`
|
|
76
|
+
* is what turned an unreadable prompt into a trap: the only visible buttons
|
|
77
|
+
* were Accept and Decline, and Accept was REFUSED because the invisible field
|
|
78
|
+
* was unset, leaving Decline as the sole affordance that did anything. An
|
|
79
|
+
* unanswered form now comes back as `dismissed` — a state the tool can name
|
|
80
|
+
* and act on — instead of a button the user is herded into pressing.
|
|
81
|
+
*/
|
|
82
|
+
export declare function confirmationForm(candidates: readonly Candidate[]): Omit<ElicitRequestFormParams, 'mode'>;
|
|
83
|
+
/** The answer that means "none of these" rather than a position. */
|
|
84
|
+
export declare const DECLINE_CHOICE = "none";
|
|
85
|
+
/**
|
|
86
|
+
* The answer once a specific candidate has been confirmed by a human.
|
|
87
|
+
*
|
|
88
|
+
* It hands over identifiers and stops. Enrolling here would mean a second copy
|
|
89
|
+
* of `enroll_file`'s logic — the share_with question, the hidden-file restore
|
|
90
|
+
* — living in a read tool, and two copies of a rule is how the two answers
|
|
91
|
+
* start to differ.
|
|
92
|
+
*/
|
|
93
|
+
export declare function confirmedAnswer(candidate: Candidate): {
|
|
94
|
+
isError?: true | undefined;
|
|
95
|
+
content: {
|
|
96
|
+
type: "text";
|
|
97
|
+
text: string;
|
|
98
|
+
}[];
|
|
99
|
+
};
|
|
100
|
+
/** The answer when the user was asked and said none of these. */
|
|
101
|
+
export declare function declinedAnswer(): {
|
|
102
|
+
isError?: true | undefined;
|
|
103
|
+
content: {
|
|
104
|
+
type: "text";
|
|
105
|
+
text: string;
|
|
106
|
+
}[];
|
|
107
|
+
};
|
|
108
|
+
/**
|
|
109
|
+
* The answer when the prompt closed without the user answering it (ENG-2789).
|
|
110
|
+
*
|
|
111
|
+
* Its own outcome and not a flavour of `declined`, because the two say opposite
|
|
112
|
+
* things about what the user knows. `declined` means they read ten workbooks
|
|
113
|
+
* and none was theirs — searching again with a different word is the right next
|
|
114
|
+
* move. This means they never told us anything, and the honest next move is to
|
|
115
|
+
* put the same list to them in the conversation, where it cannot be collapsed.
|
|
116
|
+
* Folding them together is what let three unreadable prompts report themselves
|
|
117
|
+
* as a decision the user had made.
|
|
118
|
+
*/
|
|
119
|
+
export declare function dismissedAnswer(candidates?: readonly Candidate[]): {
|
|
120
|
+
isError?: true | undefined;
|
|
121
|
+
content: {
|
|
122
|
+
type: "text";
|
|
123
|
+
text: string;
|
|
124
|
+
}[];
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* The answer when the user pasted a link rather than picking a row (ENG-2784).
|
|
128
|
+
*
|
|
129
|
+
* The URL is the user's own typing, from a field only they can fill — it is
|
|
130
|
+
* not a model-chosen argument, and it is handed straight to `enroll_file`,
|
|
131
|
+
* which is the tool that resolves and validates it. Nothing here tries to
|
|
132
|
+
* parse it: `enroll_file`'s own description calls a pasted address "the only
|
|
133
|
+
* input that names one specific file with no guessing", and re-deriving that
|
|
134
|
+
* judgement in a second place is how two answers start to differ.
|
|
135
|
+
*/
|
|
136
|
+
export declare function linkSuppliedAnswer(url: string): {
|
|
137
|
+
isError?: true | undefined;
|
|
138
|
+
content: {
|
|
139
|
+
type: "text";
|
|
140
|
+
text: string;
|
|
141
|
+
}[];
|
|
142
|
+
};
|
|
143
|
+
/**
|
|
144
|
+
* A pasted value this tool will pass on, or `null`.
|
|
145
|
+
*
|
|
146
|
+
* The only check is that it is an http(s) address, and it exists so an empty
|
|
147
|
+
* box or a stray keystroke does not get announced to the model as "the user
|
|
148
|
+
* gave us the file". Anything further — which tenant, which drive, whether the
|
|
149
|
+
* file exists — is `enroll_file`'s to decide against Microsoft, not this
|
|
150
|
+
* tool's to guess from a string.
|
|
151
|
+
*/
|
|
152
|
+
export declare function usableLink(raw: unknown): string | null;
|
|
153
|
+
/** The answer when a confirmation names something this session never offered. */
|
|
154
|
+
export declare function unknownCandidateAnswer(): {
|
|
155
|
+
isError?: true | undefined;
|
|
156
|
+
content: {
|
|
157
|
+
type: "text";
|
|
158
|
+
text: string;
|
|
159
|
+
}[];
|
|
160
|
+
};
|
|
161
|
+
/** Told to the model when the session has searched as much as it may. */
|
|
162
|
+
export declare const BUDGET_EXHAUSTED_TEXT: string;
|
|
163
|
+
/** Told to the model when the user has no delegated Microsoft grant. */
|
|
164
|
+
export declare function connectPrompt(authorizeUrl: string, expiresAt: string): string;
|
|
165
|
+
//# sourceMappingURL=drive-search.contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drive-search.contract.d.ts","sourceRoot":"","sources":["../../src/tools/drive-search.contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAC5E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAEL,KAAK,SAAS,EACd,KAAK,kBAAkB,EACxB,MAAM,oBAAoB,CAAC;AAE5B,eAAO,MAAM,yBAAyB;;;;;;;;;iBAsDpC,CAAC;AAEH,eAAO,MAAM,wBAAwB,QAoBQ,CAAC;AAE9C,eAAO,MAAM,wBAAwB;;;CAI3B,CAAC;AAEX,8EAA8E;AAC9E,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,kBAAkB,CAAC;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,iBAAiB;;;;;;EAWnD;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,CAE3D;AA4BD,wEAAwE;AACxE,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,SAAS,SAAS,EAAE,GAAG,MAAM,CAIzE;AAED,0EAA0E;AAC1E,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,SAAS,SAAS,EAAE,EAChC,KAAK,EAAE,MAAM,GACZ,MAAM,CAUR;AA6BD;;;;;;;;;GASG;A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