feat: add client side skills (#1320)
Co-authored-by: Letta Code <noreply@letta.com>
This commit is contained in:
@@ -8182,9 +8182,8 @@ export default function App({
|
||||
cmd.finish(outputLines.join("\n"), true);
|
||||
|
||||
// Manual /compact bypasses stream compaction events, so trigger
|
||||
// post-compaction reminder/skills reinjection on the next user turn.
|
||||
// post-compaction reflection reminder/auto-launch on the next user turn.
|
||||
contextTrackerRef.current.pendingReflectionTrigger = true;
|
||||
contextTrackerRef.current.pendingSkillsReinject = true;
|
||||
} catch (error) {
|
||||
let errorOutput: string;
|
||||
|
||||
|
||||
@@ -73,13 +73,16 @@ export function createCommandRunner({
|
||||
onCommandFinished,
|
||||
}: RunnerDeps) {
|
||||
function getHandle(id: string, input: string): CommandHandle {
|
||||
// biome-ignore lint/style/noNonNullAssertion: forward-reference pattern — overwritten synchronously below. null! preferred over no-ops to crash loudly if invariant breaks.
|
||||
const uninitialized = (): never => {
|
||||
throw new Error("CommandHandle callback used before initialization");
|
||||
};
|
||||
|
||||
const handle: CommandHandle = {
|
||||
id,
|
||||
input,
|
||||
update: null!,
|
||||
finish: null!,
|
||||
fail: null!,
|
||||
update: uninitialized,
|
||||
finish: uninitialized,
|
||||
fail: uninitialized,
|
||||
};
|
||||
|
||||
const update = (updateData: CommandUpdate) => {
|
||||
|
||||
@@ -454,7 +454,6 @@ function extractTextPart(v: unknown): string {
|
||||
function markCompactionCompleted(ctx?: ContextTracker): void {
|
||||
if (!ctx) return;
|
||||
ctx.pendingCompaction = true;
|
||||
ctx.pendingSkillsReinject = true;
|
||||
ctx.pendingReflectionTrigger = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,8 +16,6 @@ export type ContextTracker = {
|
||||
currentTurnId: number;
|
||||
/** Set when a compaction event is seen; consumed by the next usage_statistics push */
|
||||
pendingCompaction: boolean;
|
||||
/** Set when compaction happens; consumed by the next user message to reinject skills reminder */
|
||||
pendingSkillsReinject: boolean;
|
||||
/** Set when compaction happens; consumed by the next user message to trigger memory reminder/spawn */
|
||||
pendingReflectionTrigger: boolean;
|
||||
};
|
||||
@@ -28,7 +26,6 @@ export function createContextTracker(): ContextTracker {
|
||||
contextTokensHistory: [],
|
||||
currentTurnId: 0, // simple in-memory counter for now
|
||||
pendingCompaction: false,
|
||||
pendingSkillsReinject: false,
|
||||
pendingReflectionTrigger: false,
|
||||
};
|
||||
}
|
||||
@@ -38,6 +35,5 @@ export function resetContextHistory(ct: ContextTracker): void {
|
||||
ct.lastContextTokens = 0;
|
||||
ct.contextTokensHistory = [];
|
||||
ct.pendingCompaction = false;
|
||||
ct.pendingSkillsReinject = false;
|
||||
ct.pendingReflectionTrigger = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user