plures 1.0.0 → 1.2.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 +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +36 -2
- package/dist/index.d.ts +36 -2
- package/dist/index.js +1 -1
- package/package.json +41 -9
package/README.md
CHANGED
|
@@ -25,7 +25,7 @@ const task = await plures.verify({
|
|
|
25
25
|
console.log(task.result?.answer, task.result?.agreement);
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
-
Get a free test key at [plures.si](https://plures.si/?for=developers#join). Test keys complete at once with the first option (or `metadata.test_answer`) and never reach real people.
|
|
28
|
+
Get a free test key at [plures.si](https://plures.si/?for=developers#join). Test keys complete at once with the first option (or `metadata.test_answer`) and never reach real people. Set `metadata.test_outcome` to `split`, `tie`, `expired` or `slow` to test the cases you route to your own team.
|
|
29
29
|
|
|
30
30
|
## Production: webhooks
|
|
31
31
|
|
|
@@ -44,7 +44,7 @@ if (event.type === "task.completed" && event.data.result?.agreement === 1) {
|
|
|
44
44
|
|
|
45
45
|
## API
|
|
46
46
|
|
|
47
|
-
- `plures.tasks.create(params, { idempotencyKey? })`: send a task. Params: `question`, `options` (2 to 8, strings or `{ id, label }`), `context`, `image_url`, `instructions`, `verifiers` (1, 3, 5, 7 or 9), `max_verifiers`, `presence_check` (default true), `webhook_url`, `metadata`, `expires_in`.
|
|
47
|
+
- `plures.tasks.create(params, { idempotencyKey? })`: send a task. Params: `question`, `options` (2 to 8, strings or `{ id, label }`), `context`, `image_url`, `audio_url` or `video_url` with `media_seconds` (a clip up to 180 seconds that people play through before answering), `sensitive`, `instructions`, `verifiers` (1, 3, 5, 7 or 9), `max_verifiers`, `presence_check` (default true), `webhook_url`, `metadata`, `expires_in`.
|
|
48
48
|
- `plures.tasks.retrieve(id)`, `plures.tasks.list({ status?, limit?, starting_after? })`, `plures.tasks.cancel(id)`
|
|
49
49
|
- `plures.tasks.waitFor(id, { timeoutMs?, intervalMs? })`: poll until settled
|
|
50
50
|
- `plures.verify(params, { timeoutMs?, idempotencyKey? })`: create and wait
|
package/dist/index.cjs
CHANGED
|
@@ -26,7 +26,7 @@ __export(index_exports, {
|
|
|
26
26
|
default: () => index_default
|
|
27
27
|
});
|
|
28
28
|
module.exports = __toCommonJS(index_exports);
|
|
29
|
-
var VERSION = "1.
|
|
29
|
+
var VERSION = "1.2.0";
|
|
30
30
|
var PluresError = class extends Error {
|
|
31
31
|
constructor(message, status, type) {
|
|
32
32
|
super(message);
|
package/dist/index.d.cts
CHANGED
|
@@ -10,6 +10,18 @@ type Result = {
|
|
|
10
10
|
answers: number;
|
|
11
11
|
votes: Record<string, number>;
|
|
12
12
|
tie?: boolean;
|
|
13
|
+
/** Who made the final call: verified people, or your team after verifiers didn't all agree. */
|
|
14
|
+
decided_by?: "verifiers" | "team";
|
|
15
|
+
/** The team member who decided, when decided_by is "team". */
|
|
16
|
+
reviewer?: string;
|
|
17
|
+
note?: string;
|
|
18
|
+
};
|
|
19
|
+
/** Set when verifiers didn't all agree and the decision went to your team. */
|
|
20
|
+
type Escalation = {
|
|
21
|
+
reason: "split" | "tie" | "no_answer";
|
|
22
|
+
escalated_at: string;
|
|
23
|
+
verifiers: Result | null;
|
|
24
|
+
team_deadline?: string;
|
|
13
25
|
};
|
|
14
26
|
type Task = {
|
|
15
27
|
id: string;
|
|
@@ -20,11 +32,21 @@ type Task = {
|
|
|
20
32
|
context: string | null;
|
|
21
33
|
image_url: string | null;
|
|
22
34
|
instructions: string | null;
|
|
35
|
+
audio_url?: string | null;
|
|
36
|
+
video_url?: string | null;
|
|
37
|
+
media_seconds?: number | null;
|
|
38
|
+
sensitive?: boolean;
|
|
23
39
|
options: Option[];
|
|
24
40
|
verifiers: number;
|
|
25
41
|
presence_check?: boolean;
|
|
26
42
|
result: Result | null;
|
|
43
|
+
escalation?: Escalation | null;
|
|
27
44
|
metadata: Record<string, unknown>;
|
|
45
|
+
/** Where this decision sits on the Plures ledger, once recorded. */
|
|
46
|
+
ledger?: {
|
|
47
|
+
seq: number;
|
|
48
|
+
url: string;
|
|
49
|
+
} | null;
|
|
28
50
|
webhook_url: string | null;
|
|
29
51
|
created_at: string;
|
|
30
52
|
completed_at: string | null;
|
|
@@ -35,6 +57,14 @@ type CreateTask = {
|
|
|
35
57
|
options: (string | Option)[];
|
|
36
58
|
context?: string;
|
|
37
59
|
image_url?: string;
|
|
60
|
+
/** A recording people play through before answering, up to 3 minutes. Needs media_seconds. */
|
|
61
|
+
audio_url?: string;
|
|
62
|
+
/** A video people play through before answering, up to 3 minutes. Needs media_seconds. Not with audio_url. */
|
|
63
|
+
video_url?: string;
|
|
64
|
+
/** The clip's length in seconds, 1 to 180. Required with audio_url or video_url; pay scales with it. */
|
|
65
|
+
media_seconds?: number;
|
|
66
|
+
/** Disturbing content: only verifiers who opted in get it, behind a warning. Default false. */
|
|
67
|
+
sensitive?: boolean;
|
|
38
68
|
instructions?: string;
|
|
39
69
|
verifiers?: 1 | 3 | 5 | 7 | 9;
|
|
40
70
|
max_verifiers?: number;
|
|
@@ -43,6 +73,10 @@ type CreateTask = {
|
|
|
43
73
|
webhook_url?: string;
|
|
44
74
|
metadata?: Record<string, unknown>;
|
|
45
75
|
expires_in?: number;
|
|
76
|
+
/** Send to your team when verifiers don't agree enough. Default: on when you've added a team. */
|
|
77
|
+
escalate?: boolean;
|
|
78
|
+
/** Agreement below which this task goes to your team, 0 to 1. Default from your dashboard. */
|
|
79
|
+
escalate_below?: number;
|
|
46
80
|
};
|
|
47
81
|
type WebhookEvent = {
|
|
48
82
|
id: string;
|
|
@@ -50,7 +84,7 @@ type WebhookEvent = {
|
|
|
50
84
|
created_at: string;
|
|
51
85
|
data: Task;
|
|
52
86
|
};
|
|
53
|
-
declare const VERSION = "1.
|
|
87
|
+
declare const VERSION = "1.2.0";
|
|
54
88
|
declare class PluresError extends Error {
|
|
55
89
|
readonly status: number;
|
|
56
90
|
readonly type: string;
|
|
@@ -98,4 +132,4 @@ declare class Plures {
|
|
|
98
132
|
static verifyWebhook(rawBody: string, signatureHeader: string | null, secret: string, toleranceSec?: number): Promise<WebhookEvent>;
|
|
99
133
|
}
|
|
100
134
|
|
|
101
|
-
export { type CreateTask, type Option, Plures, PluresError, type Result, type Task, type TaskStatus, VERSION, type WebhookEvent, Plures as default };
|
|
135
|
+
export { type CreateTask, type Escalation, type Option, Plures, PluresError, type Result, type Task, type TaskStatus, VERSION, type WebhookEvent, Plures as default };
|
package/dist/index.d.ts
CHANGED
|
@@ -10,6 +10,18 @@ type Result = {
|
|
|
10
10
|
answers: number;
|
|
11
11
|
votes: Record<string, number>;
|
|
12
12
|
tie?: boolean;
|
|
13
|
+
/** Who made the final call: verified people, or your team after verifiers didn't all agree. */
|
|
14
|
+
decided_by?: "verifiers" | "team";
|
|
15
|
+
/** The team member who decided, when decided_by is "team". */
|
|
16
|
+
reviewer?: string;
|
|
17
|
+
note?: string;
|
|
18
|
+
};
|
|
19
|
+
/** Set when verifiers didn't all agree and the decision went to your team. */
|
|
20
|
+
type Escalation = {
|
|
21
|
+
reason: "split" | "tie" | "no_answer";
|
|
22
|
+
escalated_at: string;
|
|
23
|
+
verifiers: Result | null;
|
|
24
|
+
team_deadline?: string;
|
|
13
25
|
};
|
|
14
26
|
type Task = {
|
|
15
27
|
id: string;
|
|
@@ -20,11 +32,21 @@ type Task = {
|
|
|
20
32
|
context: string | null;
|
|
21
33
|
image_url: string | null;
|
|
22
34
|
instructions: string | null;
|
|
35
|
+
audio_url?: string | null;
|
|
36
|
+
video_url?: string | null;
|
|
37
|
+
media_seconds?: number | null;
|
|
38
|
+
sensitive?: boolean;
|
|
23
39
|
options: Option[];
|
|
24
40
|
verifiers: number;
|
|
25
41
|
presence_check?: boolean;
|
|
26
42
|
result: Result | null;
|
|
43
|
+
escalation?: Escalation | null;
|
|
27
44
|
metadata: Record<string, unknown>;
|
|
45
|
+
/** Where this decision sits on the Plures ledger, once recorded. */
|
|
46
|
+
ledger?: {
|
|
47
|
+
seq: number;
|
|
48
|
+
url: string;
|
|
49
|
+
} | null;
|
|
28
50
|
webhook_url: string | null;
|
|
29
51
|
created_at: string;
|
|
30
52
|
completed_at: string | null;
|
|
@@ -35,6 +57,14 @@ type CreateTask = {
|
|
|
35
57
|
options: (string | Option)[];
|
|
36
58
|
context?: string;
|
|
37
59
|
image_url?: string;
|
|
60
|
+
/** A recording people play through before answering, up to 3 minutes. Needs media_seconds. */
|
|
61
|
+
audio_url?: string;
|
|
62
|
+
/** A video people play through before answering, up to 3 minutes. Needs media_seconds. Not with audio_url. */
|
|
63
|
+
video_url?: string;
|
|
64
|
+
/** The clip's length in seconds, 1 to 180. Required with audio_url or video_url; pay scales with it. */
|
|
65
|
+
media_seconds?: number;
|
|
66
|
+
/** Disturbing content: only verifiers who opted in get it, behind a warning. Default false. */
|
|
67
|
+
sensitive?: boolean;
|
|
38
68
|
instructions?: string;
|
|
39
69
|
verifiers?: 1 | 3 | 5 | 7 | 9;
|
|
40
70
|
max_verifiers?: number;
|
|
@@ -43,6 +73,10 @@ type CreateTask = {
|
|
|
43
73
|
webhook_url?: string;
|
|
44
74
|
metadata?: Record<string, unknown>;
|
|
45
75
|
expires_in?: number;
|
|
76
|
+
/** Send to your team when verifiers don't agree enough. Default: on when you've added a team. */
|
|
77
|
+
escalate?: boolean;
|
|
78
|
+
/** Agreement below which this task goes to your team, 0 to 1. Default from your dashboard. */
|
|
79
|
+
escalate_below?: number;
|
|
46
80
|
};
|
|
47
81
|
type WebhookEvent = {
|
|
48
82
|
id: string;
|
|
@@ -50,7 +84,7 @@ type WebhookEvent = {
|
|
|
50
84
|
created_at: string;
|
|
51
85
|
data: Task;
|
|
52
86
|
};
|
|
53
|
-
declare const VERSION = "1.
|
|
87
|
+
declare const VERSION = "1.2.0";
|
|
54
88
|
declare class PluresError extends Error {
|
|
55
89
|
readonly status: number;
|
|
56
90
|
readonly type: string;
|
|
@@ -98,4 +132,4 @@ declare class Plures {
|
|
|
98
132
|
static verifyWebhook(rawBody: string, signatureHeader: string | null, secret: string, toleranceSec?: number): Promise<WebhookEvent>;
|
|
99
133
|
}
|
|
100
134
|
|
|
101
|
-
export { type CreateTask, type Option, Plures, PluresError, type Result, type Task, type TaskStatus, VERSION, type WebhookEvent, Plures as default };
|
|
135
|
+
export { type CreateTask, type Escalation, type Option, Plures, PluresError, type Result, type Task, type TaskStatus, VERSION, type WebhookEvent, Plures as default };
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,10 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "plures",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Human judgment as an API for AI agents. Send a decision to ID verified people and get their consensus back.",
|
|
5
|
-
"keywords": [
|
|
5
|
+
"keywords": [
|
|
6
|
+
"human-in-the-loop",
|
|
7
|
+
"hitl",
|
|
8
|
+
"ai-agents",
|
|
9
|
+
"human-review",
|
|
10
|
+
"human-approval",
|
|
11
|
+
"agents",
|
|
12
|
+
"llm",
|
|
13
|
+
"verification",
|
|
14
|
+
"plures"
|
|
15
|
+
],
|
|
6
16
|
"homepage": "https://plures.si/docs",
|
|
7
|
-
"repository": {
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git+https://github.com/plureslabs/plures.git",
|
|
20
|
+
"directory": "js"
|
|
21
|
+
},
|
|
8
22
|
"bugs": "https://github.com/plureslabs/plures/issues",
|
|
9
23
|
"license": "MIT",
|
|
10
24
|
"author": "Plures Labs LLC <hello@plures.si>",
|
|
@@ -14,13 +28,31 @@
|
|
|
14
28
|
"types": "./dist/index.d.ts",
|
|
15
29
|
"exports": {
|
|
16
30
|
".": {
|
|
17
|
-
"import": {
|
|
18
|
-
|
|
31
|
+
"import": {
|
|
32
|
+
"types": "./dist/index.d.ts",
|
|
33
|
+
"default": "./dist/index.js"
|
|
34
|
+
},
|
|
35
|
+
"require": {
|
|
36
|
+
"types": "./dist/index.d.cts",
|
|
37
|
+
"default": "./dist/index.cjs"
|
|
38
|
+
}
|
|
19
39
|
}
|
|
20
40
|
},
|
|
21
|
-
"files": [
|
|
41
|
+
"files": [
|
|
42
|
+
"dist",
|
|
43
|
+
"README.md"
|
|
44
|
+
],
|
|
22
45
|
"sideEffects": false,
|
|
23
|
-
"engines": {
|
|
24
|
-
|
|
25
|
-
|
|
46
|
+
"engines": {
|
|
47
|
+
"node": ">=18"
|
|
48
|
+
},
|
|
49
|
+
"scripts": {
|
|
50
|
+
"build": "tsup src/index.ts --format esm,cjs --dts --clean",
|
|
51
|
+
"prepublishOnly": "npm run build"
|
|
52
|
+
},
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"tsup": "^8.3.5",
|
|
55
|
+
"typescript": "^5.6.3",
|
|
56
|
+
"@types/node": "^22.10.0"
|
|
57
|
+
}
|
|
26
58
|
}
|