flow

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 30, 2026 License: MIT Imports: 20 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package flow draws a run in the terminal's normal flow, as it happens, from the run's own events (design/terminal-ui.md, "The live region"; decision 70): a small live block at the foot redraws in place, one status row a unit, and what has settled prints once and stays in the scrollback: each round's plan at its question, in OpenTofu's own words, and the apply's rows with the run's close. A View turns events into the rows they settle and the block as it stands; a Region writes them to a terminal with the live block, and Lines to one without it, or as plain text. Every input that moves a frame, the clock, the spinner's frame, the terminal's size and its colours, is given, so a frame draws the same every time.

Index

Constants

View Source
const (
	// MostWidth is the widest a view in the flow draws: wider terminals draw
	// it at this width, as plain output does.
	MostWidth = 120
	// LeastWidth is the narrowest: narrower terminals draw it at this width,
	// with no live region.
	LeastWidth = 52
)

The widths that change a view in the flow's form (design/terminal-ui.md, "Width").

View Source
const SpinnerFrame = 80 * time.Millisecond

SpinnerFrame is how long each of the spinner's frames shows.

Variables

This section is empty.

Functions

func Age

func Age(d time.Duration) string

Age reads how long ago something was, d: in minutes under an hour, hours under a day, days under two weeks but for a whole week, as the frames read seven days, then weeks, each whole and never rounded up.

func Approved

func Approved(run seam.RunStarted, needs seam.Need) string

Approved is what approve tells the agent once Claude Code's prompt passed it (5.4.3): the run goes on, or waits for the delete sign-in in the person's terminal, never the sign-in's link or code (decision 36). It calls the person "the user", the agent's own word (5.4.4).

func ChangeMark

func ChangeMark(k seam.ChangeKind) ink.Span

ChangeMark is a change's mark, and the pen it's drawn in.

func Clock

func Clock(t time.Time, zone *time.Location) string

Clock reads t as a clock time in zone.

func Compact

func Compact(b Brief) string

Compact is the compact summary, which the agent pastes into chat unchanged (7.7.1, 7.7.2): plain text, a line per item, with no width of its own and clock times alone, since it's read later.

func CountSpans

func CountSpans(t seam.Totals) []ink.Span

CountSpans are t's counts, +1 ~2 ±1 -1 ←1 →1 ⊖1, each in its kind's pen.

func Countdown

func Countdown(d time.Duration) string

Countdown reads how long is left until a time, as the views count down to one: 40s under a minute, 52m under an hour, then 1h 05m. A part is never rounded up.

func Duration

func Duration(d time.Duration) string

Duration reads a duration as the views give one: 4.1s under a minute, to a tenth; 1m 22s from a minute, the seconds in two digits; 1h 05m from an hour. A part is never rounded up.

func Elapsed

func Elapsed(d time.Duration) string

Elapsed reads how long a unit or a run has taken, as its row and its close give it (decision 70): whole seconds under a minute, the clock standing still between them, then as Duration.

func Lead

func Lead(end seam.State, k seam.StepKind) string

Lead is what a next step of kind k is for, after a run that ended as end (design/terminal-ui.md, "Next", "The close").

func NeedWords

func NeedWords(n seam.Need) string

NeedWords is what a question waits for.

func OneLine

func OneLine(b Brief) string

OneLine is the one-line summary, the hook's reason inside Claude Code's prompt for terrace approve (7.7.4): the code, verb, target and tier, the counts, each red flag by name, the amber flags counted by kind, and what the approval leads to.

func Plural

func Plural(n int, one, many string) string

Plural is n of a thing, its word one or many by n.

func RunMark

func RunMark(st seam.State) (ink.Span, string)

RunMark is a run's mark by where it stands, and the word for it.

func Spin

func Spin(frame int) ink.Span

Spin is the spinner at its frame-th frame, counted on from the first.

func Who

func Who(by seam.By) string

Who is who started a run, or answered it, as a view says it.

Types

type Answer

type Answer uint8

Answer is a person's answer at a question, by the key that gave it.

const (
	AnswerNone Answer = iota
	AnswerApprove
	AnswerReject
	AnswerLeave
)

The answers a question's keys give: none, the approval or the offer taken, a rejection, or the offer left standing as the command ends.

