byterover-cli 2.3.0 → 2.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/dist/oclif/commands/restart.d.ts +34 -50
  2. package/dist/oclif/commands/restart.js +122 -209
  3. package/dist/oclif/hooks/init/block-command-update-npm.d.ts +11 -0
  4. package/dist/oclif/hooks/init/block-command-update-npm.js +15 -0
  5. package/dist/oclif/hooks/init/update-notifier.d.ts +3 -0
  6. package/dist/oclif/hooks/init/update-notifier.js +17 -4
  7. package/dist/oclif/hooks/postrun/restart-after-update.d.ts +22 -0
  8. package/dist/oclif/hooks/postrun/restart-after-update.js +40 -0
  9. package/dist/server/infra/http/openrouter-api-client.js +1 -1
  10. package/node_modules/@campfirein/brv-transport-client/package.json +1 -1
  11. package/node_modules/{socket.io-parser/node_modules/debug → debug}/package.json +7 -3
  12. package/node_modules/{socket.io-parser/node_modules/debug → debug}/src/browser.js +2 -1
  13. package/node_modules/{socket.io-client/node_modules/debug → debug}/src/common.js +57 -39
  14. package/node_modules/socket.io-client/build/cjs/index.d.ts +2 -2
  15. package/node_modules/socket.io-client/build/cjs/socket.js +2 -3
  16. package/node_modules/socket.io-client/build/esm/index.d.ts +2 -2
  17. package/node_modules/socket.io-client/build/esm/package.json +1 -1
  18. package/node_modules/socket.io-client/build/esm/socket.js +1 -3
  19. package/node_modules/socket.io-client/build/esm-debug/index.d.ts +2 -2
  20. package/node_modules/socket.io-client/build/esm-debug/package.json +1 -1
  21. package/node_modules/socket.io-client/build/esm-debug/socket.js +2 -3
  22. package/node_modules/socket.io-client/dist/socket.io.esm.min.js +3 -3
  23. package/node_modules/socket.io-client/dist/socket.io.esm.min.js.map +1 -1
  24. package/node_modules/socket.io-client/dist/socket.io.js +89 -42
  25. package/node_modules/socket.io-client/dist/socket.io.js.map +1 -1
  26. package/node_modules/socket.io-client/dist/socket.io.min.js +3 -3
  27. package/node_modules/socket.io-client/dist/socket.io.min.js.map +1 -1
  28. package/node_modules/socket.io-client/dist/socket.io.msgpack.min.js +3 -3
  29. package/node_modules/socket.io-client/dist/socket.io.msgpack.min.js.map +1 -1
  30. package/node_modules/socket.io-client/package.json +3 -3
  31. package/node_modules/socket.io-parser/LICENSE +1 -1
  32. package/node_modules/socket.io-parser/build/cjs/binary.js +2 -3
  33. package/node_modules/socket.io-parser/build/cjs/index.d.ts +15 -4
  34. package/node_modules/socket.io-parser/build/cjs/index.js +62 -16
  35. package/node_modules/socket.io-parser/build/cjs/is-binary.d.ts +1 -1
  36. package/node_modules/socket.io-parser/build/cjs/is-binary.js +2 -3
  37. package/node_modules/socket.io-parser/build/esm/index.d.ts +15 -4
  38. package/node_modules/socket.io-parser/build/esm/index.js +60 -15
  39. package/node_modules/socket.io-parser/build/esm/is-binary.d.ts +1 -1
  40. package/node_modules/socket.io-parser/build/esm-debug/index.d.ts +15 -4
  41. package/node_modules/socket.io-parser/build/esm-debug/index.js +60 -15
  42. package/node_modules/socket.io-parser/build/esm-debug/is-binary.d.ts +1 -1
  43. package/node_modules/socket.io-parser/package.json +8 -22
  44. package/oclif.manifest.json +107 -100
  45. package/package.json +7 -7
  46. package/node_modules/socket.io-client/node_modules/debug/package.json +0 -60
  47. package/node_modules/socket.io-client/node_modules/debug/src/browser.js +0 -271
  48. package/node_modules/socket.io-parser/node_modules/debug/LICENSE +0 -20
  49. package/node_modules/socket.io-parser/node_modules/debug/README.md +0 -481
  50. package/node_modules/socket.io-parser/node_modules/debug/src/common.js +0 -274
  51. package/node_modules/socket.io-parser/node_modules/debug/src/index.js +0 -10
  52. package/node_modules/socket.io-parser/node_modules/debug/src/node.js +0 -263
  53. /package/node_modules/{socket.io-client/node_modules/debug → debug}/LICENSE +0 -0
  54. /package/node_modules/{socket.io-client/node_modules/debug → debug}/README.md +0 -0
  55. /package/node_modules/{socket.io-client/node_modules/debug → debug}/src/index.js +0 -0
  56. /package/node_modules/{socket.io-client/node_modules/debug → debug}/src/node.js +0 -0
