mo commited on
Commit
179a76a
·
1 Parent(s): 241f98c

feat: merged enterprise monorepo — mona-expert 2.0

Browse files

Merges the enterprise core from mona-expert-partial into the repo:
- packages/: @mona /core (config, logger, zero-dep HTTP framework),
@mona /db (dual-dialect schema DSL SQLite/MySQL, repositories),
@mona /security (envelope encryption, JWT, password, RBAC, rate
limit), @mona /providers (adapter contract + routing engine)
- database/: 25-table schema (users, devices, agents, sessions,
refresh-token families, usage, audit, subscriptions) + migration
runner; scripts: setup/migrate/seed/keygen
- Root workspaces monorepo wiring; docs/ARCHITECTURE.md documenting
the invariants: one key (mona.expert), one brain (mona.expert
engine), devices dial out. Roadmap: gateway rewrite on @mona /*,
engine-only routing, device enrollment, quality gates.

Device daemon, tests and platform dashboard unchanged and green.

.gitignore CHANGED
@@ -31,3 +31,8 @@ build/
31
  platform/node_modules/
32
  platform/data/
33
  platform/.env
 
 
 
 
 
 
31
  platform/node_modules/
32
  platform/data/
33
  platform/.env
34
+
35
+ # enterprise core
36
+ var/
37
+ .env
38
+ packages/*/node_modules/
README.md CHANGED
@@ -215,3 +215,6 @@ MIT — free forever.
215
  <p align="center">
216
  <sub>Open-source device agent. No LLM keys on your device. Ever.</sub>
217
  </p>
 
 
 
 
215
  <p align="center">
216
  <sub>Open-source device agent. No LLM keys on your device. Ever.</sub>
217
  </p>
218
+
219
+ # monorepo (merged enterprise version)
220
+ See docs/ARCHITECTURE.md — one key (mona.expert), one brain (mona.expert engine).
package-lock.json CHANGED
@@ -1,23 +1,1806 @@
1
  {
2
- "name": "mona-agent",
3
- "version": "1.0.0",
4
  "lockfileVersion": 3,
5
  "requires": true,
6
  "packages": {
7
  "": {
8
- "name": "mona-agent",
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  "version": "1.0.0",
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  "license": "MIT",
11
  "dependencies": {
12
- "ws": "^8.18.0"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  "bin": {
15
- "mona-agent": "bin/mona-agent.js"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  },
17
  "engines": {
18
- "node": ">=20"
 
 
 
19
  }
20
  },
 
 
 
 
 
 
21
  "node_modules/ws": {
22
  "version": "8.21.3",
23
  "resolved": "https://registry.npmjs.org/ws/-/ws-8.21.3.tgz",
@@ -38,6 +1821,85 @@
38
  "optional": true
39
  }
40
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
  }
42
  }
43
  }
 
