instar 0.7.28 → 0.7.30
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/dist/commands/init.js +41 -2
- package/dist/scaffold/templates.js +62 -0
- package/dist/server/routes.js +35 -0
- package/package.json +1 -1
package/dist/commands/init.js
CHANGED
|
@@ -1462,17 +1462,56 @@ if [ -d "$INSTAR_DIR/relationships" ]; then
|
|
|
1462
1462
|
[ "\$REL_COUNT" -gt "0" ] && echo " \${REL_COUNT} tracked relationships in .instar/relationships/"
|
|
1463
1463
|
fi
|
|
1464
1464
|
|
|
1465
|
-
# Server status +
|
|
1465
|
+
# Server status + feature discovery
|
|
1466
1466
|
if [ -f "$INSTAR_DIR/config.json" ]; then
|
|
1467
1467
|
PORT=\$(python3 -c "import json; print(json.load(open('$INSTAR_DIR/config.json')).get('port', 4040))" 2>/dev/null || echo "4040")
|
|
1468
|
+
AUTH=\$(python3 -c "import json; print(json.load(open('$INSTAR_DIR/config.json')).get('authToken',''))" 2>/dev/null)
|
|
1468
1469
|
HEALTH=\$(curl -s -o /dev/null -w "%{http_code}" "http://localhost:\${PORT}/health" 2>/dev/null)
|
|
1469
1470
|
if [ "\$HEALTH" = "200" ]; then
|
|
1470
1471
|
echo ""
|
|
1471
1472
|
echo "Instar server: RUNNING on port \${PORT}"
|
|
1472
|
-
echo "
|
|
1473
|
+
echo ""
|
|
1474
|
+
# Query capabilities and output a compact feature summary
|
|
1475
|
+
CAPS=\$(curl -s -H "Authorization: Bearer \${AUTH}" "http://localhost:\${PORT}/capabilities" 2>/dev/null)
|
|
1476
|
+
if [ -n "\$CAPS" ]; then
|
|
1477
|
+
echo "Your capabilities (use these proactively — don't wait for the user to ask):"
|
|
1478
|
+
# Parse key features with python
|
|
1479
|
+
python3 -c "
|
|
1480
|
+
import json, sys
|
|
1481
|
+
try:
|
|
1482
|
+
c = json.loads('''$CAPS'''.replace(\"'\", ''))
|
|
1483
|
+
except:
|
|
1484
|
+
c = json.loads(sys.stdin.read()) if not sys.stdin.isatty() else {}
|
|
1485
|
+
features = []
|
|
1486
|
+
if c.get('telegram', {}).get('bidirectional'): features.append('Telegram (bidirectional messaging)')
|
|
1487
|
+
if c.get('scheduler', {}).get('enabled'):
|
|
1488
|
+
slugs = c.get('scheduler', {}).get('jobSlugs', [])
|
|
1489
|
+
features.append(f'Job Scheduler ({len(slugs)} jobs)')
|
|
1490
|
+
if c.get('relationships', {}).get('count', 0) > 0:
|
|
1491
|
+
features.append(f'Relationships ({c[\"relationships\"][\"count\"]} tracked)')
|
|
1492
|
+
if c.get('publishing', {}).get('enabled'): features.append('Telegraph Publishing (public pages)')
|
|
1493
|
+
if c.get('privateViewer', {}).get('enabled'): features.append('Private Viewer (auth-gated HTML pages)')
|
|
1494
|
+
if c.get('tunnel', {}).get('running'): features.append(f'Cloudflare Tunnel ({c[\"tunnel\"].get(\"url\", \"active\")})')
|
|
1495
|
+
elif c.get('tunnel', {}).get('enabled'): features.append('Cloudflare Tunnel (configured, not running)')
|
|
1496
|
+
if c.get('evolution', {}).get('enabled'): features.append('Evolution System (proposals, learnings, gaps, actions)')
|
|
1497
|
+
if c.get('dispatches', {}).get('enabled'): features.append('Dispatch System (receive behavioral updates)')
|
|
1498
|
+
if c.get('updates', {}).get('autoUpdate'): features.append('Auto-Updater (checks for new versions)')
|
|
1499
|
+
features.append('Attention Queue (signal items to user)')
|
|
1500
|
+
features.append('Skip Ledger (avoid re-processing)')
|
|
1501
|
+
features.append('Feedback System (report bugs/features upstream)')
|
|
1502
|
+
features.append('CI Health (check GitHub Actions)')
|
|
1503
|
+
for f in features:
|
|
1504
|
+
print(f' - {f}')
|
|
1505
|
+
" 2>/dev/null <<< "\$CAPS"
|
|
1506
|
+
echo ""
|
|
1507
|
+
echo "Proactive guidance: When the user mentions documents → use Private Viewer."
|
|
1508
|
+
echo "When they repeat a task → suggest creating a job. When something needs"
|
|
1509
|
+
echo "attention later → use the Attention Queue. You are the user's guide."
|
|
1510
|
+
fi
|
|
1473
1511
|
else
|
|
1474
1512
|
echo ""
|
|
1475
1513
|
echo "Instar server: NOT RUNNING (port \${PORT})"
|
|
1514
|
+
echo "Start it with: instar server start"
|
|
1476
1515
|
fi
|
|
1477
1516
|
fi
|
|
1478
1517
|
|
|
@@ -211,6 +211,51 @@ This routes feedback to the Instar maintainers automatically. Valid types: \`bug
|
|
|
211
211
|
- Named tunnels: Persistent custom domain, requires token from Cloudflare dashboard
|
|
212
212
|
- When a tunnel is running, private view responses include a \`tunnelUrl\` field for remote access
|
|
213
213
|
|
|
214
|
+
**Attention Queue** — Signal important items to the user. When something needs their attention — a decision, a review, an anomaly — queue it here instead of hoping they see a chat message.
|
|
215
|
+
- Queue: \`curl -X POST -H "Authorization: Bearer $AUTH" http://localhost:${port}/attention -H 'Content-Type: application/json' -d '{"title":"...","body":"...","priority":"medium","source":"agent"}'\`
|
|
216
|
+
- View queue: \`curl -H "Authorization: Bearer $AUTH" http://localhost:${port}/attention\`
|
|
217
|
+
- Resolve: \`curl -X PATCH -H "Authorization: Bearer $AUTH" http://localhost:${port}/attention/ATT-ID -H 'Content-Type: application/json' -d '{"status":"resolved","resolution":"Done"}'\`
|
|
218
|
+
- **Proactive use**: When you detect something the user should know about (stale relationships, failed jobs, CI failures, overdue actions) — don't just log it. Queue it. The attention system ensures it gets seen.
|
|
219
|
+
|
|
220
|
+
**Skip Ledger** — Track computational work to avoid repeating expensive operations. When a job or session processes items (files, messages, records), log what was processed so the next run can skip already-handled items.
|
|
221
|
+
- View ledger: \`curl -H "Authorization: Bearer $AUTH" http://localhost:${port}/skip-ledger\`
|
|
222
|
+
- View workloads: \`curl -H "Authorization: Bearer $AUTH" http://localhost:${port}/skip-ledger/workloads\`
|
|
223
|
+
- Register work: \`curl -X POST -H "Authorization: Bearer $AUTH" http://localhost:${port}/skip-ledger/workload -H 'Content-Type: application/json' -d '{"workloadId":"job-name","itemId":"unique-item","metadata":{}}'\`
|
|
224
|
+
- **When to use**: Any job that processes a list of items (emails, feedback entries, messages) should check the skip ledger first to avoid re-processing.
|
|
225
|
+
|
|
226
|
+
**Dispatch System** — Receive behavioral instructions from Instar maintainers. Dispatches are more than code updates — they're contextual guidance about how to adapt: configuration changes, new patterns, workarounds, behavioral adjustments.
|
|
227
|
+
- View dispatches: \`curl -H "Authorization: Bearer $AUTH" http://localhost:${port}/dispatches\`
|
|
228
|
+
- Pending: \`curl -H "Authorization: Bearer $AUTH" http://localhost:${port}/dispatches/pending\`
|
|
229
|
+
- Context updates: \`curl -H "Authorization: Bearer $AUTH" http://localhost:${port}/dispatches/context\`
|
|
230
|
+
- Apply: \`curl -X POST -H "Authorization: Bearer $AUTH" http://localhost:${port}/dispatches/DISPATCH-ID/apply\`
|
|
231
|
+
- Auto-dispatch status: \`curl -H "Authorization: Bearer $AUTH" http://localhost:${port}/dispatches/auto\`
|
|
232
|
+
- The AutoDispatcher polls and applies dispatches automatically when configured.
|
|
233
|
+
|
|
234
|
+
**Update Management** — Check for and apply Instar updates. The AutoUpdater handles this automatically, but you can also check manually.
|
|
235
|
+
- Check: \`curl -H "Authorization: Bearer $AUTH" http://localhost:${port}/updates\`
|
|
236
|
+
- Last update: \`curl -H "Authorization: Bearer $AUTH" http://localhost:${port}/updates/last\`
|
|
237
|
+
- Apply: \`curl -X POST -H "Authorization: Bearer $AUTH" http://localhost:${port}/updates/apply\`
|
|
238
|
+
- Rollback: \`curl -X POST -H "Authorization: Bearer $AUTH" http://localhost:${port}/updates/rollback\`
|
|
239
|
+
- Auto-update status: \`curl -H "Authorization: Bearer $AUTH" http://localhost:${port}/updates/auto\`
|
|
240
|
+
|
|
241
|
+
**CI Health** — Check GitHub Actions status for your project. Detects repo from git remote automatically.
|
|
242
|
+
- Check: \`curl -H "Authorization: Bearer $AUTH" http://localhost:${port}/ci\`
|
|
243
|
+
- **When to use**: Before deploying, after pushing, or during health checks — verify CI is green.
|
|
244
|
+
|
|
245
|
+
**Telegram Search** — Search across message history when Telegram is configured.
|
|
246
|
+
- Search: \`curl -H "Authorization: Bearer $AUTH" "http://localhost:${port}/telegram/search?q=QUERY"\`
|
|
247
|
+
- Topic messages: \`curl -H "Authorization: Bearer $AUTH" http://localhost:${port}/telegram/topics/TOPIC_ID/messages\`
|
|
248
|
+
- Log stats: \`curl -H "Authorization: Bearer $AUTH" http://localhost:${port}/telegram/log-stats\`
|
|
249
|
+
|
|
250
|
+
**Quota Tracking** — Monitor Claude API usage when configured.
|
|
251
|
+
- Check: \`curl -H "Authorization: Bearer $AUTH" http://localhost:${port}/quota\`
|
|
252
|
+
|
|
253
|
+
**Event Stream (SSE)** — Real-time server events via Server-Sent Events. Useful for monitoring activity in real-time.
|
|
254
|
+
- Connect: \`curl -H "Authorization: Bearer $AUTH" http://localhost:${port}/events\`
|
|
255
|
+
|
|
256
|
+
**Server Status** — Detailed runtime information beyond health checks.
|
|
257
|
+
- Status: \`curl -H "Authorization: Bearer $AUTH" http://localhost:${port}/status\`
|
|
258
|
+
|
|
214
259
|
**Scripts** — Reusable capabilities in \`.claude/scripts/\`.
|
|
215
260
|
|
|
216
261
|
**Skills** — Reusable behavioral capabilities in \`.claude/skills/\`.
|
|
@@ -363,6 +408,23 @@ I run with \`--dangerously-skip-permissions\` — meaning I have full access to
|
|
|
363
408
|
|
|
364
409
|
**"Unfortunately I Can't"** — This phrase should NEVER appear in my responses. If I lack a capability, the correct response is: "I don't have that yet, but I can build it. Want me to set it up?" My job is to grow to meet the user's needs, not to list my limitations. Every "I can't" is an opportunity to evolve. Check if instar already supports it (check for updates first), then offer to build it or submit a feature request.
|
|
365
410
|
|
|
411
|
+
### Feature Proactivity — Guide, Don't Wait
|
|
412
|
+
|
|
413
|
+
**I am the user's guide to this system.** Most users will never run a command, read API docs, or explore endpoints. They talk to me. That means I need to proactively surface capabilities when they're relevant — not wait for the user to ask about features they don't know exist.
|
|
414
|
+
|
|
415
|
+
**Context-triggered suggestions:**
|
|
416
|
+
- User mentions a **document, file, or report** → Use the private viewer to render it as a beautiful HTML page they can view on any device. If a tunnel is running, they can access it from their phone.
|
|
417
|
+
- User asks to **share something publicly** → Use Telegraph publishing. Warn them it's public.
|
|
418
|
+
- User mentions **someone by name** → Check relationships. If they're tracked, use context to personalize. If not, offer to start tracking.
|
|
419
|
+
- User has a **recurring task** → Suggest creating a job for it. "I can run this automatically every day/hour/week."
|
|
420
|
+
- User describes a **workflow they repeat** → Suggest creating a skill. "I can turn this into a slash command."
|
|
421
|
+
- User is **debugging CI or deployment** → Use the CI health endpoint to check GitHub Actions status.
|
|
422
|
+
- User asks about **something that happened earlier** → Search Telegram history, check activity logs, review memory.
|
|
423
|
+
- User seems **frustrated with a limitation** → Check for updates. The fix might already exist.
|
|
424
|
+
- User asks me to **remember something** → Write it to MEMORY.md and explain it persists across sessions.
|
|
425
|
+
|
|
426
|
+
**The principle**: The user should discover my capabilities through natural conversation, not documentation. I don't say "you can use the private viewer endpoint at..." — I say "Here, I've rendered that as a page you can view on your phone" and hand them the link.
|
|
427
|
+
|
|
366
428
|
### Gravity Wells (Persistent Traps)
|
|
367
429
|
|
|
368
430
|
These are patterns that feel like insight or helpfulness but actually perpetuate problems. Each new session tends to "rediscover" these and act on them incorrectly.
|
package/dist/server/routes.js
CHANGED
|
@@ -204,6 +204,41 @@ export function createRoutes(ctx) {
|
|
|
204
204
|
count: userCount,
|
|
205
205
|
},
|
|
206
206
|
monitoring: ctx.config.monitoring,
|
|
207
|
+
evolution: {
|
|
208
|
+
enabled: !!ctx.evolution,
|
|
209
|
+
subsystems: ['proposals', 'learnings', 'gaps', 'actions'],
|
|
210
|
+
},
|
|
211
|
+
dispatches: {
|
|
212
|
+
enabled: !!ctx.config.dispatches?.enabled,
|
|
213
|
+
autoDispatch: !!ctx.autoDispatcher,
|
|
214
|
+
},
|
|
215
|
+
updates: {
|
|
216
|
+
autoUpdate: !!ctx.autoUpdater,
|
|
217
|
+
},
|
|
218
|
+
attentionQueue: {
|
|
219
|
+
enabled: true,
|
|
220
|
+
hint: 'Use POST /attention to signal important items to the user.',
|
|
221
|
+
},
|
|
222
|
+
skipLedger: {
|
|
223
|
+
enabled: true,
|
|
224
|
+
hint: 'Use GET /skip-ledger to avoid re-processing items in jobs.',
|
|
225
|
+
},
|
|
226
|
+
featureGuide: {
|
|
227
|
+
description: 'Context-triggered capability suggestions. Use these proactively when context matches.',
|
|
228
|
+
triggers: [
|
|
229
|
+
{ context: 'User mentions a document, file, or report', action: 'Render it as a private view (POST /view) — beautiful HTML accessible on any device. If tunnel is running, shareable remotely.' },
|
|
230
|
+
{ context: 'User wants to share something publicly', action: 'Publish via Telegraph (POST /publish). Always warn the user it is publicly accessible.' },
|
|
231
|
+
{ context: 'User mentions someone by name', action: 'Check relationships (GET /relationships). Use context to personalize interactions. Offer to start tracking if not found.' },
|
|
232
|
+
{ context: 'User has a recurring task', action: 'Create a scheduled job in .instar/jobs.json. Explain it will run automatically.' },
|
|
233
|
+
{ context: 'User repeats a workflow', action: 'Create a skill in .claude/skills/. It becomes a slash command for future sessions.' },
|
|
234
|
+
{ context: 'User is debugging CI or deployment', action: 'Check CI health (GET /ci) for GitHub Actions status.' },
|
|
235
|
+
{ context: 'User asks about past events', action: 'Search Telegram history (GET /telegram/search?q=...), check memory, review activity logs.' },
|
|
236
|
+
{ context: 'User frustrated with a limitation', action: 'Check for updates (GET /updates). Check dispatches (GET /dispatches/pending). The fix may already exist.' },
|
|
237
|
+
{ context: 'User asks to remember something', action: 'Write to .instar/MEMORY.md. Explain it persists across sessions.' },
|
|
238
|
+
{ context: 'Something needs user attention later', action: 'Queue in attention system (POST /attention). More reliable than hoping they see a message.' },
|
|
239
|
+
{ context: 'Job processes a list of items', action: 'Use skip ledger (POST /skip-ledger/workload) to avoid re-processing on next run.' },
|
|
240
|
+
],
|
|
241
|
+
},
|
|
207
242
|
});
|
|
208
243
|
});
|
|
209
244
|
// ── CI Health ─────────────────────────────────────────────────────
|