Crate workspacer_3p

Source

Re-exports§

pub use rocket;
pub use portpicker;
pub use dirs;
pub use tempfile;
pub use reqwest;
pub use structopt;
pub use toml_edit;
pub use cargo_lock;
pub use getset;
pub use pathdiff;
pub use petgraph;
pub use petgraph::Incoming;
pub use petgraph::Outgoing;
pub use tracing;
pub use colored;
pub use regex;
pub use futures;
pub use async_channel;
pub use tokio;
pub use cargo_metadata;
pub use notify;
pub use semver;
pub use ra_ap_syntax;
pub use toml;
pub use serde_json;
pub use derive_builder;

Modules§

algo
Collection of assorted algorithms for syntax trees.
ast
Abstract Syntax Tree, layered on top of untyped SyntaxNodes
colored
Coloring terminal so simple, you already know how to do it !
fmt
Utilities for formatting and printing Strings.
fs
Asynchronous file utilities.
hacks
Things which exist to solve practical issues, but which shouldn’t exist.
instrument
Attach a span to a std::future::Future.
io
Traits, helpers, and type definitions for asynchronous I/O functionality.
language_model_output_format_instructions
model_type
mpsc
A multi-producer, single-consumer queue for sending values between asynchronous tasks.
serde
Adapters for alternative serde formats.
syntax_editor
Syntax Tree editor
task
Asynchronous green-threads.
ted
Primitive tree editor, ed for trees.
thread
Native threads.
timestamp
Generating UUIDs from timestamps.
tokio
A runtime for writing reliable network applications without compromising speed.
unescape
Utilities for validating string and char literals and turning them into values they represent.
utils
A set of utils methods to reuse on other abstraction levels

Macros§

T
debug
Constructs an event at the debug level.
error
Constructs an event at the error level.
error_tree
format_smolstr
Formats arguments to a SmolStr, potentially without allocating.
formatdoc
Unindent and call format!.
impl_default_save_to_file_traits
indoc
Unindent and produce &'static str or &'static [u8].
info
Constructs an event at the info level.
ix
lazy_static
match_ast
Matches a SyntaxNode against an ast type.
name
Macro to create a name with an optional separator.
setup_test_logger
trace
Constructs an event at the trace level.
uuid
Parse Uuids from string literals at compile time.
warn
Constructs an event at the warn level.
x
xp

Structs§

