project-atlas 0.1.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 (43) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/CONTRIBUTING.md +57 -0
  3. package/LICENSE +21 -0
  4. package/README.md +305 -0
  5. package/SECURITY.md +28 -0
  6. package/adapters/claude-code/README.md +27 -0
  7. package/adapters/continue/README.md +16 -0
  8. package/adapters/cursor/README.md +29 -0
  9. package/adapters/opencode/README.md +37 -0
  10. package/adapters/opencode/commands/kb-context.md +5 -0
  11. package/adapters/opencode/commands/kb-refresh.md +11 -0
  12. package/adapters/opencode/skills/project-atlas/SKILL.md +15 -0
  13. package/adapters/opencode/tools/project_atlas_context.js +37 -0
  14. package/adapters/opencode/tools/project_atlas_propose.js +53 -0
  15. package/adapters/opencode/tools/project_atlas_scan.js +34 -0
  16. package/dist/core.js +1395 -0
  17. package/dist/frontmatter.js +103 -0
  18. package/dist/index.js +7 -0
  19. package/dist/mcp.js +172 -0
  20. package/dist/scanner.js +128 -0
  21. package/dist/types.js +1 -0
  22. package/dist/utils.js +174 -0
  23. package/docs/site/README.md +47 -0
  24. package/docs/site/agent-quickstart.md +243 -0
  25. package/docs/site/best-practices.md +87 -0
  26. package/docs/site/en/README.md +49 -0
  27. package/docs/site/en/agent-quickstart.md +191 -0
  28. package/docs/site/en/quick-start.md +79 -0
  29. package/docs/site/publish-now.md +166 -0
  30. package/docs/site/quick-start.md +128 -0
  31. package/docs/site/release-process.md +94 -0
  32. package/docs/site/security-faq.md +55 -0
  33. package/docs/site/team-rollout.md +59 -0
  34. package/package.json +55 -0
  35. package/schema/context-pack.schema.json +80 -0
  36. package/schema/external-evidence.schema.json +84 -0
  37. package/schema/manifest.schema.json +28 -0
  38. package/schema/memory-candidate.schema.json +76 -0
  39. package/schema/proposal.schema.json +122 -0
  40. package/schema/trigger-result.schema.json +47 -0
  41. package/templates/frontend-app/README.md +5 -0
  42. package/templates/generic-service/README.md +5 -0
  43. package/templates/java-backend/README.md +5 -0
@@ -0,0 +1,34 @@
1
+ import { spawn } from "node:child_process";
2
+ import { tool } from "@opencode-ai/plugin";
3
+
4
+ function run(command, args, cwd, abort) {
5
+ return new Promise((resolve) => {
6
+ const child = spawn(command, args, { cwd, shell: false, env: process.env });
7
+ let stdout = "";
8
+ let stderr = "";
9
+ child.stdout.on("data", (chunk) => {
10
+ stdout += chunk.toString();
11
+ });
12
+ child.stderr.on("data", (chunk) => {
13
+ stderr += chunk.toString();
14
+ });
15
+ abort?.addEventListener("abort", () => child.kill("SIGTERM"), { once: true });
16
+ child.on("error", (error) => resolve({ stdout, stderr: `${stderr}${error.message}`, exitCode: 127 }));
17
+ child.on("close", (code) => resolve({ stdout, stderr, exitCode: code ?? 1 }));
18
+ });
19
+ }
20
+
21
+ export default tool({
22
+ description: "Scan project knowledge candidates with project-atlas. This tool never writes knowledge files.",
23
+ args: {
24
+ mode: tool.schema.string().optional().describe("full or changed"),
25
+ },
26
+ async execute(args, context) {
27
+ const repo = context.worktree || context.directory || process.cwd();
28
+ const result = await run("project-atlas", ["scan", "--repo", repo, "--mode", args.mode || "full"], repo, context.abort);
29
+ return {
30
+ output: result.stdout || result.stderr,
31
+ metadata: { repo, exitCode: result.exitCode },
32
+ };
33
+ },
34
+ });