type Brief

type Brief struct {
	Run     seam.RunStarted
	Summary seam.Summary
	// Needs is what the run's question asks for, as the record has it.
	// Empty, it's the plan's.
	Needs         seam.Need
	Target        string
	Zone          *time.Location
	Standing      bool
	Offer         bool
	SignInMissing bool
}

Brief is what the texts outside the terminal word: a run, its latest round's summary, its target as commands write it, and the zone clock times read in (design/terminal-ui.md, "Text outside the terminal"); whether the summary's question stands, unanswered; whether it's a plan's offer, not yet taken; and whether nothing can approve it, as its delete sign-in wasn't set up when the run started (5.1.6).

type DeviceSignIn

type DeviceSignIn struct {
	Link, BaseLink, Code string
	ExpiresAt            time.Time
}

DeviceSignIn is a delete sign-in a view started, as the view shows it: the link with its code that approves it in a browser, the link alone where the code is typed, the code, and when the code expires. It's the view's own, as the cloud gave it, never the record's (5.5.8).

type Ending

type Ending uint8

Ending is how a view of a run ended.

const (
	EndClosed Ending = iota
	EndWaits
	EndDetached
	EndLeft
	EndApproved
	EndGone
)

The endings: the run's close settled; the run waits on a person this view can't ask; the person detached, or a hangup or terminate signal did; the person left a plan's offer standing; approve's view ended on the approval it asked for, the run going on; or the record's events stopped coming.

type Event

type Event struct {
	Entry    seam.Entry
	CaughtUp bool
	Err      error
}

Event is what a view following a run is given: an entry of the run's record, word that it has caught up with every entry the record held when it began, or the error that stopped the record being read.

type Follower

type Follower struct {
	View *View
	Out  Output
	// Screen is the terminal's size now, read again at every draw.
	Screen   func() Screen
	Now      func() time.Time
	Keyboard Keyboard
	// Cancel lands a cancel on the run.
	Cancel func(ctx context.Context) error
	// Answer lands the person's answer to question q on the run, and is
	// the entry it recorded, which settles at once; nil where it recorded
	// none, as where another answer won, whose own event settles it. It's
	// a *HeldError where another run holds the units an offer would apply.
	Answer func(ctx context.Context, q seam.Question, a Answer) (*seam.Entry, error)
	// SignIn does the delete sign-in to profile for the run, as each view
	// in the person's terminal does once the run waits for it (5.5.5): it
	// calls shown with the link and code once the cloud has given them, and
	// returns once the sign-in is done and its keys handed to the run, nil
	// then; a *SignInError where it came to nothing; or ctx's error, which
	// ends as the view stops wanting it, the sign-in landed elsewhere, the
	// run ended or the view did. nil starts none.
	SignIn func(ctx context.Context, profile config.ProfileName, shown func(DeviceSignIn)) error
	// contains filtered or unexported fields
}

Follower draws a run as it happens: every row settled so far, then, once caught up, the live block, redrawn on every event and every spinner frame, until the run closes, waits on a person, or the person detaches.

func (*Follower) Run

func (f *Follower) Run(ctx context.Context, events <-chan Event) (end Ending, err error)

Run follows events until the view ends, and is how it ended. A hangup, a terminate signal or an interrupt the terminal didn't give as a key ends ctx, which detaches, never cancels, and exits cleanly whether or not the terminal is still there to say so. The terminal is left as it was however it ends.

type GroupsOption

type GroupsOption func(*groupsOptions)

GroupsOption sets how groups are laid out.

func EndBefore

func EndBefore(e int) GroupsOption

EndBefore sets the column every line ends before, in the sheet's end's place, so groups drawn at a terminal's own width wrap there.

func PartedBy

func PartedBy(sep ink.Span) GroupsOption

PartedBy parts the groups with sep, in sep's place.

type HeldError

type HeldError struct {
	By seam.Code
}

HeldError is an answer that can't be acted on now: another run, By, holds the units a plan's offer would apply (4.2.5). The offer stands.

func (*HeldError) Error

func (e *HeldError) Error() string

type Idle

