@ruverd/julius 0.24.4 → 0.25.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 (70) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +41 -5
  3. package/dist/ask/ask.d.ts +7 -0
  4. package/dist/ask/ask.d.ts.map +1 -1
  5. package/dist/ask/ask.js +1 -1
  6. package/dist/ask/ask.js.map +1 -1
  7. package/dist/cli.d.ts +2 -0
  8. package/dist/cli.d.ts.map +1 -1
  9. package/dist/cli.js +3 -0
  10. package/dist/cli.js.map +1 -1
  11. package/dist/economy/cli.d.ts.map +1 -1
  12. package/dist/economy/cli.js +4 -2
  13. package/dist/economy/cli.js.map +1 -1
  14. package/dist/economy/compact-output.d.ts +7 -0
  15. package/dist/economy/compact-output.d.ts.map +1 -0
  16. package/dist/economy/compact-output.js +47 -0
  17. package/dist/economy/compact-output.js.map +1 -0
  18. package/dist/economy/evidence-transport.d.ts +8 -0
  19. package/dist/economy/evidence-transport.d.ts.map +1 -0
  20. package/dist/economy/evidence-transport.js +28 -0
  21. package/dist/economy/evidence-transport.js.map +1 -0
  22. package/dist/economy/index.d.ts +17 -2
  23. package/dist/economy/index.d.ts.map +1 -1
  24. package/dist/economy/index.js +88 -11
  25. package/dist/economy/index.js.map +1 -1
  26. package/dist/graph/build.d.ts +3 -0
  27. package/dist/graph/build.d.ts.map +1 -1
  28. package/dist/graph/build.js +2 -0
  29. package/dist/graph/build.js.map +1 -1
  30. package/dist/graph/extract-cache.d.ts.map +1 -1
  31. package/dist/graph/extract-cache.js +5 -1
  32. package/dist/graph/extract-cache.js.map +1 -1
  33. package/dist/graph/extract.d.ts.map +1 -1
  34. package/dist/graph/extract.js +4 -0
  35. package/dist/graph/extract.js.map +1 -1
  36. package/dist/graph/rust-settings.d.ts +2 -0
  37. package/dist/graph/rust-settings.d.ts.map +1 -0
  38. package/dist/graph/rust-settings.js +6 -0
  39. package/dist/graph/rust-settings.js.map +1 -0
  40. package/dist/graph/rust.d.ts +24 -0
  41. package/dist/graph/rust.d.ts.map +1 -0
  42. package/dist/graph/rust.js +155 -0
  43. package/dist/graph/rust.js.map +1 -0
  44. package/dist/index.d.ts +2 -0
  45. package/dist/index.d.ts.map +1 -1
  46. package/dist/index.js +1 -0
  47. package/dist/index.js.map +1 -1
  48. package/dist/mcp/compact.d.ts.map +1 -1
  49. package/dist/mcp/compact.js +39 -6
  50. package/dist/mcp/compact.js.map +1 -1
  51. package/dist/mcp/context-evidence.d.ts +25 -0
  52. package/dist/mcp/context-evidence.d.ts.map +1 -0
  53. package/dist/mcp/context-evidence.js +400 -0
  54. package/dist/mcp/context-evidence.js.map +1 -0
  55. package/dist/notes/notes.d.ts +2 -0
  56. package/dist/notes/notes.d.ts.map +1 -1
  57. package/dist/notes/notes.js +14 -2
  58. package/dist/notes/notes.js.map +1 -1
  59. package/dist/util/source.d.ts +2 -0
  60. package/dist/util/source.d.ts.map +1 -1
  61. package/dist/util/source.js +30 -2
  62. package/dist/util/source.js.map +1 -1
  63. package/dist/viewer/app.js +2 -2
  64. package/docs/hybrid-extractor.md +35 -0
  65. package/native/extractor/Cargo.lock +128 -0
  66. package/native/extractor/Cargo.toml +18 -0
  67. package/native/extractor/build.mjs +22 -0
  68. package/native/extractor/build.rs +40 -0
  69. package/native/extractor/src/lib.rs +707 -0
  70. package/package.json +10 -3
