hyperstack-core 1.5.0 → 1.5.1

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/README.md CHANGED
@@ -223,6 +223,12 @@ await hs.store({
223
223
  ## CLI
224
224
 
225
225
  ```bash
226
+ # Ingest a README into cards + edges (no manual card creation)
227
+ npx hyperstack-core ingest ./README.md
228
+ npx hyperstack-core ingest ./docs/ # whole directory
229
+ cat DECISIONS.md | npx hyperstack-core ingest --source decisions # stdin pipe
230
+ npx hyperstack-core ingest ./README.md --dry # preview without storing
231
+
226
232
  # Store a card
227
233
  npx hyperstack-core store --slug "use-clerk" --title "Use Clerk" --type decision
228
234
 
@@ -232,9 +238,12 @@ npx hyperstack-core decide --slug "use-clerk" --title "Use Clerk" --rationale "B
232
238
  # Check blockers
233
239
  npx hyperstack-core blockers deploy-prod
234
240
 
235
- # Traverse graph
241
+ # Traverse graph — forward (what this card points to)
236
242
  npx hyperstack-core graph auth-api --depth 2
237
243
 
244
+ # Traverse graph — reverse (what points at this card)
245
+ npx hyperstack-core graph auth-api --depth 2 --reverse
246
+
238
247
  # Search
239
248
  npx hyperstack-core search "authentication setup"
240
249
 
package/cli.js CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env node
1
+ #!/usr/bin/env node
2
2
 
3
3
  /**
4
4
  * hyperstack-core CLI
@@ -43,7 +43,7 @@ Commands:
43
43
  store Store a card (use --slug, --title, --body, --type, --links)
44
44
  decide Record a decision (use --slug, --title, --rationale)
45
45
  blockers <slug> Show what blocks a card
46
- graph <slug> Traverse graph from a card
46
+ graph <slug> Traverse graph from a card (--reverse for inbound edges)
47
47
  list List all cards
48
48
 
49
49
  Templates:
@@ -592,12 +592,15 @@ async function run() {
592
592
  if (command === "graph") {
593
593
  const from = args[1];
594
594
  if (!from) { console.error("Usage: hyperstack-core graph <slug>"); process.exit(1); }
595
+ const reverse = args.includes("--reverse");
595
596
  try {
596
597
  const result = await client.graph(from, {
597
598
  depth: parseInt(getFlag("depth", "2")),
598
599
  relation: getFlag("relation") || undefined,
600
+ mode: reverse ? "impact" : undefined,
599
601
  });
600
- console.log(`Graph from [${from}]: ${result.nodes?.length || 0} nodes, ${result.edges?.length || 0} edges\n`);
602
+ const direction = reverse ? "pointing at" : "from";
603
+ console.log(`Graph ${direction} [${from}]: ${result.nodes?.length || 0} nodes, ${result.edges?.length || 0} edges\n`);
601
604
  for (const n of result.nodes || []) {
602
605
  console.log(` [${n.slug}] ${n.title || "?"} (${n.cardType || "?"})`);
603
606
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hyperstack-core",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "description": "Typed graph memory for AI agents. Replace GOALS.md with queryable cards + relations. Works with OpenClaw, Claude Desktop, Cursor.",
5
5
  "type": "module",
6
6
  "main": "index.js",
package/src/client.js CHANGED
@@ -165,6 +165,7 @@ class HyperStackClient {
165
165
  * @param {number} [opts.depth=1] — hops to traverse (1-3)
166
166
  * @param {string} [opts.relation] — filter by relation type
167
167
  * @param {string} [opts.type] — filter by card type
168
+ * @param {string} [opts.mode] — "impact" for reverse traversal, "replay" for decision replay
168
169
  * @param {string} [opts.at] — ISO timestamp for time-travel
169
170
  * @returns {Promise<{nodes: Array, edges: Array}>}
170
171
  */
@@ -173,6 +174,7 @@ class HyperStackClient {
173
174
  if (opts.depth) url += `&depth=${opts.depth}`;
174
175
  if (opts.relation) url += `&relation=${opts.relation}`;
175
176
  if (opts.type) url += `&type=${opts.type}`;
177
+ if (opts.mode) url += `&mode=${opts.mode}`;
176
178
  if (opts.at) url += `&at=${encodeURIComponent(opts.at)}`;
177
179
  return this._request("GET", url);
178
180
  }