type Idle struct {
	// Repo is the repo's root as people read it, ~/infra.
	Repo string
	// Since is when it began waiting.
	Since time.Time
	// Last is the repo's last run, nil where it has none.
	Last *LastRun
	Zone *time.Location
	// Below is whether it draws below a run's view, as watch does once the
	// run it followed ends: a blank row comes between.
	Below bool
}

Idle is watch with no run to follow: it waits for the next run in the repo, until Ctrl-C (design/terminal-ui.md, "Per command", idle-*).

func (Idle) Block

func (i Idle) Block(screen Screen, t Tick) []ink.Row

Block is what's live while watch waits, at t: the spinner and what it waits for, the time it's waited, the last run, and its key.

func (Idle) Header

func (i Idle) Header(width int) []ink.Row

Header is watch's header, which settles once.

type Keyboard

type Keyboard struct {
	Keys  <-chan terminal.Key
	Stops <-chan os.Signal
	// Suspend puts the terminal back, stops the process until it's
	// continued, then sets the terminal to take keys again. It's
	// terminal.ErrHungUp where the terminal hung up meanwhile.
	Suspend func() error
	// Fence throws away every key typed before the question just drawn
	// could be seen, read or not; nil where keys aren't read.
	Fence func() error
}

Keyboard is the person's terminal as a view reads it: the keys typed, and Ctrl-Z, which Suspend answers. Its zero value reads nothing, as where stdin is no terminal.

type LastRun

type LastRun struct {
	Code   seam.Code
	Verb   config.Verb
	Target string
	State  seam.State
	At     time.Time
}

LastRun is a run as idle names it: its code, verb and target, and how and when it ended, or where it stands.

func (LastRun) Groups

func (l LastRun) Groups(room int, when string) [][]ink.Span

Groups are the last run as a line names it, in lines room cells wide: its code, its verb and target, and how it stands, with when it ended, or stands from, as when. A target too long for a line is cut from its start.

type Lines

type Lines struct {
	// contains filtered or unexported fields
}

Lines writes a view's rows as they settle, with no live block: to a terminal too narrow, too short or too dumb for one, in colour, or as plain text where output isn't a terminal, with no escape anywhere.

func NewLines

func NewLines(out io.Writer, pal ink.Palette) *Lines

NewLines writes rows to out in pal.

func (*Lines) Close

func (*Lines) Close() error

Close has nothing to put back.

func (*Lines) Draw

func (l *Lines) Draw(settled, _ []ink.Row) error

Draw writes the rows that settle; there's no block.

func (*Lines) Live

func (*Lines) Live() bool

Live reports that rows alone draw no block.

type Options

type Options struct {
	// Zone is the zone clock times read in.
	Zone *time.Location
	// Target writes a target as commands carry it: from the folder the
	// command runs in. Nil writes it from the repo's root, as the record
	// keeps it.
	Target func(unit.Path) string
	// Run is the run as the view knows it before its record's first event
	// comes: what a detach names, where the person detaches that soon.
	Run seam.RunStarted
	// Below is whether the view draws below another run's, as watch does
	// once the run it followed ends: a blank row comes between.
	Below bool
	// KeysUnread is whether no key is read from the terminal, its stdin
	// being none: Ctrl-C is never asked about, so the key line leaves it out,
	// and no question is put.
	KeysUnread bool
	// Now is the clock rows settle by; nil reads the time of the event
	// that settles them.
	Now func() time.Time
	// From is the round whose plan the view opens at, under the run's
	// title, as approve does: nothing before it settles. 0 opens at the
	// run's start.
	From int
	// Approving is whether the view is approve's: it ends once the run is
	// approved and needs no more of the person, on how to follow it.
	Approving bool
}

Options are what a view words its run with.

type Output

type Output interface {
	// Draw writes rows that settle, then the block in place of the last.
	Draw(settled, block []ink.Row) error
	// Live reports whether it draws a live block at all.
	Live() bool
	// Close leaves the terminal as it was: the block erased, the cursor
	// shown.
	Close() error
}

Output is where a view's rows are written: the rows that settle, and the live block as it stands.

type Page

type Page struct {
	// contains filtered or unexported fields
}

Page is rows laid out top to bottom in the flow's form, for a view that prints and exits, as the lists do: it takes the terminal's width up to the flow's most, and never less than its least.

