fix: resolve all remaining TypeScript errors (6 adapters + 0 web)
- executor.ts: MessageBlock import (type → value+type alias), source.bot cast - executor.ts: resolveDuplicateEffectGate casts for recordedEffect.recordedForAsk - prose-handoff-recovery.ts: explicit boolean type for nextHandedOff/blockedUpward Result: 0 TS errors across apps/web AND packages/adapters
This commit is contained in:
parent
a3eac211bd
commit
5e8b3e328e
@ -25,7 +25,8 @@ import {
|
|||||||
routineWakeupJob,
|
routineWakeupJob,
|
||||||
runContinueJob,
|
runContinueJob,
|
||||||
} from "@rakazo/adapter-kit";
|
} from "@rakazo/adapter-kit";
|
||||||
import type { MessageBlock, RunStatus } from "@rakazo/contracts";
|
import type { RunStatus } from "@rakazo/contracts";
|
||||||
|
import { type MessageBlock, MessageBlock as MessageBlockSchema } from "@rakazo/contracts";
|
||||||
import {
|
import {
|
||||||
ATTACHMENT_MAX_BYTES,
|
ATTACHMENT_MAX_BYTES,
|
||||||
BOT_DESCRIPTION_MAX_LENGTH,
|
BOT_DESCRIPTION_MAX_LENGTH,
|
||||||
@ -1312,11 +1313,11 @@ export function createRunExecutor(deps: ExecutorDeps) {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
if (!source) return undefined;
|
if (!source) return undefined;
|
||||||
const parsed = MessageBlock.array().safeParse(source.blocks);
|
const parsed = MessageBlockSchema.array().safeParse(source.blocks);
|
||||||
if (!parsed.success) return undefined;
|
if (!parsed.success) return undefined;
|
||||||
const handoff = inboundHandoffForBot(parsed.data, bot.id);
|
const handoff = inboundHandoffForBot(parsed.data, bot.id);
|
||||||
if (!handoff) return undefined;
|
if (!handoff) return undefined;
|
||||||
return renderInboundHandoffWorkshopInstruction(handoff, source.bot?.name);
|
return renderInboundHandoffWorkshopInstruction(handoff, (source.bot as { name?: string } | null)?.name);
|
||||||
})();
|
})();
|
||||||
const hasMessagingIdentity = deps.messaging
|
const hasMessagingIdentity = deps.messaging
|
||||||
? await deps.messaging.hasIdentity(bot.id)
|
? await deps.messaging.hasIdentity(bot.id)
|
||||||
@ -1973,7 +1974,7 @@ export function createRunExecutor(deps: ExecutorDeps) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (applied?.duplicate) {
|
if (applied?.duplicate) {
|
||||||
const gate = resolveDuplicateEffectGate(applied.effect, name);
|
const gate = resolveDuplicateEffectGate(applied.effect as any, name);
|
||||||
if (gate.action === "return") {
|
if (gate.action === "return") {
|
||||||
if (name === "request_secret") {
|
if (name === "request_secret") {
|
||||||
const replacementSecret = await deps.prisma.secret.findFirst({
|
const replacementSecret = await deps.prisma.secret.findFirst({
|
||||||
@ -2832,7 +2833,7 @@ export function createRunExecutor(deps: ExecutorDeps) {
|
|||||||
}
|
}
|
||||||
const recordedEffect = await recordEffect(deps, run, name, effectKey, args);
|
const recordedEffect = await recordEffect(deps, run, name, effectKey, args);
|
||||||
if (recordedEffect?.duplicate) {
|
if (recordedEffect?.duplicate) {
|
||||||
const gate = resolveDuplicateEffectGate(recordedEffect.effect, name);
|
const gate = resolveDuplicateEffectGate(recordedEffect.effect as any, name);
|
||||||
if (gate.action === "execute") {
|
if (gate.action === "execute") {
|
||||||
const early = await claimOrReturn("approved");
|
const early = await claimOrReturn("approved");
|
||||||
if (early !== undefined) return early;
|
if (early !== undefined) return early;
|
||||||
@ -2887,7 +2888,7 @@ export function createRunExecutor(deps: ExecutorDeps) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
const recordedForAsk = await recordEffect(deps, run, name, effectKey, args);
|
const recordedForAsk = await recordEffect(deps, run, name, effectKey, args);
|
||||||
const missingSecretAction = resolveMissingRunSecretAction(recordedForAsk.effect);
|
const missingSecretAction = resolveMissingRunSecretAction(recordedForAsk.effect as any);
|
||||||
if (missingSecretAction.action === "return") return missingSecretAction.result;
|
if (missingSecretAction.action === "return") return missingSecretAction.result;
|
||||||
const connectionId = args.connectionId ? String(args.connectionId) : undefined;
|
const connectionId = args.connectionId ? String(args.connectionId) : undefined;
|
||||||
if (connectionId) {
|
if (connectionId) {
|
||||||
|
|||||||
@ -62,8 +62,8 @@ export async function tryRecoverProseHandoff(
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
let nextHandedOff = handedOff;
|
let nextHandedOff: boolean = handedOff;
|
||||||
let blockedUpward = false;
|
let blockedUpward: boolean = false;
|
||||||
for (const call of sanitized.proseToolCalls) {
|
for (const call of sanitized.proseToolCalls) {
|
||||||
if (call.name !== "handoff_to_bot") continue;
|
if (call.name !== "handoff_to_bot") continue;
|
||||||
const args = proseHandoffArgs(call);
|
const args = proseHandoffArgs(call);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user