1
  {
2
+ "name": "mona-expert",
3
+ "version": "2.0.0",
4
  "lockfileVersion": 3,
5
  "requires": true,
6
  "packages": {
7
  "": {
8
+ "name": "mona-expert",
9
+ "version": "2.0.0",
10
+ "license": "MIT",
11
+ "workspaces": [
12
+ "packages/*",
13
+ "platform"
14
+ ],
15
+ "dependencies": {
16
+ "ws": "^8.18.0"
17
+ },
18
+ "bin": {
19
+ "mona-agent": "bin/mona-agent.js"
20
+ },
21
+ "engines": {
22
+ "node": ">=20"
23
+ }
24
+ },
25
+ "node_modules/@balena/dockerignore": {
26
+ "version": "1.0.2",
27
+ "resolved": "https://registry.npmjs.org/@balena/dockerignore/-/dockerignore-1.0.2.tgz",
28
+ "integrity": "sha512-wMue2Sy4GAVTk6Ic4tJVcnfdau+gx2EnG7S+uAEe+TWJFqE4YoWN4/H8MSLj4eYJKxGg26lZwboEniNiNwZQ6Q==",
29
+ "license": "Apache-2.0"
30
+ },
31
+ "node_modules/@grpc/grpc-js": {
32
+ "version": "1.14.4",
33
+ "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.14.4.tgz",
34
+ "integrity": "sha512-k9Dj3DV/itK9D06Y8f190Qgop7/Ui+D0njFV3LHMPwPT75DpXLQohE9Wmz0QElrJnzsjB7KPWiKJbOl7IPDArQ==",
35
+ "license": "Apache-2.0",
36
+ "dependencies": {
37
+ "@grpc/proto-loader": "^0.8.0",
38
+ "@js-sdsl/ordered-map": "^4.4.2"
39
+ },
40
+ "engines": {
41
+ "node": ">=12.10.0"
42
+ }
43
+ },
44
+ "node_modules/@grpc/grpc-js/node_modules/@grpc/proto-loader": {
45
+ "version": "0.8.1",
46
+ "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.8.1.tgz",
47
+ "integrity": "sha512-wtF6h+DY6M3YaDBPAmvuuA6jV8Sif9MjtOI5euKFWRgCDl5PeDpPsHR9u2l6St5ceY8AZgoNDww5+HvEsXFsGg==",
48
+ "license": "Apache-2.0",
49
+ "dependencies": {
50
+ "lodash.camelcase": "^4.3.0",
51
+ "long": "^5.0.0",
52
+ "protobufjs": "^7.5.5",
53
+ "yargs": "^17.7.2"
54
+ },
55
+ "bin": {
56
+ "proto-loader-gen-types": "build/bin/proto-loader-gen-types.js"
57
+ },
58
+ "engines": {
59
+ "node": ">=6"
60
+ }
61
+ },
62
+ "node_modules/@grpc/proto-loader": {
63
+ "version": "0.7.15",
64
+ "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.7.15.tgz",
65
+ "integrity": "sha512-tMXdRCfYVixjuFK+Hk0Q1s38gV9zDiDJfWL3h1rv4Qc39oILCu1TRTDt7+fGUI8K4G1Fj125Hx/ru3azECWTyQ==",
66
+ "license": "Apache-2.0",
67
+ "dependencies": {
68
+ "lodash.camelcase": "^4.3.0",
69
+ "long": "^5.0.0",
70
+ "protobufjs": "^7.2.5",
71
+ "yargs": "^17.7.2"
72
+ },
73
+ "bin": {
74
+ "proto-loader-gen-types": "build/bin/proto-loader-gen-types.js"
75
+ },
76
+ "engines": {
77
+ "node": ">=6"
78
+ }
79
+ },
80
+ "node_modules/@js-sdsl/ordered-map": {
81
+ "version": "4.4.2",
82
+ "resolved": "https://registry.npmjs.org/@js-sdsl/ordered-map/-/ordered-map-4.4.2.tgz",
83
+ "integrity": "sha512-iUKgm52T8HOE/makSxjqoWhe95ZJA1/G1sYsGev2JDKUSS14KAgg1LHb+Ba+IPow0xflbnSkOsZcO08C7w1gYw==",
84
+ "license": "MIT",
85
+ "funding": {
86
+ "type": "opencollective",
87
+ "url": "https://opencollective.com/js-sdsl"
88
+ }
89
+ },
90
+ "node_modules/@mona/core": {
91
+ "resolved": "packages/core",
92
+ "link": true
93
+ },
94
+ "node_modules/@mona/db": {
95
+ "resolved": "packages/db",
96
+ "link": true
97
+ },
98
+ "node_modules/@mona/providers": {
99
+ "resolved": "packages/providers",
100
+ "link": true
101
+ },
102
+ "node_modules/@mona/security": {
103
+ "resolved": "packages/security",
104
+ "link": true
105
+ },
106
+ "node_modules/@protobufjs/aspromise": {
107
+ "version": "1.1.2",
108
+ "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz",
109
+ "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==",
110
+ "license": "BSD-3-Clause"
111
+ },
112
+ "node_modules/@protobufjs/base64": {
113
+ "version": "1.1.2",
114
+ "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz",
115
+ "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==",
116
+ "license": "BSD-3-Clause"
117
+ },
118
+ "node_modules/@protobufjs/codegen": {
119
+ "version": "2.0.5",
120
+ "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.5.tgz",
121
+ "integrity": "sha512-zgXFLzW3Ap33e6d0Wlj4MGIm6Ce8O89n/apUaGNB/jx+hw+ruWEp7EwGUshdLKVRCxZW12fp9r40E1mQrf/34g==",
122
+ "license": "BSD-3-Clause"
123
+ },
124
+ "node_modules/@protobufjs/eventemitter": {
125
+ "version": "1.1.1",
126
+ "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.1.tgz",
127
+ "integrity": "sha512-vW1GmwMZNnL+gMRaovlh9yZX74kc+TTU3FObkkurpMaRtBfLP3ldjS9KQWlwZgraRE0+dheEEoAxdzcJQ8eXZg==",
128
+ "license": "BSD-3-Clause"
129
+ },
130
+ "node_modules/@protobufjs/fetch": {
131
+ "version": "1.1.1",
132
+ "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.1.tgz",
133
+ "integrity": "sha512-GpptLrs57adMSuHi3VNj0mAF8dwh36LMaYF6XyJ6JMWlVsc+t42tm1HSEDmOs3A8fC9yyeisgLhsTVQokOZ0zw==",
134
+ "license": "BSD-3-Clause",
135
+ "dependencies": {
136
+ "@protobufjs/aspromise": "^1.1.1"
137
+ }
138
+ },
139
+ "node_modules/@protobufjs/float": {
140
+ "version": "1.0.2",
141
+ "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz",
142
+ "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==",
143
+ "license": "BSD-3-Clause"
144
+ },
145
+ "node_modules/@protobufjs/path": {
146
+ "version": "1.1.2",
147
+ "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz",
148
+ "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==",
149
+ "license": "BSD-3-Clause"
150
+ },
151
+ "node_modules/@protobufjs/pool": {
152
+ "version": "1.1.0",
153
+ "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz",
154
+ "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==",
155
+ "license": "BSD-3-Clause"
156
+ },
157
+ "node_modules/@protobufjs/utf8": {
158
+ "version": "1.1.2",
159
+ "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.2.tgz",
160
+ "integrity": "sha512-b1UQwcEZ4yCnMCD8DAL1VlbvBJE9/IX4FTIp7BG1xYpf29SLazLSrqUkj4w7Y5y7cCVP6E5tcqqcI0xemPkHug==",
161
+ "license": "BSD-3-Clause"
162
+ },
163
+ "node_modules/@types/node": {
164
+ "version": "26.2.0",
165
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-26.2.0.tgz",
166
+ "integrity": "sha512-5IviulTZeRNp2vAJ514cc/HUlY5nZ9fCbq9DMyC52BrhFZACo3nI0R7qBxhQmo/d27NFe96ur/b7Wwxklda+kg==",
167
+ "license": "MIT",
168
+ "dependencies": {
169
+ "undici-types": "~8.3.0"
170
+ }
171
+ },
172
+ "node_modules/accepts": {
173
+ "version": "1.3.8",
174
+ "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz",
175
+ "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==",
176
+ "license": "MIT",
177
+ "dependencies": {
178
+ "mime-types": "~2.1.34",
179
+ "negotiator": "0.6.3"
180
+ },
181
+ "engines": {
182
+ "node": ">= 0.6"
183
+ }
184
+ },
185
+ "node_modules/agent.mona.expert-platform": {
186
+ "resolved": "platform",
187
+ "link": true
188
+ },
189
+ "node_modules/ansi-regex": {
190
+ "version": "5.0.1",
191
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
192
+ "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
193
+ "license": "MIT",
194
+ "engines": {
195
+ "node": ">=8"
196
+ }
197
+ },
198
+ "node_modules/ansi-styles": {
199
+ "version": "4.3.0",
200
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
201
+ "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
202
+ "license": "MIT",
203
+ "dependencies": {
204
+ "color-convert": "^2.0.1"
205
+ },
206
+ "engines": {
207
+ "node": ">=8"
208
+ },
209
+ "funding": {
210
+ "url": "https://github.com/chalk/ansi-styles?sponsor=1"
211
+ }
212
+ },
213
+ "node_modules/append-field": {
214
+ "version": "1.0.0",
215
+ "resolved": "https://registry.npmjs.org/append-field/-/append-field-1.0.0.tgz",
216
+ "integrity": "sha512-klpgFSWLW1ZEs8svjfb7g4qWY0YS5imI82dTg+QahUvJ8YqAY0P10Uk8tTyh9ZGuYEZEMaeJYCF5BFuX552hsw==",
217
+ "license": "MIT"
218
+ },
219
+ "node_modules/array-flatten": {
220
+ "version": "1.1.1",
221
+ "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
222
+ "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==",
223
+ "license": "MIT"
224
+ },
225
+ "node_modules/asn1": {
226
+ "version": "0.2.6",
227
+ "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz",
228
+ "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==",
229
+ "license": "MIT",
230
+ "dependencies": {
231
+ "safer-buffer": "~2.1.0"
232
+ }
233
+ },
234
+ "node_modules/base64-js": {
235
+ "version": "1.5.1",
236
+ "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
237
+ "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==",
238
+ "funding": [
239
+ {
240
+ "type": "github",
241
+ "url": "https://github.com/sponsors/feross"
242
+ },
243
+ {
244
+ "type": "patreon",
245
+ "url": "https://www.patreon.com/feross"
246
+ },
247
+ {
248
+ "type": "consulting",
249
+ "url": "https://feross.org/support"
250
+ }
251
+ ],
252
+ "license": "MIT"
253
+ },
254
+ "node_modules/bcrypt-pbkdf": {
255
+ "version": "1.0.2",
256
+ "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz",
257
+ "integrity": "sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==",
258
+ "license": "BSD-3-Clause",
259
+ "dependencies": {
260
+ "tweetnacl": "^0.14.3"
261
+ }
262
+ },
263
+ "node_modules/bl": {
264
+ "version": "4.1.0",
265
+ "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz",
266
+ "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==",
267
+ "license": "MIT",
268
+ "dependencies": {
269
+ "buffer": "^5.5.0",
270
+ "inherits": "^2.0.4",
271
+ "readable-stream": "^3.4.0"
272
+ }
273
+ },
274
+ "node_modules/body-parser": {
275
+ "version": "1.20.6",
276
+ "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.6.tgz",
277
+ "integrity": "sha512-p5tAzS57i5MV9fZFDj9LeIiTZEufbSe2eDozP+ElheSUq1m74CRq1jI4mYNDdVs9vQztXFLuk/Gd6BWTdwRJ5g==",
278
+ "license": "MIT",
279
+ "dependencies": {
280
+ "bytes": "~3.1.2",
281
+ "content-type": "~1.0.5",
282
+ "debug": "2.6.9",
283
+ "depd": "2.0.0",
284
+ "destroy": "~1.2.0",
285
+ "http-errors": "~2.0.1",
286
+ "iconv-lite": "~0.4.24",
287
+ "on-finished": "~2.4.1",
288
+ "qs": "~6.15.1",
289
+ "raw-body": "~2.5.3",
290
+ "type-is": "~1.6.18",
291
+ "unpipe": "~1.0.0"
292
+ },
293
+ "engines": {
294
+ "node": ">= 0.8",
295
+ "npm": "1.2.8000 || >= 1.4.16"
296
+ }
297
+ },
298
+ "node_modules/body-parser/node_modules/debug": {
299
+ "version": "2.6.9",
300
+ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
301
+ "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
302
+ "license": "MIT",
303
+ "dependencies": {
304
+ "ms": "2.0.0"
305
+ }
306
+ },
307
+ "node_modules/body-parser/node_modules/ms": {
308
+ "version": "2.0.0",
309
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
310
+ "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==",
311
+ "license": "MIT"
312
+ },
313
+ "node_modules/buffer": {
314
+ "version": "5.7.1",
315
+ "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz",
316
+ "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==",
317
+ "funding": [
318
+ {
319
+ "type": "github",
320
+ "url": "https://github.com/sponsors/feross"
321
+ },
322
+ {
323
+ "type": "patreon",
324
+ "url": "https://www.patreon.com/feross"
325
+ },
326
+ {
327
+ "type": "consulting",
328
+ "url": "https://feross.org/support"
329
+ }
330
+ ],
331
+ "license": "MIT",
332
+ "dependencies": {
333
+ "base64-js": "^1.3.1",
334
+ "ieee754": "^1.1.13"
335
+ }
336
+ },
337
+ "node_modules/buffer-from": {
338
+ "version": "1.1.2",
339
+ "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz",
340
+ "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==",
341
+ "license": "MIT"
342
+ },
343
+ "node_modules/buildcheck": {
344
+ "version": "0.0.7",
345
+ "resolved": "https://registry.npmjs.org/buildcheck/-/buildcheck-0.0.7.tgz",
346
+ "integrity": "sha512-lHblz4ahamxpTmnsk+MNTRWsjYKv965MwOrSJyeD588rR3Jcu7swE+0wN5F+PbL5cjgu/9ObkhfzEPuofEMwLA==",
347
+ "optional": true,
348
+ "engines": {
349
+ "node": ">=10.0.0"
350
+ }
351
+ },
352
+ "node_modules/busboy": {
353
+ "version": "1.6.0",
354
+ "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz",
355
+ "integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==",
356
+ "dependencies": {
357
+ "streamsearch": "^1.1.0"
358
+ },
359
+ "engines": {
360
+ "node": ">=10.16.0"
361
+ }
362
+ },
363
+ "node_modules/bytes": {
364
+ "version": "3.1.2",
365
+ "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",
366
+ "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==",
367
+ "license": "MIT",
368
+ "engines": {
369
+ "node": ">= 0.8"
370
+ }
371
+ },
372
+ "node_modules/call-bind-apply-helpers": {
373
+ "version": "1.0.2",
374
+ "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz",
375
+ "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==",
376
+ "license": "MIT",
377
+ "dependencies": {
378
+ "es-errors": "^1.3.0",
379
+ "function-bind": "^1.1.2"
380
+ },
381
+ "engines": {
382
+ "node": ">= 0.4"
383
+ }
384
+ },
385
+ "node_modules/call-bound": {
386
+ "version": "1.0.4",
387
+ "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz",
388
+ "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==",
389
+ "license": "MIT",
390
+ "dependencies": {
391
+ "call-bind-apply-helpers": "^1.0.2",
392
+ "get-intrinsic": "^1.3.0"
393
+ },
394
+ "engines": {
395
+ "node": ">= 0.4"
396
+ },
397
+ "funding": {
398
+ "url": "https://github.com/sponsors/ljharb"
399
+ }
400
+ },
401
+ "node_modules/chownr": {
402
+ "version": "1.1.4",
403
+ "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz",
404
+ "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==",
405
+ "license": "ISC"
406
+ },
407
+ "node_modules/cliui": {
408
+ "version": "8.0.1",
409
+ "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz",
410
+ "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==",
411
+ "license": "ISC",
412
+ "dependencies": {
413
+ "string-width": "^4.2.0",
414
+ "strip-ansi": "^6.0.1",
415
+ "wrap-ansi": "^7.0.0"
416
+ },
417
+ "engines": {
418
+ "node": ">=12"
419
+ }
420
+ },
421
+ "node_modules/color-convert": {
422
+ "version": "2.0.1",
423
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
424
+ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
425
+ "license": "MIT",
426
+ "dependencies": {
427
+ "color-name": "~1.1.4"
428
+ },
429
+ "engines": {
430
+ "node": ">=7.0.0"
431
+ }
432
+ },
433
+ "node_modules/color-name": {
434
+ "version": "1.1.4",
435
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
436
+ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
437
+ "license": "MIT"
438
+ },
439
+ "node_modules/concat-stream": {
440
+ "version": "1.6.2",
441
+ "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz",
442
+ "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==",
443
+ "engines": [
444
+ "node >= 0.8"
445
+ ],
446
+ "license": "MIT",
447
+ "dependencies": {
448
+ "buffer-from": "^1.0.0",
449
+ "inherits": "^2.0.3",
450
+ "readable-stream": "^2.2.2",
451
+ "typedarray": "^0.0.6"
452
+ }
453
+ },
454
+ "node_modules/concat-stream/node_modules/readable-stream": {
455
+ "version": "2.3.8",
456
+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz",
457
+ "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==",
458
+ "license": "MIT",
459
+ "dependencies": {
460
+ "core-util-is": "~1.0.0",
461
+ "inherits": "~2.0.3",
462
+ "isarray": "~1.0.0",
463
+ "process-nextick-args": "~2.0.0",
464
+ "safe-buffer": "~5.1.1",
465
+ "string_decoder": "~1.1.1",
466
+ "util-deprecate": "~1.0.1"
467
+ }
468
+ },
469
+ "node_modules/concat-stream/node_modules/safe-buffer": {
470
+ "version": "5.1.2",
471
+ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
472
+ "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
473
+ "license": "MIT"
474
+ },
475
+ "node_modules/concat-stream/node_modules/string_decoder": {
476
+ "version": "1.1.1",
477
+ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
478
+ "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
479
+ "license": "MIT",
480
+ "dependencies": {
481
+ "safe-buffer": "~5.1.0"
482
+ }
483
+ },
484
+ "node_modules/content-disposition": {
485
+ "version": "0.5.4",
486
+ "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz",
487
+ "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==",
488
+ "license": "MIT",
489
+ "dependencies": {
490
+ "safe-buffer": "5.2.1"
491
+ },
492
+ "engines": {
493
+ "node": ">= 0.6"
494
+ }
495
+ },
496
+ "node_modules/content-type": {
497
+ "version": "1.0.5",
498
+ "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz",
499
+ "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==",
500
+ "license": "MIT",
501
+ "engines": {
502
+ "node": ">= 0.6"
503
+ }
504
+ },
505
+ "node_modules/cookie": {
506
+ "version": "0.7.2",
507
+ "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz",
508
+ "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==",
509
+ "license": "MIT",
510
+ "engines": {
511
+ "node": ">= 0.6"
512
+ }
513
+ },
514
+ "node_modules/cookie-signature": {
515
+ "version": "1.0.7",
516
+ "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.7.tgz",
517
+ "integrity": "sha512-NXdYc3dLr47pBkpUCHtKSwIOQXLVn8dZEuywboCOJY/osA0wFSLlSawr3KN8qXJEyX66FcONTH8EIlVuK0yyFA==",
518
+ "license": "MIT"
519
+ },
520
+ "node_modules/core-util-is": {
521
+ "version": "1.0.3",
522
+ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
523
+ "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==",
524
+ "license": "MIT"
525
+ },
526
+ "node_modules/cors": {
527
+ "version": "2.8.6",
528
+ "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.6.tgz",
529
+ "integrity": "sha512-tJtZBBHA6vjIAaF6EnIaq6laBBP9aq/Y3ouVJjEfoHbRBcHBAHYcMh/w8LDrk2PvIMMq8gmopa5D4V8RmbrxGw==",
530
+ "license": "MIT",
531
+ "dependencies": {
532
+ "object-assign": "^4",
533
+ "vary": "^1"
534
+ },
535
+ "engines": {
536
+ "node": ">= 0.10"
537
+ },
538
+ "funding": {
539
+ "type": "opencollective",
540
+ "url": "https://opencollective.com/express"
541
+ }
542
+ },
543
+ "node_modules/cpu-features": {
544
+ "version": "0.0.10",
545
+ "resolved": "https://registry.npmjs.org/cpu-features/-/cpu-features-0.0.10.tgz",
546
+ "integrity": "sha512-9IkYqtX3YHPCzoVg1Py+o9057a3i0fp7S530UWokCSaFVTc7CwXPRiOjRjBQQ18ZCNafx78YfnG+HALxtVmOGA==",
547
+ "hasInstallScript": true,
548
+ "optional": true,
549
+ "dependencies": {
550
+ "buildcheck": "~0.0.6",
551
+ "nan": "^2.19.0"
552
+ },
553
+ "engines": {
554
+ "node": ">=10.0.0"
555
+ }
556
+ },
557
+ "node_modules/data-uri-to-buffer": {
558
+ "version": "4.0.1",
559
+ "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz",
560
+ "integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==",
561
+ "license": "MIT",
562
+ "engines": {
563
+ "node": ">= 12"
564
+ }
565
+ },
566
+ "node_modules/debug": {
567
+ "version": "4.4.3",
568
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",
569
+ "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",
570
+ "license": "MIT",
571
+ "dependencies": {
572
+ "ms": "^2.1.3"
573
+ },
574
+ "engines": {
575
+ "node": ">=6.0"
576
+ },
577
+ "peerDependenciesMeta": {
578
+ "supports-color": {
579
+ "optional": true
580
+ }
581
+ }
582
+ },
583
+ "node_modules/depd": {
584
+ "version": "2.0.0",
585
+ "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz",
586
+ "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==",
587
+ "license": "MIT",
588
+ "engines": {
589
+ "node": ">= 0.8"
590
+ }
591
+ },
592
+ "node_modules/destroy": {
593
+ "version": "1.2.0",
594
+ "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz",
595
+ "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==",
596
+ "license": "MIT",
597
+ "engines": {
598
+ "node": ">= 0.8",
599
+ "npm": "1.2.8000 || >= 1.4.16"
600
+ }
601
+ },
602
+ "node_modules/docker-modem": {
603
+ "version": "5.0.7",
604
+ "resolved": "https://registry.npmjs.org/docker-modem/-/docker-modem-5.0.7.tgz",
605
+ "integrity": "sha512-XJgGhoR/CLpqshm4d3L7rzH6t8NgDFUIIpztYlLHIApeJjMZKYJMz2zxPsYxnejq5h3ELYSw/RBsi3t5h7gNTA==",
606
+ "license": "Apache-2.0",
607
+ "dependencies": {
608
+ "debug": "^4.1.1",
609
+ "readable-stream": "^3.5.0",
610
+ "split-ca": "^1.0.1",
611
+ "ssh2": "^1.15.0"
612
+ },
613
+ "engines": {
614
+ "node": ">= 8.0"
615
+ }
616
+ },
617
+ "node_modules/dockerode": {
618
+ "version": "4.0.12",
619
+ "resolved": "https://registry.npmjs.org/dockerode/-/dockerode-4.0.12.tgz",
620
+ "integrity": "sha512-/bCZd6KlGcjZO8Buqmi/vXuqEGVEZ0PNjx/biBNqJD3MhK9DmdiAuKxqfNhflgDESDIiBz3qF+0e55+CpnrUcw==",
621
+ "license": "Apache-2.0",
622
+ "dependencies": {
623
+ "@balena/dockerignore": "^1.0.2",
624
+ "@grpc/grpc-js": "^1.11.1",
625
+ "@grpc/proto-loader": "^0.7.13",
626
+ "docker-modem": "^5.0.7",
627
+ "protobufjs": "^7.3.2",
628
+ "tar-fs": "^2.1.4",
629
+ "uuid": "^10.0.0"
630
+ },
631
+ "engines": {
632
+ "node": ">= 8.0"
633
+ }
634
+ },
635
+ "node_modules/dunder-proto": {
636
+ "version": "1.0.1",
637
+ "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",
638
+ "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==",
639
+ "license": "MIT",
640
+ "dependencies": {
641
+ "call-bind-apply-helpers": "^1.0.1",
642
+ "es-errors": "^1.3.0",
643
+ "gopd": "^1.2.0"
644
+ },
645
+ "engines": {
646
+ "node": ">= 0.4"
647
+ }
648
+ },
649
+ "node_modules/ee-first": {
650
+ "version": "1.1.1",
651
+ "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
652
+ "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==",
653
+ "license": "MIT"
654
+ },
655
+ "node_modules/emoji-regex": {
656
+ "version": "8.0.0",
657
+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
658
+ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
659
+ "license": "MIT"
660
+ },
661
+ "node_modules/encodeurl": {
662
+ "version": "2.0.0",
663
+ "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz",
664
+ "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==",
665
+ "license": "MIT",
666
+ "engines": {
667
+ "node": ">= 0.8"
668
+ }
669
+ },
670
+ "node_modules/end-of-stream": {
671
+ "version": "1.4.5",
672
+ "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz",
673
+ "integrity": "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==",
674
+ "license": "MIT",
675
+ "dependencies": {
676
+ "once": "^1.4.0"
677
+ }
678
+ },
679
+ "node_modules/es-define-property": {
680
+ "version": "1.0.1",
681
+ "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz",
682
+ "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==",
683
+ "license": "MIT",
684
+ "engines": {
685
+ "node": ">= 0.4"
686
+ }
687
+ },
688
+ "node_modules/es-errors": {
689
+ "version": "1.3.0",
690
+ "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz",
691
+ "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==",
692
+ "license": "MIT",
693
+ "engines": {
694
+ "node": ">= 0.4"
695
+ }
696
+ },
697
+ "node_modules/es-object-atoms": {
698
+ "version": "1.1.2",
699
+ "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.2.tgz",
700
+ "integrity": "sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==",
701
+ "license": "MIT",
702
+ "dependencies": {
703
+ "es-errors": "^1.3.0"
704
+ },
705
+ "engines": {
706
+ "node": ">= 0.4"
707
+ }
708
+ },
709
+ "node_modules/escalade": {
710
+ "version": "3.2.0",
711
+ "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz",
712
+ "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==",
713
+ "license": "MIT",
714
+ "engines": {
715
+ "node": ">=6"
716
+ }
717
+ },
718
+ "node_modules/escape-html": {
719
+ "version": "1.0.3",
720
+ "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
721
+ "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==",
722
+ "license": "MIT"
723
+ },
724
+ "node_modules/etag": {
725
+ "version": "1.8.1",
726
+ "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
727
+ "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==",
728
+ "license": "MIT",
729
+ "engines": {
730
+ "node": ">= 0.6"
731
+ }
732
+ },
733
+ "node_modules/express": {
734
+ "version": "4.22.2",
735
+ "resolved": "https://registry.npmjs.org/express/-/express-4.22.2.tgz",
736
+ "integrity": "sha512-IuL+Elrou2ZvCFHs18/CIzy2Nzvo25nZ1/D2eIZlz7c+QUayAcYoiM2BthCjs+EBHVpjYjcuLDAiCWgeIX3X1Q==",
737
+ "license": "MIT",
738
+ "dependencies": {
739
+ "accepts": "~1.3.8",
740
+ "array-flatten": "1.1.1",
741
+ "body-parser": "~1.20.5",
742
+ "content-disposition": "~0.5.4",
743
+ "content-type": "~1.0.4",
744
+ "cookie": "~0.7.1",
745
+ "cookie-signature": "~1.0.6",
746
+ "debug": "2.6.9",
747
+ "depd": "2.0.0",
748
+ "encodeurl": "~2.0.0",
749
+ "escape-html": "~1.0.3",
750
+ "etag": "~1.8.1",
751
+ "finalhandler": "~1.3.1",
752
+ "fresh": "~0.5.2",
753
+ "http-errors": "~2.0.0",
754
+ "merge-descriptors": "1.0.3",
755
+ "methods": "~1.1.2",
756
+ "on-finished": "~2.4.1",
757
+ "parseurl": "~1.3.3",
758
+ "path-to-regexp": "~0.1.12",
759
+ "proxy-addr": "~2.0.7",
760
+ "qs": "~6.15.1",
761
+ "range-parser": "~1.2.1",
762
+ "safe-buffer": "5.2.1",
763
+ "send": "~0.19.0",
764
+ "serve-static": "~1.16.2",
765
+ "setprototypeof": "1.2.0",
766
+ "statuses": "~2.0.1",
767
+ "type-is": "~1.6.18",
768
+ "utils-merge": "1.0.1",
769
+ "vary": "~1.1.2"
770
+ },
771
+ "engines": {
772
+ "node": ">= 0.10.0"
773
+ },
774
+ "funding": {
775
+ "type": "opencollective",
776
+ "url": "https://opencollective.com/express"
777
+ }
778
+ },
779
+ "node_modules/express/node_modules/debug": {
780
+ "version": "2.6.9",
781
+ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
782
+ "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
783
+ "license": "MIT",
784
+ "dependencies": {
785
+ "ms": "2.0.0"
786
+ }
787
+ },
788
+ "node_modules/express/node_modules/ms": {
789
+ "version": "2.0.0",
790
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
791
+ "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==",
792
+ "license": "MIT"
793
+ },
794
+ "node_modules/fetch-blob": {
795
+ "version": "3.2.0",
796
+ "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz",
797
+ "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==",
798
+ "funding": [
799
+ {
800
+ "type": "github",
801
+ "url": "https://github.com/sponsors/jimmywarting"
802
+ },
803
+ {
804
+ "type": "paypal",
805
+ "url": "https://paypal.me/jimmywarting"
806
+ }
807
+ ],
808
+ "license": "MIT",
809
+ "dependencies": {
810
+ "node-domexception": "^1.0.0",
811
+ "web-streams-polyfill": "^3.0.3"
812
+ },
813
+ "engines": {
814
+ "node": "^12.20 || >= 14.13"
815
+ }
816
+ },
817
+ "node_modules/finalhandler": {
818
+ "version": "1.3.2",
819
+ "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.2.tgz",
820
+ "integrity": "sha512-aA4RyPcd3badbdABGDuTXCMTtOneUCAYH/gxoYRTZlIJdF0YPWuGqiAsIrhNnnqdXGswYk6dGujem4w80UJFhg==",
821
+ "license": "MIT",
822
+ "dependencies": {
823
+ "debug": "2.6.9",
824
+ "encodeurl": "~2.0.0",
825
+ "escape-html": "~1.0.3",
826
+ "on-finished": "~2.4.1",
827
+ "parseurl": "~1.3.3",
828
+ "statuses": "~2.0.2",
829
+ "unpipe": "~1.0.0"
830
+ },
831
+ "engines": {
832
+ "node": ">= 0.8"
833
+ }
834
+ },
835
+ "node_modules/finalhandler/node_modules/debug": {
836
+ "version": "2.6.9",
837
+ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
838
+ "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
839
+ "license": "MIT",
840
+ "dependencies": {
841
+ "ms": "2.0.0"
842
+ }
843
+ },
844
+ "node_modules/finalhandler/node_modules/ms": {
845
+ "version": "2.0.0",
846
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
847
+ "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==",
848
+ "license": "MIT"
849
+ },
850
+ "node_modules/formdata-polyfill": {
851
+ "version": "4.0.10",
852
+ "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz",
853
+ "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==",
854
+ "license": "MIT",
855
+ "dependencies": {
856
+ "fetch-blob": "^3.1.2"
857
+ },
858
+ "engines": {
859
+ "node": ">=12.20.0"
860
+ }
861
+ },
862
+ "node_modules/forwarded": {
863
+ "version": "0.2.0",
864
+ "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",
865
+ "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==",
866
+ "license": "MIT",
867
+ "engines": {
868
+ "node": ">= 0.6"
869
+ }
870
+ },
871
+ "node_modules/fresh": {
872
+ "version": "0.5.2",
873
+ "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz",
874
+ "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==",
875
+ "license": "MIT",
876
+ "engines": {
877
+ "node": ">= 0.6"
878
+ }
879
+ },
880
+ "node_modules/fs-constants": {
881
+ "version": "1.0.0",
882
+ "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz",
883
+ "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==",
884
+ "license": "MIT"
885
+ },
886
+ "node_modules/function-bind": {
887
+ "version": "1.1.2",
888
+ "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
889
+ "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",
890
+ "license": "MIT",
891
+ "funding": {
892
+ "url": "https://github.com/sponsors/ljharb"
893
+ }
894
+ },
895
+ "node_modules/get-caller-file": {
896
+ "version": "2.0.5",
897
+ "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
898
+ "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
899
+ "license": "ISC",
900
+ "engines": {
901
+ "node": "6.* || 8.* || >= 10.*"
902
+ }
903
+ },
904
+ "node_modules/get-intrinsic": {
905
+ "version": "1.3.0",
906
+ "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz",
907
+ "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==",
908
+ "license": "MIT",
909
+ "dependencies": {
910
+ "call-bind-apply-helpers": "^1.0.2",
911
+ "es-define-property": "^1.0.1",
912
+ "es-errors": "^1.3.0",
913
+ "es-object-atoms": "^1.1.1",
914
+ "function-bind": "^1.1.2",
915
+ "get-proto": "^1.0.1",
916
+ "gopd": "^1.2.0",
917
+ "has-symbols": "^1.1.0",
918
+ "hasown": "^2.0.2",
919
+ "math-intrinsics": "^1.1.0"
920
+ },
921
+ "engines": {
922
+ "node": ">= 0.4"
923
+ },
924
+ "funding": {
925
+ "url": "https://github.com/sponsors/ljharb"
926
+ }
927
+ },
928
+ "node_modules/get-proto": {
929
+ "version": "1.0.1",
930
+ "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz",
931
+ "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==",
932
+ "license": "MIT",
933
+ "dependencies": {
934
+ "dunder-proto": "^1.0.1",
935
+ "es-object-atoms": "^1.0.0"
936
+ },
937
+ "engines": {
938
+ "node": ">= 0.4"
939
+ }
940
+ },
941
+ "node_modules/gopd": {
942
+ "version": "1.2.0",
943
+ "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz",
944
+ "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==",
945
+ "license": "MIT",
946
+ "engines": {
947
+ "node": ">= 0.4"
948
+ },
949
+ "funding": {
950
+ "url": "https://github.com/sponsors/ljharb"
951
+ }
952
+ },
953
+ "node_modules/has-symbols": {
954
+ "version": "1.1.0",
955
+ "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz",
956
+ "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==",
957
+ "license": "MIT",
958
+ "engines": {
959
+ "node": ">= 0.4"
960
+ },
961
+ "funding": {
962
+ "url": "https://github.com/sponsors/ljharb"
963
+ }
964
+ },
965
+ "node_modules/hasown": {
966
+ "version": "2.0.4",
967
+ "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz",
968
+ "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==",
969
+ "license": "MIT",
970
+ "dependencies": {
971
+ "function-bind": "^1.1.2"
972
+ },
973
+ "engines": {
974
+ "node": ">= 0.4"
975
+ }
976
+ },
977
+ "node_modules/http-errors": {
978
+ "version": "2.0.1",
979
+ "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz",
980
+ "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==",
981
+ "license": "MIT",
982
+ "dependencies": {
983
+ "depd": "~2.0.0",
984
+ "inherits": "~2.0.4",
985
+ "setprototypeof": "~1.2.0",
986
+ "statuses": "~2.0.2",
987
+ "toidentifier": "~1.0.1"
988
+ },
989
+ "engines": {
990
+ "node": ">= 0.8"
991
+ },
992
+ "funding": {
993
+ "type": "opencollective",
994
+ "url": "https://opencollective.com/express"
995
+ }
996
+ },
997
+ "node_modules/iconv-lite": {
998
+ "version": "0.4.24",
999
+ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
1000
+ "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
1001
+ "license": "MIT",
1002
+ "dependencies": {
1003
+ "safer-buffer": ">= 2.1.2 < 3"
1004
+ },
1005
+ "engines": {
1006
+ "node": ">=0.10.0"
1007
+ }
1008
+ },
1009
+ "node_modules/ieee754": {
1010
+ "version": "1.2.1",
1011
+ "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz",
1012
+ "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==",
1013
+ "funding": [
1014
+ {
1015
+ "type": "github",
1016
+ "url": "https://github.com/sponsors/feross"
1017
+ },
1018
+ {
1019
+ "type": "patreon",
1020
+ "url": "https://www.patreon.com/feross"
1021
+ },
1022
+ {
1023
+ "type": "consulting",
1024
+ "url": "https://feross.org/support"
1025
+ }
1026
+ ],
1027
+ "license": "BSD-3-Clause"
1028
+ },
1029
+ "node_modules/inherits": {
1030
+ "version": "2.0.4",
1031
+ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
1032
+ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
1033
+ "license": "ISC"
1034
+ },
1035
+ "node_modules/ipaddr.js": {
1036
+ "version": "1.9.1",
1037
+ "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
1038
+ "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==",
1039
+ "license": "MIT",
1040
+ "engines": {
1041
+ "node": ">= 0.10"
1042
+ }
1043
+ },
1044
+ "node_modules/is-fullwidth-code-point": {
1045
+ "version": "3.0.0",
1046
+ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
1047
+ "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
1048
+ "license": "MIT",
1049
+ "engines": {
1050
+ "node": ">=8"
1051
+ }
1052
+ },
1053
+ "node_modules/isarray": {
1054
+ "version": "1.0.0",
1055
+ "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
1056
+ "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==",
1057
+ "license": "MIT"
1058
+ },
1059
+ "node_modules/lodash.camelcase": {
1060
+ "version": "4.3.0",
1061
+ "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz",
1062
+ "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==",
1063
+ "license": "MIT"
1064
+ },
1065
+ "node_modules/long": {
1066
+ "version": "5.3.2",
1067
+ "resolved": "https://registry.npmjs.org/long/-/long-5.3.2.tgz",
1068
+ "integrity": "sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA==",
1069
+ "license": "Apache-2.0"
1070
+ },
1071
+ "node_modules/math-intrinsics": {
1072
+ "version": "1.1.0",
1073
+ "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
1074
+ "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==",
1075
+ "license": "MIT",
1076
+ "engines": {
1077
+ "node": ">= 0.4"
1078
+ }
1079
+ },
1080
+ "node_modules/media-typer": {
1081
+ "version": "0.3.0",
1082
+ "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
1083
+ "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==",
1084
+ "license": "MIT",
1085
+ "engines": {
1086
+ "node": ">= 0.6"
1087
+ }
1088
+ },
1089
+ "node_modules/merge-descriptors": {
1090
+ "version": "1.0.3",
1091
+ "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz",
1092
+ "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==",
1093
+ "license": "MIT",
1094
+ "funding": {
1095
+ "url": "https://github.com/sponsors/sindresorhus"
1096
+ }
1097
+ },
1098
+ "node_modules/methods": {
1099
+ "version": "1.1.2",
1100
+ "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz",
1101
+ "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==",
1102
+ "license": "MIT",
1103
+ "engines": {
1104
+ "node": ">= 0.6"
1105
+ }
1106
+ },
1107
+ "node_modules/mime": {
1108
+ "version": "1.6.0",
1109
+ "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
1110
+ "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==",
1111
+ "license": "MIT",
1112
+ "bin": {
1113
+ "mime": "cli.js"
1114
+ },
1115
+ "engines": {
1116
+ "node": ">=4"
1117
+ }
1118
+ },
1119
+ "node_modules/mime-db": {
1120
+ "version": "1.52.0",
1121
+ "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
1122
+ "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
1123
+ "license": "MIT",
1124
+ "engines": {
1125
+ "node": ">= 0.6"
1126
+ }
1127
+ },
1128
+ "node_modules/mime-types": {
1129
+ "version": "2.1.35",
1130
+ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
1131
+ "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
1132
+ "license": "MIT",
1133
+ "dependencies": {
1134
+ "mime-db": "1.52.0"
1135
+ },
1136
+ "engines": {
1137
+ "node": ">= 0.6"
1138
+ }
1139
+ },
1140
+ "node_modules/minimist": {
1141
+ "version": "1.2.8",
1142
+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
1143
+ "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",
1144
+ "license": "MIT",
1145
+ "funding": {
1146
+ "url": "https://github.com/sponsors/ljharb"
1147
+ }
1148
+ },
1149
+ "node_modules/mkdirp": {
1150
+ "version": "0.5.6",
1151
+ "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz",
1152
+ "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==",
1153
+ "license": "MIT",
1154
+ "dependencies": {
1155
+ "minimist": "^1.2.6"
1156
+ },
1157
+ "bin": {
1158
+ "mkdirp": "bin/cmd.js"
1159
+ }
1160
+ },
1161
+ "node_modules/mkdirp-classic": {
1162
+ "version": "0.5.3",
1163
+ "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz",
1164
+ "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==",
1165
+ "license": "MIT"
1166
+ },
1167
+ "node_modules/ms": {
1168
+ "version": "2.1.3",
1169
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
1170
+ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
1171
+ "license": "MIT"
1172
+ },
1173
+ "node_modules/multer": {
1174
+ "version": "1.4.5-lts.2",
1175
+ "resolved": "https://registry.npmjs.org/multer/-/multer-1.4.5-lts.2.tgz",
1176
+ "integrity": "sha512-VzGiVigcG9zUAoCNU+xShztrlr1auZOlurXynNvO9GiWD1/mTBbUljOKY+qMeazBqXgRnjzeEgJI/wyjJUHg9A==",
1177
+ "deprecated": "Multer 1.x is impacted by a number of vulnerabilities, which have been patched in 2.x. You should upgrade to the latest 2.x version.",
1178
+ "license": "MIT",
1179
+ "dependencies": {
1180
+ "append-field": "^1.0.0",
1181
+ "busboy": "^1.0.0",
1182
+ "concat-stream": "^1.5.2",
1183
+ "mkdirp": "^0.5.4",
1184
+ "object-assign": "^4.1.1",
1185
+ "type-is": "^1.6.4",
1186
+ "xtend": "^4.0.0"
1187
+ },
1188
+ "engines": {
1189
+ "node": ">= 6.0.0"
1190
+ }
1191
+ },
1192
+ "node_modules/nan": {
1193
+ "version": "2.28.0",
1194
+ "resolved": "https://registry.npmjs.org/nan/-/nan-2.28.0.tgz",
1195
+ "integrity": "sha512-fTsDz99OTq2sVePhGdp4qQhggZFtKr64ZNVyVajRKtMOkJxYekplBh577PiJB12v/D3s2E5cGtOI45LWp6rnLQ==",
1196
+ "license": "MIT",
1197
+ "optional": true
1198
+ },
1199
+ "node_modules/negotiator": {
1200
+ "version": "0.6.3",
1201
+ "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz",
1202
+ "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==",
1203
+ "license": "MIT",
1204
+ "engines": {
1205
+ "node": ">= 0.6"
1206
+ }
1207
+ },
1208
+ "node_modules/node-domexception": {
1209
  "version": "1.0.0",
1210
+ "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz",
1211
+ "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==",
1212
+ "deprecated": "Use your platform's native DOMException instead",
1213
+ "funding": [
1214
+ {
1215
+ "type": "github",
1216
+ "url": "https://github.com/sponsors/jimmywarting"
1217
+ },
1218
+ {
1219
+ "type": "github",
1220
+ "url": "https://paypal.me/jimmywarting"
1221
+ }
1222
+ ],
1223
+ "license": "MIT",
1224
+ "engines": {
1225
+ "node": ">=10.5.0"
1226
+ }
1227
+ },
1228
+ "node_modules/node-fetch": {
1229
+ "version": "3.3.2",
1230
+ "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz",
1231
+ "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==",
1232
  "license": "MIT",
1233
  "dependencies": {
1234
+ "data-uri-to-buffer": "^4.0.0",
1235
+ "fetch-blob": "^3.1.4",
1236
+ "formdata-polyfill": "^4.0.10"
1237
+ },
1238
+ "engines": {
1239
+ "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
1240
+ },
1241
+ "funding": {
1242
+ "type": "opencollective",
1243
+ "url": "https://opencollective.com/node-fetch"
1244
+ }
1245
+ },
1246
+ "node_modules/object-assign": {
1247
+ "version": "4.1.1",
1248
+ "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
1249
+ "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==",
1250
+ "license": "MIT",
1251
+ "engines": {
1252
+ "node": ">=0.10.0"
1253
+ }
1254
+ },
1255
+ "node_modules/object-inspect": {
1256
+ "version": "1.13.4",
1257
+ "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz",
1258
+ "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==",
1259
+ "license": "MIT",
1260
+ "engines": {
1261
+ "node": ">= 0.4"
1262
+ },
1263
+ "funding": {
1264
+ "url": "https://github.com/sponsors/ljharb"
1265
+ }
1266
+ },
1267
+ "node_modules/on-finished": {
1268
+ "version": "2.4.1",
1269
+ "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz",
1270
+ "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==",
1271
+ "license": "MIT",
1272
+ "dependencies": {
1273
+ "ee-first": "1.1.1"
1274
+ },
1275
+ "engines": {
1276
+ "node": ">= 0.8"
1277
+ }
1278
+ },
1279
+ "node_modules/once": {
1280
+ "version": "1.4.0",
1281
+ "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
1282
+ "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
1283
+ "license": "ISC",
1284
+ "dependencies": {
1285
+ "wrappy": "1"
1286
+ }
1287
+ },
1288
+ "node_modules/parseurl": {
1289
+ "version": "1.3.3",
1290
+ "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
1291
+ "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==",
1292
+ "license": "MIT",
1293
+ "engines": {
1294
+ "node": ">= 0.8"
1295
+ }
1296
+ },
1297
+ "node_modules/path-to-regexp": {
1298
+ "version": "0.1.13",
1299
+ "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.13.tgz",
1300
+ "integrity": "sha512-A/AGNMFN3c8bOlvV9RreMdrv7jsmF9XIfDeCd87+I8RNg6s78BhJxMu69NEMHBSJFxKidViTEdruRwEk/WIKqA==",
1301
+ "license": "MIT"
1302
+ },
1303
+ "node_modules/process-nextick-args": {
1304
+ "version": "2.0.1",
1305
+ "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
1306
+ "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==",
1307
+ "license": "MIT"
1308
+ },
1309
+ "node_modules/protobufjs": {
1310
+ "version": "7.6.5",
1311
+ "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.6.5.tgz",
1312
+ "integrity": "sha512-/FPD0nUc9jH6rfFjji9IBqOz4pcSE3CsT1m7Ep6Mdb0LxSUMj8hgl6GomOvZzpNpAqqGaXA0P3VSrZLFzIhQrw==",
1313
+ "hasInstallScript": true,
1314
+ "license": "BSD-3-Clause",
1315
+ "dependencies": {
1316
+ "@protobufjs/aspromise": "^1.1.2",
1317
+ "@protobufjs/base64": "^1.1.2",
1318
+ "@protobufjs/codegen": "^2.0.5",
1319
+ "@protobufjs/eventemitter": "^1.1.1",
1320
+ "@protobufjs/fetch": "^1.1.1",
1321
+ "@protobufjs/float": "^1.0.2",
1322
+ "@protobufjs/path": "^1.1.2",
1323
+ "@protobufjs/pool": "^1.1.0",
1324
+ "@protobufjs/utf8": "^1.1.1",
1325
+ "@types/node": ">=13.7.0",
1326
+ "long": "^5.3.2"
1327
+ },
1328
+ "engines": {
1329
+ "node": ">=12.0.0"
1330
+ }
1331
+ },
1332
+ "node_modules/proxy-addr": {
1333
+ "version": "2.0.7",
1334
+ "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
1335
+ "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==",
1336
+ "license": "MIT",
1337
+ "dependencies": {
1338
+ "forwarded": "0.2.0",
1339
+ "ipaddr.js": "1.9.1"
1340
+ },
1341
+ "engines": {
1342
+ "node": ">= 0.10"
1343
+ }
1344
+ },
1345
+ "node_modules/pump": {
1346
+ "version": "3.0.4",
1347
+ "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.4.tgz",
1348
+ "integrity": "sha512-VS7sjc6KR7e1ukRFhQSY5LM2uBWAUPiOPa/A3mkKmiMwSmRFUITt0xuj+/lesgnCv+dPIEYlkzrcyXgquIHMcA==",
1349
+ "license": "MIT",
1350
+ "dependencies": {
1351
+ "end-of-stream": "^1.1.0",
1352
+ "once": "^1.3.1"
1353
+ }
1354
+ },
1355
+ "node_modules/qs": {
1356
+ "version": "6.15.3",
1357
+ "resolved": "https://registry.npmjs.org/qs/-/qs-6.15.3.tgz",
1358
+ "integrity": "sha512-O9gl3zCl5h5blw1KGUzQKhA5oUXSl8rwUIM5o0S3nCXMliSvy5Dzx7/DJcI+SwgICv+IneSZwhBh1oSyEHA71A==",
1359
+ "license": "BSD-3-Clause",
1360
+ "dependencies": {
1361
+ "es-define-property": "^1.0.1",
1362
+ "side-channel": "^1.1.1"
1363
+ },
1364
+ "engines": {
1365
+ "node": ">=0.6"
1366
+ },
1367
+ "funding": {
1368
+ "url": "https://github.com/sponsors/ljharb"
1369
+ }
1370
+ },
1371
+ "node_modules/range-parser": {
1372
+ "version": "1.2.1",
1373
+ "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",
1374
+ "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==",
1375
+ "license": "MIT",
1376
+ "engines": {
1377
+ "node": ">= 0.6"
1378
+ }
1379
+ },
1380
+ "node_modules/raw-body": {
1381
+ "version": "2.5.3",
1382
+ "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.3.tgz",
1383
+ "integrity": "sha512-s4VSOf6yN0rvbRZGxs8Om5CWj6seneMwK3oDb4lWDH0UPhWcxwOWw5+qk24bxq87szX1ydrwylIOp2uG1ojUpA==",
1384
+ "license": "MIT",
1385
+ "dependencies": {
1386
+ "bytes": "~3.1.2",
1387
+ "http-errors": "~2.0.1",
1388
+ "iconv-lite": "~0.4.24",
1389
+ "unpipe": "~1.0.0"
1390
+ },
1391
+ "engines": {
1392
+ "node": ">= 0.8"
1393
+ }
1394
+ },
1395
+ "node_modules/readable-stream": {
1396
+ "version": "3.6.2",
1397
+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",
1398
+ "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==",
1399
+ "license": "MIT",
1400
+ "dependencies": {
1401
+ "inherits": "^2.0.3",
1402
+ "string_decoder": "^1.1.1",
1403
+ "util-deprecate": "^1.0.1"
1404
+ },
1405
+ "engines": {
1406
+ "node": ">= 6"
1407
+ }
1408
+ },
1409
+ "node_modules/require-directory": {
1410
+ "version": "2.1.1",
1411
+ "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
1412
+ "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==",
1413
+ "license": "MIT",
1414
+ "engines": {
1415
+ "node": ">=0.10.0"
1416
+ }
1417
+ },
1418
+ "node_modules/safe-buffer": {
1419
+ "version": "5.2.1",
1420
+ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
1421
+ "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
1422
+ "funding": [
1423
+ {
1424
+ "type": "github",
1425
+ "url": "https://github.com/sponsors/feross"
1426
+ },
1427
+ {
1428
+ "type": "patreon",
1429
+ "url": "https://www.patreon.com/feross"
1430
+ },
1431
+ {
1432
+ "type": "consulting",
1433
+ "url": "https://feross.org/support"
1434
+ }
1435
+ ],
1436
+ "license": "MIT"
1437
+ },
1438
+ "node_modules/safer-buffer": {
1439
+ "version": "2.1.2",
1440
+ "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
1441
+ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
1442
+ "license": "MIT"
1443
+ },
1444
+ "node_modules/send": {
1445
+ "version": "0.19.2",
1446
+ "resolved": "https://registry.npmjs.org/send/-/send-0.19.2.tgz",
1447
+ "integrity": "sha512-VMbMxbDeehAxpOtWJXlcUS5E8iXh6QmN+BkRX1GARS3wRaXEEgzCcB10gTQazO42tpNIya8xIyNx8fll1OFPrg==",
1448
+ "license": "MIT",
1449
+ "dependencies": {
1450
+ "debug": "2.6.9",
1451
+ "depd": "2.0.0",
1452
+ "destroy": "1.2.0",
1453
+ "encodeurl": "~2.0.0",
1454
+ "escape-html": "~1.0.3",
1455
+ "etag": "~1.8.1",
1456
+ "fresh": "~0.5.2",
1457
+ "http-errors": "~2.0.1",
1458
+ "mime": "1.6.0",
1459
+ "ms": "2.1.3",
1460
+ "on-finished": "~2.4.1",
1461
+ "range-parser": "~1.2.1",
1462
+ "statuses": "~2.0.2"
1463
+ },
1464
+ "engines": {
1465
+ "node": ">= 0.8.0"
1466
+ }
1467
+ },
1468
+ "node_modules/send/node_modules/debug": {
1469
+ "version": "2.6.9",
1470
+ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
1471
+ "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
1472
+ "license": "MIT",
1473
+ "dependencies": {
1474
+ "ms": "2.0.0"
1475
+ }
1476
+ },
1477
+ "node_modules/send/node_modules/debug/node_modules/ms": {
1478
+ "version": "2.0.0",
1479
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
1480
+ "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==",
1481
+ "license": "MIT"
1482
+ },
1483
+ "node_modules/serve-static": {
1484
+ "version": "1.16.3",
1485
+ "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.3.tgz",
1486
+ "integrity": "sha512-x0RTqQel6g5SY7Lg6ZreMmsOzncHFU7nhnRWkKgWuMTu5NN0DR5oruckMqRvacAN9d5w6ARnRBXl9xhDCgfMeA==",
1487
+ "license": "MIT",
1488
+ "dependencies": {
1489
+ "encodeurl": "~2.0.0",
1490
+ "escape-html": "~1.0.3",
1491
+ "parseurl": "~1.3.3",
1492
+ "send": "~0.19.1"
1493
+ },
1494
+ "engines": {
1495
+ "node": ">= 0.8.0"
1496
+ }
1497
+ },
1498
+ "node_modules/setprototypeof": {
1499
+ "version": "1.2.0",
1500
+ "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz",
1501
+ "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==",
1502
+ "license": "ISC"
1503
+ },
1504
+ "node_modules/side-channel": {
1505
+ "version": "1.1.1",
1506
+ "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.1.tgz",
1507
+ "integrity": "sha512-6x6dK6zJdpTzF4sQeNYxwtvBzf6Eg4GtlesS94HOvTudUeyK2WXAaIfmDgsyslYrRBeFIlsi54AYsFGUuhmvrQ==",
1508
+ "license": "MIT",
1509
+ "dependencies": {
1510
+ "es-errors": "^1.3.0",
1511
+ "object-inspect": "^1.13.4",
1512
+ "side-channel-list": "^1.0.1",
1513
+ "side-channel-map": "^1.0.1",
1514
+ "side-channel-weakmap": "^1.0.2"
1515
+ },
1516
+ "engines": {
1517
+ "node": ">= 0.4"
1518
+ },
1519
+ "funding": {
1520
+ "url": "https://github.com/sponsors/ljharb"
1521
+ }
1522
+ },
1523
+ "node_modules/side-channel-list": {
1524
+ "version": "1.0.1",
1525
+ "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.1.tgz",
1526
+ "integrity": "sha512-mjn/0bi/oUURjc5Xl7IaWi/OJJJumuoJFQJfDDyO46+hBWsfaVM65TBHq2eoZBhzl9EchxOijpkbRC8SVBQU0w==",
1527
+ "license": "MIT",
1528
+ "dependencies": {
1529
+ "es-errors": "^1.3.0",
1530
+ "object-inspect": "^1.13.4"
1531
  },
1532
+ "engines": {
1533
+ "node": ">= 0.4"
1534
+ },
1535
+ "funding": {
1536
+ "url": "https://github.com/sponsors/ljharb"
1537
+ }
1538
+ },
1539
+ "node_modules/side-channel-map": {
1540
+ "version": "1.0.1",
1541
+ "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz",
1542
+ "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==",
1543
+ "license": "MIT",
1544
+ "dependencies": {
1545
+ "call-bound": "^1.0.2",
1546
+ "es-errors": "^1.3.0",
1547
+ "get-intrinsic": "^1.2.5",
1548
+ "object-inspect": "^1.13.3"
1549
+ },
1550
+ "engines": {
1551
+ "node": ">= 0.4"
1552
+ },
1553
+ "funding": {
1554
+ "url": "https://github.com/sponsors/ljharb"
1555
+ }
1556
+ },
1557
+ "node_modules/side-channel-weakmap": {
1558
+ "version": "1.0.2",
1559
+ "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz",
1560
+ "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==",
1561
+ "license": "MIT",
1562
+ "dependencies": {
1563
+ "call-bound": "^1.0.2",
1564
+ "es-errors": "^1.3.0",
1565
+ "get-intrinsic": "^1.2.5",
1566
+ "object-inspect": "^1.13.3",
1567
+ "side-channel-map": "^1.0.1"
1568
+ },
1569
+ "engines": {
1570
+ "node": ">= 0.4"
1571
+ },
1572
+ "funding": {
1573
+ "url": "https://github.com/sponsors/ljharb"
1574
+ }
1575
+ },
1576
+ "node_modules/split-ca": {
1577
+ "version": "1.0.1",
1578
+ "resolved": "https://registry.npmjs.org/split-ca/-/split-ca-1.0.1.tgz",
1579
+ "integrity": "sha512-Q5thBSxp5t8WPTTJQS59LrGqOZqOsrhDGDVm8azCqIBjSBd7nd9o2PM+mDulQQkh8h//4U6hFZnc/mul8t5pWQ==",
1580
+ "license": "ISC"
1581
+ },
1582
+ "node_modules/sql.js": {
1583
+ "version": "1.14.1",
1584
+ "resolved": "https://registry.npmjs.org/sql.js/-/sql.js-1.14.1.tgz",
1585
+ "integrity": "sha512-gcj8zBWU5cFsi9WUP+4bFNXAyF1iRpA3LLyS/DP5xlrNzGmPIizUeBggKa8DbDwdqaKwUcTEnChtd2grWo/x/A==",
1586
+ "license": "MIT"
1587
+ },
1588
+ "node_modules/ssh2": {
1589
+ "version": "1.17.0",
1590
+ "resolved": "https://registry.npmjs.org/ssh2/-/ssh2-1.17.0.tgz",
1591
+ "integrity": "sha512-wPldCk3asibAjQ/kziWQQt1Wh3PgDFpC0XpwclzKcdT1vql6KeYxf5LIt4nlFkUeR8WuphYMKqUA56X4rjbfgQ==",
1592
+ "hasInstallScript": true,
1593
+ "dependencies": {
1594
+ "asn1": "^0.2.6",
1595
+ "bcrypt-pbkdf": "^1.0.2"
1596
+ },
1597
+ "engines": {
1598
+ "node": ">=10.16.0"
1599
+ },
1600
+ "optionalDependencies": {
1601
+ "cpu-features": "~0.0.10",
1602
+ "nan": "^2.23.0"
1603
+ }
1604
+ },
1605
+ "node_modules/statuses": {
1606
+ "version": "2.0.2",
1607
+ "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz",
1608
+ "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==",
1609
+ "license": "MIT",
1610
+ "engines": {
1611
+ "node": ">= 0.8"
1612
+ }
1613
+ },
1614
+ "node_modules/streamsearch": {
1615
+ "version": "1.1.0",
1616
+ "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz",
1617
+ "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==",
1618
+ "engines": {
1619
+ "node": ">=10.0.0"
1620
+ }
1621
+ },
1622
+ "node_modules/string_decoder": {
1623
+ "version": "1.3.0",
1624
+ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
1625
+ "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
1626
+ "license": "MIT",
1627
+ "dependencies": {
1628
+ "safe-buffer": "~5.2.0"
1629
+ }
1630
+ },
1631
+ "node_modules/string-width": {
1632
+ "version": "4.2.3",
1633
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
1634
+ "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
1635
+ "license": "MIT",
1636
+ "dependencies": {
1637
+ "emoji-regex": "^8.0.0",
1638
+ "is-fullwidth-code-point": "^3.0.0",
1639
+ "strip-ansi": "^6.0.1"
1640
+ },
1641
+ "engines": {
1642
+ "node": ">=8"
1643
+ }
1644
+ },
1645
+ "node_modules/strip-ansi": {
1646
+ "version": "6.0.1",
1647
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
1648
+ "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
1649
+ "license": "MIT",
1650
+ "dependencies": {
1651
+ "ansi-regex": "^5.0.1"
1652
+ },
1653
+ "engines": {
1654
+ "node": ">=8"
1655
+ }
1656
+ },
1657
+ "node_modules/tar-fs": {
1658
+ "version": "2.1.5",
1659
+ "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.5.tgz",
1660
+ "integrity": "sha512-OboTd8mmMhZDNPV+UjQcK9yKAatXu2aJ+r1w4im1Otd4M4fl2hwvdoXUxIYHFTHWK/3y3FarBP70v3vwmGlOxw==",
1661
+ "license": "MIT",
1662
+ "dependencies": {
1663
+ "chownr": "^1.1.1",
1664
+ "mkdirp-classic": "^0.5.2",
1665
+ "pump": "^3.0.0",
1666
+ "tar-stream": "^2.1.4"
1667
+ }
1668
+ },
1669
+ "node_modules/tar-stream": {
1670
+ "version": "2.2.0",
1671
+ "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz",
1672
+ "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==",
1673
+ "license": "MIT",
1674
+ "dependencies": {
1675
+ "bl": "^4.0.3",
1676
+ "end-of-stream": "^1.4.1",
1677
+ "fs-constants": "^1.0.0",
1678
+ "inherits": "^2.0.3",
1679
+ "readable-stream": "^3.1.1"
1680
+ },
1681
+ "engines": {
1682
+ "node": ">=6"
1683
+ }
1684
+ },
1685
+ "node_modules/toidentifier": {
1686
+ "version": "1.0.1",
1687
+ "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz",
1688
+ "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==",
1689
+ "license": "MIT",
1690
+ "engines": {
1691
+ "node": ">=0.6"
1692
+ }
1693
+ },
1694
+ "node_modules/tweetnacl": {
1695
+ "version": "0.14.5",
1696
+ "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz",
1697
+ "integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==",
1698
+ "license": "Unlicense"
1699
+ },
1700
+ "node_modules/type-is": {
1701
+ "version": "1.6.18",
1702
+ "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz",
1703
+ "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==",
1704
+ "license": "MIT",
1705
+ "dependencies": {
1706
+ "media-typer": "0.3.0",
1707
+ "mime-types": "~2.1.24"
1708
+ },
1709
+ "engines": {
1710
+ "node": ">= 0.6"
1711
+ }
1712
+ },
1713
+ "node_modules/typedarray": {
1714
+ "version": "0.0.6",
1715
+ "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz",
1716
+ "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==",
1717
+ "license": "MIT"
1718
+ },
1719
+ "node_modules/undici-types": {
1720
+ "version": "8.3.0",
1721
+ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.3.0.tgz",
1722
+ "integrity": "sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ==",
1723
+ "license": "MIT"
1724
+ },
1725
+ "node_modules/unpipe": {
1726
+ "version": "1.0.0",
1727
+ "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
1728
+ "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==",
1729
+ "license": "MIT",
1730
+ "engines": {
1731
+ "node": ">= 0.8"
1732
+ }
1733
+ },
1734
+ "node_modules/util-deprecate": {
1735
+ "version": "1.0.2",
1736
+ "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
1737
+ "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==",
1738
+ "license": "MIT"
1739
+ },
1740
+ "node_modules/utils-merge": {
1741
+ "version": "1.0.1",
1742
+ "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz",
1743
+ "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==",
1744
+ "license": "MIT",
1745
+ "engines": {
1746
+ "node": ">= 0.4.0"
1747
+ }
1748
+ },
1749
+ "node_modules/uuid": {
1750
+ "version": "10.0.0",
1751
+ "resolved": "https://registry.npmjs.org/uuid/-/uuid-10.0.0.tgz",
1752
+ "integrity": "sha512-8XkAphELsDnEGrDxUOHB3RGvXz6TeuYSGEZBOjtTtPm2lwhGBjLgOzLHB63IUWfBpNucQjND6d3AOudO+H3RWQ==",
1753
+ "deprecated": "uuid@10 and below is no longer supported. For ESM codebases, update to uuid@latest. For CommonJS codebases, use uuid@11 (but be aware this version will likely be deprecated in 2028).",
1754
+ "funding": [
1755
+ "https://github.com/sponsors/broofa",
1756
+ "https://github.com/sponsors/ctavan"
1757
+ ],
1758
+ "license": "MIT",
1759
  "bin": {
1760
+ "uuid": "dist/bin/uuid"
1761
+ }
1762
+ },
1763
+ "node_modules/vary": {
1764
+ "version": "1.1.2",
1765
+ "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
1766
+ "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==",
1767
+ "license": "MIT",
1768
+ "engines": {
1769
+ "node": ">= 0.8"
1770
+ }
1771
+ },
1772
+ "node_modules/web-streams-polyfill": {
1773
+ "version": "3.3.3",
1774
+ "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.3.3.tgz",
1775
+ "integrity": "sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==",
1776
+ "license": "MIT",
1777
+ "engines": {
1778
+ "node": ">= 8"
1779
+ }
1780
+ },
1781
+ "node_modules/wrap-ansi": {
1782
+ "version": "7.0.0",
1783
+ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
1784
+ "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
1785
+ "license": "MIT",
1786
+ "dependencies": {
1787
+ "ansi-styles": "^4.0.0",
1788
+ "string-width": "^4.1.0",
1789
+ "strip-ansi": "^6.0.0"
1790
  },
1791
  "engines": {
1792
+ "node": ">=10"
1793
+ },
1794
+ "funding": {
1795
+ "url": "https://github.com/chalk/wrap-ansi?sponsor=1"
1796
  }
1797
  },
1798
+ "node_modules/wrappy": {
1799
+ "version": "1.0.2",
1800
+ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
1801
+ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==",
1802
+ "license": "ISC"
1803
+ },
1804
  "node_modules/ws": {
1805
  "version": "8.21.3",
1806
  "resolved": "https://registry.npmjs.org/ws/-/ws-8.21.3.tgz",
 
1821
  "optional": true
1822
  }
1823
  }
1824
+ },
1825
+ "node_modules/xtend": {
1826
+ "version": "4.0.2",
1827
+ "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",
1828
+ "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==",
1829
+ "license": "MIT",
1830
+ "engines": {
1831
+ "node": ">=0.4"
1832
+ }
1833
+ },
1834
+ "node_modules/y18n": {
1835
+ "version": "5.0.8",
1836
+ "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz",
1837
+ "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==",
1838
+ "license": "ISC",
1839
+ "engines": {
1840
+ "node": ">=10"
1841
+ }
1842
+ },
1843
+ "node_modules/yargs": {
1844
+ "version": "17.7.3",
1845
+ "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.3.tgz",
1846
+ "integrity": "sha512-GZtjxm/J/4TSxuL3FNYjCmLktBTnIw/rVmKSIyKeYAZpmJB2ig9VauCC5xsa82GNKVKDAqpOn3KVzNt0zmrU0g==",
1847
+ "license": "MIT",
1848
+ "dependencies": {
1849
+ "cliui": "^8.0.1",
1850
+ "escalade": "^3.1.1",
1851
+ "get-caller-file": "^2.0.5",
1852
+ "require-directory": "^2.1.1",
1853
+ "string-width": "^4.2.3",
1854
+ "y18n": "^5.0.5",
1855
+ "yargs-parser": "^21.1.1"
1856
+ },
1857
+ "engines": {
1858
+ "node": ">=12"
1859
+ }
1860
+ },
1861
+ "node_modules/yargs-parser": {
1862
+ "version": "21.1.1",
1863
+ "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz",
1864
+ "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==",
1865
+ "license": "ISC",
1866
+ "engines": {
1867
+ "node": ">=12"
1868
+ }
1869
+ },
1870
+ "packages/core": {
1871
+ "name": "@mona/core",
1872
+ "version": "1.0.0"
1873
+ },
1874
+ "packages/db": {
1875
+ "name": "@mona/db",
1876
+ "version": "1.0.0"
1877
+ },
1878
+ "packages/providers": {
1879
+ "name": "@mona/providers",
1880
+ "version": "1.0.0"
1881
+ },
1882
+ "packages/security": {
1883
+ "name": "@mona/security",
1884
+ "version": "1.0.0"
1885
+ },
1886
+ "platform": {
1887
+ "name": "agent.mona.expert-platform",
1888
+ "version": "1.0.0",
1889
+ "license": "MIT",
1890
+ "dependencies": {
1891
+ "cors": "^2.8.5",
1892
+ "dockerode": "^4.0.2",
1893
+ "express": "^4.21.0",
1894
+ "multer": "^1.4.5-lts.1",
1895
+ "node-fetch": "^3.3.2",
1896
+ "sql.js": "^1.12.0",
1897
+ "uuid": "^10.0.0",
1898
+ "ws": "^8.18.0"
1899
+ },
1900
+ "engines": {
1901
+ "node": ">=20.0.0"
1902
+ }
1903
  }
