Skip to content
Myr

common.ts

This file

Path

packages/protocol/src/domain/common.ts

70 lines · 1.8 KiB · TypeScript

Last changed by

Merge build/comments-cli-protocol-checks into mainoscabrielbefore adoptionc86204f

History of this file

Take it

The walk stopped after 200 commits: lines older than 678c8b8 point at it.

Merge build/comments-cli-protocol-checks into mainoscabrielbefore adoptionc86204f

lines 1–2why, one step back
1// `domain/` imports only `effect` and sibling files, never the RPC stack, so
2// the SDK and the rules sandbox can load it.

Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8

lines 3–29why, one step back
3import { Schema } from "effect";
45import { RepoPath } from "../ids.ts";67export const Glob = Schema.NonEmptyString.pipe(Schema.brand("Glob"));89export type Glob = typeof Glob.Type;1011export const Command = Schema.NonEmptyString.pipe(Schema.brand("Command"));1213export type Command = typeof Command.Type;1415export const Hostname = Schema.String.pipe(16 Schema.check(17 Schema.isPattern(18 /^(?:\*\.)?[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)*$/u19 )20 ),21 Schema.brand("Hostname")22);2324export type Hostname = typeof Hostname.Type;2526export const JsonPath = Schema.NonEmptyString.pipe(Schema.brand("JsonPath"));2728export type JsonPath = typeof JsonPath.Type;29

Merge build/comments-cli-protocol-checks into mainoscabrielbefore adoptionc86204f

line 30why, one step back
30// Not `Symbol`, which would shadow the global.

Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8

lines 31–70why, one step back
31export const SymbolName = Schema.NonEmptyString.pipe(
32 Schema.brand("SymbolName")33);3435export type SymbolName = typeof SymbolName.Type;3637export const RefNameText = Schema.String.pipe(38 Schema.check(39 Schema.isPattern(/^refs\/(?!.*\.\.)[A-Za-z0-9._-]+(?:\/[A-Za-z0-9._-]+)+$/u)40 ),41 Schema.brand("RefNameText")42);4344export type RefNameText = typeof RefNameText.Type;4546export const Evidence = Schema.Struct({47 href: Schema.optionalKey(Schema.NonEmptyString),48 label: Schema.NonEmptyString,49 value: Schema.String,50});5152export type Evidence = typeof Evidence.Type;5354export const ConfigFile = Schema.Struct({55 content: Schema.String,56 path: RepoPath,57});5859export type ConfigFile = typeof ConfigFile.Type;6061export const AtLeastOne = Schema.Int.check(Schema.isGreaterThanOrEqualTo(1));6263export const NoneOrMore = Schema.Int.check(Schema.isGreaterThanOrEqualTo(0));6465export const At = Schema.Struct({66 line: AtLeastOne,67 path: RepoPath,68});6970export type At = typeof At.Type;