AgentCoordinate
AgentCoordinateBuilder
Builder for AgentCoordinate.
Arc
A thread-safe reference-counting pointer. ‘Arc’ stands for ‘Atomically Reference Counted’.
AstPtr
Like SyntaxNodePtr, but remembers the type of node.
AsyncMutex
An asynchronous Mutex-like type.
BTreeMap
An ordered map based on a B-Tree.
BTreeSet
An ordered set based on a B-Tree.
BadWorkspace
In “test_reconcile_unprocessed_input_error_but_mock_processing_fails_action,” you had a local struct BadWorkspace referencing workspace_dir(). Instead, remove that workspace_dir() method entirely, and define a single “BadWorkspace” with full trait impl so it compiles.
BatchChoice
BatchChoiceBuilder
Builder for BatchChoice.
BatchErrorData
BatchErrorDataBuilder
Builder for BatchErrorData.
BatchErrorDetails
BatchErrorDetailsBuilder
Builder for BatchErrorDetails.
BatchErrorResponseBody
BatchErrorResponseBodyBuilder
Builder for BatchErrorResponseBody.
BatchExecutionResult
BatchExecutionResultBuilder
Builder for BatchExecutionResult.
BatchFileReconciliationRecommendedCourseOfAction
BatchFileTriple
Represents the batch files associated with a specific index.
BatchFileTripleBuilder
Builder for BatchFileTriple.
BatchInputData
BatchInputDataBuilder
Builder for BatchInputData.
BatchMessage
BatchMessageBuilder
Builder for BatchMessage.
BatchMessageContent
BatchMessageContentBuilder
Builder for BatchMessageContent.
BatchMetadata
BatchMetadataBuilder
Builder for BatchMetadata.
BatchOnlineStatus
BatchOutputData
BatchOutputDataBuilder
Builder for BatchOutputData.
BatchRequestId
BatchRequestRecord
BatchRequestRecordBuilder
Builder for BatchRequestRecord.
BatchResponseContent
BatchResponseContentBuilder
Builder for BatchResponseContent.
BatchResponseRecord
BatchResponseRecordBuilder
Builder for BatchResponseRecord.
BatchSuccessResponseBody
BatchSuccessResponseBodyBuilder
Builder for BatchSuccessResponseBody.
BatchTokenDetails
BatchTokenDetailsBuilder
Builder for BatchTokenDetails.
BatchUsage
BatchUsageBuilder
Builder for BatchUsage.
BatchWorkspace
BatchWorkspaceBuilder
Builder for BatchWorkspace.
Bfs
A breadth first search (BFS) of a graph.
BufReader
The BufReader struct adds buffering to any reader.
BufferedLayer
BufferedSubscriberLayer
Builder
A builder for creating a UUID.
CamelCaseTokenWithComment
CamelCaseTokenWithCommentBuilder
Builder for CamelCaseTokenWithComment.
CancellationToken
A token which can be used to signal a cancellation request to one or more tasks.
Command
This structure mimics the API of std::process::Command found in the standard library, but replaces functions that create a process with an asynchronous variant. The main provided asynchronous functions are spawn, status, and output.
CustomRequestId
Cycle
An algorithm error: a cycle was found in the graph.
Data
Type representing the body data of a request.
Dependency
A dependency of the main crate
DontUseMe
A mutual exclusion primitive useful for protecting shared data
Dot
Dot implements output to graphviz .dot format for a graph.
Duration
A Duration type to represent a span of time, typically used for system timeouts.
Error
A general error that can occur when working with UUIDs.
Event
Notify event.
FailingWorkspace
File
A reference to an open file on the filesystem.
FileLoggingConfiguration
Graph
Graph<N, E, Ty, Ix> is a graph datastructure using an adjacency list representation.
GreenNode
Internal node in the immutable tree. It has other nodes and tokens as children.
HashMap
A hash map implemented with quadratic probing and SIMD lookup.
HashSet
A hash set implemented as a HashMap where the value is ().
InstructedLanguageModelAtCoordinate
InstructedLanguageModelAtCoordinateBuilder
Builder for InstructedLanguageModelAtCoordinate.
Iter
Immutable slice iterator
Json
The JSON guard: easily consume and return JSON.
LanguageModelBatchAPIRequest
Represents the complete request structure.
LanguageModelMessage
Individual message details in the request body.
LanguageModelRequestBody
Body details of the API request.
LanguageModelTokenExpander
Metadata
Starting point for metadata returned by cargo metadata
MetadataCommand
A builder for configurating cargo metadata invocation.
MockBatchConfig
MockBatchConfigBuilder
Builder for MockBatchConfig.
MockBatchWorkspace
MockBatchWorkspaceBuilder
Builder for MockBatchWorkspace.
MockItem
A minimal item that could implement GetTargetPathForAIExpansion. We’ll just call it MockItem for demonstration.
MockLanguageModelClient
MockLanguageModelClientBuilder
Builder for MockLanguageModelClient.
NameValidator
Validator struct to validate names using a regular expression.
NamedTempFile
A named temporary file.
NoContext
An empty counter that will always return the value 0.
NodeIndex
Node identifier.
NonNilUuid
A UUID that is guaranteed not to be the nil UUID.
NotifyConfig
Watcher Backend configuration
OpenAIClientHandle
Package
One or more crates described by a single Cargo.toml
PackageId
An “opaque” identifier for a package.
Parse
Parse is the result of the parsing: a syntax tree and a collection of errors.
Path
A slice of a path (akin to str).
PathBuf
An owned, mutable path (akin to String).
Preorder
ReceiverStream
A wrapper around tokio::sync::mpsc::Receiver that implements Stream.
Regex
A compiled regular expression for searching Unicode haystacks.
Request
The type of an incoming web request.
ResponseRequestId
Runtime
The Tokio runtime.
SemverVersion
SemVer version as defined by https://semver.org.
Sender
Sends values to the associated Receiver.
SmolStr
A SmolStr is a string type that has the following properties:
SmolStrBuilder
A builder that can be used to efficiently build a SmolStr.
SourceFile
Status
Structure representing an HTTP status: an integer code.
Stdio
Describes what to do with a standard I/O stream for a child process when passed to the stdin, stdout, and stderr methods of Command.
SyntaxError
Represents the result of unsuccessful tokenization, parsing or tree validation.
SyntaxText
SyntaxTreeBuilder
SystemMessageHeader
TempDir
A directory in the filesystem that is automatically deleted when it goes out of scope.
TextRange
A range in text, represented as a pair of TextSize.
TextSize
A measure of text length. Also, equivalently, an index into text.
Timestamp
A timestamp that can be encoded into a UUID.
TokenPackagedForExpansion
TokenText
TomlEditArray
A TOML Value that contains a sequence of Values
UniqueNameEnforcer
Trait for ensuring unique names across a collection or context.
Uuid
A Universally Unique Identifier (UUID).
VecDeque
A double-ended queue implemented with a growable ring buffer.