1904
  }
1905
  }
package.json CHANGED
@@ -1,8 +1,13 @@
1
  {
2
- "name": "mona-agent",
3
- "version": "1.2.0",
4
- "description": "Cloud-brained device agent with terminal dashboard. Multi-OS (macOS/Linux/Windows). No local LLM keys.",
5
  "type": "module",
 
 
 
 
 
6
  "bin": {
7
  "mona-agent": "./bin/mona-agent.js"
8
  },
@@ -10,7 +15,12 @@
10
  "start": "node bin/mona-agent.js start",
11
  "gui": "node bin/mona-agent.js gui",
12
  "login": "node bin/mona-agent.js login",
13
- "test": "node --test test/agent.test.mjs test/control.test.mjs test/docker-control.test.mjs test/tui-scroll.test.mjs"
 
 
 
 
 
14
  },
15
  "engines": {
16
  "node": ">=20"
@@ -21,13 +31,15 @@
21
  "license": "MIT",
22
  "repository": {
23
  "type": "git",
24
- "url": "https://github.com/MONAEXPERT/mona-agent.git"
25
  },
26
  "keywords": [
27
  "ai-agent",
28
  "device-daemon",
29
  "cloud-brain",
30
  "terminal-ui",
31
- "openclaw"
 
 
32
  ]
33
  }
 
