knosky 0.6.3 → 0.7.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 (64) hide show
  1. package/CHANGELOG.md +149 -93
  2. package/CREDITS.md +14 -14
  3. package/LICENSE.md +76 -76
  4. package/LIMITATIONS.md +33 -23
  5. package/PRIVACY.md +30 -30
  6. package/README.md +170 -117
  7. package/SECURITY.md +78 -46
  8. package/action/post-comment.mjs +94 -89
  9. package/action.yml +62 -62
  10. package/bin/knosky.mjs +279 -105
  11. package/core/CONTRACT.md +70 -70
  12. package/core/append-only-checkpoint.mjs +215 -0
  13. package/core/audit-writer.mjs +317 -0
  14. package/core/benchmark-results.mjs +225 -225
  15. package/core/bundle.mjs +178 -178
  16. package/core/churn.mjs +23 -23
  17. package/core/ci.mjs +268 -268
  18. package/core/comparison.mjs +189 -189
  19. package/core/config.mjs +189 -189
  20. package/core/constants.mjs +13 -13
  21. package/core/contract.mjs +123 -123
  22. package/core/cross-repo.mjs +111 -111
  23. package/core/decision-codes.mjs +92 -0
  24. package/core/destination.mjs +161 -161
  25. package/core/district-classification.mjs +111 -0
  26. package/core/doctor-scorecard.mjs +369 -0
  27. package/core/domain-store.mjs +347 -0
  28. package/core/edges.mjs +43 -43
  29. package/core/escalate.mjs +68 -68
  30. package/core/freshness.mjs +198 -194
  31. package/core/fs-indexer.mjs +218 -218
  32. package/core/key-store.mjs +348 -348
  33. package/core/layout.mjs +46 -46
  34. package/core/ledger.mjs +176 -141
  35. package/core/local-ipc-identity.mjs +500 -0
  36. package/core/lod.mjs +155 -155
  37. package/core/mode-b.mjs +410 -0
  38. package/core/multi-model-benchmark.mjs +405 -405
  39. package/core/net-lockdown.mjs +421 -0
  40. package/core/onboarding.mjs +223 -223
  41. package/core/operator-auth.mjs +317 -0
  42. package/core/overlays.mjs +45 -45
  43. package/core/policy-lattice.mjs +142 -0
  44. package/core/pr-comment.mjs +198 -198
  45. package/core/protocol-spec.mjs +460 -460
  46. package/core/provenance.mjs +320 -0
  47. package/core/retrieve.mjs +63 -63
  48. package/core/route.mjs +304 -304
  49. package/core/schema.mjs +275 -275
  50. package/core/signing-tiers.mjs +1265 -0
  51. package/core/swarm-bench.mjs +106 -0
  52. package/core/swarm-coordinator.mjs +867 -0
  53. package/core/trust-root-rekey.mjs +410 -0
  54. package/mcp/server.mjs +264 -108
  55. package/package.json +56 -46
  56. package/renderer/art/kenney/buildingTiles_sheet.xml +130 -130
  57. package/renderer/art/kenney/cityDetails_sheet.xml +12 -12
  58. package/renderer/art/kenney/landscapeTiles_sheet.xml +129 -129
  59. package/renderer/art/kenney/sheet_allCars.xml +545 -545
  60. package/renderer/build-rich.mjs +43 -43
  61. package/renderer/city.template.html +808 -808
  62. package/ssot/decision-codes.json +133 -0
  63. package/ssot/ladder-l0-l3.md +232 -0
  64. package/ssot/tool-menu.json +130 -0