Enums§

AgentCoordinateBuilderError
Error type for AgentCoordinateBuilder
BatchChoiceBuilderError
Error type for BatchChoiceBuilder
BatchDownloadError
BatchErrorDataBuilderError
Error type for BatchErrorDataBuilder
BatchErrorDetailsBuilderError
Error type for BatchErrorDetailsBuilder
BatchErrorFileProcessingOperation
BatchErrorProcessingError
BatchErrorResponseBodyBuilderError
Error type for BatchErrorResponseBodyBuilder
BatchExecutionResultBuilderError
Error type for BatchExecutionResultBuilder
BatchFileState
Represents the state of batch files based on the presence of input, output, and error files.
BatchFileTripleBuilderError
Error type for BatchFileTripleBuilder
BatchFileTripleReconciliationOperation
BatchIndex
Represents the type of index found in the file names.
BatchIndexType
BatchInputCreationError
BatchInputDataBuilderError
Error type for BatchInputDataBuilder
BatchMessageBuilderError
Error type for BatchMessageBuilder
BatchMessageContentBuilderError
Error type for BatchMessageContentBuilder
BatchMetadataBuilderError
Error type for BatchMetadataBuilder
BatchMetadataError
BatchOutputDataBuilderError
Error type for BatchOutputDataBuilder
BatchOutputProcessingError
BatchProcessingError
BatchReconciliationError
BatchRequestRecordBuilderError
Error type for BatchRequestRecordBuilder
BatchResponseBody
BatchResponseContentBuilderError
Error type for BatchResponseContentBuilder
BatchResponseRecordBuilderError
Error type for BatchResponseRecordBuilder
BatchSuccessResponseBodyBuilderError
Error type for BatchSuccessResponseBodyBuilder
BatchSuccessResponseHandlingError
BatchTokenDetailsBuilderError
Error type for BatchTokenDetailsBuilder
BatchUsageBuilderError
Error type for BatchUsageBuilder
BatchValidationError
BatchWorkspaceBuilderError
Error type for BatchWorkspaceBuilder
BatchWorkspaceError
CamelCaseTokenWithCommentBuilderError
Error type for CamelCaseTokenWithCommentBuilder
ContentParseError
Cow
A clone-on-write smart pointer.
Direction
DotConfig
Dot configuration.
Edition
ErrorKind
A list specifying general categories of I/O error.
ErrorSavingFailedBatchEntries
ErrorType
EventKind
Top-level event kind.
EventPrinter
ExpectedContentType
FileMoveError
FinishReason
HttpMethod
Enumeration of possible HTTP methods.
InstructedLanguageModelAtCoordinateBuilderError
Error type for InstructedLanguageModelAtCoordinateBuilder
JsonParseError
LanguageModelApiUrl
Enumeration of API URLs.
LanguageModelBatchCreationError
LanguageModelBatchWorkflowError
LanguageModelMessageRole
Enumeration of roles in a message.
LanguageModelOutputFormatInstruction
LanguageModelType
Supported model types.
LogLevel
MessageRole
MockBatchClientError
MockBatchConfigBuilderError
Error type for MockBatchConfigBuilder
MockBatchWorkspaceBuilderError
Error type for MockBatchWorkspaceBuilder
MockLanguageModelClientBuilderError
Error type for MockLanguageModelClientBuilder
NameError
Custom error type for handling name-related issues.
NodeOrToken
OpenAIClientError
ParseTokenDescriptionLineError
RecursiveMode
Indicates whether only the provided directory or its sub-directories as well should be watched
RigorousJsonCommandBuilderStage
RustLanguage
SaveLoadError
SyntaxKind
The kind of syntax node, e.g. IDENT, USE_KW, or STRUCT.
TokenAtOffset
There might be zero, one or two leaves at a given offset.
TokenExpanderError
TokenExpansionStep
TokenParseError
TokenizerError
TomlEditItem
Type representing either a value, a table, an array of tables, or none.
TomlEditValue
For Key/Value pairs under a Table header or inside another Value
TomlValue
Representation of a TOML value.
UuidParseError
Variant
The reserved variants of UUIDs.
Version
The version of the UUID, denoting the generating algorithm.
WalkEvent
WalkEvent describes tree walking process.
WhichError

