@h-ear/mcp-server 1.0.10 → 1.1.0-dev.202604170830
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/dist/schemas/index.d.ts +129 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/index.js +269 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +4 -0
- package/dist/server.js.map +1 -1
- package/dist/tools/classify-audio.d.ts.map +1 -1
- package/dist/tools/classify-audio.js +66 -36
- package/dist/tools/classify-audio.js.map +1 -1
- package/dist/tools/classify-batch.d.ts.map +1 -1
- package/dist/tools/classify-batch.js +2 -22
- package/dist/tools/classify-batch.js.map +1 -1
- package/dist/tools/create-webhook.d.ts.map +1 -1
- package/dist/tools/create-webhook.js +2 -15
- package/dist/tools/create-webhook.js.map +1 -1
- package/dist/tools/delete-webhook.d.ts.map +1 -1
- package/dist/tools/delete-webhook.js +2 -5
- package/dist/tools/delete-webhook.js.map +1 -1
- package/dist/tools/get-job-audio.d.ts.map +1 -1
- package/dist/tools/get-job-audio.js +2 -10
- package/dist/tools/get-job-audio.js.map +1 -1
- package/dist/tools/get-job-events.d.ts.map +1 -1
- package/dist/tools/get-job-events.js +2 -34
- package/dist/tools/get-job-events.js.map +1 -1
- package/dist/tools/get-job-report.d.ts +4 -0
- package/dist/tools/get-job-report.d.ts.map +1 -0
- package/dist/tools/get-job-report.js +16 -0
- package/dist/tools/get-job-report.js.map +1 -0
- package/dist/tools/get-job-waveform.d.ts.map +1 -1
- package/dist/tools/get-job-waveform.js +2 -14
- package/dist/tools/get-job-waveform.js.map +1 -1
- package/dist/tools/get-job.d.ts.map +1 -1
- package/dist/tools/get-job.js +2 -5
- package/dist/tools/get-job.js.map +1 -1
- package/dist/tools/get-upload-status.d.ts +3 -0
- package/dist/tools/get-upload-status.d.ts.map +1 -0
- package/dist/tools/get-upload-status.js +18 -0
- package/dist/tools/get-upload-status.js.map +1 -0
- package/dist/tools/get-webhook.d.ts.map +1 -1
- package/dist/tools/get-webhook.js +2 -5
- package/dist/tools/get-webhook.js.map +1 -1
- package/dist/tools/health-check.d.ts.map +1 -1
- package/dist/tools/health-check.js +2 -1
- package/dist/tools/health-check.js.map +1 -1
- package/dist/tools/list-classes.d.ts.map +1 -1
- package/dist/tools/list-classes.js +2 -15
- package/dist/tools/list-classes.js.map +1 -1
- package/dist/tools/list-jobs.d.ts.map +1 -1
- package/dist/tools/list-jobs.js +2 -15
- package/dist/tools/list-jobs.js.map +1 -1
- package/dist/tools/list-webhook-deliveries.d.ts.map +1 -1
- package/dist/tools/list-webhook-deliveries.js +2 -7
- package/dist/tools/list-webhook-deliveries.js.map +1 -1
- package/dist/tools/list-webhooks.d.ts.map +1 -1
- package/dist/tools/list-webhooks.js +2 -1
- package/dist/tools/list-webhooks.js.map +1 -1
- package/dist/tools/ping-webhook.d.ts.map +1 -1
- package/dist/tools/ping-webhook.js +2 -5
- package/dist/tools/ping-webhook.js.map +1 -1
- package/dist/tools/update-webhook.d.ts.map +1 -1
- package/dist/tools/update-webhook.js +2 -19
- package/dist/tools/update-webhook.js.map +1 -1
- package/dist/tools/usage.d.ts.map +1 -1
- package/dist/tools/usage.js +2 -1
- package/dist/tools/usage.js.map +1 -1
- package/dist/upload-tracker.d.ts +31 -0
- package/dist/upload-tracker.d.ts.map +1 -0
- package/dist/upload-tracker.js +34 -0
- package/dist/upload-tracker.js.map +1 -0
- package/package.json +7 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-webhook-deliveries.js","sourceRoot":"","sources":["../../src/tools/list-webhook-deliveries.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"list-webhook-deliveries.js","sourceRoot":"","sources":["../../src/tools/list-webhook-deliveries.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,6BAA6B,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEtF,MAAM,UAAU,6BAA6B,CAAC,MAAiB,EAAE,MAAqB;IAClF,MAAM,CAAC,IAAI,CACP,uBAAuB,EACvB,gBAAgB,CAAC,qBAAqB,EACtC,6BAA6B,EAC7B,EAAE,YAAY,EAAE,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,EACzF,KAAK,EAAE,MAAM,EAAE,EAAE;QACb,IAAI,CAAC;YACD,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,8BAA8B,CAAC,MAAM,CAAC,SAAS,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;YACtG,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;QAC3F,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,OAAO;gBACH,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,2BAA2B,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC;gBAC/H,OAAO,EAAE,IAAI;aAChB,CAAC;QACN,CAAC;IACL,CAAC,CACJ,CAAC;AACN,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-webhooks.d.ts","sourceRoot":"","sources":["../../src/tools/list-webhooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"list-webhooks.d.ts","sourceRoot":"","sources":["../../src/tools/list-webhooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjD,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,aAAa,GAAG,IAAI,CAkBnF"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { LIST_WEBHOOKS_SHAPE, toolDescriptions } from '../schemas/index.js';
|
|
1
2
|
export function registerListWebhooks(server, client) {
|
|
2
|
-
server.tool('listWebhooks',
|
|
3
|
+
server.tool('listWebhooks', toolDescriptions.listWebhooks, LIST_WEBHOOKS_SHAPE, { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true }, async () => {
|
|
3
4
|
try {
|
|
4
5
|
const result = await client.listEnterpriseWebhooks();
|
|
5
6
|
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-webhooks.js","sourceRoot":"","sources":["../../src/tools/list-webhooks.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"list-webhooks.js","sourceRoot":"","sources":["../../src/tools/list-webhooks.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5E,MAAM,UAAU,oBAAoB,CAAC,MAAiB,EAAE,MAAqB;IACzE,MAAM,CAAC,IAAI,CACP,cAAc,EACd,gBAAgB,CAAC,YAAY,EAC7B,mBAAmB,EACnB,EAAE,YAAY,EAAE,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,EACzF,KAAK,IAAI,EAAE;QACP,IAAI,CAAC;YACD,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,sBAAsB,EAAE,CAAC;YACrD,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;QAC3F,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,OAAO;gBACH,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,yBAAyB,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC;gBAC7H,OAAO,EAAE,IAAI;aAChB,CAAC;QACN,CAAC;IACL,CAAC,CACJ,CAAC;AACN,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ping-webhook.d.ts","sourceRoot":"","sources":["../../src/tools/ping-webhook.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ping-webhook.d.ts","sourceRoot":"","sources":["../../src/tools/ping-webhook.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjD,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,aAAa,GAAG,IAAI,CAkBlF"}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PING_WEBHOOK_SHAPE, toolDescriptions } from '../schemas/index.js';
|
|
2
2
|
export function registerPingWebhook(server, client) {
|
|
3
|
-
server.tool('pingWebhook',
|
|
4
|
-
webhookId: z.string().min(1)
|
|
5
|
-
.describe('The webhook ID to ping.'),
|
|
6
|
-
}, { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true }, async (params) => {
|
|
3
|
+
server.tool('pingWebhook', toolDescriptions.pingWebhook, PING_WEBHOOK_SHAPE, { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true }, async (params) => {
|
|
7
4
|
try {
|
|
8
5
|
const result = await client.pingEnterpriseWebhook(params.webhookId);
|
|
9
6
|
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ping-webhook.js","sourceRoot":"","sources":["../../src/tools/ping-webhook.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ping-webhook.js","sourceRoot":"","sources":["../../src/tools/ping-webhook.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE3E,MAAM,UAAU,mBAAmB,CAAC,MAAiB,EAAE,MAAqB;IACxE,MAAM,CAAC,IAAI,CACP,aAAa,EACb,gBAAgB,CAAC,WAAW,EAC5B,kBAAkB,EAClB,EAAE,YAAY,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,EAC3F,KAAK,EAAE,MAAM,EAAE,EAAE;QACb,IAAI,CAAC;YACD,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,qBAAqB,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;YACpE,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;QAC3F,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,OAAO;gBACH,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,wBAAwB,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC;gBAC5H,OAAO,EAAE,IAAI;aAChB,CAAC;QACN,CAAC;IACL,CAAC,CACJ,CAAC;AACN,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-webhook.d.ts","sourceRoot":"","sources":["../../src/tools/update-webhook.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"update-webhook.d.ts","sourceRoot":"","sources":["../../src/tools/update-webhook.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjD,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,aAAa,GAAG,IAAI,CAmBpF"}
|
|
@@ -1,23 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UPDATE_WEBHOOK_SHAPE, toolDescriptions } from '../schemas/index.js';
|
|
2
2
|
export function registerUpdateWebhook(server, client) {
|
|
3
|
-
server.tool('updateWebhook',
|
|
4
|
-
webhookId: z.string().min(1)
|
|
5
|
-
.describe('The webhook ID to update.'),
|
|
6
|
-
url: z.string().url().optional()
|
|
7
|
-
.describe('New HTTPS webhook URL.'),
|
|
8
|
-
events: z.array(z.string()).optional()
|
|
9
|
-
.describe('New event types to subscribe to.'),
|
|
10
|
-
status: z.enum(['active', 'paused']).optional()
|
|
11
|
-
.describe('Set to "paused" to disable or "active" to re-enable.'),
|
|
12
|
-
description: z.string().max(200).optional()
|
|
13
|
-
.describe('Updated description.'),
|
|
14
|
-
taxonomyFilter: z.array(z.string()).nullable().optional()
|
|
15
|
-
.describe('Scope to taxonomies. Pass null to clear filter.'),
|
|
16
|
-
notificationTierDepth: z.number().int().min(1).max(3).nullable().optional()
|
|
17
|
-
.describe('AudioSet tier depth (1=coarse, 2=mid, 3=fine). Max depth is 3 — tiers 4-5 exist in the taxonomy but are not supported for webhook filtering. Pass null to clear. Must pair with notificationTierValues.'),
|
|
18
|
-
notificationTierValues: z.array(z.string()).nullable().optional()
|
|
19
|
-
.describe('Tier labels to match. Pass null to clear. Must pair with notificationTierDepth.'),
|
|
20
|
-
}, { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: true }, async (params) => {
|
|
3
|
+
server.tool('updateWebhook', toolDescriptions.updateWebhook, UPDATE_WEBHOOK_SHAPE, { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: true }, async (params) => {
|
|
21
4
|
try {
|
|
22
5
|
const { webhookId, ...updates } = params;
|
|
23
6
|
const result = await client.updateEnterpriseWebhook(webhookId, updates);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-webhook.js","sourceRoot":"","sources":["../../src/tools/update-webhook.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"update-webhook.js","sourceRoot":"","sources":["../../src/tools/update-webhook.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE7E,MAAM,UAAU,qBAAqB,CAAC,MAAiB,EAAE,MAAqB;IAC1E,MAAM,CAAC,IAAI,CACP,eAAe,EACf,gBAAgB,CAAC,aAAa,EAC9B,oBAAoB,EACpB,EAAE,YAAY,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,EAC1F,KAAK,EAAE,MAAM,EAAE,EAAE;QACb,IAAI,CAAC;YACD,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO,EAAE,GAAG,MAAM,CAAC;YACzC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,uBAAuB,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;YACxE,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;QAC3F,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,OAAO;gBACH,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,0BAA0B,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC;gBAC9H,OAAO,EAAE,IAAI;aAChB,CAAC;QACN,CAAC;IACL,CAAC,CACJ,CAAC;AACN,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../../src/tools/usage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../../src/tools/usage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjD,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,aAAa,GAAG,IAAI,CAkB5E"}
|
package/dist/tools/usage.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { USAGE_SHAPE, toolDescriptions } from '../schemas/index.js';
|
|
1
2
|
export function registerUsage(server, client) {
|
|
2
|
-
server.tool('usage',
|
|
3
|
+
server.tool('usage', toolDescriptions.usage, USAGE_SHAPE, { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true }, async () => {
|
|
3
4
|
try {
|
|
4
5
|
const result = await client.usage();
|
|
5
6
|
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
package/dist/tools/usage.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usage.js","sourceRoot":"","sources":["../../src/tools/usage.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"usage.js","sourceRoot":"","sources":["../../src/tools/usage.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEpE,MAAM,UAAU,aAAa,CAAC,MAAiB,EAAE,MAAqB;IAClE,MAAM,CAAC,IAAI,CACP,OAAO,EACP,gBAAgB,CAAC,KAAK,EACtB,WAAW,EACX,EAAE,YAAY,EAAE,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,EACzF,KAAK,IAAI,EAAE;QACP,IAAI,CAAC;YACD,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;YACpC,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;QAC3F,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,OAAO;gBACH,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,uBAAuB,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC;gBAC3H,OAAO,EAAE,IAAI;aAChB,CAAC;QACN,CAAC;IACL,CAAC,CACJ,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* In-memory tracker for in-flight byte-slice uploads on the MCP stdio server.
|
|
3
|
+
*
|
|
4
|
+
* Why this exists: `classifyAudio` returns immediately after slice 0 to stay
|
|
5
|
+
* within the MCP client's tool-call wall budget. The tail upload (slices 1..N)
|
|
6
|
+
* runs in the background of the same Node process. AI agents poll
|
|
7
|
+
* `getUploadStatus(uploadSessionId)` to learn when the tail has produced a
|
|
8
|
+
* `requestId` they can pass to `getJob`.
|
|
9
|
+
*
|
|
10
|
+
* Lifetime: lives in the singleton MCP server process between tool calls.
|
|
11
|
+
* Lost on process restart — same blast radius as today's in-flight promise.
|
|
12
|
+
*/
|
|
13
|
+
export type UploadState = {
|
|
14
|
+
uploadSessionId: string;
|
|
15
|
+
fileName: string;
|
|
16
|
+
totalSlices: number;
|
|
17
|
+
slicesUploaded: number;
|
|
18
|
+
totalBytes: number;
|
|
19
|
+
startedAt: string;
|
|
20
|
+
lastUpdatedAt: string;
|
|
21
|
+
status: 'uploading' | 'complete' | 'failed';
|
|
22
|
+
requestId?: string;
|
|
23
|
+
error?: string;
|
|
24
|
+
};
|
|
25
|
+
export declare function trackerStart(state: Omit<UploadState, 'lastUpdatedAt'>): void;
|
|
26
|
+
export declare function trackerUpdate(uploadSessionId: string, patch: Partial<UploadState>): void;
|
|
27
|
+
export declare function trackerGet(uploadSessionId: string): UploadState | undefined;
|
|
28
|
+
export declare function trackerSize(): number;
|
|
29
|
+
/** Test-only: clear the tracker between cases. */
|
|
30
|
+
export declare function trackerReset(): void;
|
|
31
|
+
//# sourceMappingURL=upload-tracker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload-tracker.d.ts","sourceRoot":"","sources":["../src/upload-tracker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,MAAM,WAAW,GAAG;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,WAAW,GAAG,UAAU,GAAG,QAAQ,CAAC;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAIF,wBAAgB,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,eAAe,CAAC,GAAG,IAAI,CAE5E;AAED,wBAAgB,aAAa,CAAC,eAAe,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,WAAW,CAAC,GAAG,IAAI,CAIxF;AAED,wBAAgB,UAAU,CAAC,eAAe,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAE3E;AAED,wBAAgB,WAAW,IAAI,MAAM,CAEpC;AAED,kDAAkD;AAClD,wBAAgB,YAAY,IAAI,IAAI,CAEnC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* In-memory tracker for in-flight byte-slice uploads on the MCP stdio server.
|
|
3
|
+
*
|
|
4
|
+
* Why this exists: `classifyAudio` returns immediately after slice 0 to stay
|
|
5
|
+
* within the MCP client's tool-call wall budget. The tail upload (slices 1..N)
|
|
6
|
+
* runs in the background of the same Node process. AI agents poll
|
|
7
|
+
* `getUploadStatus(uploadSessionId)` to learn when the tail has produced a
|
|
8
|
+
* `requestId` they can pass to `getJob`.
|
|
9
|
+
*
|
|
10
|
+
* Lifetime: lives in the singleton MCP server process between tool calls.
|
|
11
|
+
* Lost on process restart — same blast radius as today's in-flight promise.
|
|
12
|
+
*/
|
|
13
|
+
const tracker = new Map();
|
|
14
|
+
export function trackerStart(state) {
|
|
15
|
+
tracker.set(state.uploadSessionId, { ...state, lastUpdatedAt: state.startedAt });
|
|
16
|
+
}
|
|
17
|
+
export function trackerUpdate(uploadSessionId, patch) {
|
|
18
|
+
const existing = tracker.get(uploadSessionId);
|
|
19
|
+
if (!existing) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
tracker.set(uploadSessionId, { ...existing, ...patch, lastUpdatedAt: new Date().toISOString() });
|
|
23
|
+
}
|
|
24
|
+
export function trackerGet(uploadSessionId) {
|
|
25
|
+
return tracker.get(uploadSessionId);
|
|
26
|
+
}
|
|
27
|
+
export function trackerSize() {
|
|
28
|
+
return tracker.size;
|
|
29
|
+
}
|
|
30
|
+
/** Test-only: clear the tracker between cases. */
|
|
31
|
+
export function trackerReset() {
|
|
32
|
+
tracker.clear();
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=upload-tracker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload-tracker.js","sourceRoot":"","sources":["../src/upload-tracker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAeH,MAAM,OAAO,GAAG,IAAI,GAAG,EAAuB,CAAC;AAE/C,MAAM,UAAU,YAAY,CAAC,KAAyC;IAClE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,eAAe,EAAE,EAAE,GAAG,KAAK,EAAE,aAAa,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC;AACrF,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,eAAuB,EAAE,KAA2B;IAC9E,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IAC9C,IAAI,CAAC,QAAQ,EAAE,CAAC;QAAC,OAAO;IAAC,CAAC;IAC1B,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,EAAE,GAAG,QAAQ,EAAE,GAAG,KAAK,EAAE,aAAa,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;AACrG,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,eAAuB;IAC9C,OAAO,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;AACxC,CAAC;AAED,MAAM,UAAU,WAAW;IACvB,OAAO,OAAO,CAAC,IAAI,CAAC;AACxB,CAAC;AAED,kDAAkD;AAClD,MAAM,UAAU,YAAY;IACxB,OAAO,CAAC,KAAK,EAAE,CAAC;AACpB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@h-ear/mcp-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.1.0-dev.202604170830",
|
|
4
4
|
"mcpName": "io.github.badajoz95/h-ear",
|
|
5
5
|
"description": "MCP server for the H-ear World audio classification API — connect Claude, ChatGPT, and other AI agents to 521+ sound classes",
|
|
6
6
|
"type": "module",
|
|
@@ -17,6 +17,10 @@
|
|
|
17
17
|
"./server": {
|
|
18
18
|
"import": "./dist/server.js",
|
|
19
19
|
"types": "./dist/server.d.ts"
|
|
20
|
+
},
|
|
21
|
+
"./schemas": {
|
|
22
|
+
"import": "./dist/schemas/index.js",
|
|
23
|
+
"types": "./dist/schemas/index.d.ts"
|
|
20
24
|
}
|
|
21
25
|
},
|
|
22
26
|
"publishConfig": {
|
|
@@ -38,7 +42,8 @@
|
|
|
38
42
|
},
|
|
39
43
|
"dependencies": {
|
|
40
44
|
"@h-ear/core": "^1.0.0",
|
|
41
|
-
"@modelcontextprotocol/sdk": "^1.26.0"
|
|
45
|
+
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
46
|
+
"zod-to-json-schema": "^3.25.2"
|
|
42
47
|
},
|
|
43
48
|
"devDependencies": {
|
|
44
49
|
"@eslint/js": "^10.0.1",
|