@@ -1,43 +1,43 @@
1
- // Build a single-file, self-contained KnoSky city: inline the contract data AND the CC0 art
2
- // sheets (base64) so the output .html opens anywhere - no server, no asset folder.
3
- //
4
- // node renderer/build-rich.mjs <city-data.json> <out.html> # Kenney CC0 art (default)
5
- // node renderer/build-rich.mjs <city-data.json> <out.html> --vector # owned vector art, no sprites
6
- import fs from 'node:fs';
7
- import path from 'node:path';
8
- import { fileURLToPath } from 'node:url';
9
-
10
- const DIR = path.dirname(fileURLToPath(import.meta.url));
11
- const args = process.argv.slice(2).filter(a => !a.startsWith('--'));
12
- const [dataPath, outName] = args;
13
- if (!dataPath || !outName) {
14
- console.log('usage: node build-rich.mjs <city-data.json> <out.html> [--vector]');
15
- process.exit(1);
16
- }
17
-
18
- // Escape a string for safe embedding inside an HTML <script> block: neutralize </script> breakout
19
- // and the U+2028/U+2029 JS line-terminator hazard. Output stays valid JSON. (No literal control chars in source.)
20
- const U2028 = String.fromCharCode(0x2028), U2029 = String.fromCharCode(0x2029);
21
- const htmlSafe = (s) => s.split('<').join('\\u003c').split(U2028).join('\\u2028').split(U2029).join('\\u2029');
22
-
23
- const VECTOR = process.argv.includes('--vector'); // owned vector art; default = Kenney CC0 sprite art
24
- let head = '<script>window.__KC_VECTOR__=true;</script>\n';
25
- if (!VECTOR) {
26
- const KDIR = path.join(DIR, 'art', 'kenney');
27
- const SHEETS = ['buildingTiles_sheet', 'cityDetails_sheet', 'sheet_allCars', 'landscapeTiles_sheet'];
28
- const ks = {};
29
- for (const nm of SHEETS) ks[nm] = {
30
- xml: fs.readFileSync(path.join(KDIR, nm + '.xml'), 'utf8'),
31
- png: 'data:image/png;base64,' + fs.readFileSync(path.join(KDIR, nm + '.png')).toString('base64')
32
- };
33
- head = '<script>window.__KC_KENNEY__=true;window.__KC_KENNEY_SHEETS__=' + htmlSafe(JSON.stringify(ks)) + ';</script>\n';
34
- }
35
-
36
- const tmpl = fs.readFileSync(path.join(DIR, 'city.template.html'), 'utf8');
37
- const data = htmlSafe(fs.readFileSync(path.resolve(dataPath), 'utf8').trim());
38
- let html = tmpl.replace('__CITY_DATA__', () => data);
39
- html = html.replace('<script id="kc-data"', () => head + '<script id="kc-data"');
40
-
41
- const out = path.resolve(outName);
42
- fs.writeFileSync(out, html);
43
- console.log('built', out, '->', (html.length / 1024 / 1024).toFixed(2), 'MB (single file)');
1
+ // Build a single-file, self-contained KnoSky city: inline the contract data AND the CC0 art
2
+ // sheets (base64) so the output .html opens anywhere - no server, no asset folder.
3
+ //
4
+ // node renderer/build-rich.mjs <city-data.json> <out.html> # Kenney CC0 art (default)
5
+ // node renderer/build-rich.mjs <city-data.json> <out.html> --vector # owned vector art, no sprites
6
+ import fs from 'node:fs';
7
+ import path from 'node:path';
8
+ import { fileURLToPath } from 'node:url';
9
+
10
+ const DIR = path.dirname(fileURLToPath(import.meta.url));
11
+ const args = process.argv.slice(2).filter(a => !a.startsWith('--'));
12
+ const [dataPath, outName] = args;
13
+ if (!dataPath || !outName) {
14
+ console.log('usage: node build-rich.mjs <city-data.json> <out.html> [--vector]');
15
+ process.exit(1);
16
+ }
17
+
18
+ // Escape a string for safe embedding inside an HTML <script> block: neutralize </script> breakout
19
+ // and the U+2028/U+2029 JS line-terminator hazard. Output stays valid JSON. (No literal control chars in source.)
20
+ const U2028 = String.fromCharCode(0x2028), U2029 = String.fromCharCode(0x2029);
21
+ const htmlSafe = (s) => s.split('<').join('\\u003c').split(U2028).join('\\u2028').split(U2029).join('\\u2029');
22
+
23
+ const VECTOR = process.argv.includes('--vector'); // owned vector art; default = Kenney CC0 sprite art
24
+ let head = '<script>window.__KC_VECTOR__=true;</script>\n';
25
+ if (!VECTOR) {
26
+ const KDIR = path.join(DIR, 'art', 'kenney');
27
+ const SHEETS = ['buildingTiles_sheet', 'cityDetails_sheet', 'sheet_allCars', 'landscapeTiles_sheet'];
28
+ const ks = {};
29
+ for (const nm of SHEETS) ks[nm] = {
30
+ xml: fs.readFileSync(path.join(KDIR, nm + '.xml'), 'utf8'),
31
+ png: 'data:image/png;base64,' + fs.readFileSync(path.join(KDIR, nm + '.png')).toString('base64')
32
+ };
33
+ head = '<script>window.__KC_KENNEY__=true;window.__KC_KENNEY_SHEETS__=' + htmlSafe(JSON.stringify(ks)) + ';</script>\n';
34
+ }
35
+
36
+ const tmpl = fs.readFileSync(path.join(DIR, 'city.template.html'), 'utf8');
37
+ const data = htmlSafe(fs.readFileSync(path.resolve(dataPath), 'utf8').trim());
38
+ let html = tmpl.replace('__CITY_DATA__', () => data);
39
+ html = html.replace('<script id="kc-data"', () => head + '<script id="kc-data"');
40
+
41
+ const out = path.resolve(outName);
42
+ fs.writeFileSync(out, html);
43
+ console.log('built', out, '->', (html.length / 1024 / 1024).toFixed(2), 'MB (single file)');