@h-ear/openclaw 0.1.0-dev.202603280905
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 +72 -0
- package/SKILL.md +34 -0
- package/dist/commands/alerts.d.ts +4 -0
- package/dist/commands/alerts.d.ts.map +1 -0
- package/dist/commands/alerts.js +14 -0
- package/dist/commands/alerts.js.map +1 -0
- package/dist/commands/classify-batch.d.ts +5 -0
- package/dist/commands/classify-batch.d.ts.map +1 -0
- package/dist/commands/classify-batch.js +16 -0
- package/dist/commands/classify-batch.js.map +1 -0
- package/dist/commands/classify.d.ts +5 -0
- package/dist/commands/classify.d.ts.map +1 -0
- package/dist/commands/classify.js +6 -0
- package/dist/commands/classify.js.map +1 -0
- package/dist/commands/health.d.ts +3 -0
- package/dist/commands/health.d.ts.map +1 -0
- package/dist/commands/health.js +6 -0
- package/dist/commands/health.js.map +1 -0
- package/dist/commands/jobs.d.ts +8 -0
- package/dist/commands/jobs.d.ts.map +1 -0
- package/dist/commands/jobs.js +14 -0
- package/dist/commands/jobs.js.map +1 -0
- package/dist/commands/sounds.d.ts +6 -0
- package/dist/commands/sounds.d.ts.map +1 -0
- package/dist/commands/sounds.js +10 -0
- package/dist/commands/sounds.js.map +1 -0
- package/dist/commands/usage.d.ts +3 -0
- package/dist/commands/usage.d.ts.map +1 -0
- package/dist/commands/usage.js +6 -0
- package/dist/commands/usage.js.map +1 -0
- package/dist/config.d.ts +7 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +15 -0
- package/dist/config.js.map +1 -0
- package/dist/formatter.d.ts +14 -0
- package/dist/formatter.d.ts.map +1 -0
- package/dist/formatter.js +141 -0
- package/dist/formatter.js.map +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +26 -0
- package/dist/index.js.map +1 -0
- package/package.json +55 -0
package/README.md
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# @h-ear/openclaw
|
|
2
|
+
|
|
3
|
+
OpenClaw skill for [H-ear World](https://h-ear.world) audio classification. Sound intelligence in WhatsApp, Telegram, Slack, Discord, and Teams.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @h-ear/openclaw
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Or via ClawHub — search for `h-ear` or paste `https://github.com/Badajoz95/h-ear-openclaw`.
|
|
12
|
+
|
|
13
|
+
## Setup
|
|
14
|
+
|
|
15
|
+
Set `HEAR_API_KEY` to your H-ear Enterprise API key:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
export HEAR_API_KEY=ncm_sk_your_key
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Commands
|
|
22
|
+
|
|
23
|
+
| Command | Description |
|
|
24
|
+
|---------|-------------|
|
|
25
|
+
| `classify <url>` | Classify audio from a URL |
|
|
26
|
+
| `classify batch <url1> <url2>...` | Batch classify multiple audio URLs |
|
|
27
|
+
| `sounds [search]` | List supported sound classes (521+) |
|
|
28
|
+
| `usage` | Show API usage statistics |
|
|
29
|
+
| `jobs [last N]` | List recent classification jobs |
|
|
30
|
+
| `job <id>` | Show detailed job results |
|
|
31
|
+
| `alerts on <sound>` | Enable alerts for a sound class |
|
|
32
|
+
| `alerts off <sound>` | Disable alerts for a sound class |
|
|
33
|
+
| `health` | Check API status |
|
|
34
|
+
|
|
35
|
+
## Example
|
|
36
|
+
|
|
37
|
+
In any connected messaging channel:
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
> classify https://example.com/city-noise.mp3
|
|
41
|
+
|
|
42
|
+
**Audio Classification Complete**
|
|
43
|
+
Duration: 45.2s | 15 noise events detected
|
|
44
|
+
|
|
45
|
+
| Sound | Confidence | Category |
|
|
46
|
+
|------------|-----------|----------|
|
|
47
|
+
| Car horn | 94% | Vehicle |
|
|
48
|
+
| Speech | 87% | Human |
|
|
49
|
+
| Dog bark | 72% | Animal |
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Programmatic Use
|
|
53
|
+
|
|
54
|
+
```typescript
|
|
55
|
+
import { createSkill, classifyCommand } from '@h-ear/openclaw';
|
|
56
|
+
|
|
57
|
+
const { client } = createSkill();
|
|
58
|
+
const result = await classifyCommand(client, 'https://example.com/audio.mp3');
|
|
59
|
+
console.log(result);
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Supported Formats
|
|
63
|
+
|
|
64
|
+
MP3, WAV, FLAC, OGG, M4A
|
|
65
|
+
|
|
66
|
+
## Get an API Key
|
|
67
|
+
|
|
68
|
+
Visit [h-ear.world](https://h-ear.world) to create an account and generate an API key.
|
|
69
|
+
|
|
70
|
+
## License
|
|
71
|
+
|
|
72
|
+
MIT
|
package/SKILL.md
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: h-ear
|
|
3
|
+
description: Audio classification and noise monitoring. Classify audio files, list 521+ sound classes, check usage, browse jobs, and set up sound alerts.
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
author: H-ear World
|
|
6
|
+
homepage: https://h-ear.world
|
|
7
|
+
openclaw:
|
|
8
|
+
requires:
|
|
9
|
+
env: [HEAR_API_KEY]
|
|
10
|
+
bins: []
|
|
11
|
+
primaryEnv: HEAR_API_KEY
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# H-ear — Sound Intelligence for AI Agents
|
|
15
|
+
|
|
16
|
+
Classify audio, detect noise events, and set up real-time sound alerts through any messaging channel.
|
|
17
|
+
|
|
18
|
+
## Commands
|
|
19
|
+
|
|
20
|
+
| Command | Description |
|
|
21
|
+
|---------|-------------|
|
|
22
|
+
| `classify <url>` | Classify audio from a URL |
|
|
23
|
+
| `classify batch <url1> <url2>...` | Batch classify multiple audio URLs |
|
|
24
|
+
| `sounds [search]` | List supported sound classes (521+) |
|
|
25
|
+
| `usage` | Show API usage statistics |
|
|
26
|
+
| `jobs [last N]` | List recent classification jobs |
|
|
27
|
+
| `job <id>` | Show detailed job results |
|
|
28
|
+
| `alerts on <sound>` | Enable alerts for a sound class |
|
|
29
|
+
| `alerts off <sound>` | Disable alerts for a sound class |
|
|
30
|
+
| `health` | Check API status |
|
|
31
|
+
|
|
32
|
+
## Setup
|
|
33
|
+
|
|
34
|
+
Set `HEAR_API_KEY` to your H-ear Enterprise API key. Get one at [h-ear.world](https://h-ear.world).
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { HearApiClient } from '@h-ear/core';
|
|
2
|
+
export declare function alertOnCommand(client: HearApiClient, soundClass: string, callbackUrl: string): Promise<string>;
|
|
3
|
+
export declare function alertOffCommand(client: HearApiClient, webhookId: string, soundClass: string): Promise<string>;
|
|
4
|
+
//# sourceMappingURL=alerts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alerts.d.ts","sourceRoot":"","sources":["../../src/commands/alerts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjD,wBAAsB,cAAc,CAChC,MAAM,EAAE,aAAa,EACrB,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,GACpB,OAAO,CAAC,MAAM,CAAC,CAOjB;AAED,wBAAsB,eAAe,CACjC,MAAM,EAAE,aAAa,EACrB,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,GACnB,OAAO,CAAC,MAAM,CAAC,CAGjB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { formatAlertRegistered, formatAlertDeregistered } from '../formatter.js';
|
|
2
|
+
export async function alertOnCommand(client, soundClass, callbackUrl) {
|
|
3
|
+
await client.registerWebhook({
|
|
4
|
+
url: callbackUrl,
|
|
5
|
+
events: ['job.completed'],
|
|
6
|
+
soundClass,
|
|
7
|
+
});
|
|
8
|
+
return formatAlertRegistered(soundClass);
|
|
9
|
+
}
|
|
10
|
+
export async function alertOffCommand(client, webhookId, soundClass) {
|
|
11
|
+
await client.deregisterWebhook(webhookId);
|
|
12
|
+
return formatAlertDeregistered(soundClass);
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=alerts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alerts.js","sourceRoot":"","sources":["../../src/commands/alerts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAEjF,MAAM,CAAC,KAAK,UAAU,cAAc,CAChC,MAAqB,EACrB,UAAkB,EAClB,WAAmB;IAEnB,MAAM,MAAM,CAAC,eAAe,CAAC;QACzB,GAAG,EAAE,WAAW;QAChB,MAAM,EAAE,CAAC,eAAe,CAAC;QACzB,UAAU;KACb,CAAC,CAAC;IACH,OAAO,qBAAqB,CAAC,UAAU,CAAC,CAAC;AAC7C,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,eAAe,CACjC,MAAqB,EACrB,SAAiB,EACjB,UAAkB;IAElB,MAAM,MAAM,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC;IAC1C,OAAO,uBAAuB,CAAC,UAAU,CAAC,CAAC;AAC/C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"classify-batch.d.ts","sourceRoot":"","sources":["../../src/commands/classify-batch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,wBAAsB,oBAAoB,CACtC,MAAM,EAAE,aAAa,EACrB,IAAI,EAAE,MAAM,EAAE,EACd,WAAW,EAAE,MAAM,EACnB,OAAO,CAAC,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GACjC,OAAO,CAAC,MAAM,CAAC,CAejB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export async function classifyBatchCommand(client, urls, callbackUrl, options) {
|
|
2
|
+
const files = urls.map((url, i) => ({ url, id: `file-${i + 1}` }));
|
|
3
|
+
const result = await client.classifyBatch({
|
|
4
|
+
files,
|
|
5
|
+
callbackUrl,
|
|
6
|
+
threshold: options?.threshold ?? 0.3,
|
|
7
|
+
});
|
|
8
|
+
return [
|
|
9
|
+
`**Batch Submitted**`,
|
|
10
|
+
`Batch ID: ${result.batchId}`,
|
|
11
|
+
`Files: ${result.fileCount}`,
|
|
12
|
+
`Estimated: ~${result.estimatedCompletionMinutes} min`,
|
|
13
|
+
`Status: ${result.status}`,
|
|
14
|
+
].join('\n');
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=classify-batch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"classify-batch.js","sourceRoot":"","sources":["../../src/commands/classify-batch.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACtC,MAAqB,EACrB,IAAc,EACd,WAAmB,EACnB,OAAgC;IAEhC,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,QAAQ,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IACnE,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC;QACtC,KAAK;QACL,WAAW;QACX,SAAS,EAAE,OAAO,EAAE,SAAS,IAAI,GAAG;KACvC,CAAC,CAAC;IAEH,OAAO;QACH,qBAAqB;QACrB,aAAa,MAAM,CAAC,OAAO,EAAE;QAC7B,UAAU,MAAM,CAAC,SAAS,EAAE;QAC5B,eAAe,MAAM,CAAC,0BAA0B,MAAM;QACtD,WAAW,MAAM,CAAC,MAAM,EAAE;KAC7B,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"classify.d.ts","sourceRoot":"","sources":["../../src/commands/classify.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjD,wBAAsB,eAAe,CACjC,MAAM,EAAE,aAAa,EACrB,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GACjC,OAAO,CAAC,MAAM,CAAC,CAGjB"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { formatClassifyResult } from '../formatter.js';
|
|
2
|
+
export async function classifyCommand(client, url, options) {
|
|
3
|
+
const result = await client.classify({ url, threshold: options?.threshold ?? 0.3 });
|
|
4
|
+
return formatClassifyResult(result);
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=classify.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"classify.js","sourceRoot":"","sources":["../../src/commands/classify.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAEvD,MAAM,CAAC,KAAK,UAAU,eAAe,CACjC,MAAqB,EACrB,GAAW,EACX,OAAgC;IAEhC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,IAAI,GAAG,EAAE,CAAC,CAAC;IACpF,OAAO,oBAAoB,CAAC,MAAM,CAAC,CAAC;AACxC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"health.d.ts","sourceRoot":"","sources":["../../src/commands/health.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjD,wBAAsB,aAAa,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAG1E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"health.js","sourceRoot":"","sources":["../../src/commands/health.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,MAAqB;IACrD,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,MAAM,EAAE,CAAC;IACrC,OAAO,YAAY,CAAC,MAAM,CAAC,CAAC;AAChC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { HearApiClient } from '@h-ear/core';
|
|
2
|
+
export declare function jobsCommand(client: HearApiClient, options?: {
|
|
3
|
+
limit?: number;
|
|
4
|
+
offset?: number;
|
|
5
|
+
status?: string;
|
|
6
|
+
}): Promise<string>;
|
|
7
|
+
export declare function jobDetailCommand(client: HearApiClient, jobId: string): Promise<string>;
|
|
8
|
+
//# sourceMappingURL=jobs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jobs.d.ts","sourceRoot":"","sources":["../../src/commands/jobs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjD,wBAAsB,WAAW,CAC7B,MAAM,EAAE,aAAa,EACrB,OAAO,CAAC,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GAC/D,OAAO,CAAC,MAAM,CAAC,CAOjB;AAED,wBAAsB,gBAAgB,CAClC,MAAM,EAAE,aAAa,EACrB,KAAK,EAAE,MAAM,GACd,OAAO,CAAC,MAAM,CAAC,CAGjB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { formatJobsList, formatJobDetail } from '../formatter.js';
|
|
2
|
+
export async function jobsCommand(client, options) {
|
|
3
|
+
const result = await client.listJobs({
|
|
4
|
+
limit: options?.limit ?? 10,
|
|
5
|
+
offset: options?.offset ?? 0,
|
|
6
|
+
status: options?.status,
|
|
7
|
+
});
|
|
8
|
+
return formatJobsList(result);
|
|
9
|
+
}
|
|
10
|
+
export async function jobDetailCommand(client, jobId) {
|
|
11
|
+
const result = await client.getJob(jobId);
|
|
12
|
+
return formatJobDetail(result);
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=jobs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jobs.js","sourceRoot":"","sources":["../../src/commands/jobs.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElE,MAAM,CAAC,KAAK,UAAU,WAAW,CAC7B,MAAqB,EACrB,OAA8D;IAE9D,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC;QACjC,KAAK,EAAE,OAAO,EAAE,KAAK,IAAI,EAAE;QAC3B,MAAM,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;QAC5B,MAAM,EAAE,OAAO,EAAE,MAAM;KAC1B,CAAC,CAAC;IACH,OAAO,cAAc,CAAC,MAAM,CAAC,CAAC;AAClC,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAClC,MAAqB,EACrB,KAAa;IAEb,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC1C,OAAO,eAAe,CAAC,MAAM,CAAC,CAAC;AACnC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sounds.d.ts","sourceRoot":"","sources":["../../src/commands/sounds.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjD,wBAAsB,aAAa,CAC/B,MAAM,EAAE,aAAa,EACrB,MAAM,CAAC,EAAE,MAAM,EACf,OAAO,CAAC,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GAC9C,OAAO,CAAC,MAAM,CAAC,CAOjB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { formatClassesList } from '../formatter.js';
|
|
2
|
+
export async function soundsCommand(client, search, options) {
|
|
3
|
+
const result = await client.listClasses({
|
|
4
|
+
category: search,
|
|
5
|
+
limit: options?.limit ?? 20,
|
|
6
|
+
offset: options?.offset ?? 0,
|
|
7
|
+
});
|
|
8
|
+
return formatClassesList(result, search);
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=sounds.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sounds.js","sourceRoot":"","sources":["../../src/commands/sounds.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpD,MAAM,CAAC,KAAK,UAAU,aAAa,CAC/B,MAAqB,EACrB,MAAe,EACf,OAA6C;IAE7C,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC;QACpC,QAAQ,EAAE,MAAM;QAChB,KAAK,EAAE,OAAO,EAAE,KAAK,IAAI,EAAE;QAC3B,MAAM,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;KAC/B,CAAC,CAAC;IACH,OAAO,iBAAiB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC7C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../../src/commands/usage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjD,wBAAsB,YAAY,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAGzE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage.js","sourceRoot":"","sources":["../../src/commands/usage.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,MAAqB;IACpD,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;IACpC,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC;AAC/B,CAAC"}
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Config resolution for H-ear OpenClaw skill.
|
|
3
|
+
* Reads from environment variables (OpenClaw passes these from SKILL.md requires).
|
|
4
|
+
*/
|
|
5
|
+
import { type ServerConfig } from '@h-ear/core';
|
|
6
|
+
export declare function resolveConfig(): ServerConfig;
|
|
7
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAgB,KAAK,YAAY,EAAwB,MAAM,aAAa,CAAC;AAEpF,wBAAgB,aAAa,IAAI,YAAY,CAU5C"}
|
package/dist/config.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Config resolution for H-ear OpenClaw skill.
|
|
3
|
+
* Reads from environment variables (OpenClaw passes these from SKILL.md requires).
|
|
4
|
+
*/
|
|
5
|
+
import { ENVIRONMENTS } from '@h-ear/core';
|
|
6
|
+
export function resolveConfig() {
|
|
7
|
+
const apiKey = process.env.HEAR_API_KEY || '';
|
|
8
|
+
const envStr = process.env.HEAR_ENV || 'prod';
|
|
9
|
+
const environment = (Object.keys(ENVIRONMENTS).includes(envStr) ? envStr : 'prod');
|
|
10
|
+
const envConfig = ENVIRONMENTS[environment];
|
|
11
|
+
const baseUrl = process.env.HEAR_BASE_URL || envConfig.baseUrl;
|
|
12
|
+
const apiPath = envConfig.apiPath;
|
|
13
|
+
return { apiKey, environment, baseUrl, apiPath };
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAA2C,MAAM,aAAa,CAAC;AAEpF,MAAM,UAAU,aAAa;IACzB,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,EAAE,CAAC;IAC9C,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,MAAM,CAAC;IAE9C,MAAM,WAAW,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAoB,CAAC;IACtG,MAAM,SAAS,GAAG,YAAY,CAAC,WAAW,CAAC,CAAC;IAC5C,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,SAAS,CAAC,OAAO,CAAC;IAC/D,MAAM,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC;IAElC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;AACrD,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Format H-ear API responses as chat-friendly markdown.
|
|
3
|
+
* Designed for messaging channels: Telegram, Slack, Discord, WhatsApp, Teams.
|
|
4
|
+
*/
|
|
5
|
+
import type { ClassifyResult, ClassesResult, HealthResult, UsageResult, JobsResult, JobResult } from '@h-ear/core';
|
|
6
|
+
export declare function formatClassifyResult(result: ClassifyResult): string;
|
|
7
|
+
export declare function formatClassesList(result: ClassesResult, search?: string): string;
|
|
8
|
+
export declare function formatHealth(result: HealthResult): string;
|
|
9
|
+
export declare function formatUsage(result: UsageResult): string;
|
|
10
|
+
export declare function formatJobsList(result: JobsResult): string;
|
|
11
|
+
export declare function formatJobDetail(result: JobResult): string;
|
|
12
|
+
export declare function formatAlertRegistered(soundClass: string): string;
|
|
13
|
+
export declare function formatAlertDeregistered(soundClass: string): string;
|
|
14
|
+
//# sourceMappingURL=formatter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatter.d.ts","sourceRoot":"","sources":["../src/formatter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACR,cAAc,EAAE,aAAa,EAAE,YAAY,EAC3C,WAAW,EAAE,UAAU,EAAE,SAAS,EACrC,MAAM,aAAa,CAAC;AAErB,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,CA8BnE;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,aAAa,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAwBhF;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAOzD;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,CAgBvD;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,CA2BzD;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAiCzD;AAED,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAEhE;AAED,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAElE"}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Format H-ear API responses as chat-friendly markdown.
|
|
3
|
+
* Designed for messaging channels: Telegram, Slack, Discord, WhatsApp, Teams.
|
|
4
|
+
*/
|
|
5
|
+
export function formatClassifyResult(result) {
|
|
6
|
+
const lines = [
|
|
7
|
+
`**Audio Classification Complete**`,
|
|
8
|
+
`Duration: ${result.duration?.toFixed(1) ?? '?'}s | ${result.eventCount} noise events detected`,
|
|
9
|
+
'',
|
|
10
|
+
];
|
|
11
|
+
if (result.classifications && result.classifications.length > 0) {
|
|
12
|
+
lines.push('| Sound | Confidence | Category |');
|
|
13
|
+
lines.push('|-------|-----------|----------|');
|
|
14
|
+
const top = result.classifications
|
|
15
|
+
.sort((a, b) => (b.confidence || 0) - (a.confidence || 0))
|
|
16
|
+
.slice(0, 10);
|
|
17
|
+
for (const cls of top) {
|
|
18
|
+
const name = cls.className || cls.class || 'Unknown';
|
|
19
|
+
const pct = `${Math.round((cls.confidence || 0) * 100)}%`;
|
|
20
|
+
const cat = cls.category || cls.tier1 || '-';
|
|
21
|
+
lines.push(`| ${name} | ${pct} | ${cat} |`);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
lines.push('No sound events detected above threshold.');
|
|
26
|
+
}
|
|
27
|
+
if (result.reportUrl) {
|
|
28
|
+
lines.push('', `Full report: ${result.reportUrl}`);
|
|
29
|
+
}
|
|
30
|
+
return lines.join('\n');
|
|
31
|
+
}
|
|
32
|
+
export function formatClassesList(result, search) {
|
|
33
|
+
const lines = [
|
|
34
|
+
`**Sound Classes** (${result.taxonomy})`,
|
|
35
|
+
`${result.totalFiltered} of ${result.totalAvailable} classes`,
|
|
36
|
+
'',
|
|
37
|
+
];
|
|
38
|
+
if (result.classes.length > 0) {
|
|
39
|
+
lines.push('| # | Class | Category |');
|
|
40
|
+
lines.push('|---|-------|----------|');
|
|
41
|
+
for (const cls of result.classes.slice(0, 20)) {
|
|
42
|
+
lines.push(`| ${cls.index} | ${cls.name} | ${cls.category} |`);
|
|
43
|
+
}
|
|
44
|
+
if (result.pagination?.hasMore) {
|
|
45
|
+
lines.push('', `_Showing ${result.classes.length} of ${result.totalFiltered} — use pagination for more._`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
const hint = search ? ` matching "${search}"` : '';
|
|
50
|
+
lines.push(`No classes found${hint}.`);
|
|
51
|
+
}
|
|
52
|
+
return lines.join('\n');
|
|
53
|
+
}
|
|
54
|
+
export function formatHealth(result) {
|
|
55
|
+
return [
|
|
56
|
+
`**H-ear API Status**`,
|
|
57
|
+
`Status: ${result.status}`,
|
|
58
|
+
`Version: ${result.version}`,
|
|
59
|
+
`Deployed: ${result.deployedTimestamp}`,
|
|
60
|
+
].join('\n');
|
|
61
|
+
}
|
|
62
|
+
export function formatUsage(result) {
|
|
63
|
+
const minutesPct = result.minutesTotal > 0
|
|
64
|
+
? Math.round((result.minutesUsed / result.minutesTotal) * 100)
|
|
65
|
+
: 0;
|
|
66
|
+
const callsPct = result.callsLimit > 0
|
|
67
|
+
? Math.round((result.callsToday / result.callsLimit) * 100)
|
|
68
|
+
: 0;
|
|
69
|
+
return [
|
|
70
|
+
`**H-ear API Usage**`,
|
|
71
|
+
`Plan: ${result.plan}`,
|
|
72
|
+
`Minutes: ${result.minutesUsed.toLocaleString()} / ${result.minutesTotal.toLocaleString()} (${minutesPct}%)`,
|
|
73
|
+
`Today: ${result.callsToday.toLocaleString()} / ${result.callsLimit.toLocaleString()} calls (${callsPct}%)`,
|
|
74
|
+
`Active keys: ${result.activeKeys}`,
|
|
75
|
+
`Period: ${result.periodStart} to ${result.periodEnd}`,
|
|
76
|
+
].join('\n');
|
|
77
|
+
}
|
|
78
|
+
export function formatJobsList(result) {
|
|
79
|
+
const lines = [
|
|
80
|
+
`**Recent Jobs** (${result.total} total)`,
|
|
81
|
+
'',
|
|
82
|
+
];
|
|
83
|
+
if (result.jobs.length > 0) {
|
|
84
|
+
lines.push('| Job ID | Status | File | Events | Created |');
|
|
85
|
+
lines.push('|--------|--------|------|--------|---------|');
|
|
86
|
+
for (const job of result.jobs) {
|
|
87
|
+
const id = job.jobId.substring(0, 8);
|
|
88
|
+
const status = job.status === 'completed' ? 'done' : job.status;
|
|
89
|
+
const file = job.fileName || '-';
|
|
90
|
+
const events = job.eventCount ?? '-';
|
|
91
|
+
const created = job.createdAt.substring(0, 16).replace('T', ' ');
|
|
92
|
+
lines.push(`| ${id}... | ${status} | ${file} | ${events} | ${created} |`);
|
|
93
|
+
}
|
|
94
|
+
if (result.pagination.hasMore) {
|
|
95
|
+
lines.push('', `_Showing ${result.jobs.length} of ${result.total} — use "jobs last N" for more._`);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
lines.push('No jobs found.');
|
|
100
|
+
}
|
|
101
|
+
return lines.join('\n');
|
|
102
|
+
}
|
|
103
|
+
export function formatJobDetail(result) {
|
|
104
|
+
const lines = [
|
|
105
|
+
`**Job ${result.jobId.substring(0, 8)}...**`,
|
|
106
|
+
`Status: ${result.status}`,
|
|
107
|
+
];
|
|
108
|
+
if (result.fileName)
|
|
109
|
+
lines.push(`File: ${result.fileName}`);
|
|
110
|
+
if (result.duration)
|
|
111
|
+
lines.push(`Duration: ${result.duration.toFixed(1)}s`);
|
|
112
|
+
if (result.eventCount !== undefined)
|
|
113
|
+
lines.push(`Events: ${result.eventCount}`);
|
|
114
|
+
lines.push(`Created: ${result.createdAt}`);
|
|
115
|
+
if (result.completedAt)
|
|
116
|
+
lines.push(`Completed: ${result.completedAt}`);
|
|
117
|
+
if (result.classifications && result.classifications.length > 0) {
|
|
118
|
+
lines.push('', '| Sound | Confidence | Category |');
|
|
119
|
+
lines.push('|-------|-----------|----------|');
|
|
120
|
+
const top = result.classifications
|
|
121
|
+
.sort((a, b) => (b.confidence || 0) - (a.confidence || 0))
|
|
122
|
+
.slice(0, 10);
|
|
123
|
+
for (const cls of top) {
|
|
124
|
+
const name = cls.className || cls.class || 'Unknown';
|
|
125
|
+
const pct = `${Math.round((cls.confidence || 0) * 100)}%`;
|
|
126
|
+
const cat = cls.category || cls.tier1 || '-';
|
|
127
|
+
lines.push(`| ${name} | ${pct} | ${cat} |`);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
if (result.reportUrl) {
|
|
131
|
+
lines.push('', `Full report: ${result.reportUrl}`);
|
|
132
|
+
}
|
|
133
|
+
return lines.join('\n');
|
|
134
|
+
}
|
|
135
|
+
export function formatAlertRegistered(soundClass) {
|
|
136
|
+
return `Alert registered. You'll be notified whenever **${soundClass}** is detected.`;
|
|
137
|
+
}
|
|
138
|
+
export function formatAlertDeregistered(soundClass) {
|
|
139
|
+
return `Alert for **${soundClass}** has been removed.`;
|
|
140
|
+
}
|
|
141
|
+
//# sourceMappingURL=formatter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatter.js","sourceRoot":"","sources":["../src/formatter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,MAAM,UAAU,oBAAoB,CAAC,MAAsB;IACvD,MAAM,KAAK,GAAa;QACpB,mCAAmC;QACnC,aAAa,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC,IAAI,GAAG,OAAO,MAAM,CAAC,UAAU,wBAAwB;QAC/F,EAAE;KACL,CAAC;IAEF,IAAI,MAAM,CAAC,eAAe,IAAI,MAAM,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC9D,KAAK,CAAC,IAAI,CAAC,mCAAmC,CAAC,CAAC;QAChD,KAAK,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC;QAE/C,MAAM,GAAG,GAAG,MAAM,CAAC,eAAe;aAC7B,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,UAAU,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,UAAU,IAAI,CAAC,CAAC,CAAC;aACzD,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAElB,KAAK,MAAM,GAAG,IAAI,GAAG,EAAE,CAAC;YACpB,MAAM,IAAI,GAAG,GAAG,CAAC,SAAS,IAAI,GAAG,CAAC,KAAK,IAAI,SAAS,CAAC;YACrD,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,UAAU,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC;YAC1D,MAAM,GAAG,GAAG,GAAG,CAAC,QAAQ,IAAI,GAAG,CAAC,KAAK,IAAI,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AC,CAAC,UAAU,IAAI,CAAC,CAAC,CAAC;aACzD,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAElB,KAAK,MAAM,GAAG,IAAI,GAAG,EAAE,CAAC;YACpB,MAAM,IAAI,GAAG,GAAG,CAAC,SAAS,IAAI,GAAG,CAAC,KAAK,IAAI,SAAS,CAAC;YACrD,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,UAAU,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC;YAC1D,MAAM,GAAG,GAAG,GAAG,CAAC,QAAQ,IAAI,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC;YAC7C,KAAK,CAAC,IAAI,CAAC,KAAK,IAAI,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC,CAAC;QAChD,CAAC;IACL,CAAC;IAED,IAAI,MAAM,CAAC,SAAS,EAAE,CAAC;QACnB,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,gBAAgB,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC;IACvD,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC5B,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,UAAkB;IACpD,OAAO,mDAAmD,UAAU,iBAAiB,CAAC;AAC1F,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,UAAkB;IACtD,OAAO,eAAe,UAAU,sBAAsB,CAAC;AAC3D,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @h-ear/openclaw — OpenClaw skill for H-ear World audio classification.
|
|
3
|
+
*
|
|
4
|
+
* Exposes H-ear Enterprise API as conversational commands for messaging channels.
|
|
5
|
+
*/
|
|
6
|
+
import { HearApiClient, type ServerConfig } from '@h-ear/core';
|
|
7
|
+
export { classifyCommand } from './commands/classify.js';
|
|
8
|
+
export { classifyBatchCommand } from './commands/classify-batch.js';
|
|
9
|
+
export { soundsCommand } from './commands/sounds.js';
|
|
10
|
+
export { healthCommand } from './commands/health.js';
|
|
11
|
+
export { usageCommand } from './commands/usage.js';
|
|
12
|
+
export { jobsCommand, jobDetailCommand } from './commands/jobs.js';
|
|
13
|
+
export { alertOnCommand, alertOffCommand } from './commands/alerts.js';
|
|
14
|
+
export { formatClassifyResult, formatClassesList, formatHealth, formatUsage, formatJobsList, formatJobDetail, formatAlertRegistered, formatAlertDeregistered, } from './formatter.js';
|
|
15
|
+
export { resolveConfig } from './config.js';
|
|
16
|
+
/** Create a configured skill instance with API client. */
|
|
17
|
+
export declare function createSkill(config?: ServerConfig): {
|
|
18
|
+
client: HearApiClient;
|
|
19
|
+
config: ServerConfig;
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,aAAa,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAI/D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAGvE,OAAO,EACH,oBAAoB,EAAE,iBAAiB,EAAE,YAAY,EACrD,WAAW,EAAE,cAAc,EAAE,eAAe,EAC5C,qBAAqB,EAAE,uBAAuB,GACjD,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,0DAA0D;AAC1D,wBAAgB,WAAW,CAAC,MAAM,CAAC,EAAE,YAAY,GAAG;IAChD,MAAM,EAAE,aAAa,CAAC;IACtB,MAAM,EAAE,YAAY,CAAC;CACxB,CAIA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @h-ear/openclaw — OpenClaw skill for H-ear World audio classification.
|
|
3
|
+
*
|
|
4
|
+
* Exposes H-ear Enterprise API as conversational commands for messaging channels.
|
|
5
|
+
*/
|
|
6
|
+
import { HearApiClient } from '@h-ear/core';
|
|
7
|
+
import { resolveConfig } from './config.js';
|
|
8
|
+
// Commands
|
|
9
|
+
export { classifyCommand } from './commands/classify.js';
|
|
10
|
+
export { classifyBatchCommand } from './commands/classify-batch.js';
|
|
11
|
+
export { soundsCommand } from './commands/sounds.js';
|
|
12
|
+
export { healthCommand } from './commands/health.js';
|
|
13
|
+
export { usageCommand } from './commands/usage.js';
|
|
14
|
+
export { jobsCommand, jobDetailCommand } from './commands/jobs.js';
|
|
15
|
+
export { alertOnCommand, alertOffCommand } from './commands/alerts.js';
|
|
16
|
+
// Formatter
|
|
17
|
+
export { formatClassifyResult, formatClassesList, formatHealth, formatUsage, formatJobsList, formatJobDetail, formatAlertRegistered, formatAlertDeregistered, } from './formatter.js';
|
|
18
|
+
// Config
|
|
19
|
+
export { resolveConfig } from './config.js';
|
|
20
|
+
/** Create a configured skill instance with API client. */
|
|
21
|
+
export function createSkill(config) {
|
|
22
|
+
const resolved = config ?? resolveConfig();
|
|
23
|
+
const client = new HearApiClient(resolved);
|
|
24
|
+
return { client, config: resolved };
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,aAAa,EAAqB,MAAM,aAAa,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,WAAW;AACX,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvE,YAAY;AACZ,OAAO,EACH,oBAAoB,EAAE,iBAAiB,EAAE,YAAY,EACrD,WAAW,EAAE,cAAc,EAAE,eAAe,EAC5C,qBAAqB,EAAE,uBAAuB,GACjD,MAAM,gBAAgB,CAAC;AAExB,SAAS;AACT,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,0DAA0D;AAC1D,MAAM,UAAU,WAAW,CAAC,MAAqB;IAI7C,MAAM,QAAQ,GAAG,MAAM,IAAI,aAAa,EAAE,CAAC;IAC3C,MAAM,MAAM,GAAG,IAAI,aAAa,CAAC,QAAQ,CAAC,CAAC;IAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;AACxC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@h-ear/openclaw",
|
|
3
|
+
"version": "0.1.0-dev.202603280905",
|
|
4
|
+
"description": "OpenClaw skill for H-ear World audio classification — sound intelligence in WhatsApp, Telegram, Slack, Discord, and Teams",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./dist/index.js",
|
|
11
|
+
"types": "./dist/index.d.ts"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"publishConfig": {
|
|
15
|
+
"access": "public"
|
|
16
|
+
},
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "tsc",
|
|
19
|
+
"build:watch": "tsc --watch",
|
|
20
|
+
"clean": "rm -rf dist",
|
|
21
|
+
"prepublishOnly": "npm run build"
|
|
22
|
+
},
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@h-ear/core": "*"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@types/node": "^20.11.0",
|
|
28
|
+
"typescript": "^5.9.3"
|
|
29
|
+
},
|
|
30
|
+
"engines": {
|
|
31
|
+
"node": ">=18"
|
|
32
|
+
},
|
|
33
|
+
"files": [
|
|
34
|
+
"dist",
|
|
35
|
+
"SKILL.md",
|
|
36
|
+
"README.md"
|
|
37
|
+
],
|
|
38
|
+
"keywords": [
|
|
39
|
+
"openclaw",
|
|
40
|
+
"openclaw-skill",
|
|
41
|
+
"h-ear",
|
|
42
|
+
"audio",
|
|
43
|
+
"classification",
|
|
44
|
+
"noise",
|
|
45
|
+
"sound",
|
|
46
|
+
"ai-agent",
|
|
47
|
+
"chatbot"
|
|
48
|
+
],
|
|
49
|
+
"license": "MIT",
|
|
50
|
+
"repository": {
|
|
51
|
+
"type": "git",
|
|
52
|
+
"url": "https://github.com/noise-control-monitor/ncm-monorepo",
|
|
53
|
+
"directory": "packages/openclaw"
|
|
54
|
+
}
|
|
55
|
+
}
|