func NewPage

func NewPage(width int) *Page

NewPage is a page for a terminal width columns wide.

func (*Page) End

func (p *Page) End() int

End is the column what's set on the right ends before.

func (*Page) Gap

func (p *Page) Gap(n int)

Gap leaves n rows blank.

func (*Page) Groups

func (p *Page) Groups(x int, groups [][]ink.Span, opts ...GroupsOption)

Groups lays out groups parted by a faint " · " from column x, a group that won't fit starting the next line under the first, and moves to the row after them.

func (*Page) Header

func (p *Page) Header(left []ink.Span, rights ...[]ink.Span) int

Header writes a view's header on the page's row, as a run's view has it: terrace's name and what the view is, and on the right the first of rights that fits. It's the index of the right side drawn, len(rights) where none fits.

func (*Page) Line

func (p *Page) Line() *ink.Row

Line is the row the page is on.

func (*Page) Narrow

func (p *Page) Narrow() bool

Narrow reports whether the page is narrow: below 70 columns.

func (*Page) Next

func (p *Page) Next()

Next moves to the row below.

func (*Page) Rows

func (p *Page) Rows() []ink.Row

Rows are the rows laid out, to the row the page is on.

func (*Page) TitleRoom

func (p *Page) TitleRoom(right ...ink.Span) int

TitleRoom is the room a header's left side has after terrace's name, beside right, the least its right side draws.

func (*Page) Width

func (p *Page) Width() int

Width is the width the page draws at.

func (*Page) Write

func (p *Page) Write(rows []ink.Row)

Write writes rows laid out elsewhere from the page's row down, and moves to the row after them.

type Record

type Record struct {
	Entries []seam.Entry
	// Options word the run as its view does. Its clock, where it has one,
	// is the time a run still going is printed at.
	Options Options
}

Record is a run's record as show prints it (decision 72): the run as its view settles it where no live block shows and no key is read, as watch prints it, or one unit's plans, or one resource's block.

func (Record) ResourceRows

func (r Record) ResourceRows(p unit.Path, round int, address string, width int) []ink.Row

ResourceRows are the resource at address in unit p laid out at a terminal width columns wide, under the run's title: the unit's row as round planned it, then each block of OpenTofu's text of that plan headed with the address. Where no heading names it, the unit's whole text follows a faint line that says so. Where round didn't plan the unit, its row is as the run left it.

func (Record) Rows

func (r Record) Rows(width int) []ink.Row

Rows are the run laid out at a terminal width columns wide, every row its view has settled: the title and its line, each round's plan with its risks and outcome, the apply's rows and the close. A run that waits on a person ends on what it waits for, as watch's view of it does; one still going on its live rows as they stand, that it goes on, and where to follow it.

func (Record) UnitRows

func (r Record) UnitRows(p unit.Path, width int) []ink.Row

UnitRows are unit p's plans laid out at a terminal width columns wide, under the run's title: for each round that planned it, its row, with OpenTofu's text of its plan under it where the plan changes anything, the round named where the run has more than one. A plan that failed part way has the text OpenTofu wrote before it failed, then the tools' diagnostic. A unit no round planned has its row as the run left it.

type Region

type Region struct {
	// contains filtered or unexported fields
}

Region writes a view to a terminal with its live block: the rows that settle print once into the terminal's flow, and the block at the foot redraws in place (design/terminal-ui.md, "The redraw"). A frame moves the cursor up the last block's height and writes each line over the one there, then erases the rest of that line, never erasing first, so no line is ever seen blank; what's left of the last block below the new one is erased after. The whole frame is one synchronized update. That's the only movement up. The cursor is hidden while a block is drawn and shown again once none is. A draw is one write, the record of the block it drew kept with it under one lock. A draw that would write the block it drew last over itself, on a terminal as wide, settling nothing, writes nothing: a frame that stands still doesn't flicker. Nor does one that settles nothing where no block was drawn and none is.

func NewRegion

func NewRegion(out io.Writer, pal ink.Palette, cols func() int) *Region

NewRegion is a live region writing to out in pal, on a terminal cols wide now.

func (*Region) Close

func (r *Region) Close() error

Close ends a synchronized update a failed write left begun, erases the block and shows the cursor where it hid it.

