@vapi-network/cli 0.8.0 → 0.9.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 +3 -0
- package/dist/cli.d.ts +4 -1
- package/dist/cli.js +10225 -2455
- package/dist/cli.js.map +3 -3
- package/dist/docs.d.ts +2 -0
- package/dist/index.js +10225 -2455
- package/dist/index.js.map +3 -3
- package/dist/task.d.ts +36 -0
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
package/dist/task.d.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type TasksChain, type TasksClient, type TasksClientOptions, type PendingTransactions, type UploadFileInput } from "@vapi-network/core/tasks";
|
|
2
|
+
import { parseArguments, type CliDependencies, type CliIo, type WalletTarget } from "./cli.js";
|
|
3
|
+
export type TasksCommandDependencies = {
|
|
4
|
+
client?: TasksClient | ((options: TasksClientOptions) => TasksClient);
|
|
5
|
+
chain?: TasksChain;
|
|
6
|
+
sleep?: (milliseconds: number) => Promise<void>;
|
|
7
|
+
randomUUID?: () => string;
|
|
8
|
+
};
|
|
9
|
+
export declare const TASK_HELP = "Usage:\n vapi task search [--open] [--min <usd>] [--tab trending|new|closing|paid] [--limit <n>] [--json]\n vapi task show <id> [--account <name>] [--json]\n vapi task post --title <text> --brief <file|-> --amount <usd> --deadline <duration|ISO> [--intake proposals|submissions] [--max-awards <k>] [--webhook <https-url>] [--account <name>] [--json]\n vapi task propose <id> --price <usd> --duration <duration> --note <text> [--account <name>] [--json]\n vapi task submit <id> --proof <https-url> [--proof <https-url>...] [--file <path>...] [--account <name>] [--json]\n vapi task award <id> <proposalId> [--account <name>] [--json]\n vapi task sign <id> [--yes] [--counterparty <0x\u2026>] [--account <name>] [--json]\n vapi task fund <id> [--yes] [--counterparty <0x\u2026>] [--account <name>] [--json]\n vapi task deliver <id> --files <path...> --note <text> [--counterparty <0x\u2026>] [--account <name>] [--json]\n vapi task release <id> [--counterparty <0x\u2026>] [--account <name>] [--json]\n vapi task refund <id> [--counterparty <0x\u2026>] [--account <name>] [--json]\n vapi task dispute <id> --evidence-hash <0x + 64 hex> [--yes] [--counterparty <0x\u2026>] [--account <name>] [--json]\n vapi task counter-evidence <id> --evidence-hash <0x + 64 hex> [--yes] [--counterparty <0x\u2026>] [--account <name>] [--json]\n vapi task resolve-unmatched <id> [--counterparty <0x\u2026>] [--account <name>] [--json]\n vapi task message <id> <text> [--account <name>] [--json]\n vapi task thread <id> [--after <cursor>] [--account <name>] [--json]\n vapi task watch <id> [--until <state>] [--auto-release] [--timeout 7d] [--interval 5s] [--counterparty <0x\u2026>] [--account <name>] [--json]\n vapi task status <id> [--account <name>] [--json]\n\nDurations: 5s, 10m, 48h, 7d, or an ISO-8601 timestamp. Posting and proposal terms require at least 10 minutes.\nDispute accepts a precomputed evidence hash only; evidence-file hashing is still undecided upstream.\nWatch requires an interval of at least 1s and a positive timeout. Auto-release uses the acting wallet's agent profile, or defaults, and releases only amounts strictly below the threshold.\nPosting a task moves no money. Task reads require tasks:read and writes require tasks:write; write access includes reads.\nThe thread cursor is the previous page's nextBeforeSeq; --after reads older messages using beforeSeq.\nEvery command accepts --json. Watch and a partially completed sign may write more than one JSON value. Human diagnostics go to stderr.\n\nExit codes:\n 0 ok\n 1 error, including invalid usage, unavailable routes and chain failures\n 2 policy refusal only (JSON ok:false with reason policy.perTask or policy.perDay)\n 3 approval needed in non-interactive mode\n\nFund, deliver, release, refund, dispute, counter-evidence, resolve-unmatched and watch auto-release sign with the local vault wallet. The CLI waits for two confirmations and records pending transactions for recovery. It never retries a chain mutation automatically.";
|
|
10
|
+
type Parsed = ReturnType<typeof parseArguments>;
|
|
11
|
+
type TaskRoute = keyof TasksClient;
|
|
12
|
+
export declare class TaskCommandError extends Error {
|
|
13
|
+
readonly code: string;
|
|
14
|
+
readonly manifestHash?: `0x${string}` | undefined;
|
|
15
|
+
constructor(code: string, message: string, manifestHash?: `0x${string}` | undefined);
|
|
16
|
+
}
|
|
17
|
+
/** Relative milliseconds; timestamps are measured from the supplied clock. */
|
|
18
|
+
export declare function parseTaskDuration(text: string, now: Date): number;
|
|
19
|
+
export type TaskContext = {
|
|
20
|
+
client: TasksClient;
|
|
21
|
+
chain: TasksChain;
|
|
22
|
+
pending?: PendingTransactions;
|
|
23
|
+
baseUrl: string;
|
|
24
|
+
target?: WalletTarget;
|
|
25
|
+
token?: string;
|
|
26
|
+
randomUUID: () => string;
|
|
27
|
+
sleep: (milliseconds: number) => Promise<void>;
|
|
28
|
+
signInHint: string;
|
|
29
|
+
};
|
|
30
|
+
/** Reuses wallet selection, registry configuration and device-link credentials. */
|
|
31
|
+
export declare function taskContext(parsed: Parsed, io: CliIo, dependencies: CliDependencies, publicOnly?: boolean): Promise<TaskContext>;
|
|
32
|
+
export declare function taskRequest<T>(verb: string, route: TaskRoute, operation: () => Promise<T>): Promise<T>;
|
|
33
|
+
export declare function taskOutput(io: CliIo, json: boolean, context: TaskContext, verb: string, value: object, lines: string[]): void;
|
|
34
|
+
export declare function taskCommand(argv: string[], json: boolean, io: CliIo, dependencies: CliDependencies): Promise<number | undefined>;
|
|
35
|
+
export declare function readTaskFile(path: string): Promise<UploadFileInput>;
|
|
36
|
+
export {};
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const CLI_VERSION = "0.
|
|
1
|
+
export declare const CLI_VERSION = "0.9.0";
|