@chemx/starter-kit 26.10.29-360 → 26.11.15-614

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 (103) hide show
  1. package/README.md +106 -433
  2. package/cli/audit/ratchet.js +52 -7
  3. package/cli/commands/cmd-router.js +3 -1
  4. package/cli/commands-schema-commit.js +3 -2
  5. package/cli/commands-schema-search.js +1 -0
  6. package/cli/commands-schema-team.js +11 -4
  7. package/cli/commit/commit-args.js +5 -4
  8. package/cli/commit/commit-hunks.js +108 -0
  9. package/cli/commit/commit-run.js +33 -2
  10. package/cli/config/index.js +28 -0
  11. package/cli/docs-check/command-tree.js +1 -1
  12. package/cli/generator-indexer.js +3 -2
  13. package/cli/index-seed.js +1 -0
  14. package/cli/lang/detect.js +189 -0
  15. package/cli/lang/legacy-extensions.js +9 -0
  16. package/cli/lang/records/c.js +53 -0
  17. package/cli/lang/records/cpp.js +76 -0
  18. package/cli/lang/records/csharp.js +59 -0
  19. package/cli/lang/records/go.js +47 -0
  20. package/cli/lang/records/index.js +18 -0
  21. package/cli/lang/records/java.js +55 -0
  22. package/cli/lang/records/javascript.js +50 -0
  23. package/cli/lang/records/kotlin.js +48 -0
  24. package/cli/lang/records/php.js +54 -0
  25. package/cli/lang/records/python.js +50 -0
  26. package/cli/lang/records/rust.js +47 -0
  27. package/cli/lang/records/svelte.js +45 -0
  28. package/cli/lang/records/typescript.js +66 -0
  29. package/cli/lang/records/vue.js +45 -0
  30. package/cli/lang/registry.js +73 -0
  31. package/cli/lang/rollout.js +114 -0
  32. package/cli/lang/schema.js +288 -0
  33. package/cli/lang/static-table.js +71 -0
  34. package/cli/lang/types.d.ts +142 -0
  35. package/cli/lang/vocab.js +90 -0
  36. package/cli/languages.js +50 -88
  37. package/cli/search-args.js +1 -1
  38. package/cli/search-ast-module.js +26 -3
  39. package/cli/search-ast.js +4 -2
  40. package/cli/search-commands.js +44 -0
  41. package/cli/search-db.js +1 -0
  42. package/cli/search-index-meta.js +23 -7
  43. package/cli/search-index-write.js +5 -2
  44. package/cli/search-literal.js +24 -6
  45. package/cli/search-queries.js +19 -0
  46. package/cli/search-schema-ddl.js +11 -0
  47. package/cli/search-schema.js +6 -3
  48. package/cli/search-sync-paths.js +4 -3
  49. package/cli/search-sync-rows.js +2 -2
  50. package/cli/search-sync.js +2 -0
  51. package/cli/search.js +8 -3
  52. package/cli/team/check-delivery.js +115 -0
  53. package/cli/team/check-drainer.js +288 -0
  54. package/cli/team/check-executor.js +106 -0
  55. package/cli/team/check-fingerprint.js +105 -0
  56. package/cli/team/check-queue.js +114 -0
  57. package/cli/team/help/card-rows.js +2 -1
  58. package/cli/team/help/check.js +6 -0
  59. package/cli/team/team-commands-check.js +142 -0
  60. package/cli/team/team-commands.js +6 -4
  61. package/cli/team/team-db-feed.js +6 -0
  62. package/cli/team/team-db-task-helpers.js +9 -6
  63. package/cli/team/team-dispatch-prompts.js +10 -1
  64. package/cli/team/team-dispatch-select.js +1 -0
  65. package/cli/team/team-dispatch-v2.js +1 -0
  66. package/cli/team/team-dispatch.js +3 -1
  67. package/cli/team/team-help-golden.json +20 -5
  68. package/cli/team/team-schema-checks.js +46 -0
  69. package/cli/team/team-schema.js +2 -0
  70. package/cli/ui-api-index.js +39 -0
  71. package/cli/ui-handlers.js +17 -20
  72. package/cli/ui-html.js +17 -4
  73. package/cli/ui-index.html +298 -107
  74. package/cli/ui-page/components/00-core.css +10 -0
  75. package/cli/ui-page/components/00-core.js +78 -0
  76. package/cli/ui-page/components/xo-agent-profile.js +6 -0
  77. package/cli/ui-page/components/xo-avatar.js +17 -0
  78. package/cli/ui-page/components/xo-composer.js +5 -0
  79. package/cli/ui-page/components/xo-notification-bell.js +5 -0
  80. package/cli/ui-page/components/xo-post-card.js +20 -0
  81. package/cli/ui-page/components/xo-post-permalink.js +5 -0
  82. package/cli/ui-page/components/xo-post-thread.js +5 -0
  83. package/cli/ui-page/components/xo-timeline.js +52 -0
  84. package/cli/ui-page/components/xo-today-card.js +5 -0
  85. package/cli/ui-paging-agents.js +34 -0
  86. package/cli/ui-paging-feed.js +14 -0
  87. package/cli/ui-paging-task-where.js +63 -0
  88. package/cli/ui-paging-tasks.js +68 -0
  89. package/cli/ui-paging.js +35 -0
  90. package/cli/ui-server-routes.js +5 -4
  91. package/cli/ui-server.js +12 -0
  92. package/cli/ui-social-digest.js +12 -0
  93. package/cli/ui-social-feed.js +12 -0
  94. package/cli/ui-social-mentions.js +12 -0
  95. package/cli/ui-social-notify.js +12 -0
  96. package/cli/ui-social-posts.js +12 -0
  97. package/cli/ui-social-profile.js +12 -0
  98. package/cli/ui-social-routes.js +21 -0
  99. package/cli/ui-social-threads.js +12 -0
  100. package/package.json +2 -2
  101. package/scripts/package-json-guard.mjs +35 -0
  102. package/scripts/package-json-guard.spec.mjs +50 -0
  103. package/scripts/publish-both.mjs +25 -7
@@ -0,0 +1,189 @@
1
+ /**
2
+ * Language detection (design spec 4.3). languageForPath tries, in order: the exact extension
3
+ * (lowercase), the exact basename, path globs (the config map, then record `files.paths`), the
4
+ * shebang of an extensionless file, then content markers and the project tie-break for an
5
+ * ambiguous extension. An extension nothing settles is no language with reason
6
+ * `ambiguous-extension`. Content is the first 8 KB: `options.content`, or read under `options.root`.
7
+ */
8
+ import fs from 'node:fs';
9
+ import path from 'node:path';
10
+ import { getLanguage, languageTable } from './registry.js';
11
+ import { compileGlob } from './static-table.js';
12
+
13
+ const HEAD_BYTES = 8192;
14
+ const markerCache = new Map();
15
+
16
+ const found = (id, via, candidates) => ({ id, record: getLanguage(id), via, reason: null, candidates });
17
+ const notFound = (reason, candidates = []) => ({ id: null, record: null, via: null, reason, candidates });
18
+
19
+ const toPosix = (relPath) => relPath.replace(/\\/g, '/').replace(/^\.\//, '');
20
+
21
+ const markerRe = (source) => {
22
+ const cached = markerCache.get(source) ?? new RegExp(source, 'm');
23
+ markerCache.set(source, cached);
24
+ return cached;
25
+ };
26
+
27
+ const readHead = (root, rel) => {
28
+ let fd = null;
29
+ try {
30
+ fd = fs.openSync(path.join(root, rel), 'r');
31
+ const buffer = Buffer.alloc(HEAD_BYTES);
32
+ const bytes = fs.readSync(fd, buffer, 0, HEAD_BYTES, 0);
33
+ return buffer.subarray(0, bytes).toString('utf-8');
34
+ } catch {
35
+ return null;
36
+ } finally {
37
+ const isOpen = fd !== null;
38
+ if (isOpen) fs.closeSync(fd);
39
+ }
40
+ };
41
+
42
+ const listDir = (dir) => {
43
+ try {
44
+ return fs.readdirSync(dir);
45
+ } catch {
46
+ return [];
47
+ }
48
+ };
49
+
50
+ /** The file's directory, then each parent up to and including the root. */
51
+ const ancestorDirs = (dir, root) => {
52
+ const dirs = [dir];
53
+ let at = dir;
54
+ const isInsideRoot = dir === root || dir.startsWith(root + path.sep);
55
+ while (isInsideRoot && at !== root && path.dirname(at) !== at) {
56
+ at = path.dirname(at);
57
+ dirs.push(at);
58
+ }
59
+ return dirs;
60
+ };
61
+
62
+ /** Per-call facts, read lazily: the file head and the directory listings the tie-break needs. */
63
+ const createContext = (rel, options) => {
64
+ const root = options.root ? path.resolve(options.root) : null;
65
+ const abs = root ? path.join(root, rel) : null;
66
+ let head;
67
+ const readContent = () => {
68
+ const hasContent = typeof options.content === 'string';
69
+ if (hasContent) return options.content.slice(0, HEAD_BYTES);
70
+ return root ? readHead(root, rel) : null;
71
+ };
72
+ return {
73
+ rel, root, abs, base: path.posix.basename(rel),
74
+ head: () => {
75
+ const isUnread = head === undefined;
76
+ if (isUnread) head = readContent();
77
+ return head;
78
+ }
79
+ };
80
+ };
81
+
82
+ const mappedLanguage = (rel, map = {}) => {
83
+ const hit = Object.entries(map).find(([glob, id]) => getLanguage(id) && compileGlob(glob).test(rel));
84
+ return hit ? hit[1] : null;
85
+ };
86
+
87
+ const pathLanguage = (rel, options) => mappedLanguage(rel, options.map)
88
+ ?? languageTable().paths.find((entry) => entry.re.test(rel))?.id
89
+ ?? null;
90
+
91
+ /** The interpreter named by a `#!` line, with `/usr/bin/env` and its flags unwrapped. */
92
+ const shebangName = (head) => {
93
+ const hasShebang = typeof head === 'string' && head.startsWith('#!');
94
+ if (!hasShebang) return null;
95
+ const words = head.slice(2).split('\n', 1)[0].trim().split(/\s+/).filter(Boolean);
96
+ const isEnv = path.posix.basename(words[0] ?? '') === 'env';
97
+ const command = isEnv ? words.slice(1).find((w) => !w.startsWith('-') && !w.includes('=')) : words[0];
98
+ return command ? path.posix.basename(command) : null;
99
+ };
100
+
101
+ const shebangLanguages = (name) => {
102
+ const { shebangs } = languageTable();
103
+ return shebangs.get(name) ?? shebangs.get(name.replace(/[\d.]+$/, '')) ?? [];
104
+ };
105
+
106
+ const scoreMarkers = (rule, head) => rule.markers
107
+ .filter((marker) => markerRe(marker.re).test(head))
108
+ .reduce((sum, marker) => sum + marker.weight, 0);
109
+
110
+ /** The one candidate whose markers reach minScore with the highest score, or null on a tie or no match. */
111
+ const byContent = (ext, ids, head) => {
112
+ const scored = ids
113
+ .map((id) => ({ id, rule: getLanguage(id).files.ambiguous?.[ext] }))
114
+ .filter(({ rule }) => rule)
115
+ .map(({ id, rule }) => ({ id, score: scoreMarkers(rule, head), minScore: rule.minScore }))
116
+ .filter(({ score, minScore }) => score >= minScore);
117
+ const top = Math.max(...scored.map((s) => s.score));
118
+ const leaders = scored.filter((s) => s.score === top);
119
+ return leaders.length === 1 ? leaders[0].id : null;
120
+ };
121
+
122
+ const holds = (when, ctx) => {
123
+ const dir = path.dirname(ctx.abs);
124
+ const sibling = when.sibling ? compileGlob(when.sibling) : null;
125
+ const ancestor = when.ancestor ? compileGlob(when.ancestor) : null;
126
+ const hasSibling = !sibling || listDir(dir).some((name) => name !== ctx.base && sibling.test(name));
127
+ const hasAncestor = !ancestor || ancestorDirs(dir, ctx.root).some((d) => listDir(d).some((n) => ancestor.test(n)));
128
+ return hasSibling && hasAncestor;
129
+ };
130
+
131
+ const byTieBreak = (ext, ids, ctx) => {
132
+ const rules = ids.flatMap((id) => getLanguage(id).files.ambiguous?.[ext]?.tieBreak ?? []);
133
+ const hit = ctx.root ? rules.find((rule) => ids.includes(rule.pick) && holds(rule.when, ctx)) : null;
134
+ return hit ? hit.pick : null;
135
+ };
136
+
137
+ const extensionOf = (base) => path.posix.extname(base).toLowerCase();
138
+
139
+ const isAmbiguousExtension = (ext, ids) => ids.length > 1 || ids.some((id) => getLanguage(id).files.ambiguous?.[ext]);
140
+
141
+ /**
142
+ * @param {string} relPath path relative to `options.root` (forward or back slashes)
143
+ * @param {{ content?: string, root?: string, map?: Record<string, string> }} [options]
144
+ * @returns {{ id: string|null, record: object|null, via: 'extension'|'filename'|'path'|'shebang'|'content'|'tie-break'|null,
145
+ * reason: null|'ambiguous-extension'|'unknown', candidates: string[] }}
146
+ */
147
+ export const languageForPath = (relPath, options = {}) => {
148
+ const ctx = createContext(toPosix(relPath), options);
149
+ const ext = extensionOf(ctx.base);
150
+ const table = languageTable();
151
+ const ids = ext ? table.byExtension.get(ext) ?? [] : [];
152
+ const isAmbiguous = isAmbiguousExtension(ext, ids);
153
+ const isUniqueExtension = ids.length > 0 && !isAmbiguous;
154
+ if (isUniqueExtension) return found(ids[0], 'extension', ids);
155
+ const named = table.byFilename.get(ctx.base) ?? [];
156
+ const isNamedFile = named.length > 0;
157
+ if (isNamedFile) return found(named[0], 'filename', named);
158
+ const byPath = pathLanguage(ctx.rel, options);
159
+ if (byPath) return found(byPath, 'path', [byPath]);
160
+ const interpreter = ext ? null : shebangName(ctx.head());
161
+ const byShebang = interpreter ? shebangLanguages(interpreter) : [];
162
+ const hasShebangLanguage = byShebang.length > 0;
163
+ if (hasShebangLanguage) return found(byShebang[0], 'shebang', byShebang);
164
+ if (!isAmbiguous) return notFound('unknown');
165
+ const head = ctx.head();
166
+ const contentPick = head === null ? null : byContent(ext, ids, head);
167
+ if (contentPick) return found(contentPick, 'content', ids);
168
+ const tiePick = byTieBreak(ext, ids, ctx);
169
+ return tiePick ? found(tiePick, 'tie-break', ids) : notFound('ambiguous-extension', ids);
170
+ };
171
+
172
+ /**
173
+ * Content-free candidates for the guard (spec 4.3): every claimant of the extension, else the
174
+ * basename's, else the path glob's language. An ambiguous extension yields all of its candidates.
175
+ */
176
+ export const languageCandidates = (relPath, options = {}) => {
177
+ const rel = toPosix(relPath);
178
+ const base = path.posix.basename(rel);
179
+ const ext = extensionOf(base);
180
+ const table = languageTable();
181
+ const ids = ext ? table.byExtension.get(ext) ?? [] : [];
182
+ const hasExtensionClaimants = ids.length > 0;
183
+ if (hasExtensionClaimants) return [...ids];
184
+ const named = table.byFilename.get(base) ?? [];
185
+ const isNamedFile = named.length > 0;
186
+ if (isNamedFile) return [...named];
187
+ const byPath = pathLanguage(rel, options);
188
+ return byPath ? [byPath] : [];
189
+ };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * The extensions a ratchet scope without `languages` was recorded over: everything the
3
+ * kit scanned before PHP support. Frozen on purpose: registering a language later must
4
+ * never turn an old baseline's unscanned extension into a gated one (it is adopted instead).
5
+ */
6
+ export const LEGACY_LANGUAGES = Object.freeze([
7
+ '.c', '.cc', '.cjs', '.cpp', '.cs', '.cxx', '.go', '.h', '.hh', '.hpp', '.hxx', '.inl',
8
+ '.java', '.js', '.jsx', '.kt', '.mjs', '.py', '.rs', '.svelte', '.ts', '.tsx', '.vue'
9
+ ]);
@@ -0,0 +1,53 @@
1
+ /** C language record (header sniffing per spec 4.3); see design spec 4.2 and 5. */
2
+ export default Object.freeze({
3
+ id: 'c',
4
+ name: 'C',
5
+ version: 1,
6
+ legacyId: 'cpp',
7
+ files: {
8
+ extensions: ['.c', '.h'],
9
+ ambiguous: {
10
+ '.h': {
11
+ markers: [
12
+ { re: '#include\\s*<(stdio|stdlib|string|stdint)\\.h>', weight: 1 },
13
+ { re: '\\btypedef\\s+struct\\b', weight: 1 }
14
+ ],
15
+ minScore: 1
16
+ }
17
+ },
18
+ tests: { names: ['test_*.c', '*_test.c'], dirs: ['tests'] }
19
+ },
20
+ syntax: {
21
+ lineComment: ['//'],
22
+ blockComment: [{ open: '/*', close: '*/' }],
23
+ blockStyle: 'brace',
24
+ qualifier: '.',
25
+ strings: [{ open: '"', close: '"', escape: '\\' }, { open: '\'', close: '\'', escape: '\\' }],
26
+ keywords: ['struct', 'enum', 'union', 'typedef', 'static', 'extern', 'void', 'return']
27
+ },
28
+ parse: { grammar: 'c', queries: 'c', grammarStatus: 'vetted', errorPolicy: 'coverage-only' },
29
+ engines: {
30
+ index: 'legacy-polyglot',
31
+ outline: 'legacy-polyglot',
32
+ symbol: 'legacy-polyglot',
33
+ logic: 'text',
34
+ audit: 'text',
35
+ editGate: 'text'
36
+ },
37
+ stages: { source: 'on', index: 'text', outline: 'text', imports: 'text' },
38
+ symbols: { exportRule: { kind: 'top-level-only' } },
39
+ imports: { resolver: 'c-include' },
40
+ layout: {},
41
+ ecosystems: ['cmake', 'make'],
42
+ audit: { analysisRevision: 1, passes: ['text'] },
43
+ notApplicable: {
44
+ forge: 'JS framework feature; not available outside the JS family',
45
+ heal: 'JS framework feature; not available outside the JS family',
46
+ explode: 'JS framework feature; not available outside the JS family',
47
+ generate: 'JS framework feature; not available outside the JS family',
48
+ capsule: 'JS framework feature; not available outside the JS family',
49
+ scaffold: 'JS framework feature; not available outside the JS family',
50
+ lanes: 'JS framework feature; not available outside the JS family',
51
+ mutators: 'JS framework feature; not available outside the JS family'
52
+ }
53
+ });
@@ -0,0 +1,76 @@
1
+ /** C++ language record (header sniffing per spec 4.3); see design spec 4.2 and 5. */
2
+ export default Object.freeze({
3
+ id: 'cpp',
4
+ name: 'C++',
5
+ version: 1,
6
+ legacyId: 'cpp',
7
+ files: {
8
+ extensions: ['.cpp', '.cc', '.cxx', '.hpp', '.hxx', '.hh', '.inl', '.h'],
9
+ ambiguous: {
10
+ '.h': {
11
+ markers: [
12
+ { re: '\\bnamespace\\s+\\w+', weight: 1 },
13
+ { re: '\\btemplate\\s*<', weight: 1 },
14
+ { re: '\\bclass\\s+\\w+\\s*[:{]', weight: 1 },
15
+ { re: '#include\\s*<(iostream|vector|string|memory)>', weight: 1 }
16
+ ],
17
+ minScore: 1,
18
+ tieBreak: [{ when: { sibling: '*.cpp' }, pick: 'cpp' }]
19
+ }
20
+ },
21
+ tests: { names: ['test_*.cpp', '*_test.cpp', '*_test.cc'], dirs: ['tests'] }
22
+ },
23
+ syntax: {
24
+ lineComment: ['//'],
25
+ blockComment: [{ open: '/*', close: '*/' }],
26
+ blockStyle: 'brace',
27
+ qualifier: '::',
28
+ strings: [{ open: '"', close: '"', escape: '\\' }, { open: '\'', close: '\'', escape: '\\' }],
29
+ keywords: [
30
+ 'struct',
31
+ 'enum',
32
+ 'union',
33
+ 'typedef',
34
+ 'static',
35
+ 'extern',
36
+ 'void',
37
+ 'return',
38
+ 'class',
39
+ 'namespace',
40
+ 'template',
41
+ 'public',
42
+ 'private'
43
+ ]
44
+ },
45
+ parse: {
46
+ grammar: 'cpp',
47
+ queries: 'cpp',
48
+ inheritQueries: ['c'],
49
+ grammarStatus: 'vetted',
50
+ errorPolicy: 'coverage-only'
51
+ },
52
+ engines: {
53
+ index: 'legacy-polyglot',
54
+ outline: 'legacy-polyglot',
55
+ symbol: 'legacy-polyglot',
56
+ logic: 'text',
57
+ audit: 'text',
58
+ editGate: 'text'
59
+ },
60
+ stages: { source: 'on', index: 'text', outline: 'text', imports: 'text' },
61
+ symbols: { exportRule: { kind: 'top-level-only' } },
62
+ imports: { resolver: 'c-include' },
63
+ layout: {},
64
+ ecosystems: ['cmake', 'make'],
65
+ audit: { analysisRevision: 1, passes: ['text'] },
66
+ notApplicable: {
67
+ forge: 'JS framework feature; not available outside the JS family',
68
+ heal: 'JS framework feature; not available outside the JS family',
69
+ explode: 'JS framework feature; not available outside the JS family',
70
+ generate: 'JS framework feature; not available outside the JS family',
71
+ capsule: 'JS framework feature; not available outside the JS family',
72
+ scaffold: 'JS framework feature; not available outside the JS family',
73
+ lanes: 'JS framework feature; not available outside the JS family',
74
+ mutators: 'JS framework feature; not available outside the JS family'
75
+ }
76
+ });
@@ -0,0 +1,59 @@
1
+ /** C# / .NET language record; see design spec 4.2 and 5. */
2
+ export default Object.freeze({
3
+ id: 'csharp',
4
+ name: 'C# / .NET',
5
+ version: 1,
6
+ files: {
7
+ extensions: ['.cs'],
8
+ vendorDirs: [{ name: 'obj', when: 'project-root' }],
9
+ generated: ['*.g.cs', '*.Designer.cs'],
10
+ tests: { names: ['*Test.cs', '*Tests.cs'] }
11
+ },
12
+ syntax: {
13
+ lineComment: ['//'],
14
+ blockComment: [{ open: '/*', close: '*/' }],
15
+ blockStyle: 'brace',
16
+ qualifier: '.',
17
+ strings: [
18
+ { open: '"', close: '"', escape: '\\' },
19
+ { open: '@"', close: '"', escape: null, raw: true, multiline: true }
20
+ ],
21
+ keywords: [
22
+ 'class',
23
+ 'struct',
24
+ 'interface',
25
+ 'enum',
26
+ 'namespace',
27
+ 'using',
28
+ 'public',
29
+ 'private',
30
+ 'internal',
31
+ 'static'
32
+ ]
33
+ },
34
+ parse: { grammar: 'c_sharp', queries: 'csharp', grammarStatus: 'vetted', errorPolicy: 'report' },
35
+ engines: {
36
+ index: 'legacy-polyglot',
37
+ outline: 'legacy-polyglot',
38
+ symbol: 'legacy-polyglot',
39
+ logic: 'text',
40
+ audit: 'csharp-heuristic',
41
+ editGate: 'text'
42
+ },
43
+ stages: { source: 'on', index: 'text', outline: 'text', imports: 'text' },
44
+ symbols: { exportRule: { kind: 'modifier', anyOf: ['public', 'internal'], default: false } },
45
+ imports: { resolver: 'dotnet-namespace' },
46
+ layout: {},
47
+ ecosystems: ['dotnet'],
48
+ audit: { analysisRevision: 1, passes: ['text'] },
49
+ notApplicable: {
50
+ forge: 'JS framework feature; not available outside the JS family',
51
+ heal: 'JS framework feature; not available outside the JS family',
52
+ explode: 'JS framework feature; not available outside the JS family',
53
+ generate: 'JS framework feature; not available outside the JS family',
54
+ capsule: 'JS framework feature; not available outside the JS family',
55
+ scaffold: 'JS framework feature; not available outside the JS family',
56
+ lanes: 'JS framework feature; not available outside the JS family',
57
+ mutators: 'JS framework feature; not available outside the JS family'
58
+ }
59
+ });
@@ -0,0 +1,47 @@
1
+ /** Go language record; see design spec 4.2 and 5. */
2
+ export default Object.freeze({
3
+ id: 'go',
4
+ name: 'Go',
5
+ version: 1,
6
+ files: {
7
+ extensions: ['.go'],
8
+ vendorDirs: [{ name: 'vendor', when: 'project-root' }],
9
+ tests: { names: ['*_test.go'] }
10
+ },
11
+ syntax: {
12
+ lineComment: ['//'],
13
+ blockComment: [{ open: '/*', close: '*/' }],
14
+ blockStyle: 'brace',
15
+ qualifier: '.',
16
+ strings: [
17
+ { open: '"', close: '"', escape: '\\' },
18
+ { open: '`', close: '`', escape: null, raw: true, multiline: true }
19
+ ],
20
+ keywords: ['func', 'type', 'struct', 'interface', 'package', 'import', 'var', 'const']
21
+ },
22
+ parse: { grammar: 'go', queries: 'go', grammarStatus: 'vetted', errorPolicy: 'coverage-only' },
23
+ engines: {
24
+ index: 'legacy-polyglot',
25
+ outline: 'legacy-polyglot',
26
+ symbol: 'legacy-polyglot',
27
+ logic: 'text',
28
+ audit: 'text',
29
+ editGate: 'text'
30
+ },
31
+ stages: { source: 'on', index: 'text', outline: 'text', imports: 'text' },
32
+ symbols: { exportRule: { kind: 'name-capitalized' } },
33
+ imports: { resolver: 'go-module' },
34
+ layout: {},
35
+ ecosystems: ['go'],
36
+ audit: { analysisRevision: 1, passes: ['text'] },
37
+ notApplicable: {
38
+ forge: 'JS framework feature; not available outside the JS family',
39
+ heal: 'JS framework feature; not available outside the JS family',
40
+ explode: 'JS framework feature; not available outside the JS family',
41
+ generate: 'JS framework feature; not available outside the JS family',
42
+ capsule: 'JS framework feature; not available outside the JS family',
43
+ scaffold: 'JS framework feature; not available outside the JS family',
44
+ lanes: 'JS framework feature; not available outside the JS family',
45
+ mutators: 'JS framework feature; not available outside the JS family'
46
+ }
47
+ });
@@ -0,0 +1,18 @@
1
+ /** Every shipped language record, in registration order (design spec 4.2). */
2
+ import javascript from './javascript.js';
3
+ import typescript from './typescript.js';
4
+ import vue from './vue.js';
5
+ import svelte from './svelte.js';
6
+ import php from './php.js';
7
+ import csharp from './csharp.js';
8
+ import python from './python.js';
9
+ import go from './go.js';
10
+ import rust from './rust.js';
11
+ import java from './java.js';
12
+ import kotlin from './kotlin.js';
13
+ import c from './c.js';
14
+ import cpp from './cpp.js';
15
+
16
+ export const LANGUAGE_RECORDS = Object.freeze([
17
+ javascript, typescript, vue, svelte, php, csharp, python, go, rust, java, kotlin, c, cpp
18
+ ]);
@@ -0,0 +1,55 @@
1
+ /** Java language record; see design spec 4.2 and 5. */
2
+ export default Object.freeze({
3
+ id: 'java',
4
+ name: 'Java',
5
+ version: 1,
6
+ legacyId: 'jvm',
7
+ files: {
8
+ extensions: ['.java'],
9
+ tests: { names: ['*Test.java', '*Tests.java', '*IT.java'], dirs: ['src/test'] }
10
+ },
11
+ syntax: {
12
+ lineComment: ['//'],
13
+ blockComment: [{ open: '/*', close: '*/' }],
14
+ blockStyle: 'brace',
15
+ qualifier: '.',
16
+ strings: [{ open: '"', close: '"', escape: '\\' }],
17
+ keywords: [
18
+ 'class',
19
+ 'interface',
20
+ 'enum',
21
+ 'record',
22
+ 'package',
23
+ 'import',
24
+ 'public',
25
+ 'private',
26
+ 'protected',
27
+ 'static'
28
+ ]
29
+ },
30
+ parse: { grammar: 'java', queries: 'java', grammarStatus: 'vetted', errorPolicy: 'report' },
31
+ engines: {
32
+ index: 'legacy-polyglot',
33
+ outline: 'legacy-polyglot',
34
+ symbol: 'legacy-polyglot',
35
+ logic: 'text',
36
+ audit: 'text',
37
+ editGate: 'text'
38
+ },
39
+ stages: { source: 'on', index: 'text', outline: 'text', imports: 'text' },
40
+ symbols: { exportRule: { kind: 'modifier', anyOf: ['public'], noneOf: ['private'], default: false } },
41
+ imports: { resolver: 'jvm-package' },
42
+ layout: {},
43
+ ecosystems: ['maven', 'gradle'],
44
+ audit: { analysisRevision: 1, passes: ['text'] },
45
+ notApplicable: {
46
+ forge: 'JS framework feature; not available outside the JS family',
47
+ heal: 'JS framework feature; not available outside the JS family',
48
+ explode: 'JS framework feature; not available outside the JS family',
49
+ generate: 'JS framework feature; not available outside the JS family',
50
+ capsule: 'JS framework feature; not available outside the JS family',
51
+ scaffold: 'JS framework feature; not available outside the JS family',
52
+ lanes: 'JS framework feature; not available outside the JS family',
53
+ mutators: 'JS framework feature; not available outside the JS family'
54
+ }
55
+ });
@@ -0,0 +1,50 @@
1
+ /** JavaScript language record; see design spec 4.2 and 5. */
2
+ export default Object.freeze({
3
+ id: 'javascript',
4
+ name: 'JavaScript',
5
+ version: 1,
6
+ files: {
7
+ extensions: ['.js', '.jsx', '.mjs', '.cjs'],
8
+ vendorDirs: [{ name: 'node_modules', when: 'always' }],
9
+ tests: {
10
+ names: ['*.test.js', '*.spec.js', '*.test.jsx', '*.spec.jsx', '*.test.mjs', '*.spec.mjs'],
11
+ dirs: ['tests', '__tests__']
12
+ }
13
+ },
14
+ syntax: {
15
+ lineComment: ['//'],
16
+ blockComment: [{ open: '/*', close: '*/' }],
17
+ blockStyle: 'brace',
18
+ qualifier: '.',
19
+ strings: [
20
+ { open: '"', close: '"', escape: '\\' },
21
+ { open: '\'', close: '\'', escape: '\\' },
22
+ { open: '`', close: '`', escape: '\\', multiline: true }
23
+ ],
24
+ keywords: ['function', 'class', 'const', 'let', 'var', 'import', 'export', 'return', 'async', 'await']
25
+ },
26
+ parse: {
27
+ grammar: 'javascript',
28
+ queries: 'javascript',
29
+ grammarStatus: 'vetted',
30
+ errorPolicy: 'report'
31
+ },
32
+ engines: {
33
+ index: 'babel',
34
+ outline: 'babel',
35
+ symbol: 'babel',
36
+ logic: 'babel',
37
+ audit: 'babel',
38
+ editGate: 'babel'
39
+ },
40
+ stages: { source: 'on', index: 'on', outline: 'on', imports: 'on' },
41
+ symbols: { exportRule: { kind: 'capture' } },
42
+ imports: { resolver: 'js' },
43
+ layout: {},
44
+ ecosystems: ['npm'],
45
+ audit: {
46
+ analysisRevision: 1,
47
+ passes: ['text', 'structure', 'complexity', 'errors', 'security', 'logging', 'tests', 'env']
48
+ },
49
+ notApplicable: {}
50
+ });
@@ -0,0 +1,48 @@
1
+ /** Kotlin language record; see design spec 4.2 and 5. */
2
+ export default Object.freeze({
3
+ id: 'kotlin',
4
+ name: 'Kotlin',
5
+ version: 1,
6
+ legacyId: 'jvm',
7
+ files: { extensions: ['.kt'], tests: { names: ['*Test.kt', '*Tests.kt'], dirs: ['src/test'] } },
8
+ syntax: {
9
+ lineComment: ['//'],
10
+ blockComment: [{ open: '/*', close: '*/' }],
11
+ blockStyle: 'brace',
12
+ qualifier: '.',
13
+ strings: [{ open: '"', close: '"', escape: '\\' }],
14
+ keywords: ['class', 'object', 'interface', 'fun', 'val', 'var', 'package', 'import']
15
+ },
16
+ parse: { grammar: 'kotlin', queries: 'kotlin', grammarStatus: 'experimental', errorPolicy: 'report' },
17
+ engines: {
18
+ index: 'legacy-polyglot',
19
+ outline: 'legacy-polyglot',
20
+ symbol: 'legacy-polyglot',
21
+ logic: 'text',
22
+ audit: 'text',
23
+ editGate: 'text'
24
+ },
25
+ stages: { source: 'on', index: 'text', outline: 'text', imports: 'text' },
26
+ symbols: {
27
+ exportRule: {
28
+ kind: 'modifier',
29
+ anyOf: ['public'],
30
+ noneOf: ['private', 'internal', 'protected'],
31
+ default: true
32
+ }
33
+ },
34
+ imports: { resolver: 'jvm-package' },
35
+ layout: {},
36
+ ecosystems: ['gradle', 'maven'],
37
+ audit: { analysisRevision: 1, passes: ['text'] },
38
+ notApplicable: {
39
+ forge: 'JS framework feature; not available outside the JS family',
40
+ heal: 'JS framework feature; not available outside the JS family',
41
+ explode: 'JS framework feature; not available outside the JS family',
42
+ generate: 'JS framework feature; not available outside the JS family',
43
+ capsule: 'JS framework feature; not available outside the JS family',
44
+ scaffold: 'JS framework feature; not available outside the JS family',
45
+ lanes: 'JS framework feature; not available outside the JS family',
46
+ mutators: 'JS framework feature; not available outside the JS family'
47
+ }
48
+ });
@@ -0,0 +1,54 @@
1
+ /** PHP language record; see design spec 4.2 and 5. */
2
+ export default Object.freeze({
3
+ id: 'php',
4
+ name: 'PHP',
5
+ version: 1,
6
+ files: {
7
+ extensions: ['.php', '.phtml'],
8
+ vendorDirs: [{ name: 'vendor', when: 'project-root' }],
9
+ tests: { names: ['*Test.php'], dirs: ['tests'] }
10
+ },
11
+ syntax: {
12
+ lineComment: ['//', '#'],
13
+ blockComment: [{ open: '/*', close: '*/' }],
14
+ strings: [{ open: '"', close: '"', escape: '\\' }, { open: '\'', close: '\'', escape: '\\' }],
15
+ blockStyle: 'brace',
16
+ keywords: [
17
+ 'function',
18
+ 'class',
19
+ 'interface',
20
+ 'trait',
21
+ 'namespace',
22
+ 'use',
23
+ 'public',
24
+ 'private',
25
+ 'protected'
26
+ ],
27
+ qualifier: '\\'
28
+ },
29
+ parse: { grammar: 'php', queries: 'php', grammarStatus: 'vetted', errorPolicy: 'report' },
30
+ engines: {
31
+ index: 'php-parser',
32
+ outline: 'php-parser',
33
+ symbol: 'php-parser',
34
+ logic: 'text',
35
+ audit: 'text',
36
+ editGate: 'text'
37
+ },
38
+ stages: { source: 'off', index: 'text', outline: 'text', imports: 'text' },
39
+ symbols: { exportRule: { kind: 'all' } },
40
+ imports: { resolver: 'php-psr4' },
41
+ layout: {},
42
+ ecosystems: ['php-harness', 'composer'],
43
+ audit: { analysisRevision: 1, passes: ['text'] },
44
+ notApplicable: {
45
+ forge: 'JS framework feature; not available outside the JS family',
46
+ heal: 'JS framework feature; not available outside the JS family',
47
+ explode: 'JS framework feature; not available outside the JS family',
48
+ generate: 'JS framework feature; not available outside the JS family',
49
+ capsule: 'JS framework feature; not available outside the JS family',
50
+ scaffold: 'JS framework feature; not available outside the JS family',
51
+ lanes: 'JS framework feature; not available outside the JS family',
52
+ mutators: 'JS framework feature; not available outside the JS family'
53
+ }
54
+ });