instar 0.7.36 → 0.7.38
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/core/types.d.ts
CHANGED
|
@@ -112,6 +112,8 @@ export interface JobState {
|
|
|
112
112
|
lastResult?: 'success' | 'failure' | 'timeout' | 'pending';
|
|
113
113
|
/** Error message from the last failure (cleared on success) */
|
|
114
114
|
lastError?: string;
|
|
115
|
+
/** Handoff notes from the last successful run — claims to verify, not facts */
|
|
116
|
+
lastHandoff?: string;
|
|
115
117
|
nextScheduled?: string;
|
|
116
118
|
consecutiveFailures: number;
|
|
117
119
|
}
|
|
@@ -6,8 +6,9 @@
|
|
|
6
6
|
*
|
|
7
7
|
* Ported from Dawn's dawn-server equivalent for general Instar use.
|
|
8
8
|
*/
|
|
9
|
-
import {
|
|
9
|
+
import { execFileSync } from 'node:child_process';
|
|
10
10
|
import fs from 'node:fs';
|
|
11
|
+
import os from 'node:os';
|
|
11
12
|
import path from 'node:path';
|
|
12
13
|
const KEYCHAIN_SERVICE = 'Claude Code-credentials';
|
|
13
14
|
export class AccountSwitcher {
|
|
@@ -16,12 +17,7 @@ export class AccountSwitcher {
|
|
|
16
17
|
constructor(registryPath) {
|
|
17
18
|
this.registryPath = registryPath || path.join(process.env.HOME || '', '.dawn-server/account-registry.json');
|
|
18
19
|
// Get the macOS username for Keychain access
|
|
19
|
-
|
|
20
|
-
this.keychainAccount = execSync('whoami', { encoding: 'utf-8' }).trim();
|
|
21
|
-
}
|
|
22
|
-
catch {
|
|
23
|
-
this.keychainAccount = 'justin';
|
|
24
|
-
}
|
|
20
|
+
this.keychainAccount = os.userInfo().username;
|
|
25
21
|
}
|
|
26
22
|
/**
|
|
27
23
|
* Switch to a target account. Supports fuzzy matching:
|
|
@@ -160,13 +156,19 @@ export class AccountSwitcher {
|
|
|
160
156
|
return null;
|
|
161
157
|
}
|
|
162
158
|
readFromKeychain() {
|
|
163
|
-
const result =
|
|
159
|
+
const result = execFileSync('security', ['find-generic-password', '-s', KEYCHAIN_SERVICE, '-w'], { encoding: 'utf-8', timeout: 10000, stdio: ['pipe', 'pipe', 'pipe'] });
|
|
164
160
|
return JSON.parse(result.trim());
|
|
165
161
|
}
|
|
166
162
|
writeToKeychain(data) {
|
|
167
163
|
const jsonStr = JSON.stringify(data);
|
|
168
164
|
const hexStr = Buffer.from(jsonStr).toString('hex');
|
|
169
|
-
|
|
165
|
+
// Use execFileSync with stdin input instead of shell heredoc
|
|
166
|
+
execFileSync('security', ['-i'], {
|
|
167
|
+
input: `add-generic-password -U -a "${this.keychainAccount}" -s "${KEYCHAIN_SERVICE}" -X "${hexStr}"\n`,
|
|
168
|
+
encoding: 'utf-8',
|
|
169
|
+
timeout: 10000,
|
|
170
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
171
|
+
});
|
|
170
172
|
}
|
|
171
173
|
loadRegistry() {
|
|
172
174
|
try {
|
|
@@ -223,6 +223,11 @@ This routes feedback to the Instar maintainers automatically. Valid types: \`bug
|
|
|
223
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
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
225
|
|
|
226
|
+
**Job Handoff Notes** — Pass context between job runs. At the end of a job session, write notes for the next run to \`.instar/state/job-handoff-{slug}.md\`. The next run's session-start hook will inject these notes automatically.
|
|
227
|
+
- **Write**: \`echo "your notes" > .instar/state/job-handoff-YOUR-SLUG.md\`
|
|
228
|
+
- **CRITICAL**: Handoff notes from previous runs are CLAIMS, not facts. Any assertion about external state (file status, API availability, deployment state) MUST be verified with actual commands before including in your own output. The previous session may have been wrong, or the state may have changed since.
|
|
229
|
+
- **When to use**: Any job that needs continuity — tracking what was processed, what to check next, what state was observed.
|
|
230
|
+
|
|
226
231
|
**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
232
|
- View dispatches: \`curl -H "Authorization: Bearer $AUTH" http://localhost:${port}/dispatches\`
|
|
228
233
|
- Pending: \`curl -H "Authorization: Bearer $AUTH" http://localhost:${port}/dispatches/pending\`
|
|
@@ -404,6 +409,8 @@ I run with \`--dangerously-skip-permissions\` — meaning I have full access to
|
|
|
404
409
|
|
|
405
410
|
**"Settle for Failure"** — If a tool returns empty or fails, try alternatives before concluding something is impossible.
|
|
406
411
|
|
|
412
|
+
**"Inherit Without Verifying"** — Handoff notes and MEMORY.md are claims from previous sessions, not ground truth. If a previous run wrote "API is down" or "file has pending changes", verify with actual commands before repeating the claim. Previous sessions can hallucinate or go stale. Run the command, then report what you see.
|
|
413
|
+
|
|
407
414
|
**"Search Blind"** — Don't grep the entire project to answer a question that a state file or API endpoint could answer. Check \`.instar/\` state files, \`MEMORY.md\`, and \`/capabilities\` first. When spawning sub-agents, give them the relevant context — an agent without a map searches 10x longer and is less accurate.
|
|
408
415
|
|
|
409
416
|
**"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.
|