@@ -403,7 +403,7 @@
403
403
  "restart": {
404
404
  "aliases": [],
405
405
  "args": {},
406
- "description": "Restart ByteRover — stop everything and start fresh.\n\nRun this when ByteRover is unresponsive, stuck, or after installing an update.\nAll open sessions and background processes are stopped before the fresh start.",
406
+ "description": "Restart ByteRover — stop everything and start fresh.\n\nRun this when ByteRover is unresponsive, stuck, or after installing an update.\nAll open sessions and background processes are stopped.\nThe daemon will restart automatically on the next brv command.",
407
407
  "examples": [
408
408
  "<%= config.bin %> <%= command.id %>"
409
409
  ],
@@ -416,6 +416,13 @@
416
416
  "pluginType": "core",
417
417
  "strict": true,
418
418
  "enableJsonFlag": false,
419
+ "PROTECTED_COMMANDS": [
420
+ "update"
421
+ ],
422
+ "SERVER_AGENT_PATTERNS": [
423
+ "brv-server.js",
424
+ "agent-process.js"
425
+ ],
419
426
  "isESM": true,
420
427
  "relativePath": [
421
428
  "dist",
@@ -1076,6 +1083,104 @@
1076
1083
  "switch.js"
1077
1084
  ]
1078
1085
  },
1086
+ "space:list": {
1087
+ "aliases": [],
1088
+ "args": {},
1089
+ "description": "List all teams and spaces",
1090
+ "examples": [
1091
+ "<%= config.bin %> space list",
1092
+ "<%= config.bin %> space list --format json"
1093
+ ],
1094
+ "flags": {
1095
+ "format": {
1096
+ "char": "f",
1097
+ "description": "Output format",
1098
+ "name": "format",
1099
+ "default": "text",
1100
+ "hasDynamicHelp": false,
1101
+ "multiple": false,
1102
+ "options": [
1103
+ "text",
1104
+ "json"
1105
+ ],
1106
+ "type": "option"
1107
+ }
1108
+ },
1109
+ "hasDynamicHelp": false,
1110
+ "hiddenAliases": [],
1111
+ "id": "space:list",
1112
+ "pluginAlias": "byterover-cli",
1113
+ "pluginName": "byterover-cli",
1114
+ "pluginType": "core",
1115
+ "strict": true,
1116
+ "enableJsonFlag": false,
1117
+ "isESM": true,
1118
+ "relativePath": [
1119
+ "dist",
1120
+ "oclif",
1121
+ "commands",
1122
+ "space",
1123
+ "list.js"
1124
+ ]
1125
+ },
1126
+ "space:switch": {
1127
+ "aliases": [],
1128
+ "args": {},
1129
+ "description": "Switch to a different space",
1130
+ "examples": [
1131
+ "<%= config.bin %> space switch --team acme --name my-space",
1132
+ "<%= config.bin %> space switch --team acme --name my-space --format json"
1133
+ ],
1134
+ "flags": {
1135
+ "format": {
1136
+ "char": "f",
1137
+ "description": "Output format",
1138
+ "name": "format",
1139
+ "default": "text",
1140
+ "hasDynamicHelp": false,
1141
+ "multiple": false,
1142
+ "options": [
1143
+ "text",
1144
+ "json"
1145
+ ],
1146
+ "type": "option"
1147
+ },
1148
+ "name": {
1149
+ "char": "n",
1150
+ "description": "Name of the space to switch to",
1151
+ "name": "name",
1152
+ "required": true,
1153
+ "hasDynamicHelp": false,
1154
+ "multiple": false,
1155
+ "type": "option"
1156
+ },
1157
+ "team": {
1158
+ "char": "t",
1159
+ "description": "Team name",
1160
+ "name": "team",
1161
+ "required": true,
1162
+ "hasDynamicHelp": false,
1163
+ "multiple": false,
1164
+ "type": "option"
1165
+ }
1166
+ },
1167
+ "hasDynamicHelp": false,
1168
+ "hiddenAliases": [],
1169
+ "id": "space:switch",
1170
+ "pluginAlias": "byterover-cli",
1171
+ "pluginName": "byterover-cli",
1172
+ "pluginType": "core",
1173
+ "strict": true,
1174
+ "enableJsonFlag": false,
1175
+ "isESM": true,
1176
+ "relativePath": [
1177
+ "dist",
1178
+ "oclif",
1179
+ "commands",
1180
+ "space",
1181
+ "switch.js"
1182
+ ]
1183
+ },
1079
1184
  "providers:connect": {
1080
1185
  "aliases": [],
1081
1186
  "args": {
@@ -1332,104 +1437,6 @@
1332
1437
  "switch.js"
1333
1438
  ]
1334
1439
  },
