project

package
v0.1.0-rc.49 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: BSD-3-Clause Imports: 30 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 project selects and evaluates project configuration, including TypeScript files. config owns static types and validation; resolve combines the selected source with server, team, and saved client state. this package does not start publishers or connectors.

Index

Constants

View Source
const MaxSnapshotBytes = 1 << 20

Variables

This section is empty.

Functions

func ConfigNames

func ConfigNames() []string

ConfigNames returns the supported project configuration filenames in discovery order.

func ServiceWorktreeLabel

func ServiceWorktreeLabel(service string, worktree Worktree) string

ServiceWorktreeLabel returns the built-in hostname label for one service.

func SharedProjectIdentity

func SharedProjectIdentity(worktree Worktree, projectRoot string) string

SharedProjectIdentity is the checkout-independent local state key.

func SharedProjectLabel

func SharedProjectLabel(role string, worktree Worktree, projectRoot string, salt [32]byte) string

SharedProjectLabel gives linked worktrees one label for project integration URLs.

func TypeScriptKeyMappings

func TypeScriptKeyMappings() map[string]string

TypeScriptKeyMappings returns the static-to-TypeScript property mappings used by evaluation and declaration generation.

Types

type LocalIdentityStore

type LocalIdentityStore interface {
	LocalProjectIdentity(context.Context, string, string) (string, string, error)
}

type LocalPublicationIdentity

type LocalPublicationIdentity struct {
	Key         string
	Fingerprint string
}

LocalPublicationIdentity identifies configured development services in one checkout. Git moves, origin changes, and branches do not change it. it is not a portable source identity for apply or workloads.

type Project

type Project struct {
	Selection  Selection
	Config     config.TNL
	Declared   *config.Project
	Deployment string
	Worktree   Worktree
	Root       string
	// contains filtered or unexported fields
}

Project is a selected and resolved project configuration.

func ReadSnapshot

func ReadSnapshot(input io.Reader) (Project, error)

func Resolve

func Resolve(ctx context.Context, selection Selection, cwd string, salt [32]byte) (Project, error)

Resolve loads a selected project configuration and resolves its worktree and configuration. an empty selection still resolves cwd as a project so commands without a configuration file share the same identity.

func (Project) AppService

func (p Project) AppService(cwd, selected string) (string, error)

AppService selects a configured app target. cwd identifies the project only; when more than one app is configured, the caller must select one by name.

func (Project) BindLocalIdentity

func (p Project) BindLocalIdentity(ctx context.Context, store LocalIdentityStore) (Project, error)

BindLocalIdentity is composed after static project evaluation, with protected local state. source identity for remote apply and workloads is independent.

func (Project) CaptureServiceTrust

func (p Project) CaptureServiceTrust(ctx context.Context, name, target string) (*targettrust.Snapshot, error)

CaptureServiceTrust captures trust for a service's resolved target. the caller compares it with control's approved metadata before mutations.

func (Project) CaptureTargetTrust

func (p Project) CaptureTargetTrust(ctx context.Context, name, discovered string) (*targettrust.Declaration, error)

CaptureTargetTrust captures portable CA material and a verified hostname. the declaration never depends on a local file or a runtime bundle fetch.

func (Project) ComposeFile

func (p Project) ComposeFile(name string) (string, error)

ComposeFile resolves a configured Compose file and rejects symlink escapes. the runtime receives an absolute file path for its explicit project command.

func (Project) ComposeProject

func (p Project) ComposeProject(name string) (string, error)

ComposeProject derives a worktree-specific Compose project name unless the target explicitly selects an existing project.

func (Project) EffectiveService

func (p Project) EffectiveService(name string) (ResolvedService, error)

EffectiveService selects one binding with project identity and local settings.

func (Project) Found

func (p Project) Found() bool

Found reports whether the project has a selected configuration file.

func (Project) GitHubRepository

func (p Project) GitHubRepository(ctx context.Context) (string, error)

GitHubRepository infers only github.com origins. source identity remains a separate checkout-independent contract and never carries job credentials.

func (Project) LocalPublicationIdentity

func (p Project) LocalPublicationIdentity() LocalPublicationIdentity

