getpatter 0.4.1 → 0.4.2
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 +185 -587
- package/dist/chunk-35EVXMGB.mjs +4472 -0
- package/dist/chunk-AFUYSNDH.mjs +31 -0
- package/dist/chunk-JO5C35FM.mjs +65 -0
- package/dist/chunk-OOIUSZB4.mjs +37 -0
- package/dist/cli.js +1139 -0
- package/dist/index.d.mts +1063 -85
- package/dist/index.d.ts +1063 -85
- package/dist/index.js +8969 -3904
- package/dist/index.mjs +2382 -3354
- package/dist/lib-4WCAS54J.mjs +830 -0
- package/dist/node-cron-373UVDIO.mjs +935 -0
- package/dist/persistence-CYIGNHSU.mjs +7 -0
- package/dist/resources/audio/NOTICE +2 -0
- package/dist/resources/audio/city-ambience.ogg +0 -0
- package/dist/resources/audio/crowded-room.ogg +0 -0
- package/dist/resources/audio/forest-ambience.ogg +0 -0
- package/dist/resources/audio/hold_music.ogg +0 -0
- package/dist/resources/audio/keyboard-typing.ogg +0 -0
- package/dist/resources/audio/keyboard-typing2.ogg +0 -0
- package/dist/resources/audio/office-ambience.ogg +0 -0
- package/dist/resources/silero_vad.onnx +0 -0
- package/dist/{test-mode-JMXZSAJS.mjs → test-mode-RH65MMSP.mjs} +2 -1
- package/dist/{tunnel-HYSU7EF2.mjs → tunnel-BL7A7GXW.mjs} +2 -1
- package/package.json +25 -8
- package/src/resources/audio/NOTICE +2 -0
- package/src/resources/audio/city-ambience.ogg +0 -0
- package/src/resources/audio/crowded-room.ogg +0 -0
- package/src/resources/audio/forest-ambience.ogg +0 -0
- package/src/resources/audio/hold_music.ogg +0 -0
- package/src/resources/audio/keyboard-typing.ogg +0 -0
- package/src/resources/audio/keyboard-typing2.ogg +0 -0
- package/src/resources/audio/office-ambience.ogg +0 -0
- package/dist/chunk-TAATEHKF.mjs +0 -396
- package/dist/chunk-VNU4GNW3.mjs +0 -45
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// src/dashboard/persistence.ts
|
|
2
|
+
import http from "http";
|
|
3
|
+
function notifyDashboard(callData, port = 8e3) {
|
|
4
|
+
try {
|
|
5
|
+
const body = JSON.stringify(callData);
|
|
6
|
+
const req = http.request(
|
|
7
|
+
{
|
|
8
|
+
hostname: "127.0.0.1",
|
|
9
|
+
port,
|
|
10
|
+
path: "/api/dashboard/ingest",
|
|
11
|
+
method: "POST",
|
|
12
|
+
headers: {
|
|
13
|
+
"Content-Type": "application/json",
|
|
14
|
+
"Content-Length": Buffer.byteLength(body)
|
|
15
|
+
},
|
|
16
|
+
timeout: 1e3
|
|
17
|
+
},
|
|
18
|
+
() => {
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
req.on("error", () => {
|
|
22
|
+
});
|
|
23
|
+
req.write(body);
|
|
24
|
+
req.end();
|
|
25
|
+
} catch {
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export {
|
|
30
|
+
notifyDashboard
|
|
31
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getLogger
|
|
3
|
+
} from "./chunk-FMNRCP5X.mjs";
|
|
4
|
+
|
|
5
|
+
// src/tunnel.ts
|
|
6
|
+
var log = getLogger();
|
|
7
|
+
async function startTunnel(port, timeoutMs = 3e4) {
|
|
8
|
+
let tunnelMod;
|
|
9
|
+
try {
|
|
10
|
+
tunnelMod = await import("./lib-4WCAS54J.mjs");
|
|
11
|
+
} catch {
|
|
12
|
+
throw new Error(
|
|
13
|
+
'Built-in tunnel requires the "cloudflared" package. Install it with:\n\n npm install cloudflared\n\nOr provide your own webhookUrl instead of using tunnel: true.'
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
log.info("Starting tunnel to localhost:%d ...", port);
|
|
17
|
+
const TunnelClass = tunnelMod.Tunnel;
|
|
18
|
+
const hasQuick = TunnelClass && typeof TunnelClass.quick === "function";
|
|
19
|
+
let instance;
|
|
20
|
+
if (hasQuick) {
|
|
21
|
+
instance = TunnelClass.quick(`http://localhost:${port}`);
|
|
22
|
+
} else {
|
|
23
|
+
const result = tunnelMod.tunnel({ "--url": `http://localhost:${port}` });
|
|
24
|
+
if (result.url && typeof result.url.then === "function") {
|
|
25
|
+
const tunnelUrl2 = await Promise.race([
|
|
26
|
+
result.url,
|
|
27
|
+
new Promise(
|
|
28
|
+
(_, reject) => setTimeout(() => reject(new Error(
|
|
29
|
+
`Tunnel failed to start within ${timeoutMs / 1e3}s. Check your internet connection or provide webhookUrl manually.`
|
|
30
|
+
)), timeoutMs)
|
|
31
|
+
)
|
|
32
|
+
]);
|
|
33
|
+
const hostname2 = tunnelUrl2.replace(/^https?:\/\//, "").replace(/\/$/, "");
|
|
34
|
+
log.info("Tunnel ready: https://%s", hostname2);
|
|
35
|
+
return { hostname: hostname2, stop: () => {
|
|
36
|
+
log.info("Stopping tunnel...");
|
|
37
|
+
result.stop();
|
|
38
|
+
} };
|
|
39
|
+
}
|
|
40
|
+
instance = result;
|
|
41
|
+
}
|
|
42
|
+
const tunnelUrl = await Promise.race([
|
|
43
|
+
new Promise((resolve) => {
|
|
44
|
+
instance.on("url", (url) => resolve(url));
|
|
45
|
+
}),
|
|
46
|
+
new Promise(
|
|
47
|
+
(_, reject) => setTimeout(() => reject(new Error(
|
|
48
|
+
`Tunnel failed to start within ${timeoutMs / 1e3}s. Check your internet connection or provide webhookUrl manually.`
|
|
49
|
+
)), timeoutMs)
|
|
50
|
+
)
|
|
51
|
+
]);
|
|
52
|
+
const hostname = tunnelUrl.replace(/^https?:\/\//, "").replace(/\/$/, "");
|
|
53
|
+
log.info("Tunnel ready: https://%s", hostname);
|
|
54
|
+
return {
|
|
55
|
+
hostname,
|
|
56
|
+
stop: () => {
|
|
57
|
+
log.info("Stopping tunnel...");
|
|
58
|
+
instance.stop();
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export {
|
|
64
|
+
startTunnel
|
|
65
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
6
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
7
|
+
}) : x)(function(x) {
|
|
8
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
9
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
10
|
+
});
|
|
11
|
+
var __esm = (fn, res) => function __init() {
|
|
12
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
13
|
+
};
|
|
14
|
+
var __commonJS = (cb, mod) => function __require2() {
|
|
15
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
16
|
+
};
|
|
17
|
+
var __export = (target, all) => {
|
|
18
|
+
for (var name in all)
|
|
19
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
20
|
+
};
|
|
21
|
+
var __copyProps = (to, from, except, desc) => {
|
|
22
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
23
|
+
for (let key of __getOwnPropNames(from))
|
|
24
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
25
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
26
|
+
}
|
|
27
|
+
return to;
|
|
28
|
+
};
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
|
|
31
|
+
export {
|
|
32
|
+
__require,
|
|
33
|
+
__esm,
|
|
34
|
+
__commonJS,
|
|
35
|
+
__export,
|
|
36
|
+
__toCommonJS
|
|
37
|
+
};
|