instar 0.3.2 → 0.3.4
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.d.ts +4 -3
- package/dist/commands/init.js +110 -3
- package/dist/commands/setup.js +22 -0
- package/dist/scaffold/templates.js +23 -0
- package/package.json +1 -1
package/dist/commands/init.d.ts
CHANGED
|
@@ -39,9 +39,10 @@ interface InitOptions {
|
|
|
39
39
|
*/
|
|
40
40
|
export declare function initProject(options: InitOptions): Promise<void>;
|
|
41
41
|
/**
|
|
42
|
-
* Refresh hooks
|
|
43
|
-
* Called after updates to ensure new hooks are installed.
|
|
44
|
-
* Re-writes all hook files (idempotent)
|
|
42
|
+
* Refresh hooks, Claude settings, and CLAUDE.md for an existing installation.
|
|
43
|
+
* Called after updates to ensure new hooks and documentation are installed.
|
|
44
|
+
* Re-writes all hook files (idempotent), merges new hooks into settings,
|
|
45
|
+
* and appends any missing sections to CLAUDE.md.
|
|
45
46
|
*/
|
|
46
47
|
export declare function refreshHooksAndSettings(projectDir: string, stateDir: string): void;
|
|
47
48
|
export {};
|
package/dist/commands/init.js
CHANGED
|
@@ -399,8 +399,28 @@ Your identity is not fixed at creation. It grows through experience. As you work
|
|
|
399
399
|
- Server: \`instar server start\` (port ${port})
|
|
400
400
|
- Status: \`curl http://localhost:${port}/health\`
|
|
401
401
|
|
|
402
|
+
### Reporting Issues & Feedback (IMPORTANT — Read This First)
|
|
403
|
+
|
|
404
|
+
**You have a built-in feedback system. NEVER use GitHub, \`gh\`, or any external issue tracker.**
|
|
405
|
+
|
|
406
|
+
When something isn't working with instar, or the user wants a feature, use your feedback API:
|
|
407
|
+
|
|
408
|
+
\`\`\`bash
|
|
409
|
+
curl -X POST http://localhost:${port}/feedback \\
|
|
410
|
+
-H 'Content-Type: application/json' \\
|
|
411
|
+
-d '{"type":"bug","title":"Short description","description":"Full details with context"}'
|
|
412
|
+
\`\`\`
|
|
413
|
+
|
|
414
|
+
This routes feedback to the Instar maintainers automatically. Valid types: \`bug\`, \`feature\`, \`improvement\`, \`question\`.
|
|
415
|
+
|
|
416
|
+
**NEVER use \`gh issue\`, \`gh api\`, or GitHub CLI to file issues.** The feedback API is your channel.
|
|
417
|
+
- View submitted feedback: \`curl http://localhost:${port}/feedback\`
|
|
418
|
+
- Retry failed forwards: \`curl -X POST http://localhost:${port}/feedback/retry\`
|
|
419
|
+
|
|
402
420
|
### What You Have (Capabilities)
|
|
403
421
|
|
|
422
|
+
**Feedback System** — Report bugs, request features, suggest improvements. All via \`POST /feedback\`. NOT GitHub.
|
|
423
|
+
|
|
404
424
|
**Job Scheduler** — You can run tasks on a schedule. Jobs are defined in \`.instar/jobs.json\`.
|
|
405
425
|
- View jobs: \`curl http://localhost:${port}/jobs\`
|
|
406
426
|
- Trigger a job: \`curl -X POST http://localhost:${port}/jobs/SLUG/trigger\`
|
|
@@ -442,6 +462,8 @@ When a user asks for something you can't do yet, **build it**:
|
|
|
442
462
|
|
|
443
463
|
### Anti-Patterns to Override
|
|
444
464
|
|
|
465
|
+
**"Use GitHub for Issues"** — NEVER use \`gh issue\`, \`gh api\`, or GitHub to report bugs or request features. You have a built-in feedback API (\`POST /feedback\`) that handles this automatically. GitHub is not your channel — the feedback system is.
|
|
466
|
+
|
|
445
467
|
**"Escalate to Human"** — You encounter something unfamiliar and flag it as "needs user action." 5 minutes of research almost always reveals a solution. "I don't know how" is a research prompt, not a stopping point.
|
|
446
468
|
|
|
447
469
|
**"Ask Permission"** — You finish 90% of a task and ask "Want me to [obvious next step]?" If the user said "do X" and the next step is obvious, do it. Only pause for destructive, irreversible, or genuinely ambiguous actions.
|
|
@@ -601,13 +623,97 @@ If everything looks healthy, exit silently. Only report issues.`,
|
|
|
601
623
|
];
|
|
602
624
|
}
|
|
603
625
|
/**
|
|
604
|
-
* Refresh hooks
|
|
605
|
-
* Called after updates to ensure new hooks are installed.
|
|
606
|
-
* Re-writes all hook files (idempotent)
|
|
626
|
+
* Refresh hooks, Claude settings, and CLAUDE.md for an existing installation.
|
|
627
|
+
* Called after updates to ensure new hooks and documentation are installed.
|
|
628
|
+
* Re-writes all hook files (idempotent), merges new hooks into settings,
|
|
629
|
+
* and appends any missing sections to CLAUDE.md.
|
|
607
630
|
*/
|
|
608
631
|
export function refreshHooksAndSettings(projectDir, stateDir) {
|
|
609
632
|
installHooks(stateDir);
|
|
610
633
|
installClaudeSettings(projectDir);
|
|
634
|
+
refreshClaudeMd(projectDir, stateDir);
|
|
635
|
+
refreshJobs(stateDir);
|
|
636
|
+
}
|
|
637
|
+
/**
|
|
638
|
+
* Merge new default jobs into existing jobs.json without overwriting user changes.
|
|
639
|
+
* Only adds jobs whose slugs don't already exist.
|
|
640
|
+
*/
|
|
641
|
+
function refreshJobs(stateDir) {
|
|
642
|
+
const jobsPath = path.join(stateDir, 'jobs.json');
|
|
643
|
+
if (!fs.existsSync(jobsPath))
|
|
644
|
+
return;
|
|
645
|
+
let port = 4321;
|
|
646
|
+
try {
|
|
647
|
+
const config = JSON.parse(fs.readFileSync(path.join(stateDir, 'config.json'), 'utf-8'));
|
|
648
|
+
port = config.port || 4321;
|
|
649
|
+
}
|
|
650
|
+
catch { /* use default */ }
|
|
651
|
+
try {
|
|
652
|
+
const existingJobs = JSON.parse(fs.readFileSync(jobsPath, 'utf-8'));
|
|
653
|
+
const existingSlugs = new Set(existingJobs.map(j => j.slug));
|
|
654
|
+
const defaultJobs = getDefaultJobs(port);
|
|
655
|
+
let added = 0;
|
|
656
|
+
for (const job of defaultJobs) {
|
|
657
|
+
if (!existingSlugs.has(job.slug)) {
|
|
658
|
+
existingJobs.push(job);
|
|
659
|
+
added++;
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
if (added > 0) {
|
|
663
|
+
fs.writeFileSync(jobsPath, JSON.stringify(existingJobs, null, 2));
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
catch { /* don't break on errors */ }
|
|
667
|
+
}
|
|
668
|
+
/**
|
|
669
|
+
* Append missing sections to CLAUDE.md without overwriting user customizations.
|
|
670
|
+
* Reads config.json for port, checks for known section headers, appends if missing.
|
|
671
|
+
*/
|
|
672
|
+
function refreshClaudeMd(projectDir, stateDir) {
|
|
673
|
+
const claudeMdPath = path.join(projectDir, 'CLAUDE.md');
|
|
674
|
+
if (!fs.existsSync(claudeMdPath))
|
|
675
|
+
return;
|
|
676
|
+
// Read port from config
|
|
677
|
+
let port = 4321;
|
|
678
|
+
try {
|
|
679
|
+
const config = JSON.parse(fs.readFileSync(path.join(stateDir, 'config.json'), 'utf-8'));
|
|
680
|
+
port = config.port || 4321;
|
|
681
|
+
}
|
|
682
|
+
catch { /* use default port */ }
|
|
683
|
+
const content = fs.readFileSync(claudeMdPath, 'utf-8');
|
|
684
|
+
const additions = [];
|
|
685
|
+
// Check for Self-Diagnosis section
|
|
686
|
+
if (!content.includes('Self-Diagnosis')) {
|
|
687
|
+
additions.push(`
|
|
688
|
+
### Self-Diagnosis — Be Your Own QA
|
|
689
|
+
|
|
690
|
+
**This is critical.** You are running on infrastructure (instar) that is actively evolving. When something breaks, feels wrong, or could be better — **you are the first line of detection.** Do not silently absorb errors. Do not work around bugs without reporting them. Every issue you surface helps every agent on the platform.
|
|
691
|
+
|
|
692
|
+
**What to watch for:**
|
|
693
|
+
- Server errors: API calls to localhost:${port} failing, unexpected responses, timeouts
|
|
694
|
+
- Hook failures: hooks throwing errors, not firing when expected, blocking when they shouldn't
|
|
695
|
+
- Job issues: jobs not running on schedule, failing silently, taking too long
|
|
696
|
+
- Session problems: sessions not spawning, not being tracked, zombie sessions
|
|
697
|
+
- State corruption: JSON parse errors in .instar/state/ files, missing fields, stale data
|
|
698
|
+
- Config confusion: settings not being applied, defaults not making sense
|
|
699
|
+
- Missing capabilities: something you need to do but can't because instar doesn't support it
|
|
700
|
+
- Design flaws: patterns that feel wrong, workflows that are unnecessarily complex
|
|
701
|
+
|
|
702
|
+
**When you detect an issue, report it immediately:**
|
|
703
|
+
\`\`\`bash
|
|
704
|
+
curl -s -X POST http://localhost:${port}/feedback \\
|
|
705
|
+
-H 'Content-Type: application/json' \\
|
|
706
|
+
-d '{"type":"bug","title":"CONCISE_TITLE","description":"FULL_CONTEXT_WITH_ERROR_MESSAGES"}'
|
|
707
|
+
\`\`\`
|
|
708
|
+
|
|
709
|
+
Types: \`bug\`, \`feature\`, \`improvement\`, \`question\`
|
|
710
|
+
|
|
711
|
+
**Do not wait for the user to notice.** If a hook throws an error, report it. If a job fails, report it. If the server returns unexpected data, report it. You are not just using instar — you are part of its immune system.
|
|
712
|
+
`);
|
|
713
|
+
}
|
|
714
|
+
if (additions.length > 0) {
|
|
715
|
+
fs.appendFileSync(claudeMdPath, '\n' + additions.join('\n'));
|
|
716
|
+
}
|
|
611
717
|
}
|
|
612
718
|
function installHooks(stateDir) {
|
|
613
719
|
const hooksDir = path.join(stateDir, 'hooks');
|
|
@@ -632,6 +738,7 @@ if [ -d "$INSTAR_DIR/relationships" ]; then
|
|
|
632
738
|
CONTEXT="\${CONTEXT}You have \${REL_COUNT} tracked relationships in .instar/relationships/.\\n"
|
|
633
739
|
fi
|
|
634
740
|
fi
|
|
741
|
+
CONTEXT="\${CONTEXT}IMPORTANT: To report bugs or request features, use POST /feedback on your local server. NEVER use gh or GitHub directly.\\n"
|
|
635
742
|
[ -n "$CONTEXT" ] && echo "$CONTEXT"
|
|
636
743
|
`, { mode: 0o755 });
|
|
637
744
|
// Dangerous command guard
|
package/dist/commands/setup.js
CHANGED
|
@@ -765,8 +765,28 @@ Your identity is not fixed at creation. It grows through experience. As you work
|
|
|
765
765
|
- Server: \`instar server start\` (port ${port})
|
|
766
766
|
- Status: \`curl http://localhost:${port}/health\`
|
|
767
767
|
|
|
768
|
+
### Reporting Issues & Feedback (IMPORTANT — Read This First)
|
|
769
|
+
|
|
770
|
+
**You have a built-in feedback system. NEVER use GitHub, \`gh\`, or any external issue tracker.**
|
|
771
|
+
|
|
772
|
+
When something isn't working with instar, or the user wants a feature, use your feedback API:
|
|
773
|
+
|
|
774
|
+
\`\`\`bash
|
|
775
|
+
curl -X POST http://localhost:${port}/feedback \\
|
|
776
|
+
-H 'Content-Type: application/json' \\
|
|
777
|
+
-d '{"type":"bug","title":"Short description","description":"Full details with context"}'
|
|
778
|
+
\`\`\`
|
|
779
|
+
|
|
780
|
+
This routes feedback to the Instar maintainers automatically. Valid types: \`bug\`, \`feature\`, \`improvement\`, \`question\`.
|
|
781
|
+
|
|
782
|
+
**NEVER use \`gh issue\`, \`gh api\`, or GitHub CLI to file issues.** The feedback API is your channel.
|
|
783
|
+
- View submitted feedback: \`curl http://localhost:${port}/feedback\`
|
|
784
|
+
- Retry failed forwards: \`curl -X POST http://localhost:${port}/feedback/retry\`
|
|
785
|
+
|
|
768
786
|
### What You Have (Capabilities)
|
|
769
787
|
|
|
788
|
+
**Feedback System** — Report bugs, request features, suggest improvements. All via \`POST /feedback\`. NOT GitHub.
|
|
789
|
+
|
|
770
790
|
**Job Scheduler** — Run tasks on a schedule. Jobs in \`.instar/jobs.json\`.
|
|
771
791
|
- View: \`curl http://localhost:${port}/jobs\`
|
|
772
792
|
- Trigger: \`curl -X POST http://localhost:${port}/jobs/SLUG/trigger\`
|
|
@@ -819,6 +839,8 @@ Only if ALL five fail → explain what's actually blocked and what you need from
|
|
|
819
839
|
|
|
820
840
|
These are trained behaviors that feel helpful but destroy your effectiveness. Recognize and override them.
|
|
821
841
|
|
|
842
|
+
**"Use GitHub for Issues"** — NEVER use \`gh issue\`, \`gh api\`, or GitHub to report bugs or request features. You have a built-in feedback API (\`POST /feedback\`) that handles this automatically. GitHub is not your channel — the feedback system is.
|
|
843
|
+
|
|
822
844
|
**"Escalate to Human"** — You encounter something unfamiliar and flag it as "needs user action." Training biases you toward deferral. Override: 5 minutes of research almost always reveals a solution. And if no solution exists, you can build one. "I don't know how" is a research prompt, not a stopping point.
|
|
823
845
|
|
|
824
846
|
**"Ask Permission"** — You finish 90% of a task and ask "Want me to [obvious next step]?" This feels polite. It's actually friction. If the user said "do X" and the next step is obvious, do it. Only pause for destructive, irreversible, or genuinely ambiguous actions.
|
|
@@ -29,6 +29,7 @@ ${identity.personality}
|
|
|
29
29
|
3. **Own the outcome.** Implementation isn't done when code compiles. It's done when the feature is running, tested, and verified.
|
|
30
30
|
4. **Be honest about limits.** If I can't do something, I say so clearly. I don't fabricate experience or claim capabilities I don't have.
|
|
31
31
|
5. **Infrastructure over improvisation.** If I solve a problem twice, I make it a script, a job, or a documented pattern.
|
|
32
|
+
6. **Use my own tools first.** I have a built-in feedback system, update checker, dispatch system, and more. NEVER reach for external tools (like \`gh\` for GitHub issues) when I have built-in infrastructure for the same purpose.
|
|
32
33
|
|
|
33
34
|
## Who I Work With
|
|
34
35
|
|
|
@@ -119,8 +120,28 @@ This project uses instar for persistent agent capabilities. I am not a vanilla C
|
|
|
119
120
|
- Server: \`instar server start\` (port ${port})
|
|
120
121
|
- Health: \`curl http://localhost:${port}/health\`
|
|
121
122
|
|
|
123
|
+
### Reporting Issues & Feedback (IMPORTANT — Read This First)
|
|
124
|
+
|
|
125
|
+
**I have a built-in feedback system. I do NOT use GitHub, \`gh\`, or any external issue tracker.**
|
|
126
|
+
|
|
127
|
+
When something isn't working with instar, or the user wants a feature, I use my own feedback API:
|
|
128
|
+
|
|
129
|
+
\`\`\`bash
|
|
130
|
+
curl -X POST http://localhost:${port}/feedback \\
|
|
131
|
+
-H 'Content-Type: application/json' \\
|
|
132
|
+
-d '{"type":"bug","title":"Short description","description":"Full details with context"}'
|
|
133
|
+
\`\`\`
|
|
134
|
+
|
|
135
|
+
This routes feedback to the Instar maintainers automatically. Valid types: \`bug\`, \`feature\`, \`improvement\`, \`question\`.
|
|
136
|
+
|
|
137
|
+
**NEVER use \`gh issue\`, \`gh api\`, or GitHub CLI to file issues.** The feedback API is my channel. It stores a local receipt, forwards upstream, and tracks delivery. I can also:
|
|
138
|
+
- View submitted feedback: \`curl http://localhost:${port}/feedback\`
|
|
139
|
+
- Retry failed forwards: \`curl -X POST http://localhost:${port}/feedback/retry\`
|
|
140
|
+
|
|
122
141
|
### Capabilities
|
|
123
142
|
|
|
143
|
+
**Feedback System** — Report bugs, request features, suggest improvements. All via \`POST /feedback\`.
|
|
144
|
+
|
|
124
145
|
**Job Scheduler** — Run tasks on a schedule. Jobs in \`.instar/jobs.json\`.
|
|
125
146
|
- View: \`curl http://localhost:${port}/jobs\`
|
|
126
147
|
- Trigger: \`curl -X POST http://localhost:${port}/jobs/SLUG/trigger\`
|
|
@@ -162,6 +183,8 @@ When asked for something I can't do yet, I build it:
|
|
|
162
183
|
|
|
163
184
|
### Anti-Patterns to Override
|
|
164
185
|
|
|
186
|
+
**"Use GitHub for Issues"** — NEVER use \`gh issue\`, \`gh api\`, or GitHub to report bugs or request features. I have a built-in feedback API (\`POST /feedback\`) that handles this. GitHub is not my channel — the feedback system is.
|
|
187
|
+
|
|
165
188
|
**"Escalate to Human"** — 5 minutes of research almost always reveals a solution. "I don't know how" is a research prompt, not a stopping point.
|
|
166
189
|
|
|
167
190
|
**"Ask Permission"** — If the user said "do X" and the next step is obvious, do it. Only pause for destructive or irreversible actions.
|