dsh-plugin-dbgraph-tool 0.0.0-stage → 0.1.0
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/lib/command.d.ts +86 -0
- package/lib/command.js +186 -0
- package/lib/index.d.ts +95 -0
- package/lib/index.js +586 -0
- package/lib/invariant.d.ts +16 -0
- package/lib/invariant.js +23 -0
- package/lib/prompt.d.ts +93 -0
- package/lib/prompt.js +337 -0
- package/lib/render.d.ts +34 -0
- package/lib/render.js +244 -0
- package/lib/schema.d.ts +782 -0
- package/lib/schema.js +315 -0
- package/package.json +78 -3
- package/README.md +0 -3
package/lib/command.d.ts
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The human `/dbgraph` slash command.
|
|
3
|
+
*
|
|
4
|
+
* The model-facing tools answer the same questions, but a person at the composer should not have to
|
|
5
|
+
* spend a model turn asking "what is indexed?". This command runs directly against `ctx.dbgraph` in
|
|
6
|
+
* the UI's command plane: nothing it returns becomes a model message or a token.
|
|
7
|
+
*
|
|
8
|
+
* Registered through conditional injection (`ctx.inject(['commands'], …)`) for the same reason the
|
|
9
|
+
* model-facing tools are not: the command registry is a host composition choice, and its absence
|
|
10
|
+
* must not hide the tools this plugin also registers. `@deepseek-ai/dsh-commands` is deliberately
|
|
11
|
+
* not imported — the service may be absent, so its public shape is mirrored structurally here.
|
|
12
|
+
* @module dsh-plugin-dbgraph-tool/command
|
|
13
|
+
*/
|
|
14
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
15
|
+
/** Command name, without the leading slash. */
|
|
16
|
+
export declare const COMMAND_NAME = "dbgraph";
|
|
17
|
+
/** One-line discovery copy the UI shows in its command list. */
|
|
18
|
+
export declare const COMMAND_DESCRIPTION = "\u67E5\u770B\u6216\u91CD\u5EFA\u672C\u5730\u6570\u636E\u5E93\u7ED3\u6784\u7D22\u5F15\uFF08status / index / connections\uFF09";
|
|
19
|
+
/** Input syntax the UI shows after the command name. */
|
|
20
|
+
export declare const COMMAND_INPUT_HINT = "[status|index [--connection <id>] [--mode l1|l2|full]|connections]";
|
|
21
|
+
/** The usage line every rejection repeats, so one screen never offers half an answer. */
|
|
22
|
+
export declare const COMMAND_USAGE = "\u7528\u6CD5\uFF1A/dbgraph [status|index [--connection <id>] [--mode l1|l2|full]|connections]";
|
|
23
|
+
/**
|
|
24
|
+
* Branded identity of this definition, mirroring `CommandDefinitionId` from
|
|
25
|
+
* `@deepseek-ai/dsh-commands/brand` without importing it.
|
|
26
|
+
*
|
|
27
|
+
* The registry treats the value as an opaque string; the local brand only keeps a plain string from
|
|
28
|
+
* being passed where a stable definition identity is meant.
|
|
29
|
+
*/
|
|
30
|
+
export type CommandDefinitionId = string & {
|
|
31
|
+
readonly __commandDefinitionId: 'CommandDefinitionId';
|
|
32
|
+
};
|
|
33
|
+
/** Stable identity, independent of the display name or the UI's per-run id. */
|
|
34
|
+
export declare const COMMAND_DEFINITION_ID: CommandDefinitionId;
|
|
35
|
+
/** What a handler settles with; mirrors the registry's `success | error` result. */
|
|
36
|
+
export type CommandResult = {
|
|
37
|
+
readonly kind: 'success';
|
|
38
|
+
readonly text?: string;
|
|
39
|
+
} | {
|
|
40
|
+
readonly kind: 'error';
|
|
41
|
+
readonly text: string;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* The invocation face a command handler receives, declared structurally — only the members this
|
|
45
|
+
* command reads.
|
|
46
|
+
*/
|
|
47
|
+
export interface CommandInvocation {
|
|
48
|
+
/** Everything after the command name, including its leading separator whitespace. */
|
|
49
|
+
readonly rawInput: string;
|
|
50
|
+
/** UI request cancellation, forwarded to every seam call. */
|
|
51
|
+
readonly signal?: AbortSignal;
|
|
52
|
+
}
|
|
53
|
+
/** One command registration, as the registry's `register` takes it. */
|
|
54
|
+
export interface CommandDefinition {
|
|
55
|
+
/** Stable plugin-namespaced identity. */
|
|
56
|
+
readonly definitionId: CommandDefinitionId;
|
|
57
|
+
/** Lowercase command name, without the slash. */
|
|
58
|
+
readonly name: string;
|
|
59
|
+
/** Discovery copy, shown in the UI's command list. */
|
|
60
|
+
readonly description: string;
|
|
61
|
+
/** Input syntax shown after the name. */
|
|
62
|
+
readonly input: {
|
|
63
|
+
readonly hint: string;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Run the command.
|
|
67
|
+
* @param invocation - the accepted command line and its context.
|
|
68
|
+
* @returns the settled result the UI renders.
|
|
69
|
+
*/
|
|
70
|
+
readonly handler: (invocation: CommandInvocation) => CommandResult | Promise<CommandResult>;
|
|
71
|
+
}
|
|
72
|
+
/** The command registry's registration surface, declared structurally. */
|
|
73
|
+
export interface CommandRegistry {
|
|
74
|
+
/**
|
|
75
|
+
* Register one command definition.
|
|
76
|
+
* @param definition - discovery metadata and handler.
|
|
77
|
+
* @returns the disposer unregistering it.
|
|
78
|
+
*/
|
|
79
|
+
register(definition: CommandDefinition): () => void;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Register the `/dbgraph` command when the host composition provides a command registry.
|
|
83
|
+
* @param ctx - the plugin context (must carry `dbgraph`; `commands` is optional).
|
|
84
|
+
*/
|
|
85
|
+
export declare function registerCommands(ctx: Context): void;
|
|
86
|
+
//# sourceMappingURL=command.d.ts.map
|
package/lib/command.js
ADDED
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The human `/dbgraph` slash command.
|
|
3
|
+
*
|
|
4
|
+
* The model-facing tools answer the same questions, but a person at the composer should not have to
|
|
5
|
+
* spend a model turn asking "what is indexed?". This command runs directly against `ctx.dbgraph` in
|
|
6
|
+
* the UI's command plane: nothing it returns becomes a model message or a token.
|
|
7
|
+
*
|
|
8
|
+
* Registered through conditional injection (`ctx.inject(['commands'], …)`) for the same reason the
|
|
9
|
+
* model-facing tools are not: the command registry is a host composition choice, and its absence
|
|
10
|
+
* must not hide the tools this plugin also registers. `@deepseek-ai/dsh-commands` is deliberately
|
|
11
|
+
* not imported — the service may be absent, so its public shape is mirrored structurally here.
|
|
12
|
+
* @module dsh-plugin-dbgraph-tool/command
|
|
13
|
+
*/
|
|
14
|
+
import { DBGRAPH_INDEX_MODES, DBGRAPH_INDEX_WRITERS } from "./schema.js";
|
|
15
|
+
import { dbgraphRoot } from "./prompt.js";
|
|
16
|
+
import { describeIndexState } from "./render.js";
|
|
17
|
+
/** Command name, without the leading slash. */
|
|
18
|
+
export const COMMAND_NAME = 'dbgraph';
|
|
19
|
+
/** One-line discovery copy the UI shows in its command list. */
|
|
20
|
+
export const COMMAND_DESCRIPTION = '查看或重建本地数据库结构索引(status / index / connections)';
|
|
21
|
+
/** Input syntax the UI shows after the command name. */
|
|
22
|
+
export const COMMAND_INPUT_HINT = '[status|index [--connection <id>] [--mode l1|l2|full]|connections]';
|
|
23
|
+
/** The usage line every rejection repeats, so one screen never offers half an answer. */
|
|
24
|
+
export const COMMAND_USAGE = `用法:/${COMMAND_NAME} ${COMMAND_INPUT_HINT}`;
|
|
25
|
+
/** Brand one plugin-namespaced command identity. */
|
|
26
|
+
function commandDefinitionId(value) {
|
|
27
|
+
return value;
|
|
28
|
+
}
|
|
29
|
+
/** Stable identity, independent of the display name or the UI's per-run id. */
|
|
30
|
+
export const COMMAND_DEFINITION_ID = commandDefinitionId('dsh-plugin-dbgraph/command/dbgraph');
|
|
31
|
+
/**
|
|
32
|
+
* Register the `/dbgraph` command when the host composition provides a command registry.
|
|
33
|
+
* @param ctx - the plugin context (must carry `dbgraph`; `commands` is optional).
|
|
34
|
+
*/
|
|
35
|
+
export function registerCommands(ctx) {
|
|
36
|
+
try {
|
|
37
|
+
ctx.inject(['commands'], child => {
|
|
38
|
+
const commands = child.commands;
|
|
39
|
+
child.effect(() => commands.register({
|
|
40
|
+
definitionId: COMMAND_DEFINITION_ID,
|
|
41
|
+
name: COMMAND_NAME,
|
|
42
|
+
description: COMMAND_DESCRIPTION,
|
|
43
|
+
input: { hint: COMMAND_INPUT_HINT },
|
|
44
|
+
handler: invocation => runCommand(ctx, invocation),
|
|
45
|
+
}), 'dbgraph: slash command');
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
console.warn('[dbgraph] commands service unavailable; /dbgraph is not registered:', error);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Parse and dispatch one invocation.
|
|
54
|
+
*
|
|
55
|
+
* A handler that throws makes the registry settle the command as an error from the thrown value
|
|
56
|
+
* instead of from a result, so every expected failure is returned as `kind: 'error'` here; only a
|
|
57
|
+
* defect escapes, and it still surfaces as the command's error.
|
|
58
|
+
* @param ctx - the plugin context carrying `dbgraph`.
|
|
59
|
+
* @param invocation - the accepted command line and its context.
|
|
60
|
+
* @returns the settled result.
|
|
61
|
+
*/
|
|
62
|
+
async function runCommand(ctx, invocation) {
|
|
63
|
+
const words = invocation.rawInput.trim() === '' ? [] : invocation.rawInput.trim().split(/\s+/u);
|
|
64
|
+
const [subcommand = 'status', ...rest] = words;
|
|
65
|
+
try {
|
|
66
|
+
switch (subcommand) {
|
|
67
|
+
case 'status':
|
|
68
|
+
return await statusCommand(ctx);
|
|
69
|
+
case 'connections':
|
|
70
|
+
return await connectionsCommand(ctx);
|
|
71
|
+
case 'index':
|
|
72
|
+
return await indexCommand(ctx, rest, invocation.signal);
|
|
73
|
+
default:
|
|
74
|
+
return { kind: 'error', text: `未知的子命令 "${subcommand}"。${COMMAND_USAGE}` };
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
catch (error) {
|
|
78
|
+
return { kind: 'error', text: String(error) };
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
/** The connection target clause: host and database, when the connection names them. */
|
|
82
|
+
function targetOf(connection) {
|
|
83
|
+
const parts = [];
|
|
84
|
+
if (connection.host !== undefined)
|
|
85
|
+
parts.push(connection.host);
|
|
86
|
+
if (connection.database !== undefined)
|
|
87
|
+
parts.push(connection.database);
|
|
88
|
+
return parts.length === 0 ? '' : ` ${parts.join('/')}`;
|
|
89
|
+
}
|
|
90
|
+
/** One connection as a line: id, label, engine, target, index state, credential state. */
|
|
91
|
+
function connectionLine(connection) {
|
|
92
|
+
const label = connection.label === undefined ? '' : ` "${connection.label}"`;
|
|
93
|
+
const credential = connection.credentialConfigured ? '' : '(凭据未配置)';
|
|
94
|
+
return `${connection.id}${label} (${connection.engine})${targetOf(connection)} — `
|
|
95
|
+
+ `${describeIndexState(connection.index)}${credential}`;
|
|
96
|
+
}
|
|
97
|
+
/** Report every configured connection's index at a glance. */
|
|
98
|
+
async function statusCommand(ctx) {
|
|
99
|
+
const root = ctx.dbgraph.storeRoot ?? dbgraphRoot();
|
|
100
|
+
const connections = await ctx.dbgraph.listConnections();
|
|
101
|
+
if (connections.length === 0) {
|
|
102
|
+
return {
|
|
103
|
+
kind: 'success',
|
|
104
|
+
text: `还没有配置连接。索引根:${root}\n在 ${root}/connections.json 里添加连接后运行 /${COMMAND_NAME} index。`,
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
const lines = [`索引根:${root}`, ...connections.map(connectionLine)];
|
|
108
|
+
return { kind: 'success', text: lines.join('\n') };
|
|
109
|
+
}
|
|
110
|
+
/** List the connections without their index state — what the model passes as `--connection`. */
|
|
111
|
+
async function connectionsCommand(ctx) {
|
|
112
|
+
const connections = await ctx.dbgraph.listConnections();
|
|
113
|
+
if (connections.length === 0)
|
|
114
|
+
return { kind: 'success', text: '还没有配置连接。' };
|
|
115
|
+
const lines = connections.map(connection => `${connection.id} (${connection.engine})${targetOf(connection)}`);
|
|
116
|
+
return { kind: 'success', text: lines.join('\n') };
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Build or refresh an index right now.
|
|
120
|
+
*
|
|
121
|
+
* Unlike the model-facing tool this never moves to a background job: a human ran a command and is
|
|
122
|
+
* waiting for its answer, and the command plane has no `job_output` equivalent to read later.
|
|
123
|
+
* @param ctx - the plugin context carrying `dbgraph`.
|
|
124
|
+
* @param words - the subcommand's arguments.
|
|
125
|
+
* @param signal - stops the run.
|
|
126
|
+
* @returns the completed run's summary, or why the arguments are unusable.
|
|
127
|
+
*/
|
|
128
|
+
async function indexCommand(ctx, words, signal) {
|
|
129
|
+
const parsed = parseIndexFlags(words);
|
|
130
|
+
if ('error' in parsed)
|
|
131
|
+
return { kind: 'error', text: `${parsed.error}。${COMMAND_USAGE}` };
|
|
132
|
+
const report = await ctx.dbgraph.index(parsed.request, signal);
|
|
133
|
+
const lines = [
|
|
134
|
+
`已索引 ${report.connection}(${report.level}):${report.objects} 对象 / ${report.columns} 列 / `
|
|
135
|
+
+ `${report.edges} 关系,${report.terms} 检索词,writer ${report.writer},${report.elapsedMs} ms。`,
|
|
136
|
+
];
|
|
137
|
+
if (report.warnings.length > 0)
|
|
138
|
+
lines.push(...report.warnings.map(warning => `警告:${warning}`));
|
|
139
|
+
return { kind: 'success', text: lines.join('\n') };
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Parse `index`'s flags.
|
|
143
|
+
* @param words - the argument words after `index`.
|
|
144
|
+
* @returns the request, or one message naming the unusable argument.
|
|
145
|
+
*/
|
|
146
|
+
function parseIndexFlags(words) {
|
|
147
|
+
let connection;
|
|
148
|
+
let mode = 'full';
|
|
149
|
+
let writer;
|
|
150
|
+
for (let index = 0; index < words.length; index += 1) {
|
|
151
|
+
const word = words[index];
|
|
152
|
+
const next = words[index + 1];
|
|
153
|
+
switch (word) {
|
|
154
|
+
case '--connection':
|
|
155
|
+
if (next === undefined || next.trim() === '')
|
|
156
|
+
return { error: '--connection 需要一个连接 id' };
|
|
157
|
+
connection = next;
|
|
158
|
+
index += 1;
|
|
159
|
+
break;
|
|
160
|
+
case '--mode':
|
|
161
|
+
if (next === undefined || !DBGRAPH_INDEX_MODES.includes(next)) {
|
|
162
|
+
return { error: `--mode 只能是 ${DBGRAPH_INDEX_MODES.join(' / ')}` };
|
|
163
|
+
}
|
|
164
|
+
mode = next;
|
|
165
|
+
index += 1;
|
|
166
|
+
break;
|
|
167
|
+
case '--writer':
|
|
168
|
+
if (next === undefined || !DBGRAPH_INDEX_WRITERS.includes(next)) {
|
|
169
|
+
return { error: `--writer 只能是 ${DBGRAPH_INDEX_WRITERS.join(' / ')}` };
|
|
170
|
+
}
|
|
171
|
+
writer = next;
|
|
172
|
+
index += 1;
|
|
173
|
+
break;
|
|
174
|
+
default:
|
|
175
|
+
return { error: `未知参数 "${word}"` };
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
return {
|
|
179
|
+
request: {
|
|
180
|
+
...connection === undefined ? {} : { connection },
|
|
181
|
+
mode,
|
|
182
|
+
...writer === undefined ? {} : { writer },
|
|
183
|
+
},
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
//# sourceMappingURL=command.js.map
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Model-facing `dbgraph` tool family over `ctx.dbgraph`.
|
|
3
|
+
*
|
|
4
|
+
* Two tools, deliberately separate. `dbgraph` is the read side, with the eight operations the seam
|
|
5
|
+
* answers directly; `dbgraph_index` builds or refreshes the on-disk index on explicit request. They
|
|
6
|
+
* are separate because `defineTool`'s `timeoutMs` is fixed per registration, not per call: a query
|
|
7
|
+
* is milliseconds and an index build is minutes, so one budget cannot fit both.
|
|
8
|
+
*
|
|
9
|
+
* The plugin also owns the system-prompt section that carries the schema digest. That section's
|
|
10
|
+
* `text` is a function, not a string: the host re-evaluates it on every assembly, which is what lets
|
|
11
|
+
* the model learn which tables exist for free instead of spending a discovery round-trip. The
|
|
12
|
+
* function reads a small JSON sidecar synchronously — opening SQLite, or reaching a server, from an
|
|
13
|
+
* assembly would tax every request.
|
|
14
|
+
*
|
|
15
|
+
* The tools own every default the seam refuses to guess — result limits, prompt budgets, the
|
|
16
|
+
* background-index threshold — so the seam's requests stay fully specified and a deployment can
|
|
17
|
+
* retune the model's answer size without touching a store. The `/dbgraph` command attaches through
|
|
18
|
+
* conditional injection instead, so a host without a command registry still gets the tool family.
|
|
19
|
+
*
|
|
20
|
+
* Namespace plugin (named exports, no default export).
|
|
21
|
+
* @module dsh-plugin-dbgraph-tool
|
|
22
|
+
*/
|
|
23
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
24
|
+
import type { IndexReport } from 'dsh-plugin-dbgraph-service';
|
|
25
|
+
import type { DbgraphIndexToolValue, DbgraphToolArgs } from './schema.ts';
|
|
26
|
+
export { renderDbgraph, renderDbgraphIndex } from './render.ts';
|
|
27
|
+
export { DBGRAPH_INDEX_MODES, DBGRAPH_INDEX_OUTPUT_SCHEMA, DBGRAPH_INDEX_PARAMETERS, DBGRAPH_INDEX_WRITERS, DBGRAPH_OPERATIONS, DBGRAPH_OUTPUT_SCHEMA, DBGRAPH_PARAMETERS, type DbgraphIndexToolArgs, type DbgraphIndexToolValue, type DbgraphToolArgs, type DbgraphToolOperation, type DbgraphToolValue, type DbgraphValueFor, } from './schema.ts';
|
|
28
|
+
export { COMMAND_DEFINITION_ID, COMMAND_DESCRIPTION, COMMAND_INPUT_HINT, COMMAND_NAME, COMMAND_USAGE, registerCommands, } from './command.ts';
|
|
29
|
+
export type { CommandDefinition, CommandDefinitionId, CommandInvocation, CommandRegistry, CommandResult } from './command.ts';
|
|
30
|
+
export { DBGRAPH_PROMPT_TEXT, DEFAULT_MAX_PROMPT_CHARS, DEFAULT_MAX_PROMPT_TABLES, dbgraphPromptHint, dbgraphRoot, formatAge, readIndexDirectories, readStatusFile, renderStatusDigest, } from './prompt.ts';
|
|
31
|
+
export type { DigestLimits, PromptHintOptions } from './prompt.ts';
|
|
32
|
+
/** Cordis plugin name for loader diagnostics. */
|
|
33
|
+
export declare const name = "tool-dbgraph";
|
|
34
|
+
/** Services required by this plugin. */
|
|
35
|
+
export declare const inject: string[];
|
|
36
|
+
/** Default tool-call timeout budget (ms) for the query-side `dbgraph` tool. */
|
|
37
|
+
export declare const DEFAULT_DBGRAPH_TOOL_TIMEOUT_MS = 30000;
|
|
38
|
+
/** Default timeout budget (ms) for `dbgraph_index`. Building an index is a different order of work than a query. */
|
|
39
|
+
export declare const DEFAULT_DBGRAPH_INDEX_TIMEOUT_MS = 300000;
|
|
40
|
+
/** Objects per connection past which an index run moves to a background job under `backgroundIndex: 'auto'`. */
|
|
41
|
+
export declare const DEFAULT_BACKGROUND_INDEX_THRESHOLD = 500;
|
|
42
|
+
/** Rows a `find` or `sql` call returns when the model names no `limit`. */
|
|
43
|
+
export declare const DEFAULT_TOOL_LIMIT = 50;
|
|
44
|
+
/** Largest `limit` honored, whatever the model asks for. */
|
|
45
|
+
export declare const DEFAULT_MAX_TOOL_LIMIT = 200;
|
|
46
|
+
/** Plugin configuration: the defaults and caps the seam requires the consumer to own. */
|
|
47
|
+
export interface Config {
|
|
48
|
+
/** Rows returned when the model names no `limit` (default 50). */
|
|
49
|
+
defaultLimit?: number;
|
|
50
|
+
/** Largest `limit` honored (default 200). */
|
|
51
|
+
maxLimit?: number;
|
|
52
|
+
/** Objects the prompt digest lists at most, across all connections (default 40). */
|
|
53
|
+
maxPromptTables?: number;
|
|
54
|
+
/** Characters the prompt digest may occupy (default 6000). */
|
|
55
|
+
maxPromptChars?: number;
|
|
56
|
+
/** Hours after which the digest marks the index stale (default 6, the seam's default). */
|
|
57
|
+
indexStaleHours?: number;
|
|
58
|
+
/** Whether to register the system-prompt section (default true). Off hides the digest, not the tools. */
|
|
59
|
+
prompt?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Whether an index run moves to the host's background-job registry: `'auto'` (default) decides by
|
|
62
|
+
* the connection's last indexed object count, `true` always uses a job when the host offers one,
|
|
63
|
+
* and `false` always runs synchronously inside the tool call.
|
|
64
|
+
*/
|
|
65
|
+
backgroundIndex?: 'auto' | boolean;
|
|
66
|
+
/** Objects the last index must have covered before `'auto'` uses a job (default 500). */
|
|
67
|
+
backgroundIndexThreshold?: number;
|
|
68
|
+
/** Tool-call timeout budget in ms for the query-side `dbgraph` tool (default 30000). */
|
|
69
|
+
timeoutMs?: number;
|
|
70
|
+
/** Tool-call timeout budget in ms for `dbgraph_index` (default 300000). */
|
|
71
|
+
indexTimeoutMs?: number;
|
|
72
|
+
}
|
|
73
|
+
/** Every configuration field with its default applied. */
|
|
74
|
+
export type ResolvedConfig = Required<Config>;
|
|
75
|
+
/**
|
|
76
|
+
* Apply every default and reject a value that would fail at call time instead.
|
|
77
|
+
* @param config - the deployment's configuration.
|
|
78
|
+
* @returns the resolved configuration.
|
|
79
|
+
*/
|
|
80
|
+
export declare function resolveConfig(config?: Config): ResolvedConfig;
|
|
81
|
+
/**
|
|
82
|
+
* Register the two model-facing tools, their system-prompt section, and the `/dbgraph` command.
|
|
83
|
+
* @param ctx - the plugin context (must inject `tools`, `dbgraph`, `systemPrompt`).
|
|
84
|
+
* @param config - the plugin configuration, or a partial one.
|
|
85
|
+
*/
|
|
86
|
+
export declare function apply(ctx: Context, config?: Config): void;
|
|
87
|
+
/**
|
|
88
|
+
* The one-line label a pending call shows.
|
|
89
|
+
* @param args - the validated tool arguments.
|
|
90
|
+
* @returns the card title naming the operation and whichever subject the operation takes.
|
|
91
|
+
*/
|
|
92
|
+
export declare function callTitle(args: DbgraphToolArgs): string;
|
|
93
|
+
/** Project every finished index run onto the model-facing field names. */
|
|
94
|
+
export declare function completedIndexValue(reports: readonly IndexReport[]): DbgraphIndexToolValue;
|
|
95
|
+
//# sourceMappingURL=index.d.ts.map
|