osborn 0.9.276 → 0.9.277
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.
|
@@ -115,7 +115,7 @@ Personal values are NOT stored in this skill. They live in a local secret file t
|
|
|
115
115
|
| City / State / Zip | `$CANDIDATE_CITY` / `$CANDIDATE_STATE` / `$CANDIDATE_ZIP` |
|
|
116
116
|
|
|
117
117
|
Jobs:
|
|
118
|
-
1.
|
|
118
|
+
1. Senior Engineer at Acme Corp — April 2024 to Present
|
|
119
119
|
2. Full Stack Developer, Freelance — January 2016 to Present
|
|
120
120
|
|
|
121
121
|
Education:
|
|
@@ -34,7 +34,7 @@ export interface ClientRedactor {
|
|
|
34
34
|
export interface RedactorOptions {
|
|
35
35
|
/**
|
|
36
36
|
* PER-PIECE opt-in un-redaction: denylisted terms to leave visible for ONE
|
|
37
|
-
* named draft/render (e.g. reveal: ["
|
|
37
|
+
* named draft/render (e.g. reveal: ["Acme"]). Never used by extraction —
|
|
38
38
|
* the profile and samples are always stored fully redacted. A renderer that
|
|
39
39
|
* reveals re-pulls the quote rows from session.db by row # and redacts them
|
|
40
40
|
* with this option, in memory, for that piece only.
|
package/dist/index.js
CHANGED
|
@@ -42,7 +42,7 @@ import { createClaudeLLM, NAMED_AGENTS, applyTurbo, requestAuthRestart } from '.
|
|
|
42
42
|
import { clearPipelineFastBrainSession, prewarmBM25Index } from './pipeline-fastbrain.js';
|
|
43
43
|
import { ensureClaudeAuth, applyAuthFallback, replayInFlightAuth, startClaudeAuthOnDemand, isOnDemandAuthInFlight } from './claude-auth.js';
|
|
44
44
|
import { statusManager } from './status-manager.js';
|
|
45
|
-
import { decideNextSession, planSwitch, resolveSessionCwd, keepNonConversationItems, recoverySessionId as pickRecoverySessionId, warmParkKey, sessionMessagesDir, createSwitchGuard, scanSlugCwd } from './session-switch.js';
|
|
45
|
+
import { decideNextSession, planSwitch, resolveSessionCwd, keepNonConversationItems, recoverySessionId as pickRecoverySessionId, warmParkKey, sessionMessagesDir, createSwitchGuard, scanSlugCwd, pickConnectWorkingDir } from './session-switch.js';
|
|
46
46
|
import { createSmitheryProxy, destroySmitheryProxy, parseSmitheryUrl, isSmitheryUrl, SmitheryAuthorizationError } from './smithery-proxy.js';
|
|
47
47
|
import { DIRECT_MODE_PROMPT } from './prompts.js';
|
|
48
48
|
import { MCP_CATALOG } from './config.js';
|
|
@@ -5095,26 +5095,40 @@ async function main() {
|
|
|
5095
5095
|
if (Number.isFinite(c) && c > 0)
|
|
5096
5096
|
connectTiming.clickTs = c;
|
|
5097
5097
|
}
|
|
5098
|
-
//
|
|
5098
|
+
// Working directory for this connection (resume-mismatch fix, #112).
|
|
5099
5099
|
//
|
|
5100
|
-
//
|
|
5101
|
-
//
|
|
5102
|
-
//
|
|
5103
|
-
//
|
|
5104
|
-
// workspace root
|
|
5105
|
-
//
|
|
5106
|
-
|
|
5107
|
-
|
|
5108
|
-
|
|
5109
|
-
|
|
5110
|
-
|
|
5111
|
-
|
|
5112
|
-
|
|
5100
|
+
// The client's workingDirectory is only a HINT. When a session is pre-
|
|
5101
|
+
// selected, the agent is AUTHORITATIVE about where that session lives:
|
|
5102
|
+
// resolve its real project dir (the only dir whose slug holds the
|
|
5103
|
+
// session's JSONL) and boot there, so `--resume <id>` finds it instead of
|
|
5104
|
+
// coming up in /workspace root — or silently as a different session —
|
|
5105
|
+
// when the hint is stale or empty (e.g. a switch rewrote the URL without
|
|
5106
|
+
// a cwd). resolveCwdForSession returns null only when the JSONL exists
|
|
5107
|
+
// nowhere yet (fresh sprite / brand-new project), in which case the hint
|
|
5108
|
+
// is honoured and created so the SDK spawn still has a valid cwd.
|
|
5109
|
+
const wdHint = (metadata.workingDirectory && typeof metadata.workingDirectory === 'string' && metadata.workingDirectory.length > 0)
|
|
5110
|
+
? metadata.workingDirectory
|
|
5111
|
+
: null;
|
|
5112
|
+
let resolvedConnectCwd = null;
|
|
5113
|
+
if (preSelectedSessionId) {
|
|
5114
|
+
try {
|
|
5115
|
+
resolvedConnectCwd = await resolveCwdForSession(preSelectedSessionId, wdHint);
|
|
5116
|
+
}
|
|
5117
|
+
catch (e) {
|
|
5118
|
+
console.warn('⚠️ connect cwd resolve failed:', e instanceof Error ? e.message : e);
|
|
5119
|
+
resolvedConnectCwd = null;
|
|
5120
|
+
}
|
|
5113
5121
|
}
|
|
5114
|
-
|
|
5115
|
-
|
|
5116
|
-
|
|
5122
|
+
const connectWd = pickConnectWorkingDir({ preSelectedSessionId, resolved: resolvedConnectCwd, hint: wdHint, defaultDir: defaultWorkingDir });
|
|
5123
|
+
// Recursive mkdirSync is a no-op when the dir already exists; only the
|
|
5124
|
+
// hint path (new project / fresh sprite) needs creating — the resolved
|
|
5125
|
+
// dir exists by construction, the default is the agent's own boot dir.
|
|
5126
|
+
if (connectWd.createIfMissing && !existsSync(connectWd.dir)) {
|
|
5127
|
+
mkdirSync(connectWd.dir, { recursive: true });
|
|
5128
|
+
console.log(`📁 Created project directory: ${connectWd.dir}`);
|
|
5117
5129
|
}
|
|
5130
|
+
workingDir = connectWd.dir;
|
|
5131
|
+
console.log(`📂 Working directory (${connectWd.source}): ${workingDir}`);
|
|
5118
5132
|
}
|
|
5119
5133
|
catch (err) {
|
|
5120
5134
|
console.log('⚠️ Could not parse participant metadata, using config voiceMode:', voiceMode);
|
package/dist/session-switch.d.ts
CHANGED
|
@@ -122,6 +122,38 @@ export declare function warmParkKey(llm: {
|
|
|
122
122
|
* otherwise the agent's boot dir (today's behaviour). Never trusts the param.
|
|
123
123
|
*/
|
|
124
124
|
export declare function sessionMessagesDir(sessionId: string, requested: string | null | undefined, bootDir: string, exists: (sessionId: string, cwd: string) => boolean): string;
|
|
125
|
+
/**
|
|
126
|
+
* Working directory the agent boots a CONNECTION in (connect-time, #112).
|
|
127
|
+
*
|
|
128
|
+
* The resume mismatch bug: a client opens `/chat?session=A&workingDirectory=X`,
|
|
129
|
+
* but X is stale/empty (a switch rewrote the URL without a cwd, or the hint was
|
|
130
|
+
* never the session's real project). Trusting the raw hint booted the agent in
|
|
131
|
+
* the wrong dir — often `/workspace` root — so `--resume A` never found A's
|
|
132
|
+
* JSONL and the session silently came up as the wrong one with a generic
|
|
133
|
+
* "Workspace" chip. The fix makes the agent AUTHORITATIVE about a pre-selected
|
|
134
|
+
* session's cwd: its RESOLVED project dir wins over the client hint.
|
|
135
|
+
*
|
|
136
|
+
* `resolved` is resolveSessionCwd(preSelectedSessionId, hint, …) — the only dir
|
|
137
|
+
* where A's JSONL actually exists (null = found nowhere yet). Pure: the caller
|
|
138
|
+
* does the I/O (resolveSessionCwd) and the mkdir when `createIfMissing`.
|
|
139
|
+
*
|
|
140
|
+
* - pre-selected + resolved → the resolved dir (already exists, no mkdir).
|
|
141
|
+
* - pre-selected + unresolved + hint → the hint, created (fresh sprite / new
|
|
142
|
+
* project whose JSONL isn't on disk yet, so --resume can still attach there).
|
|
143
|
+
* - pre-selected + nothing → the default boot dir.
|
|
144
|
+
* - no pre-selected + hint → the hint, created (new project).
|
|
145
|
+
* - no pre-selected + nothing → the default boot dir.
|
|
146
|
+
*/
|
|
147
|
+
export declare function pickConnectWorkingDir(args: {
|
|
148
|
+
preSelectedSessionId: string | null | undefined;
|
|
149
|
+
resolved: string | null | undefined;
|
|
150
|
+
hint: string | null | undefined;
|
|
151
|
+
defaultDir: string;
|
|
152
|
+
}): {
|
|
153
|
+
dir: string;
|
|
154
|
+
createIfMissing: boolean;
|
|
155
|
+
source: 'resolved' | 'hint' | 'default';
|
|
156
|
+
};
|
|
125
157
|
/**
|
|
126
158
|
* Single-flight guard for performSessionSwitch. Only the critical section
|
|
127
159
|
* (teardown + arm + session_switched) holds the guard; `after` (the spoken
|
package/dist/session-switch.js
CHANGED
|
@@ -127,6 +127,42 @@ export function sessionMessagesDir(sessionId, requested, bootDir, exists) {
|
|
|
127
127
|
}
|
|
128
128
|
return bootDir;
|
|
129
129
|
}
|
|
130
|
+
/**
|
|
131
|
+
* Working directory the agent boots a CONNECTION in (connect-time, #112).
|
|
132
|
+
*
|
|
133
|
+
* The resume mismatch bug: a client opens `/chat?session=A&workingDirectory=X`,
|
|
134
|
+
* but X is stale/empty (a switch rewrote the URL without a cwd, or the hint was
|
|
135
|
+
* never the session's real project). Trusting the raw hint booted the agent in
|
|
136
|
+
* the wrong dir — often `/workspace` root — so `--resume A` never found A's
|
|
137
|
+
* JSONL and the session silently came up as the wrong one with a generic
|
|
138
|
+
* "Workspace" chip. The fix makes the agent AUTHORITATIVE about a pre-selected
|
|
139
|
+
* session's cwd: its RESOLVED project dir wins over the client hint.
|
|
140
|
+
*
|
|
141
|
+
* `resolved` is resolveSessionCwd(preSelectedSessionId, hint, …) — the only dir
|
|
142
|
+
* where A's JSONL actually exists (null = found nowhere yet). Pure: the caller
|
|
143
|
+
* does the I/O (resolveSessionCwd) and the mkdir when `createIfMissing`.
|
|
144
|
+
*
|
|
145
|
+
* - pre-selected + resolved → the resolved dir (already exists, no mkdir).
|
|
146
|
+
* - pre-selected + unresolved + hint → the hint, created (fresh sprite / new
|
|
147
|
+
* project whose JSONL isn't on disk yet, so --resume can still attach there).
|
|
148
|
+
* - pre-selected + nothing → the default boot dir.
|
|
149
|
+
* - no pre-selected + hint → the hint, created (new project).
|
|
150
|
+
* - no pre-selected + nothing → the default boot dir.
|
|
151
|
+
*/
|
|
152
|
+
export function pickConnectWorkingDir(args) {
|
|
153
|
+
const hint = norm(args.hint);
|
|
154
|
+
if (norm(args.preSelectedSessionId)) {
|
|
155
|
+
const resolved = norm(args.resolved);
|
|
156
|
+
if (resolved)
|
|
157
|
+
return { dir: resolved, createIfMissing: false, source: 'resolved' };
|
|
158
|
+
if (hint)
|
|
159
|
+
return { dir: hint, createIfMissing: true, source: 'hint' };
|
|
160
|
+
return { dir: args.defaultDir, createIfMissing: false, source: 'default' };
|
|
161
|
+
}
|
|
162
|
+
if (hint)
|
|
163
|
+
return { dir: hint, createIfMissing: true, source: 'hint' };
|
|
164
|
+
return { dir: args.defaultDir, createIfMissing: false, source: 'default' };
|
|
165
|
+
}
|
|
130
166
|
// ── Review minors ────────────────────────────────────────────────────────────
|
|
131
167
|
/**
|
|
132
168
|
* Single-flight guard for performSessionSwitch. Only the critical section
|