@serveryyswys/node.operit 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BUILTINS.json +150 -0
- package/LICENSE +201 -674
- package/NOTICE +17 -0
- package/README.md +10 -0
- package/dist/console.d.ts +60 -0
- package/dist/console.js +193 -0
- package/dist/diagnostics_channel.d.ts +36 -0
- package/dist/diagnostics_channel.js +76 -0
- package/dist/fs/promises.d.ts +2 -1
- package/dist/fs/promises.js +1 -0
- package/dist/index.d.ts +424 -25
- package/dist/index.js +38 -2
- package/dist/lib/bridge.js +3 -1
- package/dist/lib/console-types.d.ts +12 -0
- package/dist/lib/console-types.js +2 -0
- package/dist/lib/diagnostics-channel-types.d.ts +7 -0
- package/dist/lib/diagnostics-channel-types.js +2 -0
- package/dist/lib/stream-consumers-types.d.ts +4 -0
- package/dist/lib/stream-consumers-types.js +2 -0
- package/dist/lib/util-types.d.ts +13 -0
- package/dist/lib/util-types.js +2 -0
- package/dist/lib/v8-types.d.ts +30 -0
- package/dist/lib/v8-types.js +2 -0
- package/dist/module.js +30 -0
- package/dist/punycode.d.ts +22 -0
- package/dist/punycode.js +53 -0
- package/dist/stream/consumers.d.ts +24 -0
- package/dist/stream/consumers.js +75 -0
- package/dist/sys.d.ts +8 -0
- package/dist/sys.js +9 -0
- package/dist/util/types.d.ts +16 -0
- package/dist/util/types.js +9 -0
- package/dist/util.d.ts +1 -12
- package/dist/util.js +12 -0
- package/dist/v8.d.ts +25 -0
- package/dist/v8.js +127 -0
- package/package.json +14 -12
package/BUILTINS.json
CHANGED
|
@@ -191,6 +191,156 @@
|
|
|
191
191
|
"subpath": "tty",
|
|
192
192
|
"status": "partial",
|
|
193
193
|
"note": "isatty() 恒为 false(沙箱里没有终端,这正是 supports-color / debug 这类包需要知道的答案)。ReadStream / WriteStream 需要真实终端,构造时显式抛 ONJ_UNSUPPORTED,不给「能 new 但不能用」的空壳。"
|
|
194
|
+
},
|
|
195
|
+
"dns/promises": {
|
|
196
|
+
"subpath": "dns/promises",
|
|
197
|
+
"status": "partial",
|
|
198
|
+
"note": "dns 的 promises 形态,与 require('dns').promises 是同一个对象。差异与 dns 完全一致:lookup 一族可用,resolve 一族与 reverse 显式抛 ONJ_UNSUPPORTED。"
|
|
199
|
+
},
|
|
200
|
+
"console": {
|
|
201
|
+
"subpath": "console",
|
|
202
|
+
"status": "partial",
|
|
203
|
+
"note": "完整的 Node console API(Console 类 + log/info/warn/error/debug/assert/dir/count/countReset/time/timeEnd/timeLog/trace/table/group/groupEnd/clear/profile/profileEnd/timeStamp)。sandbox 的 prelude 只提供 log/info/warn/error 且用 arguments.join(' '),本模块在其上补齐并改用 util.format(所以 '%s' 行为与 Node 一致)。差异:不指定输出流时写 prelude console(Node 是 process.stdout/stderr);clear/profile/profileEnd/timeStamp 与 Node 在非 TTY 下一样是空操作;table 只覆盖常用形态。"
|
|
204
|
+
},
|
|
205
|
+
"util/types": {
|
|
206
|
+
"subpath": "util/types",
|
|
207
|
+
"status": "ready",
|
|
208
|
+
"note": "与 require('util').types 同一个对象。高频依赖。"
|
|
209
|
+
},
|
|
210
|
+
"sys": {
|
|
211
|
+
"subpath": "sys",
|
|
212
|
+
"status": "ready",
|
|
213
|
+
"note": "已废弃的别名,Node 里 require('sys') === require('util'),这里保持同一对象。"
|
|
214
|
+
},
|
|
215
|
+
"punycode": {
|
|
216
|
+
"subpath": "punycode",
|
|
217
|
+
"status": "ready",
|
|
218
|
+
"note": "已废弃但仍被不少包直接 require。实现复用 lib/punycode.ts。version 报 '2.1.1';ucs2.decode 返回的是 UTF-16 码元序列,与 Node 一致。"
|
|
219
|
+
},
|
|
220
|
+
"diagnostics_channel": {
|
|
221
|
+
"subpath": "diagnostics_channel",
|
|
222
|
+
"status": "partial",
|
|
223
|
+
"note": "channel / hasSubscribers / subscribe / unsubscribe / Channel 全部可用(纯发布订阅,不依赖平台)。差异:Channel 的 bindStore / unbindStore / runStores 依赖 AsyncLocalStorage(需要 async_hooks),QuickJS 运行时不提供异步钩子,这三个方法显式抛 ONJ_UNSUPPORTED;tracingChannel 未实现,同样显式拒绝。"
|
|
224
|
+
},
|
|
225
|
+
"stream/consumers": {
|
|
226
|
+
"subpath": "stream/consumers",
|
|
227
|
+
"status": "partial",
|
|
228
|
+
"note": "buffer / text / json / arrayBuffer 可用。差异:blob 显式抛 ONJ_UNSUPPORTED —— 运行时不提供 Blob,与其返回形状相似但类型不对的对象不如明确拒绝;不做 Node 内部的 Readable 品牌校验,只要求对象有 on()。"
|
|
229
|
+
},
|
|
230
|
+
"v8": {
|
|
231
|
+
"subpath": "v8",
|
|
232
|
+
"status": "partial",
|
|
233
|
+
"note": "getHeapStatistics / getHeapSpaceStatistics / getHeapCodeStatistics 可用,但取的是 **JVM 堆**而不是 V8 堆(与 os.totalmem / freemem 的近似同类);getHeapSpaceStatistics 返回空数组(QuickJS 不暴露分空间统计)。serialize / deserialize / setFlagsFromString / cachedDataVersionTag / writeHeapSnapshot / takeCoverage / stopCoverage 一律显式抛 ONJ_UNSUPPORTED:它们要么依赖 V8 的二进制格式,要么是 V8 专有能力。"
|
|
234
|
+
},
|
|
235
|
+
"dgram": {
|
|
236
|
+
"subpath": "dgram",
|
|
237
|
+
"status": "unsupported",
|
|
238
|
+
"note": "刻意不提供,理由与 net 相同:UDP 裸 socket 会让插件绕过 Operit 的工具审批模型(网络访问是工具能力,走用户审批)。需要网络请用 toolCall / 内建 axios。"
|
|
239
|
+
},
|
|
240
|
+
"tls": {
|
|
241
|
+
"subpath": "tls",
|
|
242
|
+
"status": "unsupported",
|
|
243
|
+
"note": "建在 net 之上,net 不提供所以它也做不了。https 已经走 toolCall('http_request'),TLS 由宿主处理。"
|
|
244
|
+
},
|
|
245
|
+
"http2": {
|
|
246
|
+
"subpath": "http2",
|
|
247
|
+
"status": "unsupported",
|
|
248
|
+
"note": "建在 net 之上(HTTP/2 需要长连接与帧控制),net 不提供。http/https 客户端走 toolCall('http_request')。"
|
|
249
|
+
},
|
|
250
|
+
"stream/web": {
|
|
251
|
+
"subpath": "stream/web",
|
|
252
|
+
"status": "unsupported",
|
|
253
|
+
"note": "需要 WHATWG Streams(ReadableStream / WritableStream / TransformStream),Android 的 QuickJS 运行时不提供这些内建。本库实现了 Node 的 stream 模块(含 promises 与 consumers),需要流能力请用 stream。"
|
|
254
|
+
},
|
|
255
|
+
"domain": {
|
|
256
|
+
"subpath": "domain",
|
|
257
|
+
"status": "unsupported",
|
|
258
|
+
"note": "已废弃模块,且它依赖异步上下文追踪(与 async_hooks 同源),运行时不提供。"
|
|
259
|
+
},
|
|
260
|
+
"trace_events": {
|
|
261
|
+
"subpath": "trace_events",
|
|
262
|
+
"status": "unsupported",
|
|
263
|
+
"note": "V8 的 tracing 机制,运行时不是 V8。诊断可观测性请用 diagnostics_channel(已实现)。"
|
|
264
|
+
},
|
|
265
|
+
"wasi": {
|
|
266
|
+
"subpath": "wasi",
|
|
267
|
+
"status": "unsupported",
|
|
268
|
+
"note": "需要 WASM 运行时与 WASI 宿主实现,Android 的 QuickJS 运行时不提供。"
|
|
269
|
+
},
|
|
270
|
+
"inspector/promises": {
|
|
271
|
+
"subpath": "inspector/promises",
|
|
272
|
+
"status": "unsupported",
|
|
273
|
+
"note": "inspector 本身就不支持(需要 V8 inspector 协议),其 promises 形态同理。"
|
|
274
|
+
},
|
|
275
|
+
"_http_agent": {
|
|
276
|
+
"subpath": "_http_agent",
|
|
277
|
+
"status": "unsupported",
|
|
278
|
+
"note": "Node 的**内部**模块(下划线开头)。userland 不应 require 它们;确有包这么做的,说明它依赖 Node 内部实现,本运行时无法提供。已实现的是对应的公开模块:http / https(走 toolCall)。"
|
|
279
|
+
},
|
|
280
|
+
"_http_client": {
|
|
281
|
+
"subpath": "_http_client",
|
|
282
|
+
"status": "unsupported",
|
|
283
|
+
"note": "Node 的**内部**模块(下划线开头)。userland 不应 require 它们;确有包这么做的,说明它依赖 Node 内部实现,本运行时无法提供。已实现的是对应的公开模块:http / https(走 toolCall)。"
|
|
284
|
+
},
|
|
285
|
+
"_http_common": {
|
|
286
|
+
"subpath": "_http_common",
|
|
287
|
+
"status": "unsupported",
|
|
288
|
+
"note": "Node 的**内部**模块(下划线开头)。userland 不应 require 它们;确有包这么做的,说明它依赖 Node 内部实现,本运行时无法提供。已实现的是对应的公开模块:http / https(走 toolCall)。"
|
|
289
|
+
},
|
|
290
|
+
"_http_incoming": {
|
|
291
|
+
"subpath": "_http_incoming",
|
|
292
|
+
"status": "unsupported",
|
|
293
|
+
"note": "Node 的**内部**模块(下划线开头)。userland 不应 require 它们;确有包这么做的,说明它依赖 Node 内部实现,本运行时无法提供。已实现的是对应的公开模块:http / https(走 toolCall)。"
|
|
294
|
+
},
|
|
295
|
+
"_http_outgoing": {
|
|
296
|
+
"subpath": "_http_outgoing",
|
|
297
|
+
"status": "unsupported",
|
|
298
|
+
"note": "Node 的**内部**模块(下划线开头)。userland 不应 require 它们;确有包这么做的,说明它依赖 Node 内部实现,本运行时无法提供。已实现的是对应的公开模块:http / https(走 toolCall)。"
|
|
299
|
+
},
|
|
300
|
+
"_http_server": {
|
|
301
|
+
"subpath": "_http_server",
|
|
302
|
+
"status": "unsupported",
|
|
303
|
+
"note": "Node 的**内部**模块(下划线开头)。userland 不应 require 它们;确有包这么做的,说明它依赖 Node 内部实现,本运行时无法提供。已实现的是对应的公开模块:http / https(走 toolCall)。"
|
|
304
|
+
},
|
|
305
|
+
"_stream_duplex": {
|
|
306
|
+
"subpath": "_stream_duplex",
|
|
307
|
+
"status": "unsupported",
|
|
308
|
+
"note": "Node 的**内部**模块(下划线开头)。userland 不应 require 它们;确有包这么做的,说明它依赖 Node 内部实现,本运行时无法提供。已实现的是对应的公开模块:stream(含 stream/promises、stream/consumers)。"
|
|
309
|
+
},
|
|
310
|
+
"_stream_passthrough": {
|
|
311
|
+
"subpath": "_stream_passthrough",
|
|
312
|
+
"status": "unsupported",
|
|
313
|
+
"note": "Node 的**内部**模块(下划线开头)。userland 不应 require 它们;确有包这么做的,说明它依赖 Node 内部实现,本运行时无法提供。已实现的是对应的公开模块:stream(含 stream/promises、stream/consumers)。"
|
|
314
|
+
},
|
|
315
|
+
"_stream_readable": {
|
|
316
|
+
"subpath": "_stream_readable",
|
|
317
|
+
"status": "unsupported",
|
|
318
|
+
"note": "Node 的**内部**模块(下划线开头)。userland 不应 require 它们;确有包这么做的,说明它依赖 Node 内部实现,本运行时无法提供。已实现的是对应的公开模块:stream(含 stream/promises、stream/consumers)。"
|
|
319
|
+
},
|
|
320
|
+
"_stream_transform": {
|
|
321
|
+
"subpath": "_stream_transform",
|
|
322
|
+
"status": "unsupported",
|
|
323
|
+
"note": "Node 的**内部**模块(下划线开头)。userland 不应 require 它们;确有包这么做的,说明它依赖 Node 内部实现,本运行时无法提供。已实现的是对应的公开模块:stream(含 stream/promises、stream/consumers)。"
|
|
324
|
+
},
|
|
325
|
+
"_stream_wrap": {
|
|
326
|
+
"subpath": "_stream_wrap",
|
|
327
|
+
"status": "unsupported",
|
|
328
|
+
"note": "Node 的**内部**模块(下划线开头)。userland 不应 require 它们;确有包这么做的,说明它依赖 Node 内部实现,本运行时无法提供。已实现的是对应的公开模块:stream(含 stream/promises、stream/consumers)。"
|
|
329
|
+
},
|
|
330
|
+
"_stream_writable": {
|
|
331
|
+
"subpath": "_stream_writable",
|
|
332
|
+
"status": "unsupported",
|
|
333
|
+
"note": "Node 的**内部**模块(下划线开头)。userland 不应 require 它们;确有包这么做的,说明它依赖 Node 内部实现,本运行时无法提供。已实现的是对应的公开模块:stream(含 stream/promises、stream/consumers)。"
|
|
334
|
+
},
|
|
335
|
+
"_tls_common": {
|
|
336
|
+
"subpath": "_tls_common",
|
|
337
|
+
"status": "unsupported",
|
|
338
|
+
"note": "Node 的**内部**模块(下划线开头)。userland 不应 require 它们;确有包这么做的,说明它依赖 Node 内部实现,本运行时无法提供。已实现的是对应的公开模块:https(走 toolCall)。"
|
|
339
|
+
},
|
|
340
|
+
"_tls_wrap": {
|
|
341
|
+
"subpath": "_tls_wrap",
|
|
342
|
+
"status": "unsupported",
|
|
343
|
+
"note": "Node 的**内部**模块(下划线开头)。userland 不应 require 它们;确有包这么做的,说明它依赖 Node 内部实现,本运行时无法提供。已实现的是对应的公开模块:https(走 toolCall)。"
|
|
194
344
|
}
|
|
195
345
|
},
|
|
196
346
|
"packing": {
|