π OpenHands: AI-Driven Development
chore(deps): bump @openhands/extensions to 0.24.0 (#17681)
Devin647af75ba44c
diff --git a/__tests__/manifests/automation-setup.test.ts b/__tests__/manifests/automation-setup.test.tsindex cea7af550b..c09512c11c 100644--- a/__tests__/manifests/automation-setup.test.ts+++ b/__tests__/manifests/automation-setup.test.ts@@ -82,6 +82,8 @@ interface FixtureScenario {expectedFieldErrors?: Record<string, string>;/** False when the recorded request is deliberately not what setup sends. */matchesSetupPayload?: boolean;+ /** Which of the entry's trigger kinds the scenario picked, when it has several. */+ selectedTrigger?: string;}interface FixtureBundle {@@ -123,6 +125,7 @@ const CREATE_CASES = BUNDLES.flatMap((bundle) =>body: scenario.create.request.body,// A prompt entry records none; buildCreatePayload ignores it.tarballPath: scenario.upload?.response.body.tarball_path,+ selectedTrigger: scenario.selectedTrigger,},]: [],@@ -138,6 +141,7 @@ const PREFLIGHT_CASES = BUNDLES.flatMap((bundle) =>automationId: bundle.automationId,formValues: scenario.formValues ?? {},body: scenario.preflight.request.body,+ selectedTrigger: scenario.selectedTrigger,},]: [],@@ -170,6 +174,7 @@ const SERVICE_ERROR_CASES = BUNDLES.flatMap((bundle) =>formValues: scenario.formValues ?? {},responseBody: exchange.response.body,expectedFieldErrors: scenario.expectedFieldErrors,+ selectedTrigger: scenario.selectedTrigger,},];}),@@ -225,14 +230,14 @@ describe("the contract fixtures", () => {describe("buildCreatePayload", () => {it.each(CREATE_CASES)("derives the $name create body its fixture pins",- ({ automationId, formValues, body, tarballPath }) => {+ ({ automationId, formValues, body, tarballPath, selectedTrigger }) => {// Arrangeconst entry = requireEntry(automationId);// Actconst payload = tarballPath- ? buildCreatePayload(entry, formValues, tarballPath)- : buildCreatePayload(entry, formValues);+ ? buildCreatePayload(entry, formValues, tarballPath, selectedTrigger)+ : buildCreatePayload(entry, formValues, undefined, selectedTrigger);// Assertexpect(payload).toEqual(body);@@ -333,12 +338,12 @@ describe("buildCreatePayload", () => {describe("buildPreflightBody", () => {it.each(PREFLIGHT_CASES)("derives the $name preflight envelope its fixture pins",- ({ automationId, formValues, body }) => {+ ({ automationId, formValues, body, selectedTrigger }) => {// Arrangeconst entry = requireEntry(automationId);// Act- const envelope = buildPreflightBody(entry, formValues);+ const envelope = buildPreflightBody(entry, formValues, selectedTrigger);// Assertexpect(envelope).toEqual(body);@@ -365,15 +370,26 @@ describe("buildAssistedMessage", () => {describe("service rejections mapped back to fields", () => {it.each(SERVICE_ERROR_CASES)("maps the $name rejection to the fields the fixture names",- ({ automationId, formValues, responseBody, expectedFieldErrors }) => {+ ({+ automationId,+ formValues,+ responseBody,+ expectedFieldErrors,+ selectedTrigger,+ }) => {// Arrangeconst entry = requireEntry(automationId);- const payload = buildCreatePayload(entry, formValues);+ const payload = buildCreatePayload(+ entry,+ formValues,+ undefined,+ selectedTrigger,+ );// Actconst mapped = mapServiceErrors(normalizeServiceErrors(responseBody, payload),- deriveErrorMap(entry),+ deriveErrorMap(entry, selectedTrigger),);// Assert@@ -413,14 +429,19 @@ describe("deriveErrorMap", () => {// Assert β a bundle's answers reach the service through its rendered// config rather than through a prompt, so the paths are the config's.+ // With no trigger selected the map covers both of the entry's kinds.expect(errorMap).toEqual({name: ["repositories"],"trigger.schedule": ["schedule"],"trigger.timezone": ["timezone"],+ "trigger.on": ["on"],+ "trigger.filter": ["repositories", "triggerReviewer"],"template.config.repos": ["repositories"],"template.config.github_token_secret": ["githubTokenSecret"],"template.config.trigger_label": ["triggerLabel"],+ "template.config.trigger_reviewer": ["triggerReviewer"],"template.config.review_tone": ["reviewTone"],+ "template.config.maintainers": ["maintainers"],});});});diff --git a/package-lock.json b/package-lock.jsonindex e7478ef856..fa66460ee4 100644--- a/package-lock.json+++ b/package-lock.json@@ -13,7 +13,7 @@"@heroui/react": "2.8.10","@microlink/react-json-view": "1.31.25","@monaco-editor/react": "4.7.0",- "@openhands/extensions": "0.22.1",+ "@openhands/extensions": "0.24.0","@openhands/typescript-client": "1.49.6","@react-router/node": "7.18.2","@react-router/serve": "7.18.2",@@ -4165,9 +4165,9 @@"license": "MIT"},"node_modules/@openhands/extensions": {- "version": "0.22.1",- "resolved": "https://registry.npmjs.org/@openhands/extensions/-/extensions-0.22.1.tgz",- "integrity": "sha512-Y2wBBrQSODpLc12VE4w4rc0V972bOLb7fWxfVitzos+Cjq0RNDoFg60lyQErabGLV0gFlp/0Vd9jkYRGYtwqyw==",+ "version": "0.24.0",+ "resolved": "https://registry.npmjs.org/@openhands/extensions/-/extensions-0.24.0.tgz",+ "integrity": "sha512-gj1MaR+KkLTdZoKd2c/FzvSlDEjpc2XuAzvOEdHBXcVu31AIK/RrdnDKN6oUnuMLTlSSWwSokQLMH3UqBHAp1Q==","license": "MIT","engines": {"node": ">=18.20.0"diff --git a/package.json b/package.jsonindex f64e591664..3bad5f9683 100644--- a/package.json+++ b/package.json@@ -23,7 +23,7 @@"@heroui/react": "2.8.10","@microlink/react-json-view": "1.31.25","@monaco-editor/react": "4.7.0",- "@openhands/extensions": "0.22.1",+ "@openhands/extensions": "0.24.0","@openhands/typescript-client": "1.49.6","@react-router/node": "7.18.2","@react-router/serve": "7.18.2",diff --git a/src/manifests/automation-setup.ts b/src/manifests/automation-setup.tsindex b98fdd72ab..9026ba5ebf 100644--- a/src/manifests/automation-setup.ts+++ b/src/manifests/automation-setup.ts@@ -501,7 +501,7 @@ function buildTrigger(const filter = entry.setup.filter? interpolateText(entry.setup.filter, {- form: values,+ form: filterFormValues(values),automation: entry,}): undefined;@@ -518,6 +518,23 @@ function buildTrigger(};}+/**+ * The form as a filter reads it. A filter is a JMESPath expression, so a+ * multi-value answer inside it is a list literal - `['a/b', 'c/d']`, as the+ * reference renderer writes one - rather than the list of names it reads as+ * inside a sentence.+ */+function filterFormValues(values: SetupFormValues): SetupFormValues {+ return Object.fromEntries(+ Object.entries(values).map(([name, value]) => [+ name,+ Array.isArray(value)+ ? `[${value.map((item) => `'${item}'`).join(", ")}]`+ : value,+ ]),+ );+}+/*** The raw create body a bundle entry produces.*diff --git a/src/mocks/automation-handlers.ts b/src/mocks/automation-handlers.tsindex f63d9f4dbe..abb588f996 100644--- a/src/mocks/automation-handlers.ts+++ b/src/mocks/automation-handlers.ts@@ -70,9 +70,12 @@ function validateDraftTrigger(}}+ // "*" subscribes to every event the source delivers, so it never names an+ // unregistered type.if (trigger.type === "event" &&trigger.on &&+ trigger.on !== "*" &&!REGISTERED_EVENT_TYPES.includes(trigger.on)) {const source = trigger.source === "github" ? "GitHub" : trigger.source;