toolpal 0.0.0-stage → 0.1.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/LICENSE +85 -0
- package/README.md +69 -2
- package/dist/authoring.d.ts +9 -0
- package/dist/authoring.d.ts.map +1 -0
- package/dist/authoring.js +41 -0
- package/dist/authoring.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +838 -0
- package/dist/cli.js.map +1 -0
- package/dist/format.d.ts +17 -0
- package/dist/format.d.ts.map +1 -0
- package/dist/format.js +55 -0
- package/dist/format.js.map +1 -0
- package/dist/init.d.ts +2 -0
- package/dist/init.d.ts.map +1 -0
- package/dist/init.js +53 -0
- package/dist/init.js.map +1 -0
- package/dist/login.d.ts +10 -0
- package/dist/login.d.ts.map +1 -0
- package/dist/login.js +18 -0
- package/dist/login.js.map +1 -0
- package/dist/mcp.d.ts +73 -0
- package/dist/mcp.d.ts.map +1 -0
- package/dist/mcp.js +648 -0
- package/dist/mcp.js.map +1 -0
- package/dist/verify-build.d.ts +15 -0
- package/dist/verify-build.d.ts.map +1 -0
- package/dist/verify-build.js +61 -0
- package/dist/verify-build.js.map +1 -0
- package/package.json +40 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
Toolpal License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 the Toolpal authors. All rights reserved.
|
|
4
|
+
|
|
5
|
+
This license covers the Toolpal client packages: toolpal, @toolpal/sdk,
|
|
6
|
+
@toolpal/tool, @toolpal/runtime, @toolpal/sandbox, @toolpal/manifest,
|
|
7
|
+
@toolpal/analyzer and @toolpal/builder (together, the "Software"). It does not
|
|
8
|
+
cover any other Toolpal software or service, such as the Toolpal registry or
|
|
9
|
+
website. The Toolpal authors are the "licensor"; "you" means the person or
|
|
10
|
+
organization using the Software.
|
|
11
|
+
|
|
12
|
+
1. Use
|
|
13
|
+
|
|
14
|
+
The licensor grants you a free, worldwide, non-exclusive, non-transferable
|
|
15
|
+
license to install, run and use the Software for any purpose, including
|
|
16
|
+
commercial purposes, subject to the terms below.
|
|
17
|
+
|
|
18
|
+
2. Tools you build
|
|
19
|
+
|
|
20
|
+
You may include @toolpal/tool, and any other code the Software adds to a
|
|
21
|
+
tool when it builds one, in tools you create. You may publish and
|
|
22
|
+
distribute those tools, through the Toolpal registry or otherwise, under
|
|
23
|
+
terms you choose for your own code. The parts of a tool that come from the
|
|
24
|
+
Software remain under this license.
|
|
25
|
+
|
|
26
|
+
3. Copies
|
|
27
|
+
|
|
28
|
+
You may make the copies of the Software you need to use it, including in
|
|
29
|
+
your own applications, container images, caches and deployments, as long
|
|
30
|
+
as each copy keeps this license and is unmodified apart from automated
|
|
31
|
+
bundling, compilation or minification.
|
|
32
|
+
|
|
33
|
+
4. Restrictions
|
|
34
|
+
|
|
35
|
+
You may not:
|
|
36
|
+
|
|
37
|
+
a. modify the Software or make derivative works of it, except as
|
|
38
|
+
sections 2 and 3 allow;
|
|
39
|
+
b. sell, rent, lease or sublicense the Software, or distribute it on its
|
|
40
|
+
own, except as sections 2 and 3 allow;
|
|
41
|
+
c. use the Software to offer a product or service that competes with
|
|
42
|
+
Toolpal, such as a tool registry or marketplace, without the
|
|
43
|
+
licensor's written permission;
|
|
44
|
+
d. remove or change any copyright, license or other notice in the
|
|
45
|
+
Software.
|
|
46
|
+
|
|
47
|
+
5. Third-party software
|
|
48
|
+
|
|
49
|
+
The Software uses open-source components that are licensed to you under
|
|
50
|
+
their own licenses. Nothing in this license limits your rights under
|
|
51
|
+
those licenses.
|
|
52
|
+
|
|
53
|
+
6. Ownership
|
|
54
|
+
|
|
55
|
+
The licensor keeps all rights in the Software that this license does not
|
|
56
|
+
expressly grant you. This license grants no rights to the Toolpal name or
|
|
57
|
+
logo.
|
|
58
|
+
|
|
59
|
+
7. Termination
|
|
60
|
+
|
|
61
|
+
This license ends automatically if you break any of its terms. You must
|
|
62
|
+
then stop using the Software and delete your copies of it. Tools you
|
|
63
|
+
distributed before then stay licensed under section 2 for the people who
|
|
64
|
+
received them.
|
|
65
|
+
|
|
66
|
+
8. No warranty
|
|
67
|
+
|
|
68
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
69
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
70
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
71
|
+
|
|
72
|
+
9. Limitation of liability
|
|
73
|
+
|
|
74
|
+
IN NO EVENT SHALL THE LICENSOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
75
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
76
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
77
|
+
DEALINGS IN THE SOFTWARE. THIS INCLUDES HARM CAUSED BY TOOLS YOU RUN WITH
|
|
78
|
+
THE SOFTWARE: ITS ISOLATION REDUCES RISK BUT IS NOT A GUARANTEE (SEE THE
|
|
79
|
+
SECURITY MODEL IN THE TOOLPAL DOCUMENTATION).
|
|
80
|
+
|
|
81
|
+
10. Future versions
|
|
82
|
+
|
|
83
|
+
The licensor may release future versions of the Software under different
|
|
84
|
+
terms. Each version of the Software is governed by the license included
|
|
85
|
+
with it.
|
package/README.md
CHANGED
|
@@ -1,3 +1,70 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Toolpal
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Ready-made workflows that run locally on your machine — sandboxed with Node's permission model, signed by the registry, and reusable from any MCP client or Node.js app.
|
|
4
|
+
|
|
5
|
+
Browse published workflows at [toolpal.dev](https://toolpal.dev).
|
|
6
|
+
|
|
7
|
+
## Quick start (MCP)
|
|
8
|
+
|
|
9
|
+
Use Toolpal workflows directly in Claude Code, Cursor, Claude Desktop, or any MCP client:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npx toolpal login
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Add Toolpal to your MCP client configuration:
|
|
16
|
+
|
|
17
|
+
```json
|
|
18
|
+
{
|
|
19
|
+
"mcpServers": {
|
|
20
|
+
"toolpal": {
|
|
21
|
+
"command": "npx",
|
|
22
|
+
"args": ["toolpal", "mcp"]
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Click **Add** on any workflow at [toolpal.dev](https://toolpal.dev) (or run `npx toolpal add --account @toolpal/github-repo`), and it becomes available in your MCP client automatically.
|
|
29
|
+
|
|
30
|
+
## Quick start (SDK)
|
|
31
|
+
|
|
32
|
+
Install [`@toolpal/sdk`](https://www.npmjs.com/package/@toolpal/sdk), add a workflow to your project, and call it from TypeScript or JavaScript:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npm install @toolpal/sdk
|
|
36
|
+
npx toolpal add @toolpal/github-repo
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
```ts
|
|
40
|
+
import { toolpal } from "@toolpal/sdk";
|
|
41
|
+
|
|
42
|
+
const repo = await toolpal.execute({
|
|
43
|
+
tool: "@toolpal/github-repo",
|
|
44
|
+
input: { repo: "nodejs/node" },
|
|
45
|
+
});
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
`toolpal add` downloads the workflow, verifies the registry's Ed25519 signature and tarball integrity hash, prints its exact permissions, and pins it in `toolpal.json` and `toolpal.lock`.
|
|
49
|
+
|
|
50
|
+
## Publish your own workflow
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
npx toolpal login
|
|
54
|
+
npx toolpal init --name my-workflow
|
|
55
|
+
cd my-workflow
|
|
56
|
+
npm install
|
|
57
|
+
npx toolpal build
|
|
58
|
+
npx toolpal publish
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
`toolpal build` bundles your workflow, runs static analysis to derive its exact permissions (network, env vars, temp files), and captures verified examples in the sandbox.
|
|
62
|
+
|
|
63
|
+
## Requirements
|
|
64
|
+
|
|
65
|
+
- **Node.js `>= 22.15.0`** (uses Node's built-in `--permission` sandbox; Node 25+ adds native `--allow-net` isolation).
|
|
66
|
+
|
|
67
|
+
## Documentation & License
|
|
68
|
+
|
|
69
|
+
- Docs & browse catalog: [https://toolpal.dev/docs](https://toolpal.dev/docs)
|
|
70
|
+
- License: see [LICENSE](./LICENSE)
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type Toolpal } from "@toolpal/runtime";
|
|
2
|
+
import type { ToolAuthoring } from "./mcp.js";
|
|
3
|
+
/**
|
|
4
|
+
* What `publish_tool` builds and publishes with: each tool is built from its one
|
|
5
|
+
* source file in a throwaway directory under the toolpal home, and uploaded with
|
|
6
|
+
* the account's own registry client.
|
|
7
|
+
*/
|
|
8
|
+
export declare function sourceAuthoring(account: Toolpal): ToolAuthoring;
|
|
9
|
+
//# sourceMappingURL=authoring.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authoring.d.ts","sourceRoot":"","sources":["../src/authoring.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,OAAO,EAAgB,MAAM,kBAAkB,CAAC;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,aAAa,CAgC/D"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { join } from "node:path";
|
|
2
|
+
import { BuildError, buildFromSource, publishBuilt, removeSourceBuild } from "@toolpal/builder";
|
|
3
|
+
import { ToolpalError } from "@toolpal/runtime";
|
|
4
|
+
/**
|
|
5
|
+
* What `publish_tool` builds and publishes with: each tool is built from its one
|
|
6
|
+
* source file in a throwaway directory under the toolpal home, and uploaded with
|
|
7
|
+
* the account's own registry client.
|
|
8
|
+
*/
|
|
9
|
+
export function sourceAuthoring(account) {
|
|
10
|
+
return {
|
|
11
|
+
async prepare(name, code) {
|
|
12
|
+
let built;
|
|
13
|
+
try {
|
|
14
|
+
built = await buildFromSource({ name, code, workDir: join(account.home, "authoring") });
|
|
15
|
+
}
|
|
16
|
+
catch (err) {
|
|
17
|
+
// The message carries the compiler's findings, which the model needs to fix its code.
|
|
18
|
+
if (err instanceof BuildError)
|
|
19
|
+
throw new ToolpalError("INVALID_TOOL", err.message);
|
|
20
|
+
throw err;
|
|
21
|
+
}
|
|
22
|
+
const { projectDir } = built;
|
|
23
|
+
return {
|
|
24
|
+
description: built.manifest.description,
|
|
25
|
+
permissions: built.manifest.permissions,
|
|
26
|
+
flags: built.flags,
|
|
27
|
+
async publish(visibility) {
|
|
28
|
+
const client = await account.client();
|
|
29
|
+
const { pack, response } = await publishBuilt(client, projectDir, visibility);
|
|
30
|
+
// A registry from before private tools ignores the request and publishes for everyone.
|
|
31
|
+
if (visibility === "private" && response.visibility !== "private") {
|
|
32
|
+
throw new ToolpalError("REGISTRY_ERROR", `${client.baseUrl} does not support private tools, so ${response.id} is PUBLIC. Tell the user; they can withdraw it with \`toolpal yank ${response.id}\`.`);
|
|
33
|
+
}
|
|
34
|
+
return { version: pack.manifest.version, visibility: response.visibility ?? "public" };
|
|
35
|
+
},
|
|
36
|
+
dispose: () => removeSourceBuild(projectDir),
|
|
37
|
+
};
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=authoring.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authoring.js","sourceRoot":"","sources":["../src/authoring.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAChG,OAAO,EAAgB,YAAY,EAAE,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