1
  {
2
+ "name": "mona-expert",
3
+ "version": "2.0.0",
4
+ "description": "mona.expert — merged enterprise monorepo: device agent, control plane, cloud brain. One key (mona.expert), one brain (mona.expert engine).",
5
  "type": "module",
6
+ "private": true,
7
+ "workspaces": [
8
+ "packages/*",
9
+ "platform"
10
+ ],
11
  "bin": {
12
  "mona-agent": "./bin/mona-agent.js"
13
  },
 
15
  "start": "node bin/mona-agent.js start",
16
  "gui": "node bin/mona-agent.js gui",
17
  "login": "node bin/mona-agent.js login",
18
+ "test": "node --test test/agent.test.mjs test/control.test.mjs test/docker-control.test.mjs test/tui-scroll.test.mjs",
19
+ "migrate": "node scripts/migrate.mjs",
20
+ "setup": "node scripts/setup.mjs",
21
+ "seed": "node scripts/seed.mjs",
22
+ "keygen": "node scripts/keygen.mjs",
23
+ "emit:mysql": "node database/migrations/emit-mysql.mjs"
24
  },
25
  "engines": {
26
  "node": ">=20"
 
31
  "license": "MIT",
32
  "repository": {
33
  "type": "git",
34
+ "url": "https://github.com/MONAEXPERT/agent.git"
35
  },
36
  "keywords": [
37
  "ai-agent",
38
  "device-daemon",
39
  "cloud-brain",
40
  "terminal-ui",
41
+ "control-plane",
42
+ "enterprise",
43
+ "mona-expert"
44
  ]
45
  }
