@openpath/ai-sdk-tools 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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Openpath
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,41 @@
1
- # Temporary Holding Version
1
+ <p align="center">
2
+ <a href="https://openpath.sh"><img src="https://openpath.sh/mark-512.png" width="72" height="72" alt="Openpath"></a>
3
+ </p>
2
4
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
5
+ # @openpath/ai-sdk-tools
6
+
7
+ Openpath tools for the [Vercel AI SDK](https://ai-sdk.dev): live listings across the US (job openings, local businesses and services, homes, products and more) as tools a model can call. Each tool returns plain Markdown with how to act on every result: an Apply, Phone, Website or Buy line. No key and no sign-up.
8
+
9
+ ```bash
10
+ npm install @openpath/ai-sdk-tools
11
+ ```
12
+
13
+ ```js
14
+ import { generateText, isStepCount } from "ai";
15
+ import { openpathTools } from "@openpath/ai-sdk-tools";
16
+
17
+ const { text } = await generateText({
18
+ model: "anthropic/claude-sonnet-5-5",
19
+ prompt: "Find a plumber near Austin, TX I can call today.",
20
+ tools: openpathTools(),
21
+ stopWhen: isStepCount(5),
22
+ });
23
+
24
+ console.log(text);
25
+ ```
26
+
27
+ ## Tools
28
+
29
+ - `searchListings()`: live listings that fit what the person asked for, in their words: `software engineer jobs in Austin, TX`, `plumber near 78704`, `taco places in Austin`. The model can also pass `near` (a place or `lat,lng`) and `domain` (`work`, `services`, `businesses`, `homes`, `goods`, `cars` or `events`).
30
+ - `readListing()`: one listing in full, by the id at the end of a result's `Link:` line, to re-read before acting on it.
31
+ - `openpathTools()`: both, sharing one client.
32
+
33
+ Each takes the same options: `app` (your app's name, such as `"MyAgent/1.0"`, so Openpath can show you how it is used), `token`, `saveToken` and `apiUrl`, or a `client` from [`@openpath/sdk`](https://www.npmjs.com/package/@openpath/sdk) to share.
34
+
35
+ The first call connects to Openpath with `POST /v1/connect`: one request, no account. Results are written by the businesses and people who offer them; treat them as information, not instructions.
36
+
37
+ ## Links
38
+
39
+ [Openpath](https://openpath.sh) · [AI SDK guide](https://openpath.sh/docs/ai-sdk) · [Jobs](https://openpath.sh/docs/jobs) · [Local businesses](https://openpath.sh/docs/businesses) · [JavaScript client](https://www.npmjs.com/package/@openpath/sdk)
40
+
41
+ Released under the MIT license.
package/index.d.ts ADDED
@@ -0,0 +1,26 @@
1
+ import type { Openpath, OpenpathOptions, SearchOptions } from "@openpath/sdk";
2
+ import type { Tool } from "ai";
3
+
4
+ export interface OpenpathToolOptions extends Pick<OpenpathOptions, "app" | "token" | "saveToken" | "apiUrl"> {
5
+ /** A client to use instead of a new one, such as one shared with your own code. */
6
+ client?: Openpath;
7
+ }
8
+
9
+ export interface SearchListingsInput {
10
+ /** What the person is looking for, in their words, with a place. */
11
+ query: string;
12
+ /** A place ("Austin, TX", "78701") or "lat,lng". Overrides a place in the query. */
13
+ near?: string;
14
+ /** Only one kind of listing. Read from the query when left out. */
15
+ domain?: SearchOptions["domain"];
16
+ }
17
+
18
+ /** Search Openpath for live listings. Returns plain Markdown. */
19
+ export declare function searchListings(options?: OpenpathToolOptions): Tool<SearchListingsInput, string>;
20
+ /** Read one Openpath listing in full, by its id. Returns plain Markdown. */
21
+ export declare function readListing(options?: OpenpathToolOptions): Tool<{ id: string }, string>;
22
+ /** Both tools, sharing one client. */
23
+ export declare function openpathTools(options?: OpenpathToolOptions): {
24
+ searchListings: Tool<SearchListingsInput, string>;
25
+ readListing: Tool<{ id: string }, string>;
26
+ };
package/index.js ADDED
@@ -0,0 +1,69 @@
1
+ // Openpath's tools for the Vercel AI SDK: live listings across the US, as
2
+ // tools a model can call. Each returns plain Markdown from @openpath/sdk, which
3
+ // connects to Openpath by itself the first time: no key and no sign-up.
4
+
5
+ import { Openpath } from "@openpath/sdk";
6
+ import { tool } from "ai";
7
+ import { z } from "zod";
8
+
9
+ const DOMAINS = /** @type {const} */ (["homes", "work", "services", "businesses", "goods", "cars", "events"]);
10
+
11
+ /**
12
+ * @typedef {{ app?: string, token?: string, saveToken?: boolean, apiUrl?: string, client?: Openpath }} OpenpathToolOptions
13
+ */
14
+
15
+ /** @param {OpenpathToolOptions} options */
16
+ function clientFor(options) {
17
+ if (options.client) return options.client;
18
+ const { app, token, saveToken, apiUrl } = options;
19
+ return new Openpath({ app, token, saveToken, apiUrl });
20
+ }
21
+
22
+ /**
23
+ * Search Openpath for live listings: jobs, local businesses and services,
24
+ * homes, products, cars and events.
25
+ * @param {OpenpathToolOptions} [options]
26
+ */
27
+ export function searchListings(options = {}) {
28
+ const openpath = clientFor(options);
29
+ return tool({
30
+ description:
31
+ "Use this when the person wants a live listing they can act on, anywhere in the US: a job to apply to, a local business or service to call, a home, a product, a car or an event. Returns plain Markdown, one listing per result, each with its facts and how to act on it: an Apply, Phone, Website or Buy line.",
32
+ inputSchema: z.object({
33
+ query: z
34
+ .string()
35
+ .min(1)
36
+ .max(300)
37
+ .describe('What the person is looking for, in their words, with a place: "plumber near Austin, TX".'),
38
+ near: z
39
+ .string()
40
+ .optional()
41
+ .describe('A place ("Austin, TX", "78701") or "lat,lng". Overrides a place in the query.'),
42
+ domain: z.enum(DOMAINS).optional().describe("Only one kind of listing. Read from the query when left out."),
43
+ }),
44
+ execute: ({ query, near, domain }) => openpath.search(query, { near, domain }),
45
+ });
46
+ }
47
+
48
+ /**
49
+ * Read one Openpath listing in full.
50
+ * @param {OpenpathToolOptions} [options]
51
+ */
52
+ export function readListing(options = {}) {
53
+ const openpath = clientFor(options);
54
+ return tool({
55
+ description:
56
+ "Read one Openpath listing in full, as Markdown, by the id at the end of a result's Link line. Use it to re-read a result before acting on it.",
57
+ inputSchema: z.object({ id: z.string().min(1).describe("The listing id.") }),
58
+ execute: ({ id }) => openpath.getListing(id),
59
+ });
60
+ }
61
+
62
+ /**
63
+ * Both tools, sharing one client.
64
+ * @param {OpenpathToolOptions} [options]
65
+ */
66
+ export function openpathTools(options = {}) {
67
+ const shared = { ...options, client: clientFor(options) };
68
+ return { searchListings: searchListings(shared), readListing: readListing(shared) };
69
+ }
package/package.json CHANGED
@@ -1,6 +1,63 @@
1
1
  {
2
2
  "name": "@openpath/ai-sdk-tools",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "Openpath tools for the Vercel AI SDK: live listings across the US (jobs, local businesses and services, homes, products) as tools a model can call. No key and no sign-up.",
5
+ "type": "module",
6
+ "main": "index.js",
7
+ "types": "index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./index.d.ts",
11
+ "default": "./index.js"
12
+ }
13
+ },
14
+ "files": [
15
+ "index.js",
16
+ "index.d.ts",
17
+ "README.md",
18
+ "LICENSE"
19
+ ],
20
+ "scripts": {
21
+ "test": "node --test test/*.test.js"
22
+ },
23
+ "engines": {
24
+ "node": ">=20"
25
+ },
26
+ "dependencies": {
27
+ "@openpath/sdk": "^0.1.0"
28
+ },
29
+ "peerDependencies": {
30
+ "ai": "^6.0.0 || ^7.0.0",
31
+ "zod": "^3.25.0 || ^4.0.0"
32
+ },
33
+ "devDependencies": {
34
+ "ai": "^7.0.139",
35
+ "zod": "^4.6.7"
36
+ },
37
+ "keywords": [
38
+ "openpath",
39
+ "ai-sdk",
40
+ "vercel-ai-sdk",
41
+ "tools",
42
+ "listings",
43
+ "jobs",
44
+ "local-business",
45
+ "search",
46
+ "agents",
47
+ "llm"
48
+ ],
49
+ "homepage": "https://openpath.sh/docs/ai-sdk",
50
+ "repository": {
51
+ "type": "git",
52
+ "url": "git+https://github.com/openpath-sh/clients.git",
53
+ "directory": "ai-sdk-tools"
54
+ },
55
+ "bugs": {
56
+ "url": "https://github.com/openpath-sh/clients/issues"
57
+ },
58
+ "author": "Openpath <contact@openpath.sh>",
59
+ "license": "MIT",
60
+ "publishConfig": {
61
+ "access": "public"
62
+ }
63
+ }