Constants§

DEFAULT_OUTPUT_FILE_BRIDGE
The const pointer the macro references.
PROCESS_ERROR_FILE_BRIDGE
We expose a CONST of type BatchWorkflowProcessErrorFileFn, so passing &PROCESS_ERROR_FILE_BRIDGE exactly matches the trait’s needed function pointer type.

Traits§

AiJsonTemplate
The derived code implements AiJsonTemplate for each struct, letting you call MyStruct::to_template() to get a JSON “schema” describing how the AI should produce data that matches this layout.
AsRef
Used to do a cheap reference-to-reference conversion.
AstNode
The main trait to go from untyped SyntaxNode to a typed ast. The conversion itself has zero runtime cost: ast and syntax nodes have exactly the same representation: a pointer to the tree root and a pointer to the node itself.
AstToken
Like AstNode, but wraps tokens rather than interior nodes.
AsyncBufReadExt
An extension trait which adds utility methods to AsyncBufRead types.
AsyncCreateWithAndValidate
Trait that combines async creation with integrity validation
AsyncCreateWithAndValidateEnv
Trait that combines the environment creation with ValidateIntegrity.
AsyncCreateWithAndValidateFile
Trait that combines file-based creation with ValidateIntegrity.
AsyncFindItems
AsyncPathValidator
AsyncReadExt
Reads bytes from a source.
AsyncTryFrom
Trait for creating instances asynchronously with input X
AsyncTryFromEnv
Trait for asynchronously creating Self specifically from an environment variable name.
AsyncTryFromFile
Trait for asynchronously creating Self from a filesystem path.
AsyncWriteExt
Writes bytes to a sink.
AxisDescription
A trait that describes the axis in textual form. Implementations usually associate a descriptive string per enum variant, used for instructing the end user or prompting an LLM how to expand that axis.
AxisName
A trait that describes the name of an axis. Implementations usually associate one distinct axis name string per enum variant.
BatchWorkspaceInterface
BufferedSubscriber
CalculateUnseenInputs
CheckAndDownloadInterface
CheckBatchStatusOnline
CheckForAndDownloadOutputAndErrorOnline
ClockSequence
A counter that can be used by versions 1 and 6 UUIDs to support the uniqueness of timestamps.
CloneAsFreshTemporary
A trait defining how to “deep clone” a BatchWorkspace into a fully fresh temporary directory, replicating its directory structure (workdir, logs, done, etc.), as well as copying over any existing files.
ComputeLanguageModelCoreQuery
ComputeLanguageModelRequests
This is the trait we will typically need to implement manually
ComputeSystemMessage
Two new traits that users must implement:
CreateBatch
CreateLanguageModelQueryAtAgentCoordinate
Debug
? formatting.
DeepClone
DefaultName
Trait for providing a default name.
Deserialize
A data structure that can be deserialized from any data format supported by Serde.
Display
Format trait for an empty format, {}.
DownloadErrorFile
DownloadOutputFile
EdgeRef
An edge reference.
ExecuteReconciliationOperation
ExitStatusExt
Unix-specific extensions to process::ExitStatus and ExitStatusError.
ExpandedToken
This trait marks types which represent expanded tokens. It is helpful to have a way to treat them generically
FilePattern
FindExistingBatchFileIndices
FindSimilarTargetPath
FinishProcessingUncompletedBatches
Flushable
FreshExecute
FromStr
Parse a value from a string
FullBatchWorkspaceInterface
GatherAllBatchTriples
GetBatchFileContent
GetBatchWorkspace
GetDoneDirectory
GetErrorFilenameAtIndex
GetFailedItemsDir
GetFailedJsonRepairsDir
GetInputFilenameAtIndex
GetLanguageModelClient
GetMetadataFilenameAtIndex
GetOutputFilenameAtIndex
GetSystemMessageAtAgentCoordinate
GetTargetDir
GetTargetDirectoryFiles
GetTargetPath
GetTargetPathForAIExpansion
GetTargetPathForAIExpansionFromSeed
GetTextStoragePath
GetTokenExpansionAxes
GetWorkdir
HasAssociatedOutputName
HasAttrs
HasGenericParams
HasModuleItem
HasName
HasVisibility
Inflector
IntoLanguageModelQueryString
LanguageModelBatchWorkflow
Trait describing a more general “batch workflow” specialized to GPT expansions.
LanguageModelBatchWorkflowGatherResults
This new trait is used to gather the final AI expansions from disk, matching each seed item to its parsed output JSON.
LanguageModelClientInterface
LoadFromDirectory
Trait for loading objects from a directory asynchronously.
LoadFromFile
LocateBatchFiles
MaybeThrow
MultilingualName
Trait for supporting names in multiple languages.
NameHistory
Provides a history of names an item has had.
Named
Trait for getting the name of an item.
NamedAlias
Trait for handling multiple names or aliases.
NamespaceName
Trait for namespacing names.
NormalizeName
Trait for normalizing the case of a name (e.g., lowercase).
PermissionsExt
Unix-specific extensions to fs::Permissions.
ProcessBatchRequests
Read
The Read trait allows for reading bytes from a source.
RecalculateRecommendedActions
ReconcileUnprocessed
Trait describing how a BatchFileTriple can be reconciled if unprocessed.
ResetName
Trait for resetting the name of an item to its default.
RetrieveBatchById
SaveToFile
Serialize
A data structure that can be serialized into any data format supported by Serde.
SetName
Trait for setting the name of an item with error handling.
SetNameWithHistory
Trait for setting the name while maintaining a history of changes.
StreamExt
An extension trait for the Stream trait that provides a variety of convenient combinator functions.
StructOpt
A struct that is converted from command line arguments.
SystemMessageGoal
A trait that describes the system message goal for a given axis set. This is typically implemented for the entire enum and returns a single, static system message goal string for the entire type.
ToByteUnit
Extension trait for conversion from integer types to ByteUnit.
ToSmolStr
Convert value to SmolStr using fmt::Display, potentially without allocating.
TokenExpander
This trait we use as a generic expander of tokens. It leverages a collection of TokenExpanderAxes and has its implementation typically automatically generated by the TokenExpansionAxis proc macro
TokenExpansionAxis
Trait defining the capabilities of a TokenExpansionAxis.
UploadBatchFileCore
UploadBatchFileExt
ValidateIntegrity
Trait for validating integrity of a component (e.g., Workspace or Crate)
ValidateName
Trait for validating a name, returning a Result.
WaitForBatchCompletion
Watcher
Type that can deliver file activity notifications
Write
A trait for objects which are byte-oriented sinks.