packages/providers/package.json ADDED
@@ -0,0 +1 @@
 
 
1
+ { "name": "@mona/providers", "version": "1.0.0", "type": "module", "private": true, "main": "src/index.mjs", "exports": { ".": "./src/index.mjs" } }
packages/providers/src/anthropic.mjs ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { Provider, estimateTokens } from './provider.mjs';
2
+
3
+ export class AnthropicProvider extends Provider {
4
+ constructor(meta = {}) {
5
+ super({ slug: 'anthropic', name: 'Anthropic', kind: 'cloud', baseUrl: 'https://api.anthropic.com/v1', ...meta });
6
+ }
7
+ headers(credential) {
8
+ return { 'x-api-key': credential, 'anthropic-version': '2023-06-01', 'content-type': 'application/json' };
9
+ }
10
+ body({ model, messages, system, temperature, maxTokens, stream = false }) {
11
+ return {
12
+ model, max_tokens: maxTokens || 2048, temperature,
13
+ ...(system ? { system } : {}),
14
+ messages: messages.filter(m => m.role !== 'system').map(m => ({ role: m.role === 'assistant' ? 'assistant' : 'user', content: m.content })),
15
+ stream,
16
+ };
17
+ }
18
+ async authenticate(credential) { await this.listModels(credential); return { ok: true, detail: 'Key accepted.' }; }
19
+ async listModels(credential) {
20
+ const data = await this.request(`${this.baseUrl}/models`, { headers: this.headers(credential), timeoutMs: 15000 });
21
+ return (data.data || []).map(m => ({ slug: m.id, displayName: m.display_name || m.id, family: 'Claude' }));
22
+ }
23
+ async chat(req) {
24
+ const started = Date.now();
25
+ const data = await this.request(`${this.baseUrl}/messages`, {
26
+ method: 'POST', headers: this.headers(req.credential), body: this.body(req), signal: req.signal,
27
+ });
28
+ return {
29
+ text: (data.content || []).filter(b => b.type === 'text').map(b => b.text).join(''),
30
+ finishReason: data.stop_reason || 'end_turn',
31
+ usage: { inputTokens: data.usage?.input_tokens ?? 0, outputTokens: data.usage?.output_tokens ?? 0 },
32
+ latencyMs: Date.now() - started,
33
+ model: data.model || req.model,
34
+ };
35
+ }
36
+ async *stream(req) {
37
+ const res = await this.request(`${this.baseUrl}/messages`, {
38
+ method: 'POST', headers: this.headers(req.credential), body: this.body({ ...req, stream: true }), signal: req.signal, stream: true,
39
+ });
40
+ let inputTokens = 0, outputTokens = 0, finish = 'end_turn', out = '';
41
+ for await (const evt of this.readSse(res)) {
42
+ if (evt.type === 'message_start') inputTokens = evt.message?.usage?.input_tokens ?? 0;
43
+ if (evt.type === 'content_block_delta' && evt.delta?.type === 'text_delta') { out += evt.delta.text; yield { type: 'delta', text: evt.delta.text }; }
44
+ if (evt.type === 'message_delta') { outputTokens = evt.usage?.output_tokens ?? outputTokens; finish = evt.delta?.stop_reason || finish; }
45
+ if (evt.type === 'error') yield { type: 'error', code: 'PROVIDER_ERROR', message: 'The provider ended the stream early.' };
46
+ }
47
+ yield { type: 'usage', usage: { inputTokens, outputTokens: outputTokens || estimateTokens(out), estimated: !outputTokens } };
48
+ yield { type: 'done', finishReason: finish };
49
+ }
50
+ }
packages/providers/src/google.mjs ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { Provider, estimateTokens } from './provider.mjs';
2
+
3
+ export class GoogleProvider extends Provider {
4
+ constructor(meta = {}) {
5
+ super({ slug: 'google', name: 'Google AI', kind: 'cloud', baseUrl: 'https://generativelanguage.googleapis.com/v1beta', ...meta });
6
+ }
7
+ body({ messages, system, temperature, maxTokens }) {
8
+ return {
9
+ contents: messages.filter(m => m.role !== 'system').map(m => ({
10
+ role: m.role === 'assistant' ? 'model' : 'user', parts: [{ text: m.content }],
11
+ })),
12
+ ...(system ? { systemInstruction: { parts: [{ text: system }] } } : {}),
13
+ generationConfig: { temperature, maxOutputTokens: maxTokens },
14
+ };
15
+ }
16
+ async authenticate(credential) { await this.listModels(credential); return { ok: true, detail: 'Key accepted.' }; }
17
+ async listModels(credential) {
18
+ const data = await this.request(`${this.baseUrl}/models?key=${encodeURIComponent(credential)}`, { timeoutMs: 15000 });
19
+ return (data.models || []).map(m => ({
20
+ slug: String(m.name).replace(/^models\//, ''), displayName: m.displayName || m.name,
21
+ family: 'Gemini', contextWindow: m.inputTokenLimit, maxOutput: m.outputTokenLimit,
22
+ }));
23
+ }
24
+ async chat(req) {
25
+ const started = Date.now();
26
+ const url = `${this.baseUrl}/models/${encodeURIComponent(req.model)}:generateContent?key=${encodeURIComponent(req.credential)}`;
27
+ const data = await this.request(url, { method: 'POST', headers: { 'content-type': 'application/json' }, body: this.body(req), signal: req.signal });
28
+ const cand = data.candidates?.[0];
29
+ return {
30
+ text: (cand?.content?.parts || []).map(p => p.text || '').join(''),
31
+ finishReason: (cand?.finishReason || 'STOP').toLowerCase(),
32
+ usage: { inputTokens: data.usageMetadata?.promptTokenCount ?? 0, outputTokens: data.usageMetadata?.candidatesTokenCount ?? 0 },
33
+ latencyMs: Date.now() - started,
34
+ model: req.model,
35
+ };
36
+ }
37
+ async *stream(req) {
38
+ const url = `${this.baseUrl}/models/${encodeURIComponent(req.model)}:streamGenerateContent?alt=sse&key=${encodeURIComponent(req.credential)}`;
39
+ const res = await this.request(url, { method: 'POST', headers: { 'content-type': 'application/json' }, body: this.body(req), signal: req.signal, stream: true });
40
+ let usage = null, finish = 'stop', out = '';
41
+ for await (const evt of this.readSse(res)) {
42
+ const cand = evt.candidates?.[0];
43
+ const text = (cand?.content?.parts || []).map(p => p.text || '').join('');
44
+ if (text) { out += text; yield { type: 'delta', text }; }
45
+ if (cand?.finishReason) finish = String(cand.finishReason).toLowerCase();
46
+ if (evt.usageMetadata) usage = { inputTokens: evt.usageMetadata.promptTokenCount ?? 0, outputTokens: evt.usageMetadata.candidatesTokenCount ?? 0 };
47
+ }
48
+ yield { type: 'usage', usage: usage || { inputTokens: 0, outputTokens: estimateTokens(out), estimated: true } };
49
+ yield { type: 'done', finishReason: finish };
50
+ }
51
+ }
packages/providers/src/index.mjs ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ export * from './provider.mjs';
2
+ export * from './openai.mjs';
3
+ export * from './anthropic.mjs';
4
+ export * from './google.mjs';
5
+ export * from './ollama.mjs';
6
+ export * from './simulated.mjs';
7
+ export * from './router.mjs';
packages/providers/src/ollama.mjs ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { Provider, estimateTokens } from './provider.mjs';
2
+
3
+ /**
4
+ * Local models. Modelled as an ordinary provider so a laptop GPU and a hosted
5
+ * frontier model are the same kind of thing to routing, permissions and usage.
6
+ * llama.cpp, vLLM and LM Studio all expose an OpenAI-shaped API — point
7
+ * OpenAIProvider at their base URL and register it under a new slug.
8
+ */
9
+ export class OllamaProvider extends Provider {
10
+ constructor(meta = {}) {
11
+ super({ slug: 'ollama', name: 'Ollama (local)', kind: 'local', requiresCredential: false, baseUrl: 'http://127.0.0.1:11434', ...meta });
12
+ }
13
+ async authenticate() { await this.listModels(); return { ok: true, detail: 'Local runtime reachable.' }; }
14
+ async listModels() {
15
+ const data = await this.request(`${this.baseUrl}/api/tags`, { timeoutMs: 5000 });
16
+ return (data.models || []).map(m => ({ slug: m.name, displayName: m.name, family: m.details?.family || 'local' }));
17
+ }
18
+ body({ model, messages, system, temperature, maxTokens, stream }) {
19
+ return {
20
+ model, stream,
21
+ messages: system ? [{ role: 'system', content: system }, ...messages] : messages,
22
+ options: { temperature, num_predict: maxTokens },
23
+ };
24
+ }
25
+ async chat(req) {
26
+ const started = Date.now();
27
+ const data = await this.request(`${this.baseUrl}/api/chat`, {
28
+ method: 'POST', headers: { 'content-type': 'application/json' }, body: this.body({ ...req, stream: false }), signal: req.signal,
29
+ });
30
+ return {
31
+ text: data.message?.content || '',
32
+ finishReason: data.done_reason || 'stop',
33
+ usage: { inputTokens: data.prompt_eval_count ?? 0, outputTokens: data.eval_count ?? 0 },
34
+ latencyMs: Date.now() - started,
35
+ model: data.model || req.model,
36
+ };
37
+ }
38
+ /** Ollama streams newline-delimited JSON rather than SSE. */
39
+ async *stream(req) {
40
+ const res = await this.request(`${this.baseUrl}/api/chat`, {
41
+ method: 'POST', headers: { 'content-type': 'application/json' }, body: this.body({ ...req, stream: true }), signal: req.signal, stream: true,
42
+ });
43
+ const reader = res.body.getReader();
44
+ const decoder = new TextDecoder();
45
+ let buffer = '', out = '', usage = null, finish = 'stop';
46
+ while (true) {
47
+ const { done, value } = await reader.read();
48
+ if (done) break;
49
+ buffer += decoder.decode(value, { stream: true });
50
+ let i;
51
+ while ((i = buffer.indexOf('\n')) !== -1) {
52
+ const line = buffer.slice(0, i).trim();
53
+ buffer = buffer.slice(i + 1);
54
+ if (!line) continue;
55
+ let evt; try { evt = JSON.parse(line); } catch { continue; }
56
+ const text = evt.message?.content;
57
+ if (text) { out += text; yield { type: 'delta', text }; }
58
+ if (evt.done) { finish = evt.done_reason || 'stop'; usage = { inputTokens: evt.prompt_eval_count ?? 0, outputTokens: evt.eval_count ?? 0 }; }
59
+ }
60
+ }
61
+ yield { type: 'usage', usage: usage || { inputTokens: 0, outputTokens: estimateTokens(out), estimated: true } };
62
+ yield { type: 'done', finishReason: finish };
63
+ }
64
+ }
packages/providers/src/openai.mjs ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { Provider, estimateTokens } from './provider.mjs';
2
+
3
+ /** OpenAI-compatible Chat Completions. Also the base for OpenRouter and any drop-in clone. */
4
+ export class OpenAIProvider extends Provider {
5
+ constructor(meta = {}) {
6
+ super({ slug: 'openai', name: 'OpenAI', kind: 'cloud', baseUrl: 'https://api.openai.com/v1', ...meta });
7
+ }
8
+ headers(credential) {
9
+ return { authorization: `Bearer ${credential}`, 'content-type': 'application/json', ...(this.extraHeaders || {}) };
10
+ }
11
+ body({ model, messages, system, temperature, maxTokens, stream = false }) {
12
+ const msgs = system ? [{ role: 'system', content: system }, ...messages] : messages;
13
+ return { model, messages: msgs, temperature, max_tokens: maxTokens, stream, ...(stream ? { stream_options: { include_usage: true } } : {}) };
14
+ }
15
+ async authenticate(credential) {
16
+ await this.listModels(credential);
17
+ return { ok: true, detail: 'Key accepted.' };
18
+ }
19
+ async listModels(credential) {
20
+ const data = await this.request(`${this.baseUrl}/models`, { headers: this.headers(credential), timeoutMs: 15000 });
21
+ return (data.data || []).map(m => ({ slug: m.id, displayName: m.id, family: (m.id.split('-')[0] || '').toUpperCase() }));
22
+ }
23
+ async chat(req) {
24
+ const started = Date.now();
25
+ const data = await this.request(`${this.baseUrl}/chat/completions`, {
26
+ method: 'POST', headers: this.headers(req.credential), body: this.body(req), signal: req.signal,
27
+ });
28
+ const choice = data.choices?.[0] || {};
29
+ return {
30
+ text: choice.message?.content || '',
31
+ finishReason: choice.finish_reason || 'stop',
32
+ usage: { inputTokens: data.usage?.prompt_tokens ?? 0, outputTokens: data.usage?.completion_tokens ?? 0, estimated: !data.usage },
33
+ latencyMs: Date.now() - started,
34
+ model: data.model || req.model,
35
+ };
36
+ }
37
+ async *stream(req) {
38
+ const res = await this.request(`${this.baseUrl}/chat/completions`, {
39
+ method: 'POST', headers: this.headers(req.credential), body: this.body({ ...req, stream: true }), signal: req.signal, stream: true,
40
+ });
41
+ let usage = null, finish = 'stop', out = '';
42
+ for await (const evt of this.readSse(res)) {
43
+ if (evt.usage) usage = { inputTokens: evt.usage.prompt_tokens ?? 0, outputTokens: evt.usage.completion_tokens ?? 0 };
44
+ const d = evt.choices?.[0];
45
+ if (d?.finish_reason) finish = d.finish_reason;
46
+ const text = d?.delta?.content;
47
+ if (text) { out += text; yield { type: 'delta', text }; }
48
+ }
49
+ yield { type: 'usage', usage: usage || { inputTokens: estimateTokens(JSON.stringify(req.messages)), outputTokens: estimateTokens(out), estimated: true } };
50
+ yield { type: 'done', finishReason: finish };
51
+ }
52
+ async embeddings({ credential, model, input }) {
53
+ const data = await this.request(`${this.baseUrl}/embeddings`, {
54
+ method: 'POST', headers: this.headers(credential), body: { model, input },
55
+ });
56
+ return { vectors: (data.data || []).map(d => d.embedding), usage: { inputTokens: data.usage?.prompt_tokens ?? 0, outputTokens: 0 } };
57
+ }
58
+ }
59
+
60
+ export class OpenRouterProvider extends OpenAIProvider {
61
+ constructor() {
62
+ super({ slug: 'openrouter', name: 'OpenRouter', baseUrl: 'https://openrouter.ai/api/v1' });
63
+ this.extraHeaders = { 'http-referer': 'https://mona.expert', 'x-title': 'Mona.Expert' };
64
+ }
65
+ }
packages/providers/src/provider.mjs ADDED
@@ -0,0 +1,122 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { providerError, unavailable } from '@mona/core';
2
+
3
+ /**
4
+ * Provider contract.
5
+ *
6
+ * The gateway knows only this interface. Adding Mistral, Bedrock or a private
7
+ * enterprise endpoint means writing one adapter file and one registry line —
8
+ * no routing, auth or usage code changes.
9
+ *
10
+ * authenticate(credential) -> { ok, detail }
11
+ * listModels(credential) -> ModelDescriptor[]
12
+ * chat(request) -> ChatResult
13
+ * stream(request) -> AsyncIterable<StreamChunk>
14
+ * embeddings(request) -> { vectors, usage }
15
+ * healthCheck(credential) -> { status, latencyMs }
16
+ *
17
+ * StreamChunk: { type: 'delta'|'usage'|'done'|'error', text?, usage?, finishReason?, code?, message? }
18
+ */
19
+ export class Provider {
20
+ /** @param {{slug:string,name:string,kind:'cloud'|'local'|'simulated',baseUrl?:string,requiresCredential?:boolean,timeoutMs?:number}} meta */
21
+ constructor(meta) {
22
+ this.slug = meta.slug;
23
+ this.name = meta.name;
24
+ this.kind = meta.kind || 'cloud';
25
+ this.baseUrl = meta.baseUrl || '';
26
+ this.requiresCredential = meta.requiresCredential !== false;
27
+ this.timeoutMs = meta.timeoutMs || 120000;
28
+ }
29
+ async authenticate() { throw new Error(`${this.slug}: authenticate() not implemented`); }
30
+ async listModels() { throw new Error(`${this.slug}: listModels() not implemented`); }
31
+ async chat() { throw new Error(`${this.slug}: chat() not implemented`); }
32
+ async *stream() { throw new Error(`${this.slug}: stream() not implemented`); }
33
+ async embeddings() { throw providerError(`${this.name} does not offer embeddings.`); }
34
+ async healthCheck(credential) {
35
+ const started = Date.now();
36
+ try { await this.listModels(credential); return { status: 'operational', latencyMs: Date.now() - started }; }
37
+ catch (e) { return { status: 'degraded', latencyMs: Date.now() - started, detail: e.message }; }
38
+ }
39
+
40
+ /** Shared fetch with timeout, no retries on non-idempotent calls, no secret logging. */
41
+ async request(url, { method = 'GET', headers = {}, body = null, signal = null, timeoutMs = this.timeoutMs, stream = false } = {}) {
42
+ const controller = new AbortController();
43
+ const timer = setTimeout(() => controller.abort(new Error('timeout')), timeoutMs);
44
+ const onAbort = () => controller.abort(new Error('client aborted'));
45
+ signal?.addEventListener('abort', onAbort, { once: true });
46
+ try {
47
+ const res = await fetch(url, {
48
+ method,
49
+ headers: { 'user-agent': 'Mona.Expert-Gateway/1.0', ...headers },
50
+ body: body == null ? undefined : typeof body === 'string' ? body : JSON.stringify(body),
51
+ signal: controller.signal,
52
+ });
53
+ if (!res.ok) {
54
+ const text = await res.text().catch(() => '');
55
+ throw this.mapError(res.status, text);
56
+ }
57
+ return stream ? res : await res.json();
58
+ } catch (e) {
59
+ if (e?.status) throw e;
60
+ if (String(e?.message).includes('timeout')) throw providerError(`${this.name} did not respond in time.`);
61
+ if (String(e?.message).includes('aborted')) { const err = providerError('The request was cancelled.'); err.aborted = true; throw err; }
62
+ throw unavailable(`${this.name} could not be reached.`, { internal: String(e?.message || e) });
63
+ } finally {
64
+ clearTimeout(timer);
65
+ signal?.removeEventListener('abort', onAbort);
66
+ }
67
+ }
68
+
69
+ /** Upstream errors are translated, never forwarded verbatim — bodies can echo keys. */
70
+ mapError(status, rawBody) {
71
+ let detail = '';
72
+ try { const j = JSON.parse(rawBody); detail = j?.error?.message || j?.message || ''; } catch { detail = ''; }
73
+ const safe = detail.replace(/(sk-[A-Za-z0-9_-]{6,}|Bearer\s+\S+)/g, '[redacted]').slice(0, 240);
74
+ if (status === 401 || status === 403) return providerError(`${this.name} rejected the stored credential. Check the API key in Security → Provider keys.`);
75
+ if (status === 404) return providerError(`${this.name} does not recognise that model.`);
76
+ if (status === 429) { const e = providerError(`${this.name} is rate limiting this key. Try again shortly.`); e.status = 429; e.code = 'PROVIDER_RATE_LIMITED'; return e; }
77
+ if (status >= 500) return unavailable(`${this.name} is currently unavailable.`, { internal: safe });
78
+ return providerError(`${this.name} rejected the request${safe ? `: ${safe}` : '.'}`);
79
+ }
80
+
81
+ /** Line-oriented SSE reader shared by every streaming adapter. */
82
+ async *readSse(response) {
83
+ const reader = response.body.getReader();
84
+ const decoder = new TextDecoder();
85
+ let buffer = '';
86
+ try {
87
+ while (true) {
88
+ const { done, value } = await reader.read();
89
+ if (done) break;
90
+ buffer += decoder.decode(value, { stream: true });
91
+ let idx;
92
+ while ((idx = buffer.indexOf('\n')) !== -1) {
93
+ const line = buffer.slice(0, idx).replace(/\r$/, '');
94
+ buffer = buffer.slice(idx + 1);
95
+ if (!line || line.startsWith(':')) continue;
96
+ if (line.startsWith('data:')) {
97
+ const data = line.slice(5).trim();
98
+ if (data === '[DONE]') return;
99
+ try { yield JSON.parse(data); } catch { /* skip non-JSON keep-alives */ }
100
+ } else if (line.startsWith('event:')) {
101
+ yield { __event: line.slice(6).trim() };
102
+ }
103
+ }
104
+ }
105
+ } finally { try { await reader.cancel(); } catch {} }
106
+ }
107
+ }
108
+
109
+ export class ProviderRegistry {
110
+ constructor() { this.map = new Map(); }
111
+ register(provider) { this.map.set(provider.slug, provider); return this; }
112
+ get(slug) {
113
+ const p = this.map.get(slug);
114
+ if (!p) throw providerError(`No adapter is registered for "${slug}".`);
115
+ return p;
116
+ }
117
+ has(slug) { return this.map.has(slug); }
118
+ list() { return [...this.map.values()]; }
119
+ }
120
+
121
+ /** Rough token estimate used only when a provider omits usage. Marked as estimated. */
122
+ export const estimateTokens = (text) => Math.max(1, Math.ceil(String(text || '').length / 3.8));
packages/providers/src/router.mjs ADDED
@@ -0,0 +1,167 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { providerError, forbidden, notFound, dayKey } from '@mona/core';
2
+
3
+ /**
4
+ * Routing engine.
5
+ *
6
+ * This is the only place in the platform where a provider credential is decrypted,
7
+ * and it is decrypted into a local variable that is passed to one adapter call and
8
+ * then dropped. It is never attached to a request context, never returned, never
9
+ * logged, and never crosses a serialisation boundary.
10
+ */
11
+ export class RoutingEngine {
12
+ constructor({ registry, repos, keyring, config, log }) {
13
+ this.registry = registry;
14
+ this.repos = repos;
15
+ this.keyring = keyring;
16
+ this.config = config;
17
+ this.log = log;
18
+ }
19
+
20
+ /** Resolve an agent's configured provider + model, honouring its routing policy. */
21
+ async resolve(agent, { modelOverride = null } = {}) {
22
+ const model = await this.repos.models.byId(modelOverride || agent.model_id);
23
+ if (!model) throw notFound('That model is no longer available.');
24
+ if (!model.enabled) throw providerError('That model has been disabled by an administrator.');
25
+
26
+ const provider = await this.repos.providers.byId(model.provider_id);
27
+ if (!provider) throw notFound('The provider for that model is no longer configured.');
28
+ if (!provider.enabled) throw providerError(`${provider.name} is disabled on this platform.`);
29
+ if (!this.registry.has(provider.slug)) throw providerError(`No adapter is loaded for ${provider.name}.`);
30
+
31
+ // An override must still be a model the agent is allowed to use.
32
+ if (modelOverride && modelOverride !== agent.model_id) {
33
+ const allowed = await this.repos.db.get(
34
+ 'SELECT 1 AS ok FROM agent_models WHERE agent_id = ? AND model_id = ?', [agent.id, modelOverride]);
35
+ if (!allowed) throw forbidden('This agent is not permitted to use that model.');
36
+ }
37
+ return { provider, model, adapter: this.registry.get(provider.slug) };
38
+ }
39
+
40
+ /**
41
+ * Fetch and decrypt the credential for one call.
42
+ * @returns {Promise<{secret:string|null, credentialId:string|null}>}
43
+ */
44
+ async #credential(userId, provider) {
45
+ const adapter = this.registry.get(provider.slug);
46
+ if (!adapter.requiresCredential || !provider.requires_credential) return { secret: null, credentialId: null };
47
+
48
+ const row = await this.repos.providerCredentials.activeSecretFor(userId, provider.id);
49
+ if (!row) {
50
+ throw forbidden(`No active ${provider.name} key is stored for this account. Add one under Security → Provider keys.`);
51
+ }
52
+ const secret = this.keyring.decrypt(row.secret_enc, { purpose: 'provider_credential', aad: `${userId}:${provider.id}` });
53
+ return { secret, credentialId: row.id };
54
+ }
55
+
56
+ /** Cost in EUR from the model's per-million-token prices. Zero when unpriced. */
57
+ static cost(model, usage) {
58
+ const inPrice = Number(model.input_price_per_mtok || 0);
59
+ const outPrice = Number(model.output_price_per_mtok || 0);
60
+ return ((usage.inputTokens || 0) * inPrice + (usage.outputTokens || 0) * outPrice) / 1e6;
61
+ }
62
+
63
+ #buildRequest({ agent, model, messages, secret, signal, maxTokensOverride }) {
64
+ return {
65
+ model: model.slug,
66
+ messages,
67
+ system: agent.system_prompt || null,
68
+ temperature: Number(agent.temperature),
69
+ maxTokens: Math.min(maxTokensOverride || agent.max_tokens, model.max_output || agent.max_tokens),
70
+ credential: secret,
71
+ agentName: agent.name,
72
+ signal,
73
+ };
74
+ }
75
+
76
+ async chat({ agent, userId, messages, modelOverride = null, maxTokensOverride = null, signal = null }) {
77
+ const { provider, model, adapter } = await this.resolve(agent, { modelOverride });
78
+ const { secret, credentialId } = await this.#credential(userId, provider);
79
+ const started = Date.now();
80
+ try {
81
+ const result = await adapter.chat(this.#buildRequest({ agent, model, messages, secret, signal, maxTokensOverride }));
82
+ if (credentialId) await this.repos.providerCredentials.markUsed(credentialId);
83
+ return { ...result, provider, model, cost: RoutingEngine.cost(model, result.usage), latencyMs: result.latencyMs ?? Date.now() - started };
84
+ } catch (err) {
85
+ await this.repos.providers.recordHealth(provider.id, err.status >= 500 ? 'degraded' : 'operational', Date.now() - started);
86
+ throw err;
87
+ }
88
+ }
89
+
90
+ /**
91
+ * Streaming call. Yields adapter chunks unchanged plus a final `meta` chunk carrying
92
+ * the resolved provider, model, usage and cost so the caller can persist one record.
93
+ */
94
+ async *stream({ agent, userId, messages, modelOverride = null, maxTokensOverride = null, signal = null }) {
95
+ const { provider, model, adapter } = await this.resolve(agent, { modelOverride });
96
+ const { secret, credentialId } = await this.#credential(userId, provider);
97
+ const started = Date.now();
98
+ let usage = { inputTokens: 0, outputTokens: 0 };
99
+ let finishReason = 'stop';
100
+ let firstTokenAt = null;
101
+
102
+ try {
103
+ for await (const chunk of adapter.stream(this.#buildRequest({ agent, model, messages, secret, signal, maxTokensOverride }))) {
104
+ if (chunk.type === 'delta' && firstTokenAt === null) firstTokenAt = Date.now();
105
+ if (chunk.type === 'usage') { usage = chunk.usage; continue; }
106
+ if (chunk.type === 'done') { finishReason = chunk.finishReason || finishReason; continue; }
107
+ yield chunk;
108
+ }
109
+ if (credentialId) await this.repos.providerCredentials.markUsed(credentialId);
110
+ yield {
111
+ type: 'meta',
112
+ provider: provider.slug,
113
+ providerName: provider.name,
114
+ model: model.slug,
115
+ modelId: model.id,
116
+ simulated: provider.kind === 'simulated',
117
+ usage,
118
+ finishReason,
119
+ latencyMs: Date.now() - started,
120
+ firstTokenMs: firstTokenAt ? firstTokenAt - started : null,
121
+ cost: RoutingEngine.cost(model, usage),
122
+ };
123
+ } catch (err) {
124
+ await this.repos.providers.recordHealth(provider.id, err.status >= 500 ? 'degraded' : 'operational', Date.now() - started);
125
+ throw err;
126
+ }
127
+ }
128
+
129
+ /** Verify a user-supplied key against the live provider before it is stored. */
130
+ async verifyCredential(providerSlug, secret) {
131
+ const adapter = this.registry.get(providerSlug);
132
+ if (!adapter.requiresCredential) return { ok: true, detail: `${adapter.name} does not use a key.` };
133
+ try { return await adapter.authenticate(secret); }
134
+ catch (e) { return { ok: false, detail: e.message }; }
135
+ }
136
+
137
+ async healthAll() {
138
+ const rows = await this.repos.providers.all();
139
+ const out = [];
140
+ for (const p of rows) {
141
+ if (!this.registry.has(p.slug)) { out.push({ slug: p.slug, status: 'not_configured', latencyMs: null }); continue; }
142
+ const adapter = this.registry.get(p.slug);
143
+ if (adapter.requiresCredential) { out.push({ slug: p.slug, status: p.status || 'unknown', latencyMs: p.latency_ms }); continue; }
144
+ const h = await adapter.healthCheck();
145
+ await this.repos.providers.recordHealth(p.id, h.status, h.latencyMs);
146
+ out.push({ slug: p.slug, ...h });
147
+ }
148
+ return out;
149
+ }
150
+
151
+ /** One place to write everything a completed call produces. */
152
+ async record({ requestId, userId, agentId, deviceId, route, status, latencyMs, usage, providerSlug, modelSlug, errorCode = null, ip = null, userAgent = null, cost = 0 }) {
153
+ const tokens = (usage?.inputTokens || 0) + (usage?.outputTokens || 0);
154
+ await this.repos.apiRequests.record({
155
+ id: requestId, user_id: userId, agent_id: agentId, device_id: deviceId, method: 'POST', route,
156
+ status, latency_ms: latencyMs, provider_slug: providerSlug, model_slug: modelSlug,
157
+ input_tokens: usage?.inputTokens || 0, output_tokens: usage?.outputTokens || 0,
158
+ error_code: errorCode, ip, user_agent: (userAgent || '').slice(0, 200),
159
+ });
160
+ await this.repos.usage.roll({
161
+ userId, agentId, day: dayKey(), providerSlug, modelSlug,
162
+ inputTokens: usage?.inputTokens || 0, outputTokens: usage?.outputTokens || 0,
163
+ errors: status >= 400 ? 1 : 0, latencyMs, cost,
164
+ });
165
+ if (agentId) await this.repos.agents.recordTraffic(agentId, { tokens, errors: status >= 400 ? 1 : 0, latencyMs });
166
+ }
167
+ }
packages/providers/src/simulated.mjs ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { Provider, estimateTokens } from './provider.mjs';
2
+
3
+ /**
4
+ * Simulated provider — development and CI only.
5
+ *
6
+ * This is NOT a language model and never claims to be one. It exercises the full
7
+ * gateway path (auth → policy → routing → streaming → usage → audit) without a
8
+ * network or a paid key, so the platform can be tested end to end offline.
9
+ *
10
+ * Every response it produces is prefixed with a simulation banner, its models are
11
+ * named "Simulated …", and `SIMULATED_PROVIDER_ENABLED=true` is refused at boot in
12
+ * production (see assertProductionReady in @mona/core).
13
+ */
14
+ const BANNER = '**Simulated response** — no language model was called. Routing, authentication, streaming and usage accounting are real.';
15
+
16
+ const MODELS = [
17
+ { slug: 'mona-sim-fast', displayName: 'Simulated · Fast', family: 'Simulated', contextWindow: 32000, maxOutput: 4096, msPerToken: 6 },
18
+ { slug: 'mona-sim-long', displayName: 'Simulated · Long context', family: 'Simulated', contextWindow: 200000, maxOutput: 8192, msPerToken: 14 },
19
+ { slug: 'mona-sim-local', displayName: 'Simulated · On-device', family: 'Simulated', contextWindow: 8000, maxOutput: 2048, msPerToken: 22 },
20
+ ];
21
+
22
+ const sleep = (ms) => new Promise(r => setTimeout(r, ms));
23
+
24
+ /** Deterministic per-prompt jitter so repeated runs are reproducible in CI. */
25
+ function seedOf(text) {
26
+ let h = 2166136261;
27
+ for (let i = 0; i < text.length; i++) { h ^= text.charCodeAt(i); h = Math.imul(h, 16777619); }
28
+ return (h >>> 0) / 4294967295;
29
+ }
30
+
31
+ function compose({ messages, system, model, agentName }) {
32
+ const last = [...messages].reverse().find(m => m.role === 'user')?.content || '';
33
+ const turn = messages.filter(m => m.role === 'user').length;
34
+ const words = last.trim().split(/\s+/).filter(Boolean);
35
+ const seed = seedOf(last);
36
+ const lines = [BANNER, ''];
37
+
38
+ if (/```|\bfunction\b|\bclass\b|\bdef \b|\bimport \b|=>/.test(last) || /\bcode\b|\brefactor\b|\bbug\b/i.test(last)) {
39
+ lines.push(`Reading the ${words.length}-word request as a code question. A real model would answer here; the simulator returns a structured stand-in so Markdown, fenced blocks and syntax highlighting are exercised in the client.`, '');
40
+ lines.push('```js');
41
+ lines.push('// Echo of the routing decision that produced this response');
42
+ lines.push(`const route = {`);
43
+ lines.push(` agent: ${JSON.stringify(agentName || 'unnamed')},`);
44
+ lines.push(` model: ${JSON.stringify(model)},`);
45
+ lines.push(` provider: 'simulated',`);
46
+ lines.push(` systemPrompt: ${system ? `${system.length} chars` : 'none'},`);
47
+ lines.push(` contextMessages: ${messages.length},`);
48
+ lines.push('};');
49
+ lines.push('```', '');
50
+ lines.push('Set a provider key under **Security → Provider keys** and switch the agent to a live model to get a real answer.');
51
+ } else if (/^\s*(hi|hello|hey|good (morning|evening))/i.test(last)) {
52
+ lines.push(`Connected. This request travelled device → \`agent.mona.expert\` → policy check → provider adapter, and back over SSE.`, '');
53
+ lines.push(`| Stage | Result |`, `| --- | --- |`, `| Agent credential | verified |`, `| Scope \`chat\` | granted |`, `| Provider | simulated |`, `| Model | \`${model}\` |`, '');
54
+ lines.push('Ask something else, or run `/help` to see the command set.');
55
+ } else if (/\?\s*$/.test(last.trim())) {
56
+ lines.push(`That question reached turn ${turn} of this conversation with ${messages.length} messages in context.`, '');
57
+ lines.push(`A live provider would answer it. The simulator confirms instead that:`, '');
58
+ lines.push(`- the agent's credential passed verification`, `- the \`chat\` scope was granted`, `- \`${model}\` was selected by the routing policy`, `- usage for this request will appear on the dashboard within a second`);
59
+ } else {
60
+ lines.push(`Received ${words.length} words and ${last.length} characters across ${messages.length} context messages.`, '');
61
+ lines.push(`Echoing the opening for verification: *${words.slice(0, 12).join(' ')}${words.length > 12 ? '…' : ''}*`, '');
62
+ lines.push(`Latency for this response is synthetic (seed \`${seed.toFixed(4)}\`) so streaming behaviour looks realistic without a network call.`);
63
+ }
64
+ return lines.join('\n');
65
+ }
66
+
67
+ export class SimulatedProvider extends Provider {
68
+ constructor() {
69
+ super({ slug: 'simulated', name: 'Mona Simulator', kind: 'simulated', requiresCredential: false });
70
+ }
71
+ async authenticate() { return { ok: true, detail: 'Simulator needs no credential.' }; }
72
+ async listModels() { return MODELS.map(({ msPerToken, ...m }) => m); }
73
+ async healthCheck() { return { status: 'operational', latencyMs: 1 }; }
74
+
75
+ async chat(req) {
76
+ const started = Date.now();
77
+ const text = compose(req);
78
+ const spec = MODELS.find(m => m.slug === req.model) || MODELS[0];
79
+ await sleep(120 + Math.floor(seedOf(text) * 260));
80
+ return {
81
+ text,
82
+ finishReason: 'stop',
83
+ usage: { inputTokens: estimateTokens(JSON.stringify(req.messages) + (req.system || '')), outputTokens: estimateTokens(text), estimated: true },
84
+ latencyMs: Date.now() - started,
85
+ model: spec.slug,
86
+ simulated: true,
87
+ };
88
+ }
89
+
90
+ async *stream(req) {
91
+ const text = compose(req);
92
+ const spec = MODELS.find(m => m.slug === req.model) || MODELS[0];
93
+ await sleep(90 + Math.floor(seedOf(text) * 180)); // time-to-first-token
94
+ const chunks = text.match(/\s*\S+|\s+/g) || [text];
95
+ for (const chunk of chunks) {
96
+ if (req.signal?.aborted) { yield { type: 'done', finishReason: 'stopped' }; return; }
97
+ await sleep(spec.msPerToken);
98
+ yield { type: 'delta', text: chunk };
99
+ }
100
+ yield { type: 'usage', usage: { inputTokens: estimateTokens(JSON.stringify(req.messages) + (req.system || '')), outputTokens: estimateTokens(text), estimated: true } };
101
+ yield { type: 'done', finishReason: 'stop' };
102
+ }
103
+
104
+ async embeddings({ input }) {
105
+ const items = Array.isArray(input) ? input : [input];
106
+ return {
107
+ vectors: items.map(text => {
108
+ const s = seedOf(String(text));
109
+ return Array.from({ length: 32 }, (_, i) => Math.sin((i + 1) * s * Math.PI) / 2);
110
+ }),
111
+ usage: { inputTokens: items.reduce((n, t) => n + estimateTokens(t), 0), outputTokens: 0 },
112
+ };
113
+ }
114
+ }
115
+
116
+ export const SIMULATED_MODELS = MODELS;