driggsby 0.8.0 → 0.8.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/dist/args-query.js +20 -2
- package/package.json +3 -3
package/dist/args-query.js
CHANGED
|
@@ -8,6 +8,8 @@ import { didYouMean } from "./clap-suggestions.js";
|
|
|
8
8
|
import { CliError } from "./cli-error.js";
|
|
9
9
|
import { APP_TOOL_ALLOWLIST } from "./dev/tool-allowlist.js";
|
|
10
10
|
import { QUERY_HELP } from "./help.js";
|
|
11
|
+
import { ITEM_ACTION_TOOLS } from "./items/item-actions.js";
|
|
12
|
+
import { RULE_ACTION_TOOLS } from "./rules/rule-actions.js";
|
|
11
13
|
import { quotedForTerminal, wrapNames } from "./terminal-text.js";
|
|
12
14
|
// The tools that take SQL: --sql applies only to these, and a retry
|
|
13
15
|
// line names --sql only for them.
|
|
@@ -106,9 +108,25 @@ function invalidParams() {
|
|
|
106
108
|
function missingTool() {
|
|
107
109
|
return new CliError(`error: the following required arguments were not provided:\n <TOOL>\n\n${QUERY_USAGE}\n\nFor more information, try '--help'.`, 2);
|
|
108
110
|
}
|
|
111
|
+
// A tool with a command of its own (the items and rules actions): its
|
|
112
|
+
// refusal names that command rather than a read tool that looks alike.
|
|
113
|
+
function commandFor(tool) {
|
|
114
|
+
const commands = [["items", ITEM_ACTION_TOOLS], ["rules", RULE_ACTION_TOOLS]];
|
|
115
|
+
for (const [command, tools] of commands) {
|
|
116
|
+
const action = Object.keys(tools).find((name) => tools[name] === tool);
|
|
117
|
+
if (action !== undefined)
|
|
118
|
+
return `npx driggsby@latest ${command} ${action}`;
|
|
119
|
+
}
|
|
120
|
+
return undefined;
|
|
121
|
+
}
|
|
109
122
|
function unknownTool(tool) {
|
|
110
|
-
const
|
|
111
|
-
const
|
|
123
|
+
const command = commandFor(tool);
|
|
124
|
+
const similar = command === undefined ? didYouMean(tool, [...APP_TOOL_ALLOWLIST]) : undefined;
|
|
125
|
+
const tip = command !== undefined
|
|
126
|
+
? ` tip: run ${tool} with its own command:\n ${command}\n\n`
|
|
127
|
+
: similar === undefined
|
|
128
|
+
? ""
|
|
129
|
+
: ` tip: a similar tool exists: '${similar}'\n\n`;
|
|
112
130
|
return new CliError(`error: ${quotedForTerminal(tool, 60)} isn't a tool a Driggsby app can call.\n` +
|
|
113
131
|
`Apps can watch these read-only tools:\n` +
|
|
114
132
|
`${wrapNames([...APP_TOOL_ALLOWLIST], " ")}\n\n${tip}${QUERY_USAGE}\n\nFor more information, try '--help'.`, 2);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "driggsby",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"description": "Set up and build on Driggsby, the MCP server for personal finance.",
|
|
5
5
|
"license": "Apache-2.0 AND OFL-1.1",
|
|
6
6
|
"repository": {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"node": ">=18"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@driggsby/deploy": "0.8.
|
|
34
|
-
"@driggsby/sdk": "0.8.
|
|
33
|
+
"@driggsby/deploy": "0.8.1",
|
|
34
|
+
"@driggsby/sdk": "0.8.1"
|
|
35
35
|
}
|
|
36
36
|
}
|