1335
- "space:list": {
1336
- "aliases": [],
1337
- "args": {},
1338
- "description": "List all teams and spaces",
1339
- "examples": [
1340
- "<%= config.bin %> space list",
1341
- "<%= config.bin %> space list --format json"
1342
- ],
1343
- "flags": {
1344
- "format": {
1345
- "char": "f",
1346
- "description": "Output format",
1347
- "name": "format",
1348
- "default": "text",
1349
- "hasDynamicHelp": false,
1350
- "multiple": false,
1351
- "options": [
1352
- "text",
1353
- "json"
1354
- ],
1355
- "type": "option"
1356
- }
1357
- },
1358
- "hasDynamicHelp": false,
1359
- "hiddenAliases": [],
1360
- "id": "space:list",
1361
- "pluginAlias": "byterover-cli",
1362
- "pluginName": "byterover-cli",
1363
- "pluginType": "core",
1364
- "strict": true,
1365
- "enableJsonFlag": false,
1366
- "isESM": true,
1367
- "relativePath": [
1368
- "dist",
1369
- "oclif",
1370
- "commands",
1371
- "space",
1372
- "list.js"
1373
- ]
1374
- },
1375
- "space:switch": {
1376
- "aliases": [],
1377
- "args": {},
1378
- "description": "Switch to a different space",
1379
- "examples": [
1380
- "<%= config.bin %> space switch --team acme --name my-space",
1381
- "<%= config.bin %> space switch --team acme --name my-space --format json"
1382
- ],
1383
- "flags": {
1384
- "format": {
1385
- "char": "f",
1386
- "description": "Output format",
1387
- "name": "format",
1388
- "default": "text",
1389
- "hasDynamicHelp": false,
1390
- "multiple": false,
1391
- "options": [
1392
- "text",
1393
- "json"
1394
- ],
1395
- "type": "option"
1396
- },
1397
- "name": {
1398
- "char": "n",
1399
- "description": "Name of the space to switch to",
1400
- "name": "name",
1401
- "required": true,
1402
- "hasDynamicHelp": false,
1403
- "multiple": false,
1404
- "type": "option"
1405
- },
1406
- "team": {
1407
- "char": "t",
1408
- "description": "Team name",
1409
- "name": "team",
1410
- "required": true,
1411
- "hasDynamicHelp": false,
1412
- "multiple": false,
1413
- "type": "option"
1414
- }
1415
- },
1416
- "hasDynamicHelp": false,
1417
- "hiddenAliases": [],
1418
- "id": "space:switch",
1419
- "pluginAlias": "byterover-cli",
1420
- "pluginName": "byterover-cli",
1421
- "pluginType": "core",
1422
- "strict": true,
1423
- "enableJsonFlag": false,
1424
- "isESM": true,
1425
- "relativePath": [
1426
- "dist",
1427
- "oclif",
1428
- "commands",
1429
- "space",
1430
- "switch.js"
1431
- ]
1432
- },
1433
1440
  "hub:registry:add": {
1434
1441
  "aliases": [],
1435
1442
  "args": {
@@ -1629,5 +1636,5 @@
1629
1636
  ]
1630
1637
  }
1631
1638
  },
1632
- "version": "2.3.0"
1639
+ "version": "2.3.2"
1633
1640
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "byterover-cli",
3
3
  "description": "ByteRover's CLI",
4
- "version": "2.3.0",
4
+ "version": "2.3.2",
5
5
  "author": "ByteRover",
