tascan-mcp 3.16.0 → 3.16.1

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/index.js CHANGED
@@ -15,6 +15,7 @@ import { createRequire } from 'module';
15
15
 
16
16
  const require = createRequire(import.meta.url);
17
17
  const { TOOLS } = require('./tools.cjs');
18
+ const crypto = require('crypto'); // B1 (migration 220): crypto.randomUUID() is a Node built-in, no new dependency
18
19
 
19
20
  const API_BASE = process.env.TASCAN_API_URL || 'https://app.tascan.io/api/v1';
20
21
  const API_KEY = process.env.TASCAN_API_KEY || '';
@@ -24,8 +25,11 @@ if (!API_KEY) {
24
25
  process.exit(1);
25
26
  }
26
27
 
27
- // Transport-bound REST call handed to every tool handler
28
- async function api(method, path, body) {
28
+ // Transport-bound REST call handed to every tool handler. B1 (migration 220): every POST/PUT sends an
29
+ // Idempotency-Key — a fresh crypto.randomUUID() per call by default, or idemKey verbatim when a tool (e.g.
30
+ // tascan_send_sms, tascan_request_payment, tascan_add_tasks) passes one through so a RETRIED call reuses the
31
+ // same key instead of minting a new reservation (and re-running the handler) every time.
32
+ async function api(method, path, body, idemKey) {
29
33
  const opts = {
30
34
  method,
31
35
  headers: {
@@ -36,6 +40,9 @@ async function api(method, path, body) {
36
40
  if (body && (method === 'POST' || method === 'PUT')) {
37
41
  opts.body = JSON.stringify(body);
38
42
  }
43
+ if (method === 'POST' || method === 'PUT') {
44
+ opts.headers['Idempotency-Key'] = idemKey || crypto.randomUUID();
45
+ }
39
46
  const resp = await fetch(API_BASE + path, opts);
40
47
  const data = await resp.json();
41
48
  if (!resp.ok) {
@@ -46,7 +53,7 @@ async function api(method, path, body) {
46
53
  api.key = API_KEY; // raw-fetch tools read the key from here (S99: those functions now require auth)
47
54
 
48
55
  const server = new Server(
49
- { name: 'tascan', version: '3.16.0' },
56
+ { name: 'tascan', version: '3.16.1' },
50
57
  { capabilities: { tools: {} } }
51
58
  );
52
59
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tascan-mcp",
3
- "version": "3.16.0",
3
+ "version": "3.16.1",
4
4
  "mcpName": "io.github.snowbikemike/tascan-mcp",
5
5
  "description": "TaScan MCP Server — Closed-loop autonomous operations protocol. 70 tools for projects, tasks, workers, QR codes, NFC tags, worker marketplace with consented SMS invites, geofenced zones with rules (work site / hazard + AI-verified PPE checkpoints / containment / restricted, breach alerts, zone compliance audit), AI condition assessment, worker passports, verification-gated gig payments, client invoicing from verified work (overtime / day rate / per diem / expenses), shareable report links (completion, client service report, project, evidence pack), signed Action Receipts (Ed25519 JWS), cross-entity search, duplicate-worker detection, worker identity merge, AI issue analysis, and autonomous remediation dispatch. 15 patents filed (470+ claims). Task. Scan. Done.",
6
6
  "type": "module",
@@ -14,6 +14,7 @@
14
14
  "files": [
15
15
  "index.js",
16
16
  "tools.cjs",
17
+ "tools-devices.cjs",
17
18
  "scopes.cjs",
18
19
  "README.md",
19
20
  "LICENSE"