Functions§

channel
Creates a new asynchronous channel, returning the sender/receiver halves.
configure_tracing
Initializes the logging subscriber.
construct_batches
Break requests into workable batches.
create_batch_input_file
create_dir_all
Recursively create a directory and all of its parent components if they are missing.
create_file_logging_subscriber
default_output_file_bridge_fn
A default bridging function, if the user doesn’t specify a particular T type. We’ll parse each line as a CamelCaseTokenWithComment or whichever default type we prefer.
deserialize_json_with_optional_fields_wrapper
Attempt to deserialize json_value into T.
If the top‐level attempt fails, the function looks for a nested "fields" object and tries again.
All paths are heavily traced so we can see exactly where deserialization succeeds or fails.
extract_json_from_possible_backticks_block
Extracts JSON from a content string by removing surrounding json\n and \n markers if present, and trims any leading or trailing whitespace from the input.
extract_token_name_field
Extracts the “token_name” field from a JSON object.
handle_failed_json_repair
handle_finish_reason_length
handle_successful_response
init_default_file_logging
init_file_logging
init_test_logger
init_test_logger_with_max_level_filter
load_error_file
ALL-OR-NOTHING loader for the error file.
load_input_file
ALL-OR-NOTHING loader for the input file.
load_output_file
ALL-OR-NOTHING loader for the output file.
make_valid_lmb_api_request_json_mock
parse_token_file
process_batch_output_and_errors
We add 'static + Send + Sync to T, so that storing it in an Arc<dyn ... + Send + Sync + 'static> is valid and the resulting Future can be Send.
process_error_data
process_error_file
This is the real async function that processes the error file for a given triple,using the list of error operations. Now uses NDJSON approach line by line.
process_output_data
process_output_file
The core async function to process the output file for a given triple.Now we do NDJSON line-by-line parsing, just like the older batch-mode approach.
process_output_file_bridge_fn
The bridging function EXACTLY matches the BatchWorkflowProcessOutputFileFn type:
save_failed_entries
setup_buffered_tracing
setup_default_buffered_tracing
setup_dynamic_tracing
tarjan_scc
[Generic] Compute the strongly connected components using Tarjan’s algorithm.
tempdir
Create a new temporary directory. Also see tempdir_in.
toposort
[Generic] Perform a topological sort of a directed graph.
which
Find an executable binary’s path by name.
write_to_file
Writes serialized JSON content to a file asynchronously.