6
6
  "bin": {
7
7
  "brv": "./bin/run.js"
@@ -22,7 +22,7 @@
22
22
  "@ai-sdk/vercel": "^1.0.33",
23
23
  "@ai-sdk/xai": "^2.0.57",
24
24
  "@anthropic-ai/sdk": "^0.70.1",
25
- "@campfirein/brv-transport-client": "github:campfirein/brv-transport-client#release/0.8.2",
25
+ "@campfirein/brv-transport-client": "github:campfirein/brv-transport-client#release/0.8.4",
26
26
  "@google/genai": "^1.29.0",
27
27
  "@inkjs/ui": "^2.0.0",
28
28
  "@inquirer/prompts": "^7.9.0",
@@ -35,7 +35,6 @@
35
35
  "@tanstack/react-query": "^5.90.20",
36
36
  "ai": "^5.0.129",
37
37
  "axios": "^1.12.2",
38
- "better-sqlite3": "^11.5.0",
39
38
  "chalk": "^5.6.2",
40
39
  "esbuild": "^0.27.2",
41
40
  "express": "^5.1.0",
@@ -59,8 +58,8 @@
59
58
  "react": "^19.2.1",
60
59
  "react-router-dom": "^7.13.0",
61
60
  "remark-parse": "^11.0.0",
62
- "socket.io": "^4.8.1",
63
- "socket.io-client": "^4.8.1",
61
+ "socket.io": "^4.8.3",
62
+ "socket.io-client": "^4.8.3",
64
63
  "stopword": "^3.1.5",
65
64
  "unified": "^11.0.5",
66
65
  "unpdf": "^1.4.0",
@@ -76,7 +75,6 @@
76
75
  "@eslint/compat": "^1",
77
76
  "@oclif/prettier-config": "^0.2.1",
78
77
  "@oclif/test": "^4",
79
- "@types/better-sqlite3": "^7.6.13",
80
78
  "@types/chai": "^4",
81
79
  "@types/express": "^5.0.3",
82
80
  "@types/js-yaml": "^4.0.9",
@@ -125,12 +123,14 @@
125
123
  "commands": "./dist/oclif/commands",
126
124
  "hooks": {
127
125
  "init": [
126
+ "./dist/oclif/hooks/init/block-command-update-npm",
128
127
  "./dist/oclif/hooks/init/welcome",
129
128
  "./dist/oclif/hooks/init/update-notifier"
130
129
  ],
131
130
  "command_not_found": "./dist/oclif/hooks/command_not_found/handle-invalid-commands",
132
131
  "error": "./dist/oclif/hooks/error/clean-errors",
133
- "prerun": "./dist/oclif/hooks/prerun/validate-brv-config-version"
132
+ "prerun": "./dist/oclif/hooks/prerun/validate-brv-config-version",
133
+ "postrun": "./dist/oclif/hooks/postrun/restart-after-update"
134
134
  },
135
135
  "plugins": [
136
136
  "@oclif/plugin-help",
@@ -1,60 +0,0 @@
1
- {
2
- "name": "debug",
3
- "version": "4.3.7",
4
- "repository": {
5
- "type": "git",
6
- "url": "git://github.com/debug-js/debug.git"
7
- },
8
- "description": "Lightweight debugging utility for Node.js and the browser",
9
- "keywords": [
10
- "debug",
11
- "log",
12
- "debugger"
13
- ],
14
- "files": [
15
- "src",
16
- "LICENSE",
17
- "README.md"
18
- ],
19
- "author": "Josh Junon (https://github.com/qix-)",
20
- "contributors": [
21
- "TJ Holowaychuk <tj@vision-media.ca>",
22
- "Nathan Rajlich <nathan@tootallnate.net> (http://n8.io)",
23
- "Andrew Rhyne <rhyneandrew@gmail.com>"
24
- ],
25
- "license": "MIT",
26
- "scripts": {
27
- "lint": "xo",
28
- "test": "npm run test:node && npm run test:browser && npm run lint",
29
- "test:node": "istanbul cover _mocha -- test.js test.node.js",
30
- "test:browser": "karma start --single-run",
31
- "test:coverage": "cat ./coverage/lcov.info | coveralls"
32
- },
33
- "dependencies": {
34
- "ms": "^2.1.3"
35
- },
36
- "devDependencies": {
37
- "brfs": "^2.0.1",
38
- "browserify": "^16.2.3",
39
- "coveralls": "^3.0.2",
40
- "istanbul": "^0.4.5",
41
- "karma": "^3.1.4",
42
- "karma-browserify": "^6.0.0",
43
- "karma-chrome-launcher": "^2.2.0",
44
- "karma-mocha": "^1.3.0",
45
- "mocha": "^5.2.0",
46
- "mocha-lcov-reporter": "^1.2.0",
47
- "sinon": "^14.0.0",
48
- "xo": "^0.23.0"
49
- },
50
- "peerDependenciesMeta": {
51
- "supports-color": {
52
- "optional": true
53
- }
54
- },
55
- "main": "./src/index.js",
56
- "browser": "./src/browser.js",
57
- "engines": {
58
- "node": ">=6.0"
59
- }
60
- }
@@ -1,271 +0,0 @@
1
- /* eslint-env browser */
2
-
3
- /**
4
- * This is the web browser implementation of `debug()`.
5
- */
6
-
7
- exports.formatArgs = formatArgs;
8
- exports.save = save;
9
- exports.load = load;
10
- exports.useColors = useColors;
11
- exports.storage = localstorage();
12
- exports.destroy = (() => {
13
- let warned = false;
14
-
15
- return () => {
16
- if (!warned) {
17
- warned = true;
18
- console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
19
- }
20
- };
21
- })();
22
-
23
- /**
24
- * Colors.
25
- */
26
-
27
- exports.colors = [
28
- '#0000CC',
29
- '#0000FF',
30
- '#0033CC',
31
- '#0033FF',
32
- '#0066CC',
33
- '#0066FF',
34
- '#0099CC',
35
- '#0099FF',
36
- '#00CC00',
37
- '#00CC33',
38
- '#00CC66',
39
- '#00CC99',
40
- '#00CCCC',
41
- '#00CCFF',
42
- '#3300CC',
43
- '#3300FF',
44
- '#3333CC',
45
- '#3333FF',
46
- '#3366CC',
47
- '#3366FF',
48
- '#3399CC',
49
- '#3399FF',
50
- '#33CC00',
51
- '#33CC33',
52
- '#33CC66',
53
- '#33CC99',
54
- '#33CCCC',
55
- '#33CCFF',
56
- '#6600CC',
57
- '#6600FF',
58
- '#6633CC',
59
- '#6633FF',
60
- '#66CC00',
61
- '#66CC33',
62
- '#9900CC',
63
- '#9900FF',
64
- '#9933CC',
65
- '#9933FF',
66
- '#99CC00',
67
- '#99CC33',
68
- '#CC0000',
69
- '#CC0033',
70
- '#CC0066',
71
- '#CC0099',
72
- '#CC00CC',
73
- '#CC00FF',
74
- '#CC3300',
75
- '#CC3333',
76
- '#CC3366',
77
- '#CC3399',
78
- '#CC33CC',
79
- '#CC33FF',
80
- '#CC6600',
81
- '#CC6633',
82
- '#CC9900',
83
- '#CC9933',
84
- '#CCCC00',
85
- '#CCCC33',
86
- '#FF0000',
87
- '#FF0033',
88
- '#FF0066',
89
- '#FF0099',
90
- '#FF00CC',
91
- '#FF00FF',
92
- '#FF3300',
93
- '#FF3333',
94
- '#FF3366',
95
- '#FF3399',
96
- '#FF33CC',
97
- '#FF33FF',
98
- '#FF6600',
99
- '#FF6633',
100
- '#FF9900',
101
- '#FF9933',
102
- '#FFCC00',
103
- '#FFCC33'
104
- ];
105
-
106
- /**
107
- * Currently only WebKit-based Web Inspectors, Firefox >= v31,
108
- * and the Firebug extension (any Firefox version) are known
109
- * to support "%c" CSS customizations.
110
- *
111
- * TODO: add a `localStorage` variable to explicitly enable/disable colors
112
- */
113
-
114
- // eslint-disable-next-line complexity
115
- function useColors() {
116
- // NB: In an Electron preload script, document will be defined but not fully
117
- // initialized. Since we know we're in Chrome, we'll just detect this case
118
- // explicitly
119
- if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
120
- return true;
121
- }
122
-
123
- // Internet Explorer and Edge do not support colors.
124
- if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
125
- return false;
126
- }
127
-
128
- let m;
129
-
130
- // Is webkit? http://stackoverflow.com/a/16459606/376773
131
- // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
132
- return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
133
- // Is firebug? http://stackoverflow.com/a/398120/376773
134
- (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
135
- // Is firefox >= v31?
136
- // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
137
- (typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31) ||
138
- // Double check webkit in userAgent just in case we are in a worker
139
- (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
140
- }
141
-
142
- /**
143
- * Colorize log arguments if enabled.
144
- *
145
- * @api public
146
- */
147
-
148
- function formatArgs(args) {
149
- args[0] = (this.useColors ? '%c' : '') +
150
- this.namespace +
151
- (this.useColors ? ' %c' : ' ') +
152
- args[0] +
153
- (this.useColors ? '%c ' : ' ') +
154
- '+' + module.exports.humanize(this.diff);
155
-
156
- if (!this.useColors) {
157
- return;
158
- }
159
-
160
- const c = 'color: ' + this.color;
161
- args.splice(1, 0, c, 'color: inherit');
162
-
163
- // The final "%c" is somewhat tricky, because there could be other
164
- // arguments passed either before or after the %c, so we need to
165
- // figure out the correct index to insert the CSS into
166
- let index = 0;
167
- let lastC = 0;
168
- args[0].replace(/%[a-zA-Z%]/g, match => {
169
- if (match === '%%') {
170
- return;
171
- }
172
- index++;
173
- if (match === '%c') {
174
- // We only are interested in the *last* %c
175
- // (the user may have provided their own)
176
- lastC = index;
177
- }
178
- });
179
-
180
- args.splice(lastC, 0, c);
181
- }
182
-
183
- /**
184
- * Invokes `console.debug()` when available.
185
- * No-op when `console.debug` is not a "function".
186
- * If `console.debug` is not available, falls back
187
- * to `console.log`.
188
- *
189
- * @api public
190
- */
191
- exports.log = console.debug || console.log || (() => {});
192
-
193
- /**
194
- * Save `namespaces`.
195
- *
196
- * @param {String} namespaces
197
- * @api private
198
- */
199
- function save(namespaces) {
200
- try {
201
- if (namespaces) {
202
- exports.storage.setItem('debug', namespaces);
203
- } else {
204
- exports.storage.removeItem('debug');
205
- }
206
- } catch (error) {
207
- // Swallow
208
- // XXX (@Qix-) should we be logging these?
209
- }
210
- }
211
-
212
- /**
213
- * Load `namespaces`.
214
- *
215
- * @return {String} returns the previously persisted debug modes
216
- * @api private
217
- */
218
- function load() {
219
- let r;
220
- try {
221
- r = exports.storage.getItem('debug');
222
- } catch (error) {
223
- // Swallow
224
- // XXX (@Qix-) should we be logging these?
225
- }
226
-
227
- // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
228
- if (!r && typeof process !== 'undefined' && 'env' in process) {
229
- r = process.env.DEBUG;
230
- }
231
-
232
- return r;
233
- }
234
-
235
- /**
236
- * Localstorage attempts to return the localstorage.
237
- *
238
- * This is necessary because safari throws
239
- * when a user disables cookies/localstorage
240
- * and you attempt to access it.
241
- *
242
- * @return {LocalStorage}
243
- * @api private
244
- */
245
-
246
- function localstorage() {
247
- try {
248
- // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
249
- // The Browser also has localStorage in the global context.
250
- return localStorage;
251
- } catch (error) {
252
- // Swallow
253
- // XXX (@Qix-) should we be logging these?
254
- }
255
- }
256
-
257
- module.exports = require('./common')(exports);
258
-
259
- const {formatters} = module.exports;
260
-
261
- /**
262
- * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
263
- */
264
-
265
- formatters.j = function (v) {
266
- try {
267
- return JSON.stringify(v);
268
- } catch (error) {
269
- return '[UnexpectedJSONParseError]: ' + error.message;
270
- }
271
- };
@@ -1,20 +0,0 @@
1
- (The MIT License)
2
-
3
- Copyright (c) 2014-2017 TJ Holowaychuk <tj@vision-media.ca>
4
- Copyright (c) 2018-2021 Josh Junon
5
-
6
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software
7
- and associated documentation files (the 'Software'), to deal in the Software without restriction,
8
- including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
9
- and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
10
- subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all copies or substantial
13
- portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
16
- LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
18
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
19
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
-