@devries-cameron20 / composio Mirror · read-only
Fork 0

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

Mirrored from https://github.com/Camo67/composio.git

Synced Nov 21, 03:37 UTC

next
ts 62 lines 2.28 KB
Raw
1 import { Effect, Schema } from 'effect';
2
3 /** Who a release is for: stable installs by default, beta only when asked for. */
4 export const Channel = Schema.Literals(['stable', 'beta']);
5 export type Channel = typeof Channel.Type;
6 export const stableByDefault = Channel.pipe(
7 Schema.withDecodingDefaultKey(Effect.succeed('stable' as const))
8 );
9
10 /**
11 * Everything that differs between channels. The request, the release PR, the gate, the tag and
12 * the reviewed files are the same for both.
13 */
14 export const CHANNELS = {
15 stable: {
16 /** The npm dist-tag a published version moves forward. */
17 npmTag: 'latest',
18 /**
19 * Whether the release PR commits versions, changelogs and references to `next`. A beta PR
20 * commits only its plan, so `next` stays stable and every changeset stays pending.
21 */
22 commitsVersions: true,
23 /**
24 * Checks the release PR head needs besides the candidate checks. The docs are checked against
25 * the candidate packages, not the published ones the pull-request docs workflows install.
26 */
27 extraChecks: ['SDK candidate docs'],
28 /** Whether publishing opens a docs PR that pins the released npm versions. */
29 pinsDocs: true,
30 },
31 beta: {
32 // `beta` belongs to the 1.0 prerelease train on `main`; previews of `next` use `next`.
33 npmTag: 'next',
34 commitsVersions: false,
35 // A beta PR does not touch the docs, so no docs check runs on it.
36 extraChecks: [],
37 pinsDocs: false,
38 },
39 } as const satisfies Record<
40 Channel,
41 {
42 readonly npmTag: string;
43 readonly commitsVersions: boolean;
44 readonly extraChecks: ReadonlyArray<string>;
45 readonly pinsDocs: boolean;
46 }
47 >;
48
49 /**
50 * Changesets snapshot settings for a beta: the version the changesets would release, suffixed
51 * with the planning run, such as `0.29.0-beta.19087654321`. The run ID is unique and grows over
52 * time, so betas sort in request order without reading the registry or the clock.
53 */
54 export const betaSnapshot = (run: string) => ({
55 config: { useCalculatedVersion: true, prereleaseTemplate: `{tag}.${run}` },
56 parameters: { tag: 'beta' },
57 });
58
59 const BETA = /^(\d+\.\d+\.\d+)-beta\.(\d+)$/;
60
61 /** The PEP 440 spelling of a planned version: `1.2.3-beta.45` is published as `1.2.3b45`. */
62 export const pythonVersion = (version: string) => version.replace(BETA, '$1b$2');