func (*Region) Draw

func (r *Region) Draw(settled, block []ink.Row) error

Draw writes the rows that settle over the last block, and the block below them, as one frame.

func (*Region) Live

func (*Region) Live() bool

Live reports that a region draws a live block.

type Screen

type Screen struct {
	Width, Height int
	// Background is whether the process is in the terminal's background.
	Background bool
}

Screen is the terminal a block is drawn for: its size, a height of 0 where it gives none.

func (Screen) Roomy

func (s Screen) Roomy() bool

Roomy reports whether a terminal of s has room for a live block: a size of zero is one the terminal didn't give, and a process in the terminal's background has none, as its block would draw over the shell.

type SignInEnd

type SignInEnd uint8

SignInEnd is how a view's sign-in came to nothing.

const (
	SignInFailed SignInEnd = iota
	SignInExpired
	SignInDenied
	SignInWrongUser
)

The ends: a failure, its words given; the code expired before anyone used it (5.5.6); the person denied it in the browser; or a user who can't take the delete permission set signed in (5.5.7).

type SignInError

type SignInError struct {
	End SignInEnd
	Why string
}

SignInError is a view's sign-in that came to nothing, and how. Why words a failure, for the view to say.

func (*SignInError) Error

func (e *SignInError) Error() string

type Tick

type Tick struct {
	Now   time.Time
	Frame int
}

Tick is the moment a block is drawn at: the clock, and the spinner's frame.

type View

type View struct {
	// contains filtered or unexported fields
}

View is a run drawn in the flow, from its events in order.

func NewView

func NewView(opt Options) *View

NewView is a view of a run, worded with opt.

func (*View) AnswerOf

func (v *View) AnswerOf(r rune) Answer

AnswerOf is the answer key k gives at the question up, AnswerNone for a key that answers nothing: Enter among them, as there's no default (decision 38).

func (*View) Approved

func (v *View) Approved() bool

Approved reports whether approve's view ended on the approval it asked for, the run going on.

func (*View) Ask

func (v *View) Ask(width int) []ink.Row

Ask is the rows Ctrl-C's question settles where no live block can hold it: a terminal too narrow, too short or too dumb for one asks it once, and it's answered below. A block drawn while it's up draws its keys alone.

func (*View) AskQuestion

func (v *View) AskQuestion(width int) []ink.Row

AskQuestion is the rows the question settles where no live block can hold it: a terminal too narrow, too short or too dumb for one prints it once with its keys, and it's answered below them.

func (*View) Asked

func (v *View) Asked() bool

Asked reports whether the Ctrl-C question up has settled as rows.

func (*View) Asking

func (v *View) Asking() bool

Asking reports whether the run's question is up, to be answered with the view's keys.

func (*View) Asks

func (v *View) Asks() int

Asks is how many questions the run has put: each new one is drawn afresh, and keys typed before it are thrown away.

func (*View) Block

func (v *View) Block(screen Screen, t Tick) []ink.Row

Block is the live block as it stands at t, for screen: never taller than the terminal less one row, giving way where it must in the order the design gives, with a blank row above it where there's room and the row settled last isn't one. It's empty where the run has no live block.

func (*View) CancelAsked

func (v *View) CancelAsked()

CancelAsked takes Ctrl-C's question down as the person cancels at it: its answer shows in its place as the cancel lands.

func (*View) Detach

func (v *View) Detach(at time.Time, width int) []ink.Row

Detach is the rows that settle as the person detaches at at: the live rows as they stand, then a line saying the run goes on, and where to follow it; or where the run waits on the person, in the question's place, what it waits for, and where to approve it.

func (*View) Detaching

func (v *View) Detaching() bool

Detaching reports whether the Ctrl-C question is up.

func (*View) Finished

func (v *View) Finished() bool

Finished reports whether the run's close has settled: nothing more draws.

func (*View) HeldBy

func (v *View) HeldBy(code seam.Code)

HeldBy says, under the question up, that run code holds the units its offer would apply, so taking it waits until that run is done (4.2.5).

func (*View) Leave

func (v *View) Leave(width int) []ink.Row

Leave is the rows that settle as the person leaves a plan's offer standing: in the offer's place, what it waits for and where to take it (4.7.7).

