@nuanu-ai/agentify 0.5.1 → 0.5.2
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 +4 -2
- package/dist/schema.d.ts +0 -2
- package/dist/schema.js +1 -1
- package/dist/transport.d.ts +2 -3
- package/dist/transport.js +1 -1
- package/dist/verify.d.ts +0 -11
- package/dist/verify.js +2 -2
- package/dist/worker.d.ts +4 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -3,8 +3,10 @@
|
|
|
3
3
|
Agentify puts a merchant's existing products where AI agents buy. Each product
|
|
4
4
|
gets a card in an agent-facing storefront and a paid address of its own,
|
|
5
5
|
`/x402/<item>/purchase`, where an agent pays for it with the x402 payment
|
|
6
|
-
protocol
|
|
7
|
-
|
|
6
|
+
protocol. The buyer pays into the merchant's own payout contract, which nobody
|
|
7
|
+
owns and nobody can redirect. It keeps the money until it is paid out, which
|
|
8
|
+
the merchant can do at any time, and then sends 99.9% to the merchant's wallet
|
|
9
|
+
and 0.1% to Agentify ([Money](https://agentify.ad/docs/money)).
|
|
8
10
|
|
|
9
11
|
This package is the merchant's side of it. It publishes the cards, receives
|
|
10
12
|
paid orders and price questions through one outgoing connection, and closes
|
package/dist/schema.d.ts
CHANGED
|
@@ -16,8 +16,6 @@ export interface SchemaIssue {
|
|
|
16
16
|
readonly path: readonly PropertyKey[];
|
|
17
17
|
readonly message: string;
|
|
18
18
|
}
|
|
19
|
-
/** The code a finding travels under when the schema did not name one. */
|
|
20
|
-
export declare const UNNAMED_FINDING = "invalid";
|
|
21
19
|
/**
|
|
22
20
|
* A schema's findings, in the shape the publish call answers in, so a local
|
|
23
21
|
* check and a refused publish read the same. The path is flattened to text,
|
package/dist/schema.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* carries the contract schemas' findings into the shape a merchant reads.
|
|
7
7
|
*/
|
|
8
8
|
/** The code a finding travels under when the schema did not name one. */
|
|
9
|
-
|
|
9
|
+
const UNNAMED_FINDING = "invalid";
|
|
10
10
|
/**
|
|
11
11
|
* A schema's findings, in the shape the publish call answers in, so a local
|
|
12
12
|
* check and a refused publish read the same. The path is flattened to text,
|
package/dist/transport.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ export interface Gateway {
|
|
|
24
24
|
* It reads the shape of a parse result rather than using zod's `infer`,
|
|
25
25
|
* because zod is not this package's to import (see `schema.ts`).
|
|
26
26
|
*/
|
|
27
|
-
|
|
27
|
+
type DocumentOf<N extends RouteName> = (typeof API_ROUTES)[N]["response"] extends {
|
|
28
28
|
document: {
|
|
29
29
|
safeParse(value: unknown): infer Result;
|
|
30
30
|
};
|
|
@@ -97,8 +97,6 @@ export interface CallOptions {
|
|
|
97
97
|
readonly body?: unknown;
|
|
98
98
|
readonly signal?: AbortSignal;
|
|
99
99
|
}
|
|
100
|
-
/** The address of one call: the gateway's base, then the route's own path. */
|
|
101
|
-
export declare const addressOf: (baseUrl: string, name: RouteName, path: CallOptions["path"]) => string;
|
|
102
100
|
/**
|
|
103
101
|
* What is known about a failed call, as a clause to put before the failure's
|
|
104
102
|
* own `reason`: one for each reach, and one for a refusal the gateway wrote in
|
|
@@ -119,3 +117,4 @@ export declare const whatIsKnown: (failure: TransportFailure) => string;
|
|
|
119
117
|
* while at runtime it is the right one.
|
|
120
118
|
*/
|
|
121
119
|
export declare const callRoute: <N extends RouteName>(gateway: Gateway, name: N, options?: CallOptions) => Promise<Answer<N>>;
|
|
120
|
+
export {};
|
package/dist/transport.js
CHANGED
|
@@ -77,7 +77,7 @@ const quote = (text) => text.length <= QUOTED_CHARACTERS
|
|
|
77
77
|
? JSON.stringify(text)
|
|
78
78
|
: `${JSON.stringify(text.slice(0, QUOTED_CHARACTERS))} and ${text.length - QUOTED_CHARACTERS} more characters, not shown`;
|
|
79
79
|
/** The address of one call: the gateway's base, then the route's own path. */
|
|
80
|
-
|
|
80
|
+
const addressOf = (baseUrl, name, path) => `${baseUrl.replace(/\/+$/, "")}${expandPath(API_ROUTES[name].path, path ?? {})}`;
|
|
81
81
|
const failure = (route, reason, reach, body, refusal) => ({
|
|
82
82
|
ok: false,
|
|
83
83
|
failure: {
|
package/dist/verify.d.ts
CHANGED
|
@@ -9,16 +9,5 @@
|
|
|
9
9
|
* against the exit code. The cards to check are named on the command line,
|
|
10
10
|
* because nothing says where a merchant keeps them.
|
|
11
11
|
*/
|
|
12
|
-
/** What the command answers with. */
|
|
13
|
-
export declare const VERIFY_EXIT: Readonly<{
|
|
14
|
-
/** Every card it was given is complete as far as the contract can tell. */
|
|
15
|
-
PASSED: 0;
|
|
16
|
-
/** A card has findings. */
|
|
17
|
-
PROBLEMS: 1;
|
|
18
|
-
/** The command was called with something it cannot work from. */
|
|
19
|
-
USAGE: 2;
|
|
20
|
-
}>;
|
|
21
|
-
/** The code a finding carries when the file held no card to check at all. */
|
|
22
|
-
export declare const NOT_JSON = "not_json";
|
|
23
12
|
export type Say = (line: string) => void;
|
|
24
13
|
export declare const runVerify: (argv: readonly string[], say: Say) => Promise<number>;
|
package/dist/verify.js
CHANGED
|
@@ -14,7 +14,7 @@ import { basename } from "node:path";
|
|
|
14
14
|
import { checkCard } from "./check-card.js";
|
|
15
15
|
import { describeProblems } from "./schema.js";
|
|
16
16
|
/** What the command answers with. */
|
|
17
|
-
|
|
17
|
+
const VERIFY_EXIT = Object.freeze({
|
|
18
18
|
/** Every card it was given is complete as far as the contract can tell. */
|
|
19
19
|
PASSED: 0,
|
|
20
20
|
/** A card has findings. */
|
|
@@ -30,7 +30,7 @@ const NOT_CHECKED_HERE = [
|
|
|
30
30
|
" keep what the first delivery carried.",
|
|
31
31
|
].join("\n");
|
|
32
32
|
/** The code a finding carries when the file held no card to check at all. */
|
|
33
|
-
|
|
33
|
+
const NOT_JSON = "not_json";
|
|
34
34
|
const nameOf = (file, card) => {
|
|
35
35
|
const key = typeof card === "object" && card !== null && "merchant_item_id" in card
|
|
36
36
|
? card.merchant_item_id
|
package/dist/worker.d.ts
CHANGED
|
@@ -24,9 +24,9 @@ import { type Gateway } from "./transport.js";
|
|
|
24
24
|
* registers a function of this shape that attaches the order's calls and then
|
|
25
25
|
* calls the merchant's own handler.
|
|
26
26
|
*/
|
|
27
|
-
|
|
27
|
+
type OrderDispatch = (order: Order) => HandlerAnswer | Promise<HandlerAnswer>;
|
|
28
28
|
/** The same, for "how much is this and is it there". */
|
|
29
|
-
|
|
29
|
+
type QuoteDispatch = (question: QuoteRequest) => QuoteResponse | Promise<QuoteResponse>;
|
|
30
30
|
/**
|
|
31
31
|
* The name of one delivery of a message: its envelope's `id` and when it was
|
|
32
32
|
* sent. It is no way to recognise a repeat; an order sent again comes in a
|
|
@@ -140,7 +140,7 @@ export declare const REGISTERED_AS: Readonly<{
|
|
|
140
140
|
*/
|
|
141
141
|
export type StreamHandlerKind = (typeof REGISTERED_AS)[keyof typeof REGISTERED_AS];
|
|
142
142
|
/** What answers each kind, in the shape this loop calls. */
|
|
143
|
-
|
|
143
|
+
interface StreamDispatch {
|
|
144
144
|
order: OrderDispatch;
|
|
145
145
|
quote: QuoteDispatch;
|
|
146
146
|
event: EventHandler;
|
|
@@ -205,3 +205,4 @@ export interface RunningWorker {
|
|
|
205
205
|
export declare const startWorker: (gateway: Gateway, handlers: HandlerRegistry, clock?: WorkerClock,
|
|
206
206
|
/** A parameter so a test can see the deadline work without waiting it out. */
|
|
207
207
|
deadlineMs?: number) => RunningWorker;
|
|
208
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuanu-ai/agentify",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Sell your existing products to AI agents: publish product cards to an x402 storefront and fill the paid orders from your own service.",
|
|
6
6
|
"keywords": [
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"access": "public"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@nuanu-ai/agentify-contracts": "0.10.
|
|
39
|
+
"@nuanu-ai/agentify-contracts": "0.10.1"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"vitest": "^4.1.11",
|