mirror of
https://github.com/ComposioHQ/composio.git
synced 2026-09-22 11:46:35 +08:00
705591451c
This PR: - upgrades every CI action to its latest release (only `changesets/action` had one: v2.1.1 -> v2.1.2, SHA-pinned) and every outdated dependency across the pnpm workspace, the docs bun workspace, and all three `uv.lock` files - moves zod to 4.5.4 everywhere first-party — catalog, docs, `@composio/json-schema-to-zod`, `@composio/claude-agent-sdk` and the zod-v4 e2e fixtures; the `*-zod-v3` fixtures stay on 3.25.76 because that is what they exercise - moves `@mastra/core` 1.52.1 -> 1.53.0, which is the ceiling rather than a preference: bisecting `ts/examples/mastra`'s `cf:dry-run` shows 1.54.0 moved the workspace/sandbox subsystem behind `@mastra/core/agent`, which drags execa (-> `npm-run-path` -> `unicorn-magic`) into the Workers bundle where esbuild cannot link it. `@mastra/mcp` is capped at 1.17.2 for the same reason — 1.17.3 wants `@mastra/core` >=1.64. The docs bun workspace mirrors that cap as an explicit devDependency plus `overrides` entry, because bun does not apply overrides to auto-installed peers - clears every production advisory that has a published fix, so the audit gate can run without `--ignore`, which does not filter a single run: it writes the advisory into `auditConfig` and exits 0 whatever else is outstanding, so the gate was passing over nine advisories - `qs` -> >=6.16.0, `fast-uri` -> >=3.1.6, `toml` -> the 4.x line, all via overrides in the existing `# temporary: … drop when` style - `extract-zip` (GHSA-jmr9-qjv8-65gv) has no fixed version to move to — 2.0.1 is the newest release and GitHub records `first_patched_version` as null — so it moves to `auditConfig.ignoreGhsas` pointing at the `extractZipSafely` mitigation that already covers it - GHSA-866g-f22w-33x8 (`@ai-sdk/provider-utils` 3.x, low) also has nothing to move to: the advisory names 3.0.98 as patched but the 3.x line stopped at 3.0.30 and GitHub records no fixed version. It only enters the tree through `@mastra/core`, which is a peer or dev dependency of every published package, so all flagged paths are private examples and e2e fixtures. It goes in `ignoreGhsas` with that rationale so the un-levelled `pnpm audit --prod` step stops posting a warning comment on every PR - widens `@composio/anthropic`'s `@anthropic-ai/sdk` peer range to include `^0.124.0`, the line its devDependency now tests against (for a `0.x` caret, `^0.120.0` excluded it); the package is in the changeset for that reason - adapts three call sites that upstream broke: `eve` 0.52 moved `ApprovalContext` to `eve/tools/approval`, `@pierre/diffs` 1.4 gave `FileDiffProps` a second type parameter, and `fumadocs-openapi` 11.4 fixed the undeclared-tag drop that a docs guard test asserted (the guard now also asserts the page positively, so it cannot pass vacuously) - drops the stale `hono` `minimumReleaseAgeExclude` entry (its comment said to after 2026-08-06) and adds an `undici` `peerDependencyRules` allowance for openai 7.10's new optional peer ## Context Some upgrades were deliberately declined, each for a reason recorded next to the pin: - `vitest`/`@vitest/ui` stay on 4.1.11 — `@cloudflare/vitest-pool-workers@0.22.0` (latest) peers on `vitest ^4.1.0` - `undici` stays on `^7` in core — `pinnedDispatcher.node.ts` documents that Node's `fetch` rejects undici 8 dispatchers - the `pnpm` catalog entry stays on `^11` to match the mise-owned toolchain - `eve` stays on 0.27.6 in docs — 0.52 changes the `defineAgent` model definition and the `useEveAgent` helpers, so `agent/agent.ts` and `components/eve-chat.tsx` fail `types:check`; migrating the docs agent is its own PR - `@earendil-works/pi-coding-agent` stays on 0.84.4 — 0.85.x imports `@earendil-works/pi-server` without declaring it, so `test/pi.test.ts` fails to load `declareOperationTags` is kept as a safety net rather than retired, even though `fumadocs-openapi` 11.4 makes it redundant: removing it changes how specs are normalised at sync time and is worth its own PR. Verified locally: `pnpm build:packages`, `pnpm typecheck`, `pnpm test`, `pnpm typecheck:examples`, `pnpm lint:examples`, `turbo cf:dry-run --filter='./ts/examples/*'`, `pnpm peers check`, `pnpm audit --prod --audit-level=high` (exit 0), frozen-lockfile installs for pnpm and bun, docs `types:check` + 542 static tests, and Python `make chk` + `make tst` (1790 passed). https://claude.ai/code/session_018evFic47PFPXuB95uRE1aw EOF -R ComposioHQ/composio
116 lines
3.6 KiB
TypeScript
116 lines
3.6 KiB
TypeScript
import { createPatch } from 'diff';
|
|
import { getSingularPatch } from '@pierre/diffs';
|
|
import { preloadFileDiff } from '@pierre/diffs/ssr';
|
|
import type { FileDiffProps } from '@pierre/diffs/react';
|
|
import { DiffView, HIDE_DIFF_STATS_CSS } from './diff-view';
|
|
import { FILE_BUILDS } from '@/lib/file-builds';
|
|
|
|
async function diffFor(file: string, prev: string, code: string) {
|
|
const fileDiff = getSingularPatch(createPatch(file, prev, code, '', ''));
|
|
const { prerenderedHTML } = await preloadFileDiff({
|
|
fileDiff,
|
|
options: { diffStyle: 'unified', unsafeCSS: HIDE_DIFF_STATS_CSS },
|
|
});
|
|
return { fileDiff, prerenderedHTML };
|
|
}
|
|
|
|
function StepCard({
|
|
n,
|
|
title,
|
|
file,
|
|
description,
|
|
fileDiff,
|
|
prerenderedHTML,
|
|
code,
|
|
}: {
|
|
n: number;
|
|
title: string;
|
|
file: string;
|
|
description?: string;
|
|
|
|
fileDiff: FileDiffProps<undefined, undefined>['fileDiff'];
|
|
prerenderedHTML: string;
|
|
code: string;
|
|
}) {
|
|
return (
|
|
<div className="overflow-hidden rounded-sm border border-fd-border bg-fd-background">
|
|
<div className="flex items-center gap-2.5 border-b border-fd-border px-3 py-2">
|
|
<span className="flex size-5 shrink-0 items-center justify-center rounded-sm bg-[var(--composio-brand)]/10 font-mono text-[11px] font-medium text-[var(--composio-brand)]">
|
|
{n}
|
|
</span>
|
|
<span className="text-[13px] font-medium text-fd-foreground">{title}</span>
|
|
<span className="ml-auto font-mono text-[10px] uppercase tracking-[0.06em] text-fd-foreground/40">
|
|
{file}
|
|
</span>
|
|
</div>
|
|
{description ? (
|
|
<p className="px-3 pt-2.5 text-[13px] leading-snug text-fd-foreground/65">{description}</p>
|
|
) : null}
|
|
<div className="p-3">
|
|
<DiffView fileDiff={fileDiff} prerenderedHTML={prerenderedHTML} code={code} />
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
/**
|
|
* FileBuildup — renders one of the example's files growing a piece at a time.
|
|
* Each step is a diff against the previous stage (powered by @pierre/diffs).
|
|
*
|
|
* Pass `step` (1-indexed) to render just that one step's diff, so the prose for
|
|
* a concept can sit right next to the code that adds it. Without `step`, renders
|
|
* every step with its built-in description.
|
|
*
|
|
* `name` keys into the merged FILE_BUILDS registry (see lib/file-builds.ts),
|
|
* which carries every example's stages under unique keys.
|
|
*/
|
|
export async function FileBuildup({
|
|
name,
|
|
step,
|
|
}: {
|
|
name: keyof typeof FILE_BUILDS;
|
|
step?: number;
|
|
}) {
|
|
const build = FILE_BUILDS[name];
|
|
if (!build) return null;
|
|
|
|
if (typeof step === 'number') {
|
|
const i = step - 1;
|
|
const stage = build.stages[i];
|
|
if (!stage) return null;
|
|
const prev = i > 0 ? build.stages[i - 1].code : '';
|
|
const { fileDiff, prerenderedHTML } = await diffFor(build.file, prev, stage.code);
|
|
// The heading above and the diff's own filename header already name it, so
|
|
// render just the diff with no extra card chrome.
|
|
return (
|
|
<div className="not-prose my-6">
|
|
<DiffView fileDiff={fileDiff} prerenderedHTML={prerenderedHTML} code={stage.code} />
|
|
</div>
|
|
);
|
|
}
|
|
|
|
const steps = [];
|
|
let prev = '';
|
|
for (const stage of build.stages) {
|
|
steps.push({ ...stage, ...(await diffFor(build.file, prev, stage.code)) });
|
|
prev = stage.code;
|
|
}
|
|
|
|
return (
|
|
<div className="not-prose my-6 flex flex-col gap-5">
|
|
{steps.map((s, i) => (
|
|
<StepCard
|
|
key={s.title}
|
|
n={i + 1}
|
|
title={s.title}
|
|
file={build.file}
|
|
description={s.description}
|
|
fileDiff={s.fileDiff}
|
|
prerenderedHTML={s.prerenderedHTML}
|
|
code={s.code}
|
|
/>
|
|
))}
|
|
</div>
|
|
);
|
|
}
|