@minhpnq1807/contextos 0.5.35 → 0.5.36

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.5.36
4
+
5
+ - **Fix ctx_score_context MCP output not rendering in Antigravity editor:** The `content` text block returned by the MCP tool previously only contained raw telemetry JSON, which editors cannot render as user-facing context. Now the tool uses `scheduleContext()` to produce the same human-readable markdown (Critical ContextOS rules, Suggested files, Skills, Workflows) that the hook path generates, and returns it as the primary `content[0].text` block. Telemetry JSON is pushed to a secondary content block. This ensures Antigravity (and any MCP-compatible editor) displays the scored rules and file suggestions.
6
+ - **Fix symlink incompatibility with antigravity-awesome-skills:** `copyDirectory` in `skillshare-sync.js` was preserving symlinks when copying skills, which caused `antigravity-awesome-skills` to crash with "Skipping unsafe destination symlink" on re-install. Now follows symlinks and copies actual file content instead, making output compatible with all tools that write to the same skills directory.
7
+ - **Updated MCP protocol smoke test:** Assertions now validate the two-block content structure — human-readable context first, telemetry JSON last.
8
+
3
9
  ## 0.5.35
4
10
 
5
11
  - **Add GitHub Copilot agent support:** New `copilot` agent for `ctx install --agent copilot` and `ctx setup`. Creates `.github/copilot-instructions.md` with ContextOS integration marker and configures `ctx-mcp` MCP server in `.vscode/mcp.json`. Copilot is now recognized by Ruler (`ctx sync --rules`) and Skillshare (`ctx sync --skills`) alongside existing codex, claude, and agy agents.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minhpnq1807/contextos",
3
- "version": "0.5.35",
3
+ "version": "0.5.36",
4
4
  "description": "Task-aware AGENTS.md context injection and compliance reporting for Codex, Claude Code, and Antigravity.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ctx",
3
- "version": "0.5.35",
3
+ "version": "0.5.36",
4
4
  "description": "Inject task-relevant AGENTS.md rules into Codex through plugin hooks.",
5
5
  "author": {
6
6
  "name": "ContextOS"
@@ -330,11 +330,18 @@ function copyDirectory(sourceDir, targetDir) {
330
330
  for (const entry of fs.readdirSync(sourceDir, { withFileTypes: true })) {
331
331
  const source = path.join(sourceDir, entry.name);
332
332
  const target = path.join(targetDir, entry.name);
333
- if (entry.isDirectory()) {
333
+ if (entry.isSymbolicLink()) {
334
+ // Follow symlinks and copy real content to avoid incompatibility
335
+ // with tools like antigravity-awesome-skills that reject symlinks.
336
+ const real = fs.realpathSync(source);
337
+ const stat = fs.statSync(real);
338
+ if (stat.isDirectory()) {
339
+ copyDirectory(real, target);
340
+ } else if (stat.isFile()) {
341
+ fs.copyFileSync(real, target);
342
+ }
343
+ } else if (entry.isDirectory()) {
334
344
  copyDirectory(source, target);
335
- } else if (entry.isSymbolicLink()) {
336
- const link = fs.readlinkSync(source);
337
- fs.symlinkSync(link, target);
338
345
  } else if (entry.isFile()) {
339
346
  fs.copyFileSync(source, target);
340
347
  }
@@ -2,6 +2,7 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
2
  import { z } from "zod";
3
3
 
4
4
  import { scoreContext } from "../lib/score-context.js";
5
+ import { scheduleContext } from "../lib/scheduler.js";
5
6
 
6
7
  export function createContextOSMcpServer({ dataDir }) {
7
8
  const server = new McpServer({
@@ -51,13 +52,31 @@ export function createContextOSMcpServer({ dataDir }) {
51
52
  skills: args.skills,
52
53
  workflows: args.workflows
53
54
  });
55
+
56
+ // Format the same human-readable context that the hook path produces
57
+ const scheduled = scheduleContext({
58
+ rules: result.scoredRules,
59
+ relevantFiles: result.suggestedFiles,
60
+ suggestedSkills: result.suggestedSkills,
61
+ suggestedWorkflows: result.suggestedWorkflows
62
+ });
63
+
64
+ const contextText = scheduled.additionalContext || "";
65
+ const contentBlocks = [];
66
+
67
+ // Primary block: human-readable rules, files, skills, workflows
68
+ if (contextText) {
69
+ contentBlocks.push({ type: "text", text: contextText });
70
+ }
71
+
72
+ // Secondary block: telemetry metadata
73
+ contentBlocks.push({
74
+ type: "text",
75
+ text: JSON.stringify(result.telemetry)
76
+ });
77
+
54
78
  return {
55
- content: [
56
- {
57
- type: "text",
58
- text: JSON.stringify(result.telemetry)
59
- }
60
- ],
79
+ content: contentBlocks,
61
80
  structuredContent: {
62
81
  scoredRules: result.scoredRules,
63
82
  suggestedFiles: result.suggestedFiles,
@@ -70,3 +89,4 @@ export function createContextOSMcpServer({ dataDir }) {
70
89
 
71
90
  return server;
72
91
  }
92
+