Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,30 @@ npmPreapprovedPackages:
- "@earendil-works/[email protected]"
- "@earendil-works/[email protected]"

# Native tool input public declarations in the pinned local runtime patch.
# Patch manifest edits alone do not add dependencies during Yarn resolution.
packageExtensions:
# Pass the checker's compiler through to Volar instead of resolving native TS7.
"@astrojs/[email protected]":
peerDependencies:
typescript: "^5.0.0 || ^6.0.0"
# Dependency analysis and its public types require the JavaScript compiler API.
"[email protected]":
dependencies:
typescript: "6.0.3"
# Native tool input public declarations in the pinned local runtime patch.
# Patch manifest edits alone do not add dependencies during Yarn resolution.
"@flue/[email protected]":
dependencies:
"@standard-schema/spec": "1.1.0"

catalog:
tsx: "4.20.6"
typescript: "6.0.3"
typescript: "7.0.2"
"@typescript/typescript6": "6.0.2"
vite: "8.2.2"
vitest: "4.1.11"
"@tsconfig/bases": "1.0.28"
"@types/node": "22.18.13"

catalogs:
typescript6:
typescript: "6.0.3"
4 changes: 2 additions & 2 deletions apps/brunch-agent/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"dev": "vite dev",
"fix:eslint": "oxlint --fix --type-aware --type-check --report-unused-disable-directives-severity=error .",
"lint:eslint": "oxlint --type-aware --type-check --report-unused-disable-directives-severity=error .",
"lint:tsc": "tsgo --noEmit",
"lint:tsc": "tsc --noEmit",
"persona": "node --experimental-strip-types evals/petrinaut/persona/launch.ts",
"petrinaut:dev": "vite dev --config petrinaut-local.vite.config.ts",
"probe:turn": "node --experimental-strip-types evals/petrinaut/turn-probe.ts",
Expand Down Expand Up @@ -60,12 +60,12 @@
"@types/pg": "8.23.1",
"@types/react": "19.2.14",
"@types/react-dom": "19.2.3",
"@typescript/native-preview": "7.0.0-dev.20260511.1",
"@valibot/to-json-schema": "1.7.1",
"ai": "6.0.286",
"dependency-cruiser": "18.0.0",
"oxlint": "1.86.0",
"oxlint-tsgolint": "7.0.2003",
"typescript": "catalog:",
"vite": "catalog:",
"vitest": "catalog:",
"wait-on": "9.0.1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,17 +318,14 @@ const ensureFlowDefinitionEntity = async ({
const properties = mapFlowDefinitionToEntityProperties(flowDefinition);

const existingEntity = await getFlowDefinitionEntityById({
flowDefinitionEntityId: entityIdFromComponents(
userId as WebId,
flowDefinitionId,
),
flowDefinitionEntityId: entityIdFromComponents(userId, flowDefinitionId),
graphApiClient: graphApi,
userAuthentication: authentication,
});

