hyperstack-core 1.0.0 → 1.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.
- package/README.md +4 -0
- package/adapters/openclaw.js +21 -0
- package/cli.js +44 -0
- package/package.json +1 -1
- package/src/client.js +11 -0
package/README.md
CHANGED
|
@@ -91,6 +91,10 @@ const blockers = await builder.tools.hs_blockers({ slug: "deploy-prod" });
|
|
|
91
91
|
# Initialize with multi-agent template
|
|
92
92
|
npx hyperstack-core init openclaw-multiagent
|
|
93
93
|
|
|
94
|
+
# Auto-extract cards from text (zero LLM cost)
|
|
95
|
+
npx hyperstack-core ingest project.txt
|
|
96
|
+
echo "We use Next.js 14 and PostgreSQL" | npx hyperstack-core ingest -
|
|
97
|
+
|
|
94
98
|
# Store cards
|
|
95
99
|
npx hyperstack-core store --slug "use-clerk" --title "Use Clerk" --type decision
|
|
96
100
|
|
package/adapters/openclaw.js
CHANGED
|
@@ -176,6 +176,27 @@ function createOpenClawAdapter(opts = {}) {
|
|
|
176
176
|
cards,
|
|
177
177
|
};
|
|
178
178
|
},
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Auto-extract cards from raw text (conversation, project description).
|
|
182
|
+
* Finds preferences, people, decisions, tech stack mentions.
|
|
183
|
+
* Zero LLM cost. Best for onboarding.
|
|
184
|
+
*/
|
|
185
|
+
async hs_ingest({ text }) {
|
|
186
|
+
if (!text || text.trim().length === 0) {
|
|
187
|
+
return { text: "Error: text parameter required", cards: [] };
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
const result = await client.ingest(text);
|
|
191
|
+
const cards = result.cards || [];
|
|
192
|
+
|
|
193
|
+
return {
|
|
194
|
+
text: `✅ Created ${cards.length} cards from ${text.length} chars of text:\n` +
|
|
195
|
+
cards.map(c => ` [${c.slug}] ${c.title} (${c.cardType})`).join("\n"),
|
|
196
|
+
cards,
|
|
197
|
+
count: cards.length,
|
|
198
|
+
};
|
|
199
|
+
},
|
|
179
200
|
},
|
|
180
201
|
|
|
181
202
|
/**
|
package/cli.js
CHANGED
|
@@ -42,6 +42,7 @@ Commands:
|
|
|
42
42
|
decide Record a decision (use --slug, --title, --rationale)
|
|
43
43
|
blockers <slug> Show what blocks a card
|
|
44
44
|
graph <slug> Traverse graph from a card
|
|
45
|
+
ingest <file|text> Auto-extract cards from text (zero LLM cost)
|
|
45
46
|
list List all cards
|
|
46
47
|
|
|
47
48
|
Templates:
|
|
@@ -61,6 +62,8 @@ Examples:
|
|
|
61
62
|
npx hyperstack-core store --slug "use-clerk" --title "Use Clerk for auth" --type decision
|
|
62
63
|
npx hyperstack-core blockers deploy-prod
|
|
63
64
|
npx hyperstack-core graph auth-api --depth 2
|
|
65
|
+
npx hyperstack-core ingest project.txt
|
|
66
|
+
echo "We use Next.js 14 and PostgreSQL" | npx hyperstack-core ingest -
|
|
64
67
|
`);
|
|
65
68
|
}
|
|
66
69
|
|
|
@@ -480,6 +483,47 @@ async function run() {
|
|
|
480
483
|
return;
|
|
481
484
|
}
|
|
482
485
|
|
|
486
|
+
if (command === "ingest") {
|
|
487
|
+
let text = "";
|
|
488
|
+
const input = args[1];
|
|
489
|
+
|
|
490
|
+
if (!input) {
|
|
491
|
+
console.error("Usage: npx hyperstack-core ingest <file|text|->");
|
|
492
|
+
console.error(" file Read from file");
|
|
493
|
+
console.error(" - Read from stdin");
|
|
494
|
+
console.error(" text Treat argument as raw text");
|
|
495
|
+
process.exit(1);
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
if (input === "-") {
|
|
499
|
+
// Read from stdin
|
|
500
|
+
const chunks = [];
|
|
501
|
+
process.stdin.on("data", chunk => chunks.push(chunk));
|
|
502
|
+
await new Promise(resolve => process.stdin.on("end", resolve));
|
|
503
|
+
text = Buffer.concat(chunks).toString("utf-8");
|
|
504
|
+
} else if (existsSync(input)) {
|
|
505
|
+
// Read from file
|
|
506
|
+
text = readFileSync(input, "utf-8");
|
|
507
|
+
} else {
|
|
508
|
+
// Treat as raw text
|
|
509
|
+
text = input;
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
if (!text || text.trim().length === 0) {
|
|
513
|
+
console.error("Error: No text provided");
|
|
514
|
+
process.exit(1);
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
console.log(`Ingesting ${text.length} chars...`);
|
|
518
|
+
const result = await client.ingest(text);
|
|
519
|
+
const cards = result.cards || [];
|
|
520
|
+
console.log(`\n✅ Created ${cards.length} cards:\n`);
|
|
521
|
+
for (const c of cards) {
|
|
522
|
+
console.log(` [${c.slug}] ${c.title} (${c.cardType || "general"})`);
|
|
523
|
+
}
|
|
524
|
+
return;
|
|
525
|
+
}
|
|
526
|
+
|
|
483
527
|
if (command === "list") {
|
|
484
528
|
const result = await client.list();
|
|
485
529
|
console.log(`HyperStack: ${result.count ?? 0}/${result.limit ?? "?"} cards (plan: ${result.plan || "?"})\n`);
|
package/package.json
CHANGED
package/src/client.js
CHANGED
|
@@ -129,6 +129,17 @@ class HyperStackClient {
|
|
|
129
129
|
return this._request("DELETE", `/api/cards?workspace=${this.workspace}&id=${slug}`);
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
+
/**
|
|
133
|
+
* Auto-extract cards from raw text.
|
|
134
|
+
* Finds preferences, people, decisions, tech stack mentions using regex.
|
|
135
|
+
* Zero LLM cost. Great for onboarding.
|
|
136
|
+
* @param {string} text — raw conversation or project description
|
|
137
|
+
* @returns {Promise<{cards: Array, count: number}>}
|
|
138
|
+
*/
|
|
139
|
+
async ingest(text) {
|
|
140
|
+
return this._request("POST", `/api/ingest?workspace=${this.workspace}`, { text });
|
|
141
|
+
}
|
|
142
|
+
|
|
132
143
|
// ─── Graph ───────────────────────────────────────────
|
|
133
144
|
|
|
134
145
|
/**
|