0xkobold 0.7.2 → 0.8.0

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 (252) hide show
  1. package/HEARTBEAT.md +239 -0
  2. package/IDENTITY.md +12 -0
  3. package/README.md +138 -4
  4. package/SOUL.md +21 -0
  5. package/dist/package.json +10 -5
  6. package/dist/src/agent/bootstrap-loader.js +295 -66
  7. package/dist/src/agent/bootstrap-loader.js.map +1 -1
  8. package/dist/src/agent/context-pruning.js +10 -5
  9. package/dist/src/agent/context-pruning.js.map +1 -1
  10. package/dist/src/agent/embedded-runner.js +29 -15
  11. package/dist/src/agent/embedded-runner.js.map +1 -1
  12. package/dist/src/agent/index.js +5 -2
  13. package/dist/src/agent/index.js.map +1 -1
  14. package/dist/src/agent/system-prompt.js +167 -20
  15. package/dist/src/agent/system-prompt.js.map +1 -1
  16. package/dist/src/agent/tools/spawn-agent.js +72 -5
  17. package/dist/src/agent/tools/spawn-agent.js.map +1 -1
  18. package/dist/src/channels/slack/webhook.js +2 -2
  19. package/dist/src/channels/slack/webhook.js.map +1 -1
  20. package/dist/src/channels/telegram/bot.js +4 -4
  21. package/dist/src/channels/telegram/bot.js.map +1 -1
  22. package/dist/src/channels/whatsapp/integration.js +4 -4
  23. package/dist/src/channels/whatsapp/integration.js.map +1 -1
  24. package/dist/src/cli/commands/gateway.js +9 -10
  25. package/dist/src/cli/commands/gateway.js.map +1 -1
  26. package/dist/src/cli/commands/init.js +90 -0
  27. package/dist/src/cli/commands/init.js.map +1 -1
  28. package/dist/src/cli/commands/setup.js +53 -0
  29. package/dist/src/cli/commands/setup.js.map +1 -1
  30. package/dist/src/cli/index.js +0 -0
  31. package/dist/src/config/unified-config.js +5 -0
  32. package/dist/src/config/unified-config.js.map +1 -1
  33. package/dist/src/cron/index.js +2 -0
  34. package/dist/src/cron/index.js.map +1 -1
  35. package/dist/src/cron/nl-parser.js +522 -0
  36. package/dist/src/cron/nl-parser.js.map +1 -0
  37. package/dist/src/cron/runner.js +6 -31
  38. package/dist/src/cron/runner.js.map +1 -1
  39. package/dist/src/event-bus/index.js.map +1 -1
  40. package/dist/src/extensions/core/agent-orchestrator-extension.js +200 -148
  41. package/dist/src/extensions/core/agent-orchestrator-extension.js.map +1 -1
  42. package/dist/src/extensions/core/diagnostics-extension.js +93 -56
  43. package/dist/src/extensions/core/diagnostics-extension.js.map +1 -1
  44. package/dist/src/extensions/core/draconic-safety-extension.js +256 -3
  45. package/dist/src/extensions/core/draconic-safety-extension.js.map +1 -1
  46. package/dist/src/extensions/core/heartbeat-extension.js +416 -150
  47. package/dist/src/extensions/core/heartbeat-extension.js.map +1 -1
  48. package/dist/src/extensions/core/{generative-agents-extension.js → learning-extension.js} +90 -128
  49. package/dist/src/extensions/core/learning-extension.js.map +1 -0
  50. package/dist/src/extensions/core/perennial-memory-extension.js +884 -87
  51. package/dist/src/extensions/core/perennial-memory-extension.js.map +1 -1
  52. package/dist/src/extensions/core/routed-ollama-extension.js +345 -0
  53. package/dist/src/extensions/core/routed-ollama-extension.js.map +1 -0
  54. package/dist/src/extensions/core/task-manager-extension.js +25 -2
  55. package/dist/src/extensions/core/task-manager-extension.js.map +1 -1
  56. package/dist/src/extensions/core/websearch-enhanced-extension.js +81 -23
  57. package/dist/src/extensions/core/websearch-enhanced-extension.js.map +1 -1
  58. package/dist/src/extensions/core/workspace-footer-extension.js +40 -63
  59. package/dist/src/extensions/core/workspace-footer-extension.js.map +1 -1
  60. package/dist/src/extensions/loader.js +5 -1
  61. package/dist/src/extensions/loader.js.map +1 -1
  62. package/dist/src/gateway/gateway-server.js +74 -3
  63. package/dist/src/gateway/gateway-server.js.map +1 -1
  64. package/dist/src/gateway/index.js +2 -2
  65. package/dist/src/gateway/index.js.map +1 -1
  66. package/dist/src/gateway/methods/agent.js +1 -1
  67. package/dist/src/gateway/methods/agent.js.map +1 -1
  68. package/dist/src/gateway/methods/index.js +4 -0
  69. package/dist/src/gateway/methods/index.js.map +1 -1
  70. package/dist/src/gateway/methods/node.js +261 -0
  71. package/dist/src/gateway/methods/node.js.map +1 -0
  72. package/dist/src/gateway/queue-modes.js +356 -0
  73. package/dist/src/gateway/queue-modes.js.map +1 -0
  74. package/dist/src/index.js +47 -6
  75. package/dist/src/index.js.map +1 -1
  76. package/dist/src/llm/community-analytics.js +569 -0
  77. package/dist/src/llm/community-analytics.js.map +1 -0
  78. package/dist/src/llm/index.js +28 -4
  79. package/dist/src/llm/index.js.map +1 -1
  80. package/dist/src/llm/model-discovery.js +335 -0
  81. package/dist/src/llm/model-discovery.js.map +1 -0
  82. package/dist/src/llm/model-popularity.js +566 -0
  83. package/dist/src/llm/model-popularity.js.map +1 -0
  84. package/dist/src/llm/model-scoring-db.js +553 -0
  85. package/dist/src/llm/model-scoring-db.js.map +1 -0
  86. package/dist/src/llm/multi-provider.js +258 -0
  87. package/dist/src/llm/multi-provider.js.map +1 -0
  88. package/dist/src/llm/ollama.js +133 -187
  89. package/dist/src/llm/ollama.js.map +1 -1
  90. package/dist/src/llm/router-commands.js +773 -0
  91. package/dist/src/llm/router-commands.js.map +1 -0
  92. package/dist/src/llm/router-core.js +600 -0
  93. package/dist/src/llm/router-core.js.map +1 -0
  94. package/dist/src/memory/checkpoint-manager.js +278 -0
  95. package/dist/src/memory/checkpoint-manager.js.map +1 -0
  96. package/dist/src/memory/conflict-detector.js +279 -0
  97. package/dist/src/memory/conflict-detector.js.map +1 -0
  98. package/dist/src/memory/context-graph.js +360 -0
  99. package/dist/src/memory/context-graph.js.map +1 -0
  100. package/dist/src/memory/dialectic/benchmark-cli.js +200 -0
  101. package/dist/src/memory/dialectic/benchmark-cli.js.map +1 -0
  102. package/dist/src/memory/dialectic/debug-reasoning.js +37 -0
  103. package/dist/src/memory/dialectic/debug-reasoning.js.map +1 -0
  104. package/dist/src/memory/dialectic/index.js +135 -0
  105. package/dist/src/memory/dialectic/index.js.map +1 -0
  106. package/dist/src/memory/dialectic/nudges.js +380 -0
  107. package/dist/src/memory/dialectic/nudges.js.map +1 -0
  108. package/dist/src/memory/dialectic/reasoning-engine.js +607 -0
  109. package/dist/src/memory/dialectic/reasoning-engine.js.map +1 -0
  110. package/dist/src/memory/dialectic/reasoning.js +390 -0
  111. package/dist/src/memory/dialectic/reasoning.js.map +1 -0
  112. package/dist/src/memory/dialectic/skill-creation.js +481 -0
  113. package/dist/src/memory/dialectic/skill-creation.js.map +1 -0
  114. package/dist/src/memory/dialectic/store.js +663 -0
  115. package/dist/src/memory/dialectic/store.js.map +1 -0
  116. package/dist/src/memory/dialectic/types.js +11 -0
  117. package/dist/src/memory/dialectic/types.js.map +1 -0
  118. package/dist/src/memory/index.js +24 -2
  119. package/dist/src/memory/index.js.map +1 -1
  120. package/dist/src/memory/memory-decay.js +350 -0
  121. package/dist/src/memory/memory-decay.js.map +1 -0
  122. package/dist/src/memory/memory-integration.js +5 -5
  123. package/dist/src/memory/memory-integration.js.map +1 -1
  124. package/dist/src/memory/migrate-memory-stream.js +97 -0
  125. package/dist/src/memory/migrate-memory-stream.js.map +1 -0
  126. package/dist/src/memory/session-memory-bridge.js +49 -5
  127. package/dist/src/memory/session-memory-bridge.js.map +1 -1
  128. package/dist/src/memory/session-store.js +123 -0
  129. package/dist/src/memory/session-store.js.map +1 -1
  130. package/dist/src/memory/smart-write-rules.js +164 -0
  131. package/dist/src/memory/smart-write-rules.js.map +1 -0
  132. package/dist/src/memory/tiered-memory.js +436 -0
  133. package/dist/src/memory/tiered-memory.js.map +1 -0
  134. package/dist/src/memory/types.js +6 -0
  135. package/dist/src/memory/types.js.map +1 -0
  136. package/dist/src/memory/verify-migration.js +99 -0
  137. package/dist/src/memory/verify-migration.js.map +1 -0
  138. package/dist/src/pi-config.js +11 -9
  139. package/dist/src/pi-config.js.map +1 -1
  140. package/dist/src/skills/conditional-skills.js +464 -0
  141. package/dist/src/skills/conditional-skills.js.map +1 -0
  142. package/dist/src/skills/index.js +5 -0
  143. package/dist/src/skills/index.js.map +1 -1
  144. package/dist/src/skills/loader.js +56 -0
  145. package/dist/src/skills/loader.js.map +1 -1
  146. package/dist/src/skills/skill-manage.js +417 -0
  147. package/dist/src/skills/skill-manage.js.map +1 -0
  148. package/dist/src/tui/commands/orchestration-commands.js +62 -0
  149. package/dist/src/tui/commands/orchestration-commands.js.map +1 -1
  150. package/package.json +10 -5
  151. package/skills/model-router-test.ts +65 -0
  152. package/dist/src/extensions/core/auto-security-scan-extension.js +0 -41
  153. package/dist/src/extensions/core/auto-security-scan-extension.js.map +0 -1
  154. package/dist/src/extensions/core/cloudflare-browser-extension.js +0 -389
  155. package/dist/src/extensions/core/cloudflare-browser-extension.js.map +0 -1
  156. package/dist/src/extensions/core/compaction-safeguard.js +0 -223
  157. package/dist/src/extensions/core/compaction-safeguard.js.map +0 -1
  158. package/dist/src/extensions/core/generative-agents-extension.js.map +0 -1
  159. package/dist/src/extensions/core/obsidian-bridge-extension.js +0 -488
  160. package/dist/src/extensions/core/obsidian-bridge-extension.js.map +0 -1
  161. package/dist/src/llm/router.js +0 -145
  162. package/dist/src/llm/router.js.map +0 -1
  163. package/skills/kobold-scan-skill/node_modules/.package-lock.json +0 -172
  164. package/skills/kobold-scan-skill/node_modules/ansi-styles/index.d.ts +0 -345
  165. package/skills/kobold-scan-skill/node_modules/ansi-styles/index.js +0 -163
  166. package/skills/kobold-scan-skill/node_modules/ansi-styles/license +0 -9
  167. package/skills/kobold-scan-skill/node_modules/ansi-styles/package.json +0 -56
  168. package/skills/kobold-scan-skill/node_modules/ansi-styles/readme.md +0 -152
  169. package/skills/kobold-scan-skill/node_modules/balanced-match/.github/FUNDING.yml +0 -2
  170. package/skills/kobold-scan-skill/node_modules/balanced-match/LICENSE.md +0 -21
  171. package/skills/kobold-scan-skill/node_modules/balanced-match/README.md +0 -97
  172. package/skills/kobold-scan-skill/node_modules/balanced-match/index.js +0 -62
  173. package/skills/kobold-scan-skill/node_modules/balanced-match/package.json +0 -48
  174. package/skills/kobold-scan-skill/node_modules/brace-expansion/.github/FUNDING.yml +0 -2
  175. package/skills/kobold-scan-skill/node_modules/brace-expansion/LICENSE +0 -21
  176. package/skills/kobold-scan-skill/node_modules/brace-expansion/README.md +0 -135
  177. package/skills/kobold-scan-skill/node_modules/brace-expansion/index.js +0 -203
  178. package/skills/kobold-scan-skill/node_modules/brace-expansion/package.json +0 -49
  179. package/skills/kobold-scan-skill/node_modules/chalk/index.d.ts +0 -415
  180. package/skills/kobold-scan-skill/node_modules/chalk/license +0 -9
  181. package/skills/kobold-scan-skill/node_modules/chalk/package.json +0 -68
  182. package/skills/kobold-scan-skill/node_modules/chalk/readme.md +0 -341
  183. package/skills/kobold-scan-skill/node_modules/chalk/source/index.js +0 -229
  184. package/skills/kobold-scan-skill/node_modules/chalk/source/templates.js +0 -134
  185. package/skills/kobold-scan-skill/node_modules/chalk/source/util.js +0 -39
  186. package/skills/kobold-scan-skill/node_modules/color-convert/CHANGELOG.md +0 -54
  187. package/skills/kobold-scan-skill/node_modules/color-convert/LICENSE +0 -21
  188. package/skills/kobold-scan-skill/node_modules/color-convert/README.md +0 -68
  189. package/skills/kobold-scan-skill/node_modules/color-convert/conversions.js +0 -839
  190. package/skills/kobold-scan-skill/node_modules/color-convert/index.js +0 -81
  191. package/skills/kobold-scan-skill/node_modules/color-convert/package.json +0 -48
  192. package/skills/kobold-scan-skill/node_modules/color-convert/route.js +0 -97
  193. package/skills/kobold-scan-skill/node_modules/color-name/LICENSE +0 -8
  194. package/skills/kobold-scan-skill/node_modules/color-name/README.md +0 -11
  195. package/skills/kobold-scan-skill/node_modules/color-name/index.js +0 -152
  196. package/skills/kobold-scan-skill/node_modules/color-name/package.json +0 -28
  197. package/skills/kobold-scan-skill/node_modules/commander/LICENSE +0 -22
  198. package/skills/kobold-scan-skill/node_modules/commander/Readme.md +0 -1129
  199. package/skills/kobold-scan-skill/node_modules/commander/esm.mjs +0 -16
  200. package/skills/kobold-scan-skill/node_modules/commander/index.js +0 -27
  201. package/skills/kobold-scan-skill/node_modules/commander/lib/argument.js +0 -147
  202. package/skills/kobold-scan-skill/node_modules/commander/lib/command.js +0 -2179
  203. package/skills/kobold-scan-skill/node_modules/commander/lib/error.js +0 -45
  204. package/skills/kobold-scan-skill/node_modules/commander/lib/help.js +0 -461
  205. package/skills/kobold-scan-skill/node_modules/commander/lib/option.js +0 -326
  206. package/skills/kobold-scan-skill/node_modules/commander/lib/suggestSimilar.js +0 -100
  207. package/skills/kobold-scan-skill/node_modules/commander/package-support.json +0 -16
  208. package/skills/kobold-scan-skill/node_modules/commander/package.json +0 -80
  209. package/skills/kobold-scan-skill/node_modules/commander/typings/index.d.ts +0 -891
  210. package/skills/kobold-scan-skill/node_modules/fs.realpath/LICENSE +0 -43
  211. package/skills/kobold-scan-skill/node_modules/fs.realpath/README.md +0 -33
  212. package/skills/kobold-scan-skill/node_modules/fs.realpath/index.js +0 -66
  213. package/skills/kobold-scan-skill/node_modules/fs.realpath/old.js +0 -303
  214. package/skills/kobold-scan-skill/node_modules/fs.realpath/package.json +0 -26
  215. package/skills/kobold-scan-skill/node_modules/glob/LICENSE +0 -15
  216. package/skills/kobold-scan-skill/node_modules/glob/README.md +0 -399
  217. package/skills/kobold-scan-skill/node_modules/glob/common.js +0 -244
  218. package/skills/kobold-scan-skill/node_modules/glob/glob.js +0 -790
  219. package/skills/kobold-scan-skill/node_modules/glob/package.json +0 -55
  220. package/skills/kobold-scan-skill/node_modules/glob/sync.js +0 -486
  221. package/skills/kobold-scan-skill/node_modules/has-flag/index.d.ts +0 -39
  222. package/skills/kobold-scan-skill/node_modules/has-flag/index.js +0 -8
  223. package/skills/kobold-scan-skill/node_modules/has-flag/license +0 -9
  224. package/skills/kobold-scan-skill/node_modules/has-flag/package.json +0 -46
  225. package/skills/kobold-scan-skill/node_modules/has-flag/readme.md +0 -89
  226. package/skills/kobold-scan-skill/node_modules/inflight/LICENSE +0 -15
  227. package/skills/kobold-scan-skill/node_modules/inflight/README.md +0 -37
  228. package/skills/kobold-scan-skill/node_modules/inflight/inflight.js +0 -54
  229. package/skills/kobold-scan-skill/node_modules/inflight/package.json +0 -29
  230. package/skills/kobold-scan-skill/node_modules/inherits/LICENSE +0 -16
  231. package/skills/kobold-scan-skill/node_modules/inherits/README.md +0 -42
  232. package/skills/kobold-scan-skill/node_modules/inherits/inherits.js +0 -9
  233. package/skills/kobold-scan-skill/node_modules/inherits/inherits_browser.js +0 -27
  234. package/skills/kobold-scan-skill/node_modules/inherits/package.json +0 -29
  235. package/skills/kobold-scan-skill/node_modules/minimatch/LICENSE +0 -15
  236. package/skills/kobold-scan-skill/node_modules/minimatch/README.md +0 -259
  237. package/skills/kobold-scan-skill/node_modules/minimatch/lib/path.js +0 -4
  238. package/skills/kobold-scan-skill/node_modules/minimatch/minimatch.js +0 -944
  239. package/skills/kobold-scan-skill/node_modules/minimatch/package.json +0 -35
  240. package/skills/kobold-scan-skill/node_modules/once/LICENSE +0 -15
  241. package/skills/kobold-scan-skill/node_modules/once/README.md +0 -79
  242. package/skills/kobold-scan-skill/node_modules/once/once.js +0 -42
  243. package/skills/kobold-scan-skill/node_modules/once/package.json +0 -33
  244. package/skills/kobold-scan-skill/node_modules/supports-color/browser.js +0 -5
  245. package/skills/kobold-scan-skill/node_modules/supports-color/index.js +0 -135
  246. package/skills/kobold-scan-skill/node_modules/supports-color/license +0 -9
  247. package/skills/kobold-scan-skill/node_modules/supports-color/package.json +0 -53
  248. package/skills/kobold-scan-skill/node_modules/supports-color/readme.md +0 -76
  249. package/skills/kobold-scan-skill/node_modules/wrappy/LICENSE +0 -15
  250. package/skills/kobold-scan-skill/node_modules/wrappy/README.md +0 -36
  251. package/skills/kobold-scan-skill/node_modules/wrappy/package.json +0 -29
  252. package/skills/kobold-scan-skill/node_modules/wrappy/wrappy.js +0 -33