if (!existingEntity) {
await HashEntity.create<FlowDefinitionEntity>(graphApi, authentication, {
webId: userId as WebId,
webId: userId,
entityUuid: flowDefinitionId,
entityTypeIds,
properties,
Expand Down Expand Up @@ -421,7 +418,7 @@ const seedEntities = async ({

for (const [index, { entityTypeId, properties }] of entities.entries()) {
await HashEntity.create(graphApi, authentication, {
webId: userId as WebId,
webId: userId,
entityTypeIds: [entityTypeId],
properties: mergePropertyObjectAndMetadata(properties, undefined),
provenance: { actorType: "user", origin: { type: "api" } },
Expand Down Expand Up @@ -646,7 +643,7 @@ const describeWorkflowError = (error: unknown) => {

while (current?.cause) {
activityType = current.activityType ?? activityType;
current = current.cause as typeof current;
current = current.cause;
}

return `${activityType ? `\`${activityType}\` failed: ` : ""}${current?.message ?? "unknown error"}`;
Expand Down Expand Up @@ -909,15 +906,12 @@ const main = async () => {
const workflowError = await workflowErrorWhenClosed;

const flowRun = await getFlowRunFromTemporalWorkflowId({
flowDefinitionEntityId: entityIdFromComponents(
userId as WebId,
flowDefinitionId,
),
flowRunEntityId: entityIdFromComponents(userId as WebId, workflowId),
flowDefinitionEntityId: entityIdFromComponents(userId, flowDefinitionId),
flowRunEntityId: entityIdFromComponents(userId, workflowId),
name: flowDefinition.name,
temporalClient: client,
temporalWorkflowId: workflowId,
webId: userId as WebId,
webId: userId,
storageProvider: getStorageProvider(),
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ describe("aggregateAction", () => {
"00000000-0000-4000-8000-000000000001~00000000-0000-4000-8000-000000000011" as EntityId;
vi.mocked(queryEntities).mockResolvedValueOnce({
entities: [],
} as unknown as QueryEntitiesResponse);
});

expect(
await run({ kind: "EntityId", value: [entityId] }, scoreSum),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ describe("filterListAction", () => {
recordId: { entityId },
entityTypeIds: [
index === 1
? ("https://example.com/types/entity-type/person/v/1" as VersionedUrl)
? "https://example.com/types/entity-type/person/v/1"
: companyType,
],
},
Expand Down Expand Up @@ -203,6 +203,7 @@ describe("filterListAction", () => {
const result = await run(
{
kind: "EntityId",
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion -- These malformed fixtures still need EntityId branding despite other Payload variants accepting strings.
value: [validEntityId, "" as EntityId, "not-an-entity-id" as EntityId],
},
isCompany,
Expand Down Expand Up @@ -467,7 +468,7 @@ describe("filterListAction", () => {
it("reports an entity the user can't read as not found", async () => {
vi.mocked(queryEntities).mockResolvedValueOnce({
entities: [],
} as unknown as QueryEntitiesResponse);
});

expect(
await run({ kind: "EntityId", value: [validEntityId] }, isCompany),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import type {
VersionedUrl,
} from "@blockprotocol/type-system";
import type { FileStorageProvider } from "@local/hash-backend-utils/file-storage";
import type { QueryEntitiesResponse } from "@local/hash-graph-sdk/entity";
import type { FilterCondition } from "@local/hash-isomorphic-utils/flows/filter-condition";
import type {
Payload,
Expand Down Expand Up @@ -224,7 +223,7 @@ describe("findAction", () => {
"00000000-0000-4000-8000-000000000001~00000000-0000-4000-8000-000000000011" as EntityId;
vi.mocked(queryEntities).mockResolvedValueOnce({
entities: [],
} as unknown as QueryEntitiesResponse);
});

expect(
await run(
Expand All @@ -238,8 +237,7 @@ describe("findAction", () => {
operator: "isOfType",
value: {
kind: "VersionedUrl",
value:
"https://example.com/types/entity-type/company/v/1" as VersionedUrl,
value: "https://example.com/types/entity-type/company/v/1",
},
},
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,7 @@ const tools: LlmToolDefinition<ToolName>[] = [
* string rather than an object — parse it before schema validation.
*/
sanitizeInputBeforeValidation: (rawInput) => {
if (
"config" in rawInput &&
typeof (rawInput as { config: unknown }).config === "string"
) {
if ("config" in rawInput && typeof rawInput.config === "string") {
return {
...rawInput,
config: JSON.parse(
Expand Down Expand Up @@ -332,7 +329,7 @@ export const generateChartConfigAction: FlowActionActivity<
Array.isArray(parsedChartData) &&
parsedChartData.length > 0 &&
parsedChartData[0]
? Object.keys(parsedChartData[0] as object).join(", ")
? Object.keys(parsedChartData[0]).join(", ")
: "unknown"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ const tools: LlmToolDefinition<ToolName>[] = [
},
required: ["filter"],
additionalProperties: false,
$defs: filterSchemaDefinitions as Record<string, unknown>,
$defs: filterSchemaDefinitions,
},
},
{
Expand Down Expand Up @@ -598,7 +598,7 @@ const tools: LlmToolDefinition<ToolName>[] = [
},
required: ["filter", "explanation", "suggestedChartTypes"],
additionalProperties: false,
$defs: filterSchemaDefinitions as Record<string, unknown>,
$defs: filterSchemaDefinitions,
},
},
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ describe("orderByAction", () => {
"00000000-0000-4000-8000-000000000001~00000000-0000-4000-8000-000000000011" as EntityId;
vi.mocked(queryEntities).mockResolvedValueOnce({
entities: [],
} as unknown as QueryEntitiesResponse);
});

expect(await run({ kind: "EntityId", value: [entityId] }, byScore)).toEqual(
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ const createColumnsForEntity = (

for (const { schema } of entityTypeAndParents) {
for (const baseUrl of typedKeys(schema.properties)) {
properties.add(baseUrl as BaseUrl);
properties.add(baseUrl);
}
for (const linkTypeId of typedKeys(schema.links ?? {})) {
links.add(linkTypeId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const mapLlmToolDefinitionToOpenAiToolDefinition = (
*/
strict: false,
name: tool.name,
parameters: tool.inputSchema as OpenAI.FunctionParameters,
parameters: tool.inputSchema,
description: tool.description,
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ export const mapOpenAiMessagesToLlmMessages = (params: {
{
role: "user",
content: [toolResultContent],
} as LlmUserMessage,
},
];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ vi.mock("@local/hash-backend-utils/temporal", async (importOriginal) => {
},
},
flowDefinitionEntityId: entityIdFromComponents(
aliceUserAccountId as WebId,
aliceUserAccountId,
generateUuid() as EntityUuid,
),
flowInputs: {},
Expand Down
5 changes: 2 additions & 3 deletions apps/hash-api/src/analysis/analyses/dashboards.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
import type {
ActorEntityUuid,
MachineId,
RoleName,
WebId,
} from "@blockprotocol/type-system";
import type { FileStorageProvider } from "@local/hash-backend-utils/file-storage";
Expand Down Expand Up @@ -177,7 +176,7 @@ describe("dashboardItemData analysis", () => {
registerAnalyses(dashboardAnalyses);

mockedGetRole.mockReset();
mockedGetRole.mockResolvedValue("member" as RoleName);
mockedGetRole.mockResolvedValue("member");

mockedGetWebMachineId.mockReset();
mockedGetWebMachineId.mockResolvedValue(WEB_MACHINE_ID);
Expand Down Expand Up @@ -209,7 +208,7 @@ describe("dashboardItemData analysis", () => {
it("errors when the item does not exist in the web", async () => {
mockedQueryEntities.mockResolvedValue({
entities: [],
} as unknown as Awaited<ReturnType<typeof queryEntities>>);
});

const result = await resolve({ itemUuid: ITEM_UUID });
expect(result.status).toBe("error");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import { beforeEach, describe, expect, it, vi } from "vitest";

import type {
ActorEntityUuid,
RoleName,
WebId,
} from "@blockprotocol/type-system";
import type { ActorEntityUuid, WebId } from "@blockprotocol/type-system";
import type { FileStorageProvider } from "@local/hash-backend-utils/file-storage";
import type Keyv from "keyv";

Expand Down Expand Up @@ -89,7 +85,7 @@ describe("resolveInvocation (supply-chain analyses)", () => {
clearAnalysisRegistry();
registerAnalyses(supplyChainAnalyses);
mockedGetRole.mockReset();
mockedGetRole.mockResolvedValue("member" as RoleName);
mockedGetRole.mockResolvedValue("member");
});

it("resolves productGraph to a presigned graph artifact", async () => {
Expand Down Expand Up @@ -387,7 +383,7 @@ describe("resolveInvocation (supply-chain analyses)", () => {
getObjectLastModified: async () => {
throw new Error("Storage unavailable");
},
} as unknown as FileStorageProvider,
},
cache,
});

Expand Down
6 changes: 3 additions & 3 deletions apps/hash-api/src/auth/kratos-endpoint-allowlist.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
} from "./kratos-endpoint-allowlist";

import type { Logger } from "@local/hash-backend-utils/logger";
import type { NextFunction, Request, RequestHandler, Response } from "express";
import type { Request, Response } from "express";
import type { AddressInfo } from "node:net";

vi.mock("@sentry/node", () => ({ captureMessage: vi.fn() }));
Expand Down Expand Up @@ -325,7 +325,7 @@ describe("guardKratosProxy", () => {

const guarded = guardKratosProxy({
logger: { error } as unknown as Logger,
proxy: proxy as unknown as RequestHandler,
proxy,
});

const call = (
Expand All @@ -341,7 +341,7 @@ describe("guardKratosProxy", () => {
ip,
} as unknown as Request,
{ sendStatus } as unknown as Response,
next as unknown as NextFunction,
next,
);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,7 @@ import {

import type { ImpureGraphContext } from "../../../../context-types";
import type { BeforeUpdateEntityHookCallback } from "../update-entity-hooks";
import type {
ActorEntityUuid,
BaseUrl,
WebId,
} from "@blockprotocol/type-system";
import type { ActorEntityUuid, BaseUrl } from "@blockprotocol/type-system";
import type { UserProperties } from "@local/hash-isomorphic-utils/system-types/user";

/**
Expand Down Expand Up @@ -255,7 +251,7 @@ export const userBeforeEntityUpdateHookCallback: BeforeUpdateEntityHookCallback
await updateWebShortname(
context.graphApi,
{ actorId: systemAccountId },
{ webId: user.accountId as WebId, shortname: updatedShortname },
{ webId: user.accountId, shortname: updatedShortname },
);
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ export const getCommentAncestorBlock: ImpureGraphFunction<
)
) {
// @todo - make sure the entity is really a block
return getBlockFromEntity({ entity: parentEntity as Block["entity"] });
return getBlockFromEntity({ entity: parentEntity });
} else {
return getCommentAncestorBlock(context, authentication, {
commentEntityId: parentEntity.metadata.recordId.entityId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import type {
MachineId,
ProvidedEntityEditionProvenance,
UserId,
WebId,
} from "@blockprotocol/type-system";
import type {
UserSecretService,
Expand Down Expand Up @@ -165,7 +164,7 @@ export const createUserSecret = async <
authentication,
{
entityTypeIds: [systemEntityTypes.userSecret.entityTypeId],
webId: userAccountId as WebId,
webId: userAccountId,
entityUuid: userSecretEntityUuid,
properties: secretMetadata,
policies: [
Expand All @@ -188,7 +187,7 @@ export const createUserSecret = async <
{ graphApi, provenance },
authentication,
{
webId: userAccountId as WebId,
webId: userAccountId,
entityUuid: usesUserSecretEntityUuid,
properties: { value: {} },
linkData: {
Expand Down
Loading
Loading