func (Project) LocalWorktreeKey

func (p Project) LocalWorktreeKey() string

LocalWorktreeKey identifies this project directory without sending local paths to control. server, team and source identity remain separate scope checks.

func (Project) ResolvePublish

func (p Project) ResolvePublish(name, discovered string) (*config.Publish, error)

ResolvePublish finishes target discovery for the captured deployment.

func (Project) SelectDeployment

func (project Project) SelectDeployment(name string) (Project, error)

SelectDeployment materializes one captured selection without changing another handle or evaluating configuration again. local discovery defaults stay local.

func (Project) Snapshot

func (p Project) Snapshot() ([]byte, string, error)

Snapshot transfers an already evaluated configuration to a connector owner. it stays in the private process pipe; metadata and journals never contain it.

func (Project) SourceIdentity

func (p Project) SourceIdentity(ctx context.Context) (SourceIdentity, error)

type ProjectContext

type ProjectContext struct {
	RelativeDirectory string `json:"relativeDirectory"`
}

type ResolvedService

type ResolvedService struct {
	config.Service
	Server   *string
	Team     *string
	Feedback *bool
	OAuth    bool
	Publish  *config.Publish
	Webhooks map[string]config.Webhook
}

ResolvedService contains inherited settings for one service, not a parsed project document. target discovery and trust resolution happen separately.

type Selection

type Selection struct {
	Path       string
	Explicit   bool
	Deployment string
	Workload   string
}

func SelectProjectConfig

func SelectProjectConfig(ctx context.Context, cwd, flagPath, environmentPath string, disabled bool) (Selection, error)

SelectProjectConfig applies explicit selection before nearest-file discovery.

type SourceIdentity

type SourceIdentity struct {
	Key         string
	Fingerprint string
	Label       string
	Source      naming.GitProjectSource
}

SourceIdentity is independent of checkout directory, branch and client state. the full fingerprint lets control reject a project-key collision.

type Worktree

type Worktree struct {
	Root  string        `json:"root"`
	Name  string        `json:"name"`
	Label WorktreeLabel `json:"label"`
	IsGit bool          `json:"isGit"`
	// contains filtered or unexported fields
}

func ApplyWorktreeHashSalt

func ApplyWorktreeHashSalt(worktree Worktree, projectRoot string, salt [32]byte) Worktree

func ResolveWorktree

func ResolveWorktree(ctx context.Context, cwd string) (Worktree, error)

ResolveWorktree returns project facts and falls back to cwd when Git is unavailable or cwd is not inside a worktree. ApplyWorktreeHashSalt adds the client-state-specific label used in public hostnames.

func (Worktree) PrimaryCheckoutRoot

func (w Worktree) PrimaryCheckoutRoot() string

PrimaryCheckoutRoot returns the primary Git checkout shared by linked worktrees.

type WorktreeLabel

type WorktreeLabel struct {
	Project   string `json:"project"`
	Checkout  string `json:"checkout,omitempty"`
	ID        string `json:"id"`
	FullLabel string `json:"fullLabel"`
}

WorktreeLabel exposes the DNS-safe pieces used in the finished label. the primary checkout has no checkout component.

Directories

Path Synopsis
package githubmetadata resolves immutable repository metadata during trusted apply.
package githubmetadata resolves immutable repository metadata during trusted apply.
package projectinit owns project initialization planning, safe edits, and project-local dependency installation.
package projectinit owns project initialization planning, safe edits, and project-local dependency installation.
Package projectmeta validates and writes browser-safe project metadata.
Package projectmeta validates and writes browser-safe project metadata.
package resolve composes project selection with client state and current server facts.
package resolve composes project selection with client state and current server facts.
package sourcestate records bounded Git identifiers without saving source files.
package sourcestate records bounded Git identifiers without saving source files.
package workloadmanifest owns the nonsecret build-to-runtime workload context.
package workloadmanifest owns the nonsecret build-to-runtime workload context.
package workloadsetup owns trusted workload setup and stable provider bindings.
package workloadsetup owns trusted workload setup and stable provider bindings.

Jump to

Keyboard shortcuts

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