plures 1.0.0 → 1.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/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
 
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.0.0";
29
+ var VERSION = "1.1.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;
@@ -24,6 +36,7 @@ type Task = {
24
36
  verifiers: number;
25
37
  presence_check?: boolean;
26
38
  result: Result | null;
39
+ escalation?: Escalation | null;
27
40
  metadata: Record<string, unknown>;
28
41
  webhook_url: string | null;
29
42
  created_at: string;
@@ -43,6 +56,10 @@ type CreateTask = {
43
56
  webhook_url?: string;
44
57
  metadata?: Record<string, unknown>;
45
58
  expires_in?: number;
59
+ /** Send to your team when verifiers don't agree enough. Default: on when you've added a team. */
60
+ escalate?: boolean;
61
+ /** Agreement below which this task goes to your team, 0 to 1. Default from your dashboard. */
62
+ escalate_below?: number;
46
63
  };
47
64
  type WebhookEvent = {
48
65
  id: string;
@@ -50,7 +67,7 @@ type WebhookEvent = {
50
67
  created_at: string;
51
68
  data: Task;
52
69
  };
53
- declare const VERSION = "1.0.0";
70
+ declare const VERSION = "1.1.0";
54
71
  declare class PluresError extends Error {
55
72
  readonly status: number;
56
73
  readonly type: string;
@@ -98,4 +115,4 @@ declare class Plures {
98
115
  static verifyWebhook(rawBody: string, signatureHeader: string | null, secret: string, toleranceSec?: number): Promise<WebhookEvent>;
99
116
  }
100
117
 
101
- export { type CreateTask, type Option, Plures, PluresError, type Result, type Task, type TaskStatus, VERSION, type WebhookEvent, Plures as default };
118
+ 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;
@@ -24,6 +36,7 @@ type Task = {
24
36
  verifiers: number;
25
37
  presence_check?: boolean;
26
38
  result: Result | null;
39
+ escalation?: Escalation | null;
27
40
  metadata: Record<string, unknown>;
28
41
  webhook_url: string | null;
29
42
  created_at: string;
@@ -43,6 +56,10 @@ type CreateTask = {
43
56
  webhook_url?: string;
44
57
  metadata?: Record<string, unknown>;
45
58
  expires_in?: number;
59
+ /** Send to your team when verifiers don't agree enough. Default: on when you've added a team. */
60
+ escalate?: boolean;
61
+ /** Agreement below which this task goes to your team, 0 to 1. Default from your dashboard. */
62
+ escalate_below?: number;
46
63
  };
47
64
  type WebhookEvent = {
48
65
  id: string;
@@ -50,7 +67,7 @@ type WebhookEvent = {
50
67
  created_at: string;
51
68
  data: Task;
52
69
  };
53
- declare const VERSION = "1.0.0";
70
+ declare const VERSION = "1.1.0";
54
71
  declare class PluresError extends Error {
55
72
  readonly status: number;
56
73
  readonly type: string;
@@ -98,4 +115,4 @@ declare class Plures {
98
115
  static verifyWebhook(rawBody: string, signatureHeader: string | null, secret: string, toleranceSec?: number): Promise<WebhookEvent>;
99
116
  }
100
117
 
101
- export { type CreateTask, type Option, Plures, PluresError, type Result, type Task, type TaskStatus, VERSION, type WebhookEvent, Plures as default };
118
+ 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
@@ -1,5 +1,5 @@
1
1
  // src/index.ts
2
- var VERSION = "1.0.0";
2
+ var VERSION = "1.1.0";
3
3
  var PluresError = class extends Error {
4
4
  constructor(message, status, type) {
5
5
  super(message);
package/package.json CHANGED
@@ -1,10 +1,24 @@
1
1
  {
2
2
  "name": "plures",
3
- "version": "1.0.0",
3
+ "version": "1.1.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": ["human-in-the-loop", "hitl", "ai-agents", "human-review", "human-approval", "agents", "llm", "verification", "plures"],
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": { "type": "git", "url": "git+https://github.com/plureslabs/plures.git", "directory": "js" },
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": { "types": "./dist/index.d.ts", "default": "./dist/index.js" },
18
- "require": { "types": "./dist/index.d.cts", "default": "./dist/index.cjs" }
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": ["dist", "README.md"],
41
+ "files": [
42
+ "dist",
43
+ "README.md"
44
+ ],
22
45
  "sideEffects": false,
23
- "engines": { "node": ">=18" },
24
- "scripts": { "build": "tsup src/index.ts --format esm,cjs --dts --clean", "prepublishOnly": "npm run build" },
25
- "devDependencies": { "tsup": "^8.3.5", "typescript": "^5.6.3", "@types/node": "^22.10.0" }
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
  }