@@ -0,0 +1,128 @@
1
+ # This file is automatically @generated by Cargo.
2
+ # It is not intended for manual editing.
3
+ version = 4
4
+
5
+ [[package]]
6
+ name = "cc"
7
+ version = "1.11.0"
8
+ source = "registry+https://github.com/rust-lang/crates.io-index"
9
+ checksum = "375989decec1a0fa424442bed520fa12ede43a48475ce8c7417d2c69b32b5f6b"
10
+ dependencies = [
11
+ "find-msvc-tools",
12
+ "shlex",
13
+ ]
14
+
15
+ [[package]]
16
+ name = "find-msvc-tools"
17
+ version = "0.1.15"
18
+ source = "registry+https://github.com/rust-lang/crates.io-index"
19
+ checksum = "1c66915cc5391097de7a2b0b972e8505aa33c0df401fd3a6811dbdb32881ba48"
20
+
21
+ [[package]]
22
+ name = "itoa"
23
+ version = "1.0.18"
24
+ source = "registry+https://github.com/rust-lang/crates.io-index"
25
+ checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"
26
+
27
+ [[package]]
28
+ name = "julius-extractor"
29
+ version = "0.1.0"
30
+ dependencies = [
31
+ "cc",
32
+ "serde_json",
33
+ ]
34
+
35
+ [[package]]
36
+ name = "memchr"
37
+ version = "2.8.3"
38
+ source = "registry+https://github.com/rust-lang/crates.io-index"
39
+ checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"
40
+
41
+ [[package]]
42
+ name = "proc-macro2"
43
+ version = "1.0.107"
44
+ source = "registry+https://github.com/rust-lang/crates.io-index"
45
+ checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
46
+ dependencies = [
47
+ "unicode-ident",
48
+ ]
49
+
50
+ [[package]]
51
+ name = "quote"
52
+ version = "1.0.47"
53
+ source = "registry+https://github.com/rust-lang/crates.io-index"
54
+ checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
55
+ dependencies = [
56
+ "proc-macro2",
57
+ ]
58
+
59
+ [[package]]
60
+ name = "serde"
61
+ version = "1.0.229"
62
+ source = "registry+https://github.com/rust-lang/crates.io-index"
63
+ checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba"
64
+ dependencies = [
65
+ "serde_core",
66
+ ]
67
+
68
+ [[package]]
69
+ name = "serde_core"
70
+ version = "1.0.229"
71
+ source = "registry+https://github.com/rust-lang/crates.io-index"
72
+ checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48"
73
+ dependencies = [
74
+ "serde_derive",
75
+ ]
76
+
77
+ [[package]]
78
+ name = "serde_derive"
79
+ version = "1.0.229"
80
+ source = "registry+https://github.com/rust-lang/crates.io-index"
81
+ checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348"
82
+ dependencies = [
83
+ "proc-macro2",
84
+ "quote",
85
+ "syn",
86
+ ]
87
+
88
+ [[package]]
89
+ name = "serde_json"
90
+ version = "1.0.154"
91
+ source = "registry+https://github.com/rust-lang/crates.io-index"
92
+ checksum = "e7e9cc8b1b85264074fbcc02a88680c4096b1e47df8f739dceb03bf482f04bd6"
93
+ dependencies = [
94
+ "itoa",
95
+ "memchr",
96
+ "serde",
97
+ "serde_core",
98
+ "zmij",
99
+ ]
100
+
101
+ [[package]]
102
+ name = "shlex"
103
+ version = "2.0.1"
104
+ source = "registry+https://github.com/rust-lang/crates.io-index"
105
+ checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba"
106
+
107
+ [[package]]
108
+ name = "syn"
109
+ version = "3.0.9"
110
+ source = "registry+https://github.com/rust-lang/crates.io-index"
111
+ checksum = "d78c8dee4c7bf0e14673097256fed6142ce9d3b85a408189d07482442145823b"
112
+ dependencies = [
113
+ "proc-macro2",
114
+ "quote",
115
+ "unicode-ident",
116
+ ]
117
+
118
+ [[package]]
119
+ name = "unicode-ident"
120
+ version = "1.0.27"
121
+ source = "registry+https://github.com/rust-lang/crates.io-index"
122
+ checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563"
123
+
124
+ [[package]]
125
+ name = "zmij"
126
+ version = "1.0.23"
127
+ source = "registry+https://github.com/rust-lang/crates.io-index"
128
+ checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b"
@@ -0,0 +1,18 @@
1
+ [package]
2
+ name = "julius-extractor"
3
+ version = "0.1.0"
4
+ edition = "2021"
5
+ publish = false
6
+
7
+ [lib]
8
+ crate-type = ["cdylib"]
9
+
10
+ [dependencies]
11
+ serde_json = "=1.0.154"
12
+
13
+ [build-dependencies]
14
+ cc = "=1.11.0"
15
+
16
+ [profile.release]
17
+ lto = true
18
+ codegen-units = 1
@@ -0,0 +1,22 @@
1
+ import { execFileSync } from 'node:child_process';
2
+ import { copyFileSync, existsSync, renameSync } from 'node:fs';
3
+ import { createRequire } from 'node:module';
4
+ import { homedir } from 'node:os';
5
+ import { dirname, join, resolve } from 'node:path';
6
+ import { fileURLToPath } from 'node:url';
7
+
8
+ const here = dirname(fileURLToPath(import.meta.url));
9
+ if (!['darwin', 'linux'].includes(process.platform)) throw new Error('Rust extraction currently supports macOS and Linux; use the default TypeScript backend on this platform');
10
+ const require = createRequire(import.meta.url);
11
+ const cargo = process.env.CARGO ?? (existsSync(join(homedir(), '.cargo/bin/cargo')) ? join(homedir(), '.cargo/bin/cargo') : 'cargo');
12
+ // Resolve each package independently: npm may hoist dependencies above this package.
13
+ const core = dirname(require.resolve('tree-sitter/package.json'));
14
+ const grammar = dirname(require.resolve('tree-sitter-typescript/package.json'));
15
+ execFileSync(cargo, ['build', '--release', '--locked', ...(process.argv.includes('--online') ? [] : ['--offline']), '--manifest-path', join(here, 'Cargo.toml')], {
16
+ cwd: here, stdio: 'inherit', env: { ...process.env, JULIUS_TREE_SITTER: core, JULIUS_TS_GRAMMAR: grammar },
17
+ });
18
+ const library = process.platform === 'darwin' ? 'libjulius_extractor.dylib' : 'libjulius_extractor.so';
19
+ const target = join(here, 'extractor.node');
20
+ copyFileSync(join(resolve(here, process.env.CARGO_TARGET_DIR || 'target'), 'release', library), `${target}.tmp`);
21
+ renameSync(`${target}.tmp`, target);
22
+ console.log(`Built optional Rust extractor: ${target}`);
@@ -0,0 +1,40 @@
1
+ use std::{env, path::PathBuf};
2
+
3
+ fn main() {
4
+ let core = PathBuf::from(
5
+ env::var("JULIUS_TREE_SITTER")
6
+ .expect("Set JULIUS_TREE_SITTER to the installed tree-sitter package"),
7
+ )
8
+ .join("vendor/tree-sitter/lib");
9
+ let grammar = PathBuf::from(
10
+ env::var("JULIUS_TS_GRAMMAR")
11
+ .expect("Set JULIUS_TS_GRAMMAR to the installed TypeScript grammar package"),
12
+ );
13
+ cc::Build::new()
14
+ .define("_POSIX_C_SOURCE", "200112L")
15
+ .define("_DEFAULT_SOURCE", None)
16
+ .include(core.join("src"))
17
+ .include(core.join("include"))
18
+ .file(core.join("src/lib.c"))
19
+ .flag_if_supported("-std=c11")
20
+ .warnings(false)
21
+ .compile("julius_ts_core");
22
+ for name in ["typescript", "tsx"] {
23
+ let dir = grammar.join(name).join("src");
24
+ cc::Build::new()
25
+ .include(&dir)
26
+ .file(dir.join("parser.c"))
27
+ .file(dir.join("scanner.c"))
28
+ .flag_if_supported("-std=c11")
29
+ .warnings(false)
30
+ .compile(&format!("julius_ts_{name}"));
31
+ }
32
+ if env::var("CARGO_CFG_TARGET_OS").as_deref() == Ok("macos") {
33
+ println!("cargo:rustc-link-arg=-undefined");
34
+ println!("cargo:rustc-link-arg=dynamic_lookup");
35
+ }
36
+ println!("cargo:rerun-if-env-changed=JULIUS_TREE_SITTER");
37
+ println!("cargo:rerun-if-env-changed=JULIUS_TS_GRAMMAR");
38
+ println!("cargo:rerun-if-changed={}", core.display());
39
+ println!("cargo:rerun-if-changed={}", grammar.display());
40
+ }