Skip to content

Commit 63bfc76

Browse files
Shawclaude
andcommitted
fix(cloud): unblock api/frontend typecheck — more bang-equals + index exports
Round 2 of cloud typecheck fixes after Cloud CF Deploy verify failed. bang-equals (5 more): - agent-gateway-router.ts (3 lines): `!owner.organization_id !== args.organizationId` → `owner.organization_id !== args.organizationId` - node-autoscaler.ts: `!bootstrap.controlPlanePublicKey.trim().length === 0` → `bootstrap.controlPlanePublicKey.trim().length === 0` - runtime-factory.ts: `!context.characterId === DEFAULT_AGENT_ID_STRING` → `context.characterId === DEFAULT_AGENT_ID_STRING` other typecheck blockers: - n8n-credential-bridge.ts: `!k.expires_at > now` was comparing boolean to Date. Fixed to `(!k.expires_at || k.expires_at > now)` matching intent. - character.ts:155: added `!character.messageExamples ||` null guard exposed by the earlier bang-equals fix. missing exports (storage proxy + vendor-connections work landed but never wired into index): - packages/db/repositories/index.ts + schemas/index.ts: add ./org-storage-quota + ./vendor-connections. Verified: bun run --cwd cloud/apps/{api,frontend} typecheck both PASS. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 9aecbec commit 63bfc76

7 files changed

Lines changed: 13 additions & 7 deletions

File tree

cloud/packages/db/repositories/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ export * from "./model-pricing";
9696
// Core Platform Repositories
9797
// ============================================
9898
export * from "./org-rate-limit-overrides";
99+
export * from "./org-storage-quota";
99100
export * from "./organization-invites";
100101
export * from "./organizations";
101102
export * from "./provider-health";
@@ -119,3 +120,4 @@ export * from "./usage-records";
119120
export * from "./user-mcps";
120121
export * from "./user-sessions";
121122
export * from "./users";
123+
export * from "./vendor-connections";

cloud/packages/db/schemas/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ export * from "./managed-domains";
5151
export * from "./model-pricing";
5252
export * from "./moderation-violations";
5353
export * from "./org-rate-limit-overrides";
54+
export * from "./org-storage-quota";
5455
export * from "./organization-billing";
5556
export * from "./organization-config";
5657
export * from "./organization-encryption-keys";
@@ -78,6 +79,7 @@ export * from "./user-preferences";
7879
export * from "./user-sessions";
7980
export * from "./user-voices";
8081
export * from "./users";
82+
export * from "./vendor-connections";
8183
export * from "./vertex-model-assignments";
8284
export * from "./vertex-tuned-models";
8385
export * from "./vertex-tuning-jobs";

cloud/packages/lib/eliza/plugin-n8n-bridge/n8n-credential-bridge.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,9 @@ export class N8nCredentialBridge extends Service {
314314
private async getUserApiKey(userId: string, organizationId: string): Promise<string | null> {
315315
const keys = await apiKeysService.listByOrganization(organizationId);
316316
const now = new Date();
317-
const userKey = keys.find((k) => k.user_id === userId && k.is_active && !k.expires_at > now);
317+
const userKey = keys.find(
318+
(k) => k.user_id === userId && k.is_active && (!k.expires_at || k.expires_at > now),
319+
);
318320

319321
if (!userKey) {
320322
logger.warn("[N8nCredentialBridge] No active API key found", {

cloud/packages/lib/eliza/runtime-factory.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1816,7 +1816,7 @@ export class RuntimeFactory {
18161816
`[RuntimeFactory] Creating runtime: user=${context.userId}, mode=${context.agentMode}, char=${context.characterId || "default"}, webSearch=${context.webSearchEnabled}`,
18171817
);
18181818

1819-
const isDefaultCharacter = !context.characterId === DEFAULT_AGENT_ID_STRING;
1819+
const isDefaultCharacter = context.characterId === DEFAULT_AGENT_ID_STRING;
18201820
const loaderOptions = { webSearchEnabled: context.webSearchEnabled };
18211821

18221822
const { character, plugins, modeResolution } = isDefaultCharacter

cloud/packages/lib/eliza/shared/providers/character.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ export const characterProvider: Provider = {
152152
// Contextual selection: Score examples by keyword overlap with current message
153153
// Current: Show 3 examples (balanced for context window)
154154
const messageExamplesText = (() => {
155-
if (character.messageExamples.length === 0) {
155+
if (!character.messageExamples || character.messageExamples.length === 0) {
156156
return "";
157157
}
158158

cloud/packages/lib/services/agent-gateway-router.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ export class AgentGatewayRouterService {
331331
};
332332
}
333333

334-
if (!owner.organization_id !== args.organizationId) {
334+
if (owner.organization_id !== args.organizationId) {
335335
return {
336336
reason: "owner_org_mismatch",
337337
};
@@ -578,7 +578,7 @@ export class AgentGatewayRouterService {
578578
};
579579
}
580580

581-
if (!owner.organization_id !== args.organizationId) {
581+
if (owner.organization_id !== args.organizationId) {
582582
return {
583583
handled: false,
584584
reason: "owner_org_mismatch",
@@ -667,7 +667,7 @@ export class AgentGatewayRouterService {
667667
};
668668
}
669669

670-
if (!owner.organization_id !== args.organizationId) {
670+
if (owner.organization_id !== args.organizationId) {
671671
return {
672672
handled: false,
673673
reason: "owner_org_mismatch",

cloud/packages/lib/services/containers/node-autoscaler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ export class NodeAutoscaler {
182182
"Cannot provision a node: HCLOUD_TOKEN is not set.",
183183
);
184184
}
185-
if (!bootstrap.controlPlanePublicKey.trim().length === 0) {
185+
if (bootstrap.controlPlanePublicKey.trim().length === 0) {
186186
throw new HetznerCloudError(
187187
"invalid_input",
188188
"controlPlanePublicKey is required to provision a node",

0 commit comments

Comments
 (0)