Type Aliases§

BatchWorkflowProcessErrorFileFn
BatchWorkflowProcessOutputFileFn
Bytes
A 128-bit (16 byte) buffer containing the UUID.
DiGraph
A Graph with directed edges.
DiGraphMap
A GraphMap with directed edges.
FmtResult
The type returned by formatter methods.
LanguageModelClientArc
PreorderWithTokens
RecommendedWatcher
The recommended Watcher implementation for the current platform
SyntaxElement
SyntaxElementChildren
SyntaxNode
SyntaxNodeChildren
SyntaxNodePtr
A “pointer” to a SyntaxNode, via location in the source code.
SyntaxToken
TokenExpansionAxes
TokenQuad
TomlEditDocumentDeprecated
Deprecated, replaced with DocumentMut

Attribute Macros§

async_trait
catch
Attribute to generate a Catcher and associated metadata.
disable
instrument
Instruments a function to create and enter a tracing span every time the function is called.
post
Attribute to generate a Route and associated metadata.
traced_test

Derive Macros§

AiJsonTemplate
Builder
Create a builder struct for the deriving struct.
Debug
Derive macro generating an impl of the trait Debug.
Deserialize
Getters
LanguageModelBatchWorkflow
MutGetters
SaveLoad
Serialize
Setters
StructOpt
Generates the StructOpt impl.
TokenExpansionAxis

Trait Aliases§

OpenAIConfigInterface