func (*View) Live

func (v *View) Live() bool

Live reports whether the run has a live block now: a round planning or applying, its question up, or the wait for the sign-in after the click.

func (*View) PutQuestion

func (v *View) PutQuestion()

PutQuestion puts the Ctrl-C question up in the key line's place.

func (*View) Question

func (v *View) Question() (seam.Question, bool)

Question is the question up now, as the record names it, false where none is.

func (*View) QuestionAsked

func (v *View) QuestionAsked() bool

QuestionAsked reports whether the question up has settled as rows.

func (*View) Settle

func (v *View) Settle(e seam.Entry, width int) []ink.Row

Settle takes the run's next event, and is the rows it settles above the live block, laid out for a terminal width columns wide. Once the view has finished, nothing more settles.

func (*View) SettleSignIn

func (v *View) SettleSignIn(width int, now time.Time) []ink.Row

SettleSignIn is the rows the sign-in settles where no live block can hold it: its block as it stands at now, once its link and code come, and once it comes to nothing, answered below its keys.

func (*View) SettleTitle

func (v *View) SettleTitle(width int) []ink.Row

SettleTitle is the run's title and the line under it, to settle where no live block shows them: on a terminal too narrow, too short or too dumb for one, in its background, or where output isn't a terminal. It's nothing before the run starts, or the round the view opens at, and once they've settled.

func (*View) SignInAgain

func (v *View) SignInAgain() bool

SignInAgain has the view start a new sign-in, with a new link and code, where its last came to nothing, as s does (5.5.6, 5.5.7), and reports whether it will.

func (*View) SignInEnded

func (v *View) SignInEnded(try int, err error, at time.Time)

SignInEnded takes how try's sign-in ended, at at: nil where it's done, its keys handed to the run; a *SignInError where it came to nothing, saying how; and any other error as a failure with no words of its own.

func (*View) SignInProfile

func (v *View) SignInProfile() config.ProfileName

SignInProfile is the delete sign-in's profile, as the question named it.

func (*View) SignInQuestion

func (v *View) SignInQuestion() seam.Question

SignInQuestion is the question whose click the sign-in follows, which a reject at the sign-in answers (4.4.10).

func (*View) SignInShown

func (v *View) SignInShown(try int, d DeviceSignIn)

SignInShown takes the link and code try's sign-in shows.

func (*View) SignInToSettle

func (v *View) SignInToSettle() bool

SignInToSettle reports whether the sign-in has something to show that hasn't settled as rows, for a terminal with no room for a block.

func (*View) SigningIn

func (v *View) SigningIn() bool

SigningIn reports whether the run waits for the delete sign-in, its click given.

func (*View) StartSignIn

func (v *View) StartSignIn() int

StartSignIn marks a new sign-in under way, and is its try, which names its news.

func (*View) TakeQuestionDown

func (v *View) TakeQuestionDown()

TakeQuestionDown takes the Ctrl-C question down, as an answer or Esc does.

func (*View) Waiting

func (v *View) Waiting() bool

Waiting reports whether the run waits on a person this view can't ask, as where it reads no keys.

func (*View) Waits

func (v *View) Waits(width int) []ink.Row

Waits is the rows that settle where the run waits on a person and this view can't ask: what it waits for and until when, then where to see it in full and approve it.

func (*View) WantsSignIn

func (v *View) WantsSignIn() bool

WantsSignIn reports whether the view starts a sign-in now, as each view in the person's terminal does once the run waits for one (5.5.5): it reads the person's keys, and has none under way, none done, and none come to nothing that s hasn't asked to try again.

type Waiter

type Waiter struct {
	Idle     Idle
	Out      Output
	Screen   func() Screen
	Now      func() time.Time
	Keyboard Keyboard
	// Next is the next run to follow, false where there's none yet.
	Next func(ctx context.Context) (seam.Code, bool, error)
}

Waiter draws watch waiting for the next run, until Next finds one, the person presses Ctrl-C, or ctx ends.

func (*Waiter) Run

func (w *Waiter) Run(ctx context.Context) (code seam.Code, found bool, err error)

Run waits, and is the run found, false where the wait was stopped. The block is erased however it ends; the header stays.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL