semantic-atlas 2.6.0 → 2.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 (35) hide show
  1. package/.agents/skills/semantic-atlas/SKILL.md +49 -23
  2. package/.agents/skills/semantic-atlas-maintenance/SKILL.md +24 -17
  3. package/.agents/skills/semantic-atlas-maintenance/references/boundary-design.md +120 -0
  4. package/.agents/skills/semantic-atlas-maintenance/references/map-authoring.md +5 -4
  5. package/README.md +9 -5
  6. package/README.zh-CN.md +8 -4
  7. package/dist/application/map-application.d.ts +2 -1
  8. package/dist/application/map-application.d.ts.map +1 -1
  9. package/dist/application/map-application.js +25 -0
  10. package/dist/application/map-application.js.map +1 -1
  11. package/dist/cli/run-cli.d.ts.map +1 -1
  12. package/dist/cli/run-cli.js +8 -0
  13. package/dist/cli/run-cli.js.map +1 -1
  14. package/dist/contracts/cli.d.ts +11 -0
  15. package/dist/contracts/cli.d.ts.map +1 -1
  16. package/dist/i18n/index.d.ts +4 -0
  17. package/dist/i18n/index.d.ts.map +1 -1
  18. package/dist/i18n/locales/en/cli.d.ts +2 -0
  19. package/dist/i18n/locales/en/cli.d.ts.map +1 -1
  20. package/dist/i18n/locales/en/cli.js +2 -0
  21. package/dist/i18n/locales/en/cli.js.map +1 -1
  22. package/dist/i18n/locales/zh-CN/cli.d.ts +2 -0
  23. package/dist/i18n/locales/zh-CN/cli.d.ts.map +1 -1
  24. package/dist/i18n/locales/zh-CN/cli.js +2 -0
  25. package/dist/i18n/locales/zh-CN/cli.js.map +1 -1
  26. package/dist/query/concept-search-service.d.ts +9 -0
  27. package/dist/query/concept-search-service.d.ts.map +1 -0
  28. package/dist/query/concept-search-service.js +127 -0
  29. package/dist/query/concept-search-service.js.map +1 -0
  30. package/docs/architecture.md +29 -10
  31. package/docs/evaluation.md +11 -1
  32. package/docs/map-format.md +33 -9
  33. package/docs/product-contract.md +20 -13
  34. package/package.json +4 -4
  35. package/.agents/skills/semantic-atlas/scripts/query-context.mjs +0 -101
@@ -1,101 +0,0 @@
1
- import { access, readFile } from "node:fs/promises";
2
- import { fileURLToPath } from "node:url";
3
- import { spawnSync } from "node:child_process";
4
-
5
- const arguments_ = process.argv.slice(2);
6
- if (arguments_.length === 0) {
7
- fail("Usage: query-context.mjs <business-term> --repo <repository-root>");
8
- }
9
-
10
- const bundledCli = fileURLToPath(new URL("../../../../dist/cli/bin.js", import.meta.url));
11
- const command = await resolveCliCommand();
12
- const result = spawnSync(command.executable, command.arguments, {
13
- encoding: "utf8",
14
- });
15
-
16
- if (result.error) {
17
- fail(`Could not run the semantic-atlas CLI: ${result.error.message}`);
18
- }
19
-
20
- let envelope;
21
- try {
22
- envelope = JSON.parse(result.stdout);
23
- } catch {
24
- fail("The available semantic-atlas command does not implement the v1 context contract.");
25
- }
26
-
27
- if (envelope?.schemaVersion !== 1 || envelope?.command !== "context") {
28
- fail("The available semantic-atlas command returned an incompatible context envelope.");
29
- }
30
-
31
- process.stdout.write(result.stdout);
32
- process.stderr.write(result.stderr);
33
- process.exitCode = result.status ?? 2;
34
-
35
- async function resolveCliCommand() {
36
- const managedIdentity = await readManagedIdentity();
37
- if (managedIdentity) {
38
- const versionResult = spawnSync("semantic-atlas", ["--version"], {
39
- encoding: "utf8",
40
- });
41
- if (versionResult.error) {
42
- fail(`Could not verify the managed semantic-atlas CLI: ${versionResult.error.message}`);
43
- }
44
- const installedVersion = versionResult.stdout.trim();
45
- if (versionResult.status !== 0 || installedVersion !== managedIdentity.packageVersion) {
46
- fail(
47
- `The managed Semantic Atlas Skill requires CLI ${managedIdentity.packageVersion}, but ${installedVersion || "no compatible CLI"} is available.`,
48
- );
49
- }
50
- return {
51
- executable: "semantic-atlas",
52
- arguments: ["context", ...arguments_],
53
- };
54
- }
55
-
56
- if (await fileExists(bundledCli)) {
57
- return {
58
- executable: process.execPath,
59
- arguments: [bundledCli, "context", ...arguments_],
60
- };
61
- }
62
-
63
- return {
64
- executable: "semantic-atlas",
65
- arguments: ["context", ...arguments_],
66
- };
67
- }
68
-
69
- async function readManagedIdentity() {
70
- try {
71
- const marker = JSON.parse(
72
- await readFile(new URL("../.semantic-atlas-managed.json", import.meta.url), "utf8"),
73
- );
74
- if (
75
- marker?.schemaVersion === 1 &&
76
- marker?.managedBy === "semantic-atlas" &&
77
- marker?.skillName === "semantic-atlas" &&
78
- typeof marker?.packageVersion === "string"
79
- ) {
80
- return { packageVersion: marker.packageVersion };
81
- }
82
- fail("The managed Semantic Atlas Skill has an invalid package identity.");
83
- } catch (error) {
84
- if (error?.code === "ENOENT") return undefined;
85
- fail("The managed Semantic Atlas Skill package identity could not be read.");
86
- }
87
- }
88
-
89
- async function fileExists(filePath) {
90
- try {
91
- await access(filePath);
92
- return true;
93
- } catch {
94
- return false;
95
- }
96
- }
97
-
98
- function fail(message) {
99
- process.stderr.write(`${message}\n`);
100
- process.exit(2);
101
- }