@@ -1,81 +0,0 @@
1
- const conversions = require('./conversions');
2
- const route = require('./route');
3
-
4
- const convert = {};
5
-
6
- const models = Object.keys(conversions);
7
-
8
- function wrapRaw(fn) {
9
- const wrappedFn = function (...args) {
10
- const arg0 = args[0];
11
- if (arg0 === undefined || arg0 === null) {
12
- return arg0;
13
- }
14
-
15
- if (arg0.length > 1) {
16
- args = arg0;
17
- }
18
-
19
- return fn(args);
20
- };
21
-
22
- // Preserve .conversion property if there is one
23
- if ('conversion' in fn) {
24
- wrappedFn.conversion = fn.conversion;
25
- }
26
-
27
- return wrappedFn;
28
- }
29
-
30
- function wrapRounded(fn) {
31
- const wrappedFn = function (...args) {
32
- const arg0 = args[0];
33
-
34
- if (arg0 === undefined || arg0 === null) {
35
- return arg0;
36
- }
37
-
38
- if (arg0.length > 1) {
39
- args = arg0;
40
- }
41
-
42
- const result = fn(args);
43
-
44
- // We're assuming the result is an array here.
45
- // see notice in conversions.js; don't use box types
46
- // in conversion functions.
47
- if (typeof result === 'object') {
48
- for (let len = result.length, i = 0; i < len; i++) {
49
- result[i] = Math.round(result[i]);
50
- }
51
- }
52
-
53
- return result;
54
- };
55
-
56
- // Preserve .conversion property if there is one
57
- if ('conversion' in fn) {
58
- wrappedFn.conversion = fn.conversion;
59
- }
60
-
61
- return wrappedFn;
62
- }
63
-
64
- models.forEach(fromModel => {
65
- convert[fromModel] = {};
66
-
67
- Object.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels});
68
- Object.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels});
69
-
70
- const routes = route(fromModel);
71
- const routeModels = Object.keys(routes);
72
-
73
- routeModels.forEach(toModel => {
74
- const fn = routes[toModel];
75
-
76
- convert[fromModel][toModel] = wrapRounded(fn);
77
- convert[fromModel][toModel].raw = wrapRaw(fn);
78
- });
79
- });
80
-
81
- module.exports = convert;
@@ -1,48 +0,0 @@
1
- {
2
- "name": "color-convert",
3
- "description": "Plain color conversion functions",
4
- "version": "2.0.1",
5
- "author": "Heather Arthur <fayearthur@gmail.com>",
6
- "license": "MIT",
7
- "repository": "Qix-/color-convert",
8
- "scripts": {
9
- "pretest": "xo",
10
- "test": "node test/basic.js"
11
- },
12
- "engines": {
13
- "node": ">=7.0.0"
14
- },
15
- "keywords": [
16
- "color",
17
- "colour",
18
- "convert",
19
- "converter",
20
- "conversion",
21
- "rgb",
22
- "hsl",
23
- "hsv",
24
- "hwb",
25
- "cmyk",
26
- "ansi",
27
- "ansi16"
28
- ],
29
- "files": [
30
- "index.js",
31
- "conversions.js",
32
- "route.js"
33
- ],
34
- "xo": {
35
- "rules": {
36
- "default-case": 0,
37
- "no-inline-comments": 0,
38
- "operator-linebreak": 0
39
- }
40
- },
41
- "devDependencies": {
42
- "chalk": "^2.4.2",
43
- "xo": "^0.24.0"
44
- },
45
- "dependencies": {
46
- "color-name": "~1.1.4"
47
- }
48
- }
@@ -1,97 +0,0 @@
1
- const conversions = require('./conversions');
2
-
3
- /*
4
- This function routes a model to all other models.
5
-
6
- all functions that are routed have a property `.conversion` attached
7
- to the returned synthetic function. This property is an array
8
- of strings, each with the steps in between the 'from' and 'to'
9
- color models (inclusive).
10
-
11
- conversions that are not possible simply are not included.
12
- */
13
-
14
- function buildGraph() {
15
- const graph = {};
16
- // https://jsperf.com/object-keys-vs-for-in-with-closure/3
17
- const models = Object.keys(conversions);
18
-
19
- for (let len = models.length, i = 0; i < len; i++) {
20
- graph[models[i]] = {
21
- // http://jsperf.com/1-vs-infinity
22
- // micro-opt, but this is simple.
23
- distance: -1,
24
- parent: null
25
- };
26
- }
27
-
28
- return graph;
29
- }
30
-
31
- // https://en.wikipedia.org/wiki/Breadth-first_search
32
- function deriveBFS(fromModel) {
33
- const graph = buildGraph();
34
- const queue = [fromModel]; // Unshift -> queue -> pop
35
-
36
- graph[fromModel].distance = 0;
37
-
38
- while (queue.length) {
39
- const current = queue.pop();
40
- const adjacents = Object.keys(conversions[current]);
41
-
42
- for (let len = adjacents.length, i = 0; i < len; i++) {
43
- const adjacent = adjacents[i];
44
- const node = graph[adjacent];
45
-
46
- if (node.distance === -1) {
47
- node.distance = graph[current].distance + 1;
48
- node.parent = current;
49
- queue.unshift(adjacent);
50
- }
51
- }
52
- }
53
-
54
- return graph;
55
- }
56
-
57
- function link(from, to) {
58
- return function (args) {
59
- return to(from(args));
60
- };
61
- }
62
-
63
- function wrapConversion(toModel, graph) {
64
- const path = [graph[toModel].parent, toModel];
65
- let fn = conversions[graph[toModel].parent][toModel];
66
-
67
- let cur = graph[toModel].parent;
68
- while (graph[cur].parent) {
69
- path.unshift(graph[cur].parent);
70
- fn = link(conversions[graph[cur].parent][cur], fn);
71
- cur = graph[cur].parent;
72
- }
73
-
74
- fn.conversion = path;
75
- return fn;
76
- }
77
-
78
- module.exports = function (fromModel) {
79
- const graph = deriveBFS(fromModel);
80
- const conversion = {};
81
-
82
- const models = Object.keys(graph);
83
- for (let len = models.length, i = 0; i < len; i++) {
84
- const toModel = models[i];
85
- const node = graph[toModel];
86
-
87
- if (node.parent === null) {
88
- // No possible conversion, or this node is the source model.
89
- continue;
90
- }
91
-
92
- conversion[toModel] = wrapConversion(toModel, graph);
93
- }
94
-
95
- return conversion;
96
- };
97
-
@@ -1,8 +0,0 @@
1
- The MIT License (MIT)
2
- Copyright (c) 2015 Dmitry Ivanov
3
-
4
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
5
-
6
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
7
-
8
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,11 +0,0 @@
1
- A JSON with color names and its values. Based on http://dev.w3.org/csswg/css-color/#named-colors.
2
-
3
- [![NPM](https://nodei.co/npm/color-name.png?mini=true)](https://nodei.co/npm/color-name/)
4
-
5
-
6
- ```js
7
- var colors = require('color-name');
8
- colors.red //[255,0,0]
9
- ```
10
-
11
- <a href="LICENSE"><img src="https://upload.wikimedia.org/wikipedia/commons/0/0c/MIT_logo.svg" width="120"/></a>
@@ -1,152 +0,0 @@
1
- 'use strict'
2
-
3
- module.exports = {
4
- "aliceblue": [240, 248, 255],
5
- "antiquewhite": [250, 235, 215],
6
- "aqua": [0, 255, 255],
7
- "aquamarine": [127, 255, 212],
8
- "azure": [240, 255, 255],
9
- "beige": [245, 245, 220],
10
- "bisque": [255, 228, 196],
11
- "black": [0, 0, 0],
12
- "blanchedalmond": [255, 235, 205],
13
- "blue": [0, 0, 255],
14
- "blueviolet": [138, 43, 226],
15
- "brown": [165, 42, 42],
16
- "burlywood": [222, 184, 135],
17
- "cadetblue": [95, 158, 160],
18
- "chartreuse": [127, 255, 0],
19
- "chocolate": [210, 105, 30],
20
- "coral": [255, 127, 80],
21
- "cornflowerblue": [100, 149, 237],
22
- "cornsilk": [255, 248, 220],
23
- "crimson": [220, 20, 60],
24
- "cyan": [0, 255, 255],
25
- "darkblue": [0, 0, 139],
26
- "darkcyan": [0, 139, 139],
27
- "darkgoldenrod": [184, 134, 11],
28
- "darkgray": [169, 169, 169],
29
- "darkgreen": [0, 100, 0],
30
- "darkgrey": [169, 169, 169],
31
- "darkkhaki": [189, 183, 107],
32
- "darkmagenta": [139, 0, 139],
33
- "darkolivegreen": [85, 107, 47],
34
- "darkorange": [255, 140, 0],
35
- "darkorchid": [153, 50, 204],
36
- "darkred": [139, 0, 0],
37
- "darksalmon": [233, 150, 122],
38
- "darkseagreen": [143, 188, 143],
39
- "darkslateblue": [72, 61, 139],
40
- "darkslategray": [47, 79, 79],
41
- "darkslategrey": [47, 79, 79],
42
- "darkturquoise": [0, 206, 209],
43
- "darkviolet": [148, 0, 211],
44
- "deeppink": [255, 20, 147],
45
- "deepskyblue": [0, 191, 255],
46
- "dimgray": [105, 105, 105],
47
- "dimgrey": [105, 105, 105],
48
- "dodgerblue": [30, 144, 255],
49
- "firebrick": [178, 34, 34],
50
- "floralwhite": [255, 250, 240],
51
- "forestgreen": [34, 139, 34],
52
- "fuchsia": [255, 0, 255],
53
- "gainsboro": [220, 220, 220],
54
- "ghostwhite": [248, 248, 255],
55
- "gold": [255, 215, 0],
56
- "goldenrod": [218, 165, 32],
57
- "gray": [128, 128, 128],
58
- "green": [0, 128, 0],
59
- "greenyellow": [173, 255, 47],
60
- "grey": [128, 128, 128],
61
- "honeydew": [240, 255, 240],
62
- "hotpink": [255, 105, 180],
63
- "indianred": [205, 92, 92],
64
- "indigo": [75, 0, 130],
65
- "ivory": [255, 255, 240],
66
- "khaki": [240, 230, 140],
67
- "lavender": [230, 230, 250],
68
- "lavenderblush": [255, 240, 245],
69
- "lawngreen": [124, 252, 0],
70
- "lemonchiffon": [255, 250, 205],
71
- "lightblue": [173, 216, 230],
72
- "lightcoral": [240, 128, 128],
73
- "lightcyan": [224, 255, 255],
74
- "lightgoldenrodyellow": [250, 250, 210],
75
- "lightgray": [211, 211, 211],
76
- "lightgreen": [144, 238, 144],
77
- "lightgrey": [211, 211, 211],
78
- "lightpink": [255, 182, 193],
79
- "lightsalmon": [255, 160, 122],
80
- "lightseagreen": [32, 178, 170],
81
- "lightskyblue": [135, 206, 250],
82
- "lightslategray": [119, 136, 153],
83
- "lightslategrey": [119, 136, 153],
84
- "lightsteelblue": [176, 196, 222],
85
- "lightyellow": [255, 255, 224],
86
- "lime": [0, 255, 0],
87
- "limegreen": [50, 205, 50],
88
- "linen": [250, 240, 230],
89
- "magenta": [255, 0, 255],
90
- "maroon": [128, 0, 0],
91
- "mediumaquamarine": [102, 205, 170],
92
- "mediumblue": [0, 0, 205],
93
- "mediumorchid": [186, 85, 211],
94
- "mediumpurple": [147, 112, 219],
95
- "mediumseagreen": [60, 179, 113],
96
- "mediumslateblue": [123, 104, 238],
97
- "mediumspringgreen": [0, 250, 154],
98
- "mediumturquoise": [72, 209, 204],
99
- "mediumvioletred": [199, 21, 133],
100
- "midnightblue": [25, 25, 112],
101
- "mintcream": [245, 255, 250],
102
- "mistyrose": [255, 228, 225],
103
- "moccasin": [255, 228, 181],
104
- "navajowhite": [255, 222, 173],
105
- "navy": [0, 0, 128],
106
- "oldlace": [253, 245, 230],
107
- "olive": [128, 128, 0],
108
- "olivedrab": [107, 142, 35],
109
- "orange": [255, 165, 0],
110
- "orangered": [255, 69, 0],
111
- "orchid": [218, 112, 214],
112
- "palegoldenrod": [238, 232, 170],
113
- "palegreen": [152, 251, 152],
114
- "paleturquoise": [175, 238, 238],
115
- "palevioletred": [219, 112, 147],
116
- "papayawhip": [255, 239, 213],
117
- "peachpuff": [255, 218, 185],
118
- "peru": [205, 133, 63],
119
- "pink": [255, 192, 203],
120
- "plum": [221, 160, 221],
121
- "powderblue": [176, 224, 230],
122
- "purple": [128, 0, 128],
123
- "rebeccapurple": [102, 51, 153],
124
- "red": [255, 0, 0],
125
- "rosybrown": [188, 143, 143],
126
- "royalblue": [65, 105, 225],
127
- "saddlebrown": [139, 69, 19],
128
- "salmon": [250, 128, 114],
129
- "sandybrown": [244, 164, 96],
130
- "seagreen": [46, 139, 87],
131
- "seashell": [255, 245, 238],
132
- "sienna": [160, 82, 45],
133
- "silver": [192, 192, 192],
134
- "skyblue": [135, 206, 235],
135
- "slateblue": [106, 90, 205],
136
- "slategray": [112, 128, 144],
137
- "slategrey": [112, 128, 144],
138
- "snow": [255, 250, 250],
139
- "springgreen": [0, 255, 127],
140
- "steelblue": [70, 130, 180],
141
- "tan": [210, 180, 140],
142
- "teal": [0, 128, 128],
143
- "thistle": [216, 191, 216],
144
- "tomato": [255, 99, 71],
145
- "turquoise": [64, 224, 208],
146
- "violet": [238, 130, 238],
147
- "wheat": [245, 222, 179],
148
- "white": [255, 255, 255],
149
- "whitesmoke": [245, 245, 245],
150
- "yellow": [255, 255, 0],
151
- "yellowgreen": [154, 205, 50]
152
- };
@@ -1,28 +0,0 @@
1
- {
2
- "name": "color-name",
3
- "version": "1.1.4",
4
- "description": "A list of color names and its values",
5
- "main": "index.js",
6
- "files": [
7
- "index.js"
8
- ],
9
- "scripts": {
10
- "test": "node test.js"
11
- },
12
- "repository": {
13
- "type": "git",
14
- "url": "git@github.com:colorjs/color-name.git"
15
- },
16
- "keywords": [
17
- "color-name",
18
- "color",
19
- "color-keyword",
20
- "keyword"
21
- ],
22
- "author": "DY <dfcreative@gmail.com>",
23
- "license": "MIT",
24
- "bugs": {
25
- "url": "https://github.com/colorjs/color-name/issues"
26
- },
27
- "homepage": "https://github.com/colorjs/color-name"
28
- }
@@ -1,22 +0,0 @@
1
- (The MIT License)
2
-
3
- Copyright (c) 2011 TJ Holowaychuk <tj@vision-media.ca>
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining
6
- a copy of this software and associated documentation files (the
7
- 'Software'), to deal in the Software without restriction, including
8
- without limitation the rights to use, copy, modify, merge, publish,
9
- distribute, sublicense, and/or sell copies of the Software, and to
10
- permit persons to whom the Software is furnished to do so, subject to
11
- the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be
14
- included in all copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.