@sporhq/spor 0.5.1 → 0.5.2

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.
@@ -2,6 +2,6 @@
2
2
  "name": "spor",
3
3
  "displayName": "Spor Context Compiler",
4
4
  "description": "Maintains a typed, versioned knowledge graph and compiles compact briefings from it: session-start injection, per-prompt relevance digests, capture at discovery, end-of-session distillation, decision queue.",
5
- "version": "0.5.1",
5
+ "version": "0.5.2",
6
6
  "author": { "name": "losthammer" }
7
7
  }
package/lib/query.js CHANGED
@@ -145,14 +145,22 @@ if (require.main === module) {
145
145
  to: has("to") ? opt("to", null) : null,
146
146
  });
147
147
 
148
+ // Project a loaded node for JSON output: drop the parser's load-time `file`
149
+ // artifact, and drop pin/exclude when empty — the regex parser initializes
150
+ // both to [] on every node, so they are noise unless a briefing/correction
151
+ // actually populated them (a non-empty list is kept). Deletes from a shallow
152
+ // copy so the original key order is preserved.
153
+ const cleanNode = (n) => {
154
+ const out = { ...n };
155
+ delete out.file;
156
+ if (Array.isArray(out.pin) && !out.pin.length) delete out.pin;
157
+ if (Array.isArray(out.exclude) && !out.exclude.length) delete out.exclude;
158
+ return out;
159
+ };
160
+
148
161
  if (has("json")) {
149
162
  if (r.edges) process.stdout.write(JSON.stringify(r.edges, null, 2) + "\n");
150
- else {
151
- // Strip the parser's internal `file` field from JSON node output (it's a
152
- // load-time artifact, not graph data).
153
- const clean = r.nodes.map(({ file, ...rest }) => rest);
154
- process.stdout.write(JSON.stringify(clean, null, 2) + "\n");
155
- }
163
+ else process.stdout.write(JSON.stringify(r.nodes.map(cleanNode), null, 2) + "\n");
156
164
  process.exit(0);
157
165
  }
158
166
 
@@ -183,8 +191,7 @@ if (require.main === module) {
183
191
  if (raw != null) {
184
192
  process.stdout.write(raw.endsWith("\n") ? raw : raw + "\n");
185
193
  } else {
186
- const { file: _f, ...rest } = n; // drop the load-time artifact
187
- process.stdout.write(JSON.stringify(rest, null, 2) + "\n");
194
+ process.stdout.write(JSON.stringify(cleanNode(n), null, 2) + "\n"); // raw file unreadable: reconstructed view
188
195
  }
189
196
  console.log("---");
190
197
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sporhq/spor",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "description": "Spor — a shared memory substrate for teams and agents. Decisions, their reasons, and the traces they leave. Knowledge-graph context compiler: session-start briefings, per-prompt digests, capture at discovery, end-of-session distillation, decision queue.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Anthony Allen",