@softov/ahpc 0.1.0 → 0.3.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/README.md +69 -1
- package/dist/src/ahp/channels.js +10 -3
- package/dist/src/ahp/live.js +63 -6
- package/dist/src/ahp/publish.js +31 -6
- package/dist/src/cli/main.d.ts +1 -1
- package/dist/src/cli/main.js +100 -98
- package/dist/src/flags.js +7 -0
- package/dist/src/main.js +14 -2
- package/dist/src/mcp/http.d.ts +34 -0
- package/dist/src/mcp/http.js +247 -0
- package/dist/src/mcp/serve.d.ts +96 -0
- package/dist/src/mcp/serve.js +169 -0
- package/dist/src/mcp/stdio.d.ts +14 -0
- package/dist/src/mcp/stdio.js +64 -0
- package/dist/src/mcp/tools.d.ts +68 -0
- package/dist/src/mcp/tools.js +765 -0
- package/dist/src/tui.d.ts +1 -1
- package/dist/src/tui.js +1 -0
- package/dist/src/version.d.ts +2 -0
- package/dist/src/version.js +38 -0
- package/dist/src/wait.d.ts +56 -0
- package/dist/src/wait.js +160 -0
- package/package.json +1 -1
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { HostConnection } from '../ahp/connection.js';
|
|
2
|
+
/** As much of JSON Schema as a tool's arguments need. */
|
|
3
|
+
export interface Schema {
|
|
4
|
+
type: 'object';
|
|
5
|
+
properties: Record<string, {
|
|
6
|
+
type: 'string' | 'number' | 'boolean' | 'object' | 'array';
|
|
7
|
+
description?: string;
|
|
8
|
+
items?: {
|
|
9
|
+
type: string;
|
|
10
|
+
};
|
|
11
|
+
additionalProperties?: boolean | {
|
|
12
|
+
type: string;
|
|
13
|
+
};
|
|
14
|
+
}>;
|
|
15
|
+
required?: string[];
|
|
16
|
+
additionalProperties?: boolean;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* A set of tools a caller has to ask for by name.
|
|
20
|
+
*
|
|
21
|
+
* The core table - sessions, turns, attention - is what a server is for and is
|
|
22
|
+
* always served. These are not: a tool table is read by a model alongside
|
|
23
|
+
* everything else it was given, and thirty tools is a worse server than twelve
|
|
24
|
+
* for the thing almost everybody wants. So they are opt-*in*, one group at a
|
|
25
|
+
* time, and a caller that needs files says so.
|
|
26
|
+
*/
|
|
27
|
+
export type Group = 'resources' | 'terminals' | 'automations' | 'changes';
|
|
28
|
+
/** Every group there is, for `--mcp-tools` to name in its help. */
|
|
29
|
+
export declare const GROUPS: readonly Group[];
|
|
30
|
+
/** One tool, as MCP describes it and as this client runs it. */
|
|
31
|
+
export interface Tool {
|
|
32
|
+
/** The name a caller uses. MCP has no dots, so these are underscored. */
|
|
33
|
+
name: string;
|
|
34
|
+
/**
|
|
35
|
+
* The group that has to be turned on for this to be served.
|
|
36
|
+
*
|
|
37
|
+
* Absent is core: always there, never asked for.
|
|
38
|
+
*/
|
|
39
|
+
group?: Group;
|
|
40
|
+
/** A short label, for a client that shows one. */
|
|
41
|
+
title: string;
|
|
42
|
+
/** What it does and when to reach for it, written for a model. */
|
|
43
|
+
description: string;
|
|
44
|
+
input: Schema;
|
|
45
|
+
/** Whether it changes anything, which some clients ask a person about. */
|
|
46
|
+
readOnly: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Do it.
|
|
49
|
+
*
|
|
50
|
+
* `report` is where to say what is happening while a long one runs, and is
|
|
51
|
+
* absent unless the caller asked for progress and the transport can carry
|
|
52
|
+
* it. A tool that reports nothing is a tool that finishes quickly enough
|
|
53
|
+
* not to need to.
|
|
54
|
+
*/
|
|
55
|
+
run(host: HostConnection, input: Record<string, unknown>, report?: (said: string) => void): Promise<unknown>;
|
|
56
|
+
}
|
|
57
|
+
export declare const TOOLS: Tool[];
|
|
58
|
+
/**
|
|
59
|
+
* One tool by the name a caller used, or nothing.
|
|
60
|
+
*
|
|
61
|
+
* Over the whole table, including groups nobody turned on - whether a tool
|
|
62
|
+
* exists and whether this server serves it are different questions, and
|
|
63
|
+
* `served` answers the second. Telling somebody the tool is in a group they
|
|
64
|
+
* did not ask for is a better answer than telling them it does not exist.
|
|
65
|
+
*/
|
|
66
|
+
export declare const named: (name: string) => Tool | undefined;
|
|
67
|
+
/** The tools a server started with these groups serves. */
|
|
68
|
+
export declare const served: (groups?: readonly string[]) => Tool[];
|