repo
stringlengths
6
65
file_url
stringlengths
81
311
file_path
stringlengths
6
227
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:31:58
2026-01-04 20:25:31
truncated
bool
2 classes
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-migrate/src/cli/shared.rs
forc-plugins/forc-migrate/src/cli/shared.rs
use std::path::PathBuf; use anyhow::{bail, Ok, Result}; use clap::Parser; use forc_pkg::{self as pkg, PackageManifestFile}; use forc_pkg::{ manifest::{GenericManifestFile, ManifestFile}, source::IPFSNode, }; use forc_tracing::println_action_green; use sway_core::{BuildTarget, Engines}; use sway_error::diagnost...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-migrate/src/cli/commands/check.rs
forc-plugins/forc-migrate/src/cli/commands/check.rs
use clap::Parser; use crate::{ cli::{ self, shared::{ compile_package, create_migration_diagnostic, print_features_and_migration_steps, }, }, get_migration_steps_or_return, migrations::{DryRun, MigrationStepKind}, }; use anyhow::{Ok, Result}; use forc_util::format_di...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-migrate/src/cli/commands/mod.rs
forc-plugins/forc-migrate/src/cli/commands/mod.rs
pub(crate) mod check; pub(crate) mod run; pub(crate) mod show;
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-migrate/src/cli/commands/run.rs
forc-plugins/forc-migrate/src/cli/commands/run.rs
use std::{ collections::HashSet, path::{Path, PathBuf}, }; use anyhow::{bail, Ok, Result}; use clap::Parser; use forc_tracing::{println_action_green, println_action_yellow, println_yellow_bold}; use forc_util::{format_diagnostic, fs_locking::is_file_dirty}; use itertools::Itertools; use sway_ast::Module; use s...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-migrate/src/cli/commands/show.rs
forc-plugins/forc-migrate/src/cli/commands/show.rs
use std::collections::HashMap; use crate::cli::shared::{max_feature_name_len, print_features_and_migration_steps}; use crate::get_migration_steps_or_return; use crate::migrations::MigrationStepExecution; use anyhow::{Ok, Result}; use clap::Parser; use itertools::Itertools; use sway_error::formatting::{sequence_to_list...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-migrate/src/modifying/attribute.rs
forc-plugins/forc-migrate/src/modifying/attribute.rs
use sway_ast::{ attribute::{Attribute, AttributeArg, CFG_ATTRIBUTE_NAME, DOC_COMMENT_ATTRIBUTE_NAME}, brackets::SquareBrackets, keywords::{HashBangToken, HashToken, Token}, AttributeDecl, Literal, Parens, Punctuated, }; use sway_types::{Ident, Span, Spanned}; use crate::assert_insert_span; use super::...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-migrate/src/modifying/expr.rs
forc-plugins/forc-migrate/src/modifying/expr.rs
use sway_ast::{ keywords::{DotToken, Token}, Expr, Parens, PathExprSegment, Punctuated, }; use sway_types::{Ident, Span}; use crate::assert_insert_span; use super::New; impl New { /// Creates an [Expr] representing a call to a non-generic method with the name `method_name`. /// The method does not ac...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-migrate/src/modifying/path_expression_segment.rs
forc-plugins/forc-migrate/src/modifying/path_expression_segment.rs
use sway_ast::PathExprSegment; use sway_types::{Ident, Spanned}; use super::Modifier; impl Modifier<'_, PathExprSegment> { pub(crate) fn set_name<S: AsRef<str> + ?Sized>(&mut self, name: &S) -> &mut Self { // We preserve the current span of the name. let insert_span = self.element.name.span(); ...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-migrate/src/modifying/module.rs
forc-plugins/forc-migrate/src/modifying/module.rs
use std::cmp::min; use sway_ast::{attribute::Annotated, ItemFn, ItemKind, Module}; use sway_types::{Span, Spanned}; use super::Modifier; #[allow(dead_code)] impl Modifier<'_, Module> { /// Removes an [Annotated<ItemKind>] from `self`. /// The item to remove is identified by its [Span], `annotated_item_span`...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-migrate/src/modifying/function.rs
forc-plugins/forc-migrate/src/modifying/function.rs
use sway_ast::{ keywords::{FnToken, Keyword}, Braces, CodeBlockContents, FnSignature, ItemFn, Parens, Punctuated, }; use sway_types::{Ident, Span, Spanned}; use crate::assert_insert_span; use super::{Modifier, New}; impl Modifier<'_, ItemFn> { pub(crate) fn set_name<S: AsRef<str> + ?Sized>(&mut self, nam...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-migrate/src/modifying/literal.rs
forc-plugins/forc-migrate/src/modifying/literal.rs
use sway_ast::{ literal::{LitBool, LitBoolType}, Literal, }; use sway_types::Span; use crate::assert_insert_span; use super::New; impl New { /// Creates a [Literal] representing bool `value`. pub(crate) fn literal_bool(insert_span: Span, value: bool) -> Literal { assert_insert_span!(insert_sp...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-migrate/src/modifying/mod.rs
forc-plugins/forc-migrate/src/modifying/mod.rs
//! This module contains common API for building new and modifying existing //! elements within a lexed tree. use sway_types::Span; mod annotated; mod attribute; mod expr; mod function; mod literal; mod module; mod path_expression_segment; mod storage_field; /// A wrapper around a lexed tree element that will be mod...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-migrate/src/modifying/annotated.rs
forc-plugins/forc-migrate/src/modifying/annotated.rs
#[allow(unused_imports)] // Used in doc-comments. use sway_ast::{ attribute::{Annotated, Attribute}, AttributeDecl, }; use sway_types::{Span, Spanned}; use super::Modifier; impl<T> Modifier<'_, Annotated<T>> { /// From `self`, removes [AttributeDecl] that contains an [Attribute] /// whose span equals...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-migrate/src/modifying/storage_field.rs
forc-plugins/forc-migrate/src/modifying/storage_field.rs
use num_bigint::BigUint; use sway_ast::{ keywords::{InToken, Keyword}, Expr, LitInt, StorageField, }; use sway_types::{Span, Spanned}; use super::Modifier; pub(crate) trait ToInKey { fn to_in_key(self, span: Span) -> Expr; } impl ToInKey for BigUint { fn to_in_key(self, span: Span) -> Expr { ...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-doc/src/lib.rs
forc-plugins/forc-doc/src/lib.rs
pub mod doc; pub mod render; pub mod search; use anyhow::{bail, Result}; use clap::Parser; use doc::{module::ModuleInfo, Documentation}; use forc_pkg::{ self as pkg, manifest::{GenericManifestFile, ManifestFile}, source::IPFSNode, PackageManifestFile, Programs, }; use forc_tracing::println_action_green...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-doc/src/search.rs
forc-plugins/forc-doc/src/search.rs
use crate::doc::{module::ModuleInfo, Document, Documentation}; use anyhow::Result; use serde::{Deserialize, Serialize}; use std::{ collections::{BTreeMap, HashMap}, fs, path::Path, }; const JS_SEARCH_FILE_NAME: &str = "search.js"; /// Creates the search index javascript file for the search bar. pub fn wri...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-doc/src/main.rs
forc-plugins/forc-doc/src/main.rs
use anyhow::{bail, Result}; use clap::Parser; use forc_doc::{generate_docs, render::INDEX_FILENAME, Command, DocResult, ASSETS_DIR_NAME}; use include_dir::{include_dir, Dir}; use std::{ process::Command as Process, {fs, path::PathBuf}, }; pub fn main() -> Result<()> { let build_instructions = Command::pars...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-doc/src/render/link.rs
forc-plugins/forc-doc/src/render/link.rs
//! Handles creation of links for modules. use crate::{ doc::module::ModuleInfo, render::{BlockTitle, DocStyle, Renderable}, RenderPlan, }; use anyhow::Result; use horrorshow::{box_html, Raw, RenderBox, Template}; use std::collections::BTreeMap; /// Used for creating links between docs. #[derive(Debug, Clo...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-doc/src/render/index.rs
forc-plugins/forc-doc/src/render/index.rs
//! Handles creation of `index.html` files. use crate::{ doc::module::ModuleInfo, render::{ link::DocLinks, search::generate_searchbar, sidebar::*, BlockTitle, DocStyle, Renderable, IDENTITY, }, RenderPlan, ASSETS_DIR_NAME, }; use anyhow::Result; use horrorshow::{box_html, Raw, RenderBox...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-doc/src/render/title.rs
forc-plugins/forc-doc/src/render/title.rs
use sway_core::{language::ty::TyDecl, TypeInfo}; pub trait DocBlock { /// Returns the title of the block that the user will see. fn title(&self) -> BlockTitle; /// Returns the name of the block that will be used in the html and css. fn name(&self) -> &str; } /// Represents all of the possible titles //...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-doc/src/render/search.rs
forc-plugins/forc-doc/src/render/search.rs
//! Generates the searchbar. use crate::doc::module::ModuleInfo; use horrorshow::{box_html, Raw, RenderBox}; use minifier::js::minify; pub(crate) fn generate_searchbar(module_info: &ModuleInfo) -> Box<dyn RenderBox> { let path_to_root = module_info.path_to_root(); // Since this searchbar is rendered on all pag...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-doc/src/render/mod.rs
forc-plugins/forc-doc/src/render/mod.rs
//! Renders [Documentation] to HTML. use crate::{ doc::{ module::{ModuleInfo, ModulePrefixes}, Document, Documentation, }, render::{ index::{AllDocIndex, ModuleIndex}, link::{DocLink, DocLinks}, title::BlockTitle, util::format::docstring::DocStrings, }, ...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-doc/src/render/sidebar.rs
forc-plugins/forc-doc/src/render/sidebar.rs
use crate::ASSETS_DIR_NAME; use std::path::PathBuf; use crate::{ doc::module::ModuleInfo, render::{ BlockTitle, DocLinks, DocStyle, Renderable, {ALL_DOC_FILENAME, IDENTITY, INDEX_FILENAME}, }, RenderPlan, }; use anyhow::Result; use horrorshow::{box_html, Raw, RenderBox, Template}; pub(crate) t...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-doc/src/render/util/mod.rs
forc-plugins/forc-doc/src/render/util/mod.rs
//! Utilities for managing edge cases in rendering types and their corresponding documentation. pub mod format; /// Strip the generic suffix from a type name. For example, `Foo<T>` would become `Foo`. pub fn strip_generic_suffix(input: &str) -> &str { input.split_once('<').map_or(input, |(head, _)| head) }
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-doc/src/render/util/format/docstring.rs
forc-plugins/forc-doc/src/render/util/format/docstring.rs
//! Rendering and formatting for Sway doc attributes. use crate::render::util::format::constant::*; use comrak::{markdown_to_html, ComrakOptions}; use std::fmt::Write; use sway_core::transform::{AttributeKind, Attributes}; use sway_lsp::utils::markdown::format_docs; pub(crate) trait DocStrings { fn to_html_string(...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-doc/src/render/util/format/mod.rs
forc-plugins/forc-doc/src/render/util/format/mod.rs
//! Formatting utility, mainly for use in complex HTML string manipulation. mod constant; pub mod docstring;
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-doc/src/render/util/format/constant.rs
forc-plugins/forc-doc/src/render/util/format/constant.rs
pub(crate) const MAX_PREVIEW_CHARS: usize = 100; pub(crate) const CLOSING_PARAGRAPH_TAG: &str = "</p>"; const H1: &str = "<h1>"; const H2: &str = "<h2>"; const H3: &str = "<h3>"; const H4: &str = "<h4>"; const H5: &str = "<h5>"; pub(crate) const HTML_HEADERS: &[&str] = &[H1, H2, H3, H4, H5]; pub(crate) const NEWLINE_CH...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-doc/src/render/item/mod.rs
forc-plugins/forc-doc/src/render/item/mod.rs
pub mod components; pub mod context; pub mod documentable_type; mod type_anchor;
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-doc/src/render/item/type_anchor.rs
forc-plugins/forc-doc/src/render/item/type_anchor.rs
//! Creation of HTML anchors for types that can be linked. use crate::{doc::module::ModuleInfo, RenderPlan}; use anyhow::{anyhow, Result}; use horrorshow::{box_html, RenderBox}; use sway_core::{AbiName, TypeInfo}; use sway_types::{Named, Spanned}; /// Handles types & nested types that should have links /// eg. (`[]` r...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-doc/src/render/item/components.rs
forc-plugins/forc-doc/src/render/item/components.rs
//! Handles creation of the head and body of an HTML doc. use crate::{ doc::module::ModuleInfo, render::{ item::context::ItemContext, search::generate_searchbar, sidebar::{Sidebar, SidebarNav}, DocStyle, Renderable, IDENTITY, }, RenderPlan, ASSETS_DIR_NAME, }; use anyhow:...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-doc/src/render/item/documentable_type.rs
forc-plugins/forc-doc/src/render/item/documentable_type.rs
use crate::render::title::{BlockTitle, DocBlock}; use sway_core::{language::ty::TyDecl, TypeInfo}; /// The compiler type that can be documented. #[derive(Clone, Debug)] pub enum DocumentableType { /// Any type that is declared in the Sway source code can be documented. Declared(TyDecl), /// Primitive types...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-doc/src/render/item/context.rs
forc-plugins/forc-doc/src/render/item/context.rs
//! Manages how the context of Sway types are rendered on corresponding item pages. use crate::{ doc::module::ModuleInfo, render::{ item::type_anchor::render_type_anchor, link::{DocLink, DocLinks}, title::BlockTitle, title::DocBlock, util::format::docstring::DocStrings, ...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
true
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-doc/src/doc/descriptor.rs
forc-plugins/forc-doc/src/doc/descriptor.rs
//! Determine whether a [Declaration] is documentable. use crate::{ doc::{module::ModuleInfo, Document}, render::{ item::{ components::*, context::{Context, ContextType, ItemContext}, documentable_type::DocumentableType, }, util::format::docstring::Doc...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-doc/src/doc/module.rs
forc-plugins/forc-doc/src/doc/module.rs
//! Handles the gathering of module information used in navigation and documentation of modules. use crate::render::{util::format::docstring::create_preview, INDEX_FILENAME}; use anyhow::Result; use horrorshow::{box_html, Template}; use std::{fmt::Write, path::PathBuf}; use sway_core::language::CallPath; pub(crate) ty...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-doc/src/doc/mod.rs
forc-plugins/forc-doc/src/doc/mod.rs
//! Handles conversion of compiled typed Sway programs into [Document]s that can be rendered into HTML. mod descriptor; pub mod module; use crate::{ doc::{descriptor::Descriptor, module::ModuleInfo}, render::{ item::{components::*, context::DocImplTrait, documentable_type::DocumentableType}, li...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-doc/tests/lib.rs
forc-plugins/forc-doc/tests/lib.rs
use dir_indexer::get_relative_file_paths_set; use expect_test::{expect, Expect}; use forc_doc::{self, generate_docs, Command, DocResult}; use std::{ collections::HashSet, path::{Path, PathBuf}, }; /// The path to the generated HTML of the type the traits are implemented on. const IMPL_FOR: &str = "bar/struct.B...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-doc/benches/bench_main.rs
forc-plugins/forc-doc/benches/bench_main.rs
use codspeed_criterion_compat::{criterion_group, criterion_main, Criterion}; use forc_doc::{compile, compile_html, Command, DocContext}; use std::path::Path; fn benchmarks(c: &mut Criterion) { let path = Path::new("./../../sway-lib-std"); let opts = Command { path: Some(path.to_str().unwrap().to_string...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-fmt/src/main.rs
forc-plugins/forc-fmt/src/main.rs
//! A `forc` plugin for running the Sway code formatter. use anyhow::{bail, Result}; use clap::Parser; use forc_pkg::{ manifest::{GenericManifestFile, ManifestFile}, WorkspaceManifestFile, }; use forc_tracing::{init_tracing_subscriber, println_error, println_green, println_red}; use forc_util::fs_locking::is_f...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-publish/src/lib.rs
forc-plugins/forc-publish/src/lib.rs
pub mod credentials; pub mod error; pub mod forc_pub_client; mod md_pre_process; pub mod tarball; pub mod validate;
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-publish/src/forc_pub_client.rs
forc-plugins/forc-publish/src/forc_pub_client.rs
use crate::error::Error; use crate::error::Result; use reqwest::StatusCode; use semver::Version; use serde::{Deserialize, Serialize}; use std::fs; use std::path::Path; use url::Url; use uuid::Uuid; /// The publish request. #[derive(Serialize, Debug)] pub struct PublishRequest { pub upload_id: Uuid, } /// The publ...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-publish/src/tarball.rs
forc-plugins/forc-publish/src/tarball.rs
use crate::error::Result; use crate::md_pre_process::flatten_markdown; use crate::validate::validate_dir; use flate2::write::GzEncoder; use flate2::Compression; use forc_tracing::println_warning; use std::fs::{self, File}; use std::path::{Path, PathBuf}; use tar::Builder; use tempfile::{tempdir, TempDir}; use walkdir::...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-publish/src/error.rs
forc-plugins/forc-publish/src/error.rs
use reqwest::StatusCode; use serde::Deserialize; pub type Result<T> = std::result::Result<T, Error>; #[derive(Debug, thiserror::Error)] pub enum Error { #[error("I/O error: {0}")] IoError(#[from] std::io::Error), #[error("Json error: {0}")] JsonError(#[from] serde_json::Error), #[error("HTTP err...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-publish/src/credentials.rs
forc-plugins/forc-publish/src/credentials.rs
use crate::error::Result; use forc_util::user_forc_directory; use serde::{Deserialize, Serialize}; use std::fs; use std::io::{self}; use std::path::PathBuf; use toml; const CREDENTIALS_FILE: &str = "credentials.toml"; #[derive(Serialize, Deserialize)] struct Registry { token: String, } #[derive(Serialize, Deseri...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-publish/src/main.rs
forc-plugins/forc-publish/src/main.rs
use clap::{crate_version, Parser}; use forc_publish::credentials::get_auth_token; use forc_publish::error::Result; use forc_publish::forc_pub_client::ForcPubClient; use forc_publish::tarball::create_tarball_from_current_dir; use forc_tracing::{ init_tracing_subscriber, println_action_green, println_error, TracingSu...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-publish/src/validate.rs
forc-plugins/forc-publish/src/validate.rs
use crate::error::{Error, Result}; use forc_pkg::manifest::{GenericManifestFile, ManifestFile}; use std::path::Path; /// Checks the following cases for an early error generation: /// 1. Target dir doesn't contain a Forc.toml /// 2. Target manifest file doesn't contain a version /// 3. Target project's dependencies ...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-publish/src/md_pre_process/error.rs
forc-plugins/forc-publish/src/md_pre_process/error.rs
use regex::Error as RegexError; use std::io; use std::path::PathBuf; use thiserror::Error; #[derive(Error, Debug)] pub enum MDPreProcessError { #[error("I/O error: {0}")] Io(#[from] io::Error), #[error("Regex error: {0}")] Regex(#[from] RegexError), #[error("Missing include file: {0}")] Missi...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-publish/src/md_pre_process/mod.rs
forc-plugins/forc-publish/src/md_pre_process/mod.rs
pub(crate) mod error; use error::MDPreProcessError; use regex::Regex; use std::{ collections::{HashMap, HashSet, VecDeque}, fs, path::{Path, PathBuf}, }; #[derive(Debug)] struct MarkdownFile { path: PathBuf, includes: HashSet<PathBuf>, } impl MarkdownFile { fn parse<P: AsRef<Path>>(path: P) -...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-lsp/src/main.rs
forc-plugins/forc-lsp/src/main.rs
//! A simple `forc` plugin for starting the sway language server. //! //! Once installed and available via `PATH`, can be executed via `forc lsp`. #![recursion_limit = "256"] // Use Jemalloc for main binary #[global_allocator] static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc; use clap::Parser; ...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-tx/src/lib.rs
forc-plugins/forc-tx/src/lib.rs
//! A simple tool for constructing transactions from the command line. use clap::{Args, Parser}; use devault::Devault; use forc_util::tx_utils::Salt; use fuel_tx::{ output, policies::{Policies, PolicyType}, Buildable, Chargeable, ConsensusParameters, }; use fuels_core::types::transaction::TxPolicies; use s...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
true
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-tx/src/main.rs
forc-plugins/forc-tx/src/main.rs
fn main() -> anyhow::Result<()> { let cmd = forc_tx::Command::parse(); let tx = fuel_tx::Transaction::try_from(cmd.tx)?; match cmd.output_path { None => { let string = serde_json::to_string_pretty(&tx)?; println!("{string}"); } Some(path) => { let ...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-node/src/consts.rs
forc-plugins/forc-node/src/consts.rs
/// Minimum fuel-core version supported. pub const MIN_FUEL_CORE_VERSION: &str = "0.43.0"; pub const MINIMUM_OPEN_FILE_DESCRIPTOR_LIMIT: u64 = 51200; pub const TESTNET_SERVICE_NAME: &str = "fuel-sepolia-testnet-node"; pub const TESTNET_SYNC_HEADER_BATCH_SIZE: u32 = 100; pub const TESTNET_RELAYER_LISTENING_CONTRACT: &...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-node/src/run_opts.rs
forc-plugins/forc-node/src/run_opts.rs
use std::{fmt::Display, path::PathBuf}; /// Possible parameters to set while integrating with `fuel-core run`. #[derive(Debug, Default)] pub struct RunOpts { pub(crate) service_name: Option<String>, /// DB type, possible options are: `["in-memory", "rocksdb"]`. pub(crate) db_type: DbType, /// Should be...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-node/src/chain_config.rs
forc-plugins/forc-node/src/chain_config.rs
use crate::{ consts::{ CHAIN_CONFIG_REPO_NAME, CONFIG_FOLDER, IGNITION_CONFIG_FOLDER_NAME, LOCAL_CONFIG_FOLDER_NAME, TESTNET_CONFIG_FOLDER_NAME, }, util::ask_user_yes_no_question, }; use anyhow::{bail, Result}; use forc_tracing::{println_action_green, println_warning}; use forc_util::user_fo...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-node/src/lib.rs
forc-plugins/forc-node/src/lib.rs
pub mod chain_config; pub mod cmd; pub mod consts; pub mod ignition; pub mod local; pub mod run_opts; pub mod testnet; pub mod util;
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-node/src/util.rs
forc-plugins/forc-node/src/util.rs
use crate::consts::{ DB_FOLDER, IGNITION_CONFIG_FOLDER_NAME, LOCAL_CONFIG_FOLDER_NAME, TESTNET_CONFIG_FOLDER_NAME, }; use anyhow::{anyhow, Result}; use dialoguer::{theme::ColorfulTheme, Confirm, Input, Password}; use forc_util::user_forc_directory; use fuel_crypto::{ rand::{prelude::StdRng, SeedableRng}, Se...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-node/src/main.rs
forc-plugins/forc-node/src/main.rs
//! A forc plugin to start a fuel core instance, preconfigured for generic //! usecases. use clap::Parser; use forc_node::{ cmd::{ForcNodeCmd, Mode}, consts::{MINIMUM_OPEN_FILE_DESCRIPTOR_LIMIT, MIN_FUEL_CORE_VERSION}, ignition, local, testnet, util::{check_open_fds_limit, get_fuel_core_version}, }; use...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-node/src/cmd.rs
forc-plugins/forc-node/src/cmd.rs
use std::net::IpAddr; use crate::{ consts::{DEFAULT_PEERING_PORT, DEFAULT_PORT}, ignition::cmd::IgnitionCmd, local::cmd::LocalCmd, testnet::cmd::TestnetCmd, }; use clap::{Parser, Subcommand}; #[derive(Debug, Parser)] #[clap(name = "forc node", version)] /// Forc node is a wrapper around fuel-core with...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-node/src/testnet/op.rs
forc-plugins/forc-node/src/testnet/op.rs
use crate::{ chain_config::{check_and_update_chain_config, ChainConfig}, consts::{ TESTNET_RELAYER_DA_DEPLOY_HEIGHT, TESTNET_RELAYER_LISTENING_CONTRACT, TESTNET_RELAYER_LOG_PAGE_SIZE, TESTNET_SERVICE_NAME, TESTNET_SYNC_BLOCK_STREAM_BUFFER_SIZE, TESTNET_SYNC_HEADER_BATCH_SIZE, }, ...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-node/src/testnet/mod.rs
forc-plugins/forc-node/src/testnet/mod.rs
pub mod cmd; pub mod op;
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-node/src/testnet/cmd.rs
forc-plugins/forc-node/src/testnet/cmd.rs
use crate::{cmd::ConnectionSettings, consts::TESTNET_BOOTSTRAP_NODE, util::DbConfig}; use clap::Parser; use std::path::PathBuf; #[derive(Parser, Debug, Clone)] pub struct TestnetCmd { #[clap(flatten)] pub connection_settings: ConnectionSettings, #[clap(long, default_value = default_testnet_db_path().into_o...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-node/src/local/mod.rs
forc-plugins/forc-node/src/local/mod.rs
pub mod cmd; use crate::{ chain_config::{check_and_update_chain_config, ChainConfig}, util::HumanReadableConfig, }; use forc_tracing::println_green; use fuel_core::service::FuelService; /// Local is a local node suited for local development. /// By default, the node is in `debug` mode and the db used is `in-m...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-node/src/local/cmd.rs
forc-plugins/forc-node/src/local/cmd.rs
use crate::consts::DEFAULT_PORT; use anyhow; use clap::Parser; use fuel_core::{ chain_config::default_consensus_dev_key, service::{ config::{DbType, Trigger}, Config, }, }; use fuel_core_chain_config::{ coin_config_helpers::CoinConfigGenerator, ChainConfig, CoinConfig, Owner, SnapshotMet...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-node/src/ignition/op.rs
forc-plugins/forc-node/src/ignition/op.rs
use super::cmd::IgnitionCmd; use crate::{ chain_config::{check_and_update_chain_config, ChainConfig}, consts::{ MAINNET_BOOTSTRAP_NODE, MAINNET_RELAYER_DA_DEPLOY_HEIGHT, MAINNET_RELAYER_LISTENING_CONTRACT, MAINNET_RELAYER_LOG_PAGE_SIZE, MAINNET_SERVICE_NAME, MAINNET_SYNC_HEADER_BATCH_SIZ...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-node/src/ignition/mod.rs
forc-plugins/forc-node/src/ignition/mod.rs
pub mod cmd; pub mod op;
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-node/src/ignition/cmd.rs
forc-plugins/forc-node/src/ignition/cmd.rs
use crate::{cmd::ConnectionSettings, consts::MAINNET_BOOTSTRAP_NODE, util::DbConfig}; use clap::Parser; use std::path::PathBuf; #[derive(Parser, Debug, Clone)] pub struct IgnitionCmd { #[clap(flatten)] pub connection_settings: ConnectionSettings, #[clap(long, default_value = default_ignition_db_path().into...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-node/tests/local.rs
forc-plugins/forc-node/tests/local.rs
use std::time::Duration; use forc_node::local::{cmd::LocalCmd, run}; use serde_json::json; use tokio::time::sleep; #[ignore = "CI errors with: IO error: not a terminal"] #[tokio::test] async fn start_local_node_check_health() { let port = portpicker::pick_unused_port().expect("No ports free"); let local_cmd =...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-mcp/src/rate_limit.rs
forc-plugins/forc-mcp/src/rate_limit.rs
use axum::{ extract::Request, http::{HeaderMap, StatusCode}, middleware::Next, response::{IntoResponse, Response}, Json, }; use serde_json::json; use std::{ collections::HashMap, net::{IpAddr, SocketAddr}, sync::Arc, time::{Duration, Instant}, }; use tokio::sync::RwLock; /// Rate li...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-mcp/src/lib.rs
forc-plugins/forc-mcp/src/lib.rs
pub mod auth; pub mod forc_call; pub mod rate_limit; use axum::{ extract::State, response::IntoResponse, routing::{get, post}, Router, }; use rate_limit::{public_rate_limit_middleware, RateLimitConfig, RateLimiter}; use rmcp::{ model::*, service::RequestContext, transport::{ sse_ser...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-mcp/src/main.rs
forc-plugins/forc-mcp/src/main.rs
use anyhow::Result; use clap::{Parser, Subcommand}; use forc_mcp::{ auth::AuthConfig, forc_call::ForcCallTools, run_http_server, run_sse_server, run_stdio_server, ForcMcpServer, }; /// Model Context Protocol (MCP) server for Forc #[derive(Parser)] #[command(name = "forc-mcp")] #[command(about = "MCP server plu...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-mcp/src/auth/storage.rs
forc-plugins/forc-mcp/src/auth/storage.rs
use super::ApiKey; use anyhow::Result; use async_trait::async_trait; use std::collections::HashMap; use std::path::Path; use std::sync::Arc; use tokio::sync::RwLock; /// Storage trait for API keys #[async_trait] pub trait ApiKeyStorage: Send + Sync { async fn create(&self, key: ApiKey) -> Result<()>; async fn ...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-mcp/src/auth/service.rs
forc-plugins/forc-mcp/src/auth/service.rs
use super::{ generate_api_key, ApiKey, ApiKeyStorage, AuthConfig, AuthError, CreateApiKeyResponse, ErrorResponse, FileStorage, ImportRequest, InMemoryStorage, Role, }; use anyhow::Result; use axum::{ extract::{Path, Query, State}, http::StatusCode, response::IntoResponse, Json, }; use chrono::Ut...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
true
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-mcp/src/auth/mod.rs
forc-plugins/forc-mcp/src/auth/mod.rs
pub mod service; pub mod storage; pub use service::{ create_api_key, delete_api_key, get_api_key, import_api_keys, list_api_keys, AuthManager, }; pub use storage::{ApiKeyStorage, FileStorage, InMemoryStorage}; use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; use sha2::{Digest, Sha256}; use thiser...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-mcp/src/forc_call/resources.rs
forc-plugins/forc-mcp/src/forc_call/resources.rs
use rmcp::{model::*, service::RequestContext, Error as McpError, RoleServer}; // Resource URI constants pub const TYPE_ENCODING_REFERENCE_URI: &str = "forc-call://type-encoding-reference"; pub const COMMON_COMMANDS_URI: &str = "forc-call://examples/common-commands"; pub const CONTRACT_SAMPLES_URI: &str = "forc-call://...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-mcp/src/forc_call/mod.rs
forc-plugins/forc-mcp/src/forc_call/mod.rs
mod resources; use crate::McpToolModule; use resources::{COMMON_COMMANDS_URI, CONTRACT_SAMPLES_URI, TYPE_ENCODING_REFERENCE_URI}; use rmcp::{ handler::server::{router::tool::ToolRouter, tool::Parameters}, model::*, schemars::{self, JsonSchema}, service::RequestContext, tool, tool_handler, tool_rout...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
true
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-debug/src/lib.rs
forc-plugins/forc-debug/src/lib.rs
pub mod cli; pub mod debugger; pub mod error; pub mod names; pub mod server; pub mod types; // Re-exports pub use fuel_core_client::client::{schema::RunResult, FuelClient}; pub use fuel_vm::prelude::{ContractId, Transaction};
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-debug/src/names.rs
forc-plugins/forc-debug/src/names.rs
/// A list of predefined register names mapped to their corresponding indices. pub const REGISTERS: [&str; 16] = [ "zero", "one", "of", "pc", "ssp", "sp", "fp", "hp", "err", "ggas", "cgas", "bal", "is", "ret", "retl", "flag", ]; /// Returns the name of a register given its index. /// /// If the index correspon...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-debug/src/error.rs
forc-plugins/forc-debug/src/error.rs
use crate::types::Instruction; use dap::requests::Command; pub type Result<T> = std::result::Result<T, Error>; #[derive(Debug, thiserror::Error)] pub enum Error { #[error(transparent)] ArgumentError(#[from] ArgumentError), #[error(transparent)] AdapterError(#[from] AdapterError), #[error("VM err...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-debug/src/types.rs
forc-plugins/forc-debug/src/types.rs
use crate::error::{Error, Result}; use dap::types::Breakpoint; use fuel_types::ContractId; use std::{ collections::HashMap, ops::{Deref, DerefMut}, path::PathBuf, }; use sway_core::asm_generation::ProgramABI; pub type ExitCode = i64; pub type Instruction = u64; pub type Breakpoints = HashMap<PathBuf, Vec<B...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-debug/src/main.rs
forc-plugins/forc-debug/src/main.rs
use clap::Parser; use forc_tracing::{init_tracing_subscriber, println_error, TracingSubscriberOptions}; #[derive(Parser, Debug)] #[clap(name = "forc-debug", version)] /// Forc plugin for the Sway DAP (Debug Adapter Protocol) implementation. pub struct Opt { /// The URL of the Fuel Client GraphQL API #[clap(def...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-debug/src/server/state.rs
forc-plugins/forc-debug/src/server/state.rs
use crate::{ error::AdapterError, types::{Breakpoints, Instruction}, }; use dap::types::StartDebuggingRequestKind; use forc_pkg::BuiltPackage; use forc_test::{execute::TestExecutor, setup::TestSetup, TestResult}; use std::path::PathBuf; use sway_core::source_map::SourceMap; #[derive(Default, Debug, Clone)] ///...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-debug/src/server/util.rs
forc-plugins/forc-debug/src/server/util.rs
use crate::types::Instruction; use dap::types::Source; use fuel_vm::fuel_asm::RegId; use std::path::Path; #[derive(Debug, Clone)] /// Utility for generating unique, incremental IDs. pub(crate) struct IdGenerator { next_id: i64, } impl Default for IdGenerator { fn default() -> Self { Self::new() } ...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-debug/src/server/mod.rs
forc-plugins/forc-debug/src/server/mod.rs
mod handlers; mod state; mod util; use crate::{ error::{self, AdapterError, Error}, server::{state::ServerState, util::IdGenerator}, types::{ExitCode, Instruction}, }; use dap::{ events::{ExitedEventBody, OutputEventBody, StoppedEventBody}, prelude::*, types::StartDebuggingRequestKind, }; use f...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-debug/src/server/handlers/handle_stack_trace.rs
forc-plugins/forc-debug/src/server/handlers/handle_stack_trace.rs
use crate::server::{util, AdapterError, DapServer, HandlerResult}; use dap::{ responses::ResponseBody, types::{StackFrame, StackFramePresentationhint}, }; impl DapServer { /// Handles a `stack_trace` request. Returns the list of [StackFrame]s for the current execution state. pub(crate) fn handle_stack_...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-debug/src/server/handlers/mod.rs
forc-plugins/forc-debug/src/server/handlers/mod.rs
use crate::{ error::AdapterError, server::{ AdditionalData, DapServer, HandlerResult, INSTRUCTIONS_VARIABLE_REF, REGISTERS_VARIABLE_REF, THREAD_ID, }, }; use dap::{ prelude::*, types::{Scope, StartDebuggingRequestKind}, }; use requests::{EvaluateArguments, LaunchRequestArguments}; us...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-debug/src/server/handlers/handle_breakpoint_locations.rs
forc-plugins/forc-debug/src/server/handlers/handle_breakpoint_locations.rs
use crate::server::{AdapterError, DapServer, HandlerResult}; use dap::{ requests::BreakpointLocationsArguments, responses::ResponseBody, types::BreakpointLocation, }; use std::path::PathBuf; impl DapServer { /// Handles a `breakpoint_locations` request. Returns the list of [BreakpointLocation]s. pub(crate)...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-debug/src/server/handlers/handle_variables.rs
forc-plugins/forc-debug/src/server/handlers/handle_variables.rs
use crate::{ names::register_name, server::{ AdapterError, DapServer, HandlerResult, INSTRUCTIONS_VARIABLE_REF, REGISTERS_VARIABLE_REF, }, }; use dap::{requests::VariablesArguments, responses::ResponseBody, types::Variable}; use fuel_vm::fuel_asm::{Imm06, Imm12, Imm18, Imm24, Instruction, RawInstruc...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-debug/src/server/handlers/handle_set_breakpoints.rs
forc-plugins/forc-debug/src/server/handlers/handle_set_breakpoints.rs
use crate::server::{AdapterError, DapServer, HandlerResult}; use dap::{ requests::SetBreakpointsArguments, responses::ResponseBody, types::{Breakpoint, StartDebuggingRequestKind}, }; use std::path::PathBuf; impl DapServer { /// Handles a `set_breakpoints` request. Returns the list of [Breakpoint]s for ...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-debug/src/cli/state.rs
forc-plugins/forc-debug/src/cli/state.rs
use crate::{cli::commands::Commands, names}; use rustyline::{ completion::Completer, highlight::{CmdKind, Highlighter}, hint::Hinter, validate::{ValidationContext, ValidationResult, Validator}, Context, Helper, }; use serde_json::Value; use std::{borrow::Cow, collections::HashSet, fs}; pub struct D...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-debug/src/cli/commands.rs
forc-plugins/forc-debug/src/cli/commands.rs
use crate::{cli::state::DebuggerHelper, error::Result}; use std::collections::HashSet; use strsim::levenshtein; #[derive(Debug, Clone)] pub struct Command { pub name: &'static str, pub aliases: &'static [&'static str], pub help: &'static str, } pub struct Commands { pub tx: Command, pub reset: Com...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-debug/src/cli/mod.rs
forc-plugins/forc-debug/src/cli/mod.rs
mod commands; mod state; pub use commands::parse_int; use crate::{ debugger::Debugger, error::{ArgumentError, Error, Result}, }; use rustyline::{CompletionType, Config, EditMode, Editor}; use state::DebuggerHelper; use std::path::PathBuf; /// Start the CLI debug interface pub async fn start_cli(api_url: &str...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-debug/src/debugger/commands.rs
forc-plugins/forc-debug/src/debugger/commands.rs
use crate::{error::ArgumentError, ContractId}; use fuel_tx::Receipt; use serde::{Deserialize, Serialize}; /// Commands representing all debug operations #[derive(Debug, Clone, Serialize, Deserialize)] pub enum DebugCommand { /// Start a new transaction with optional ABI information StartTransaction { /...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-debug/src/debugger/mod.rs
forc-plugins/forc-debug/src/debugger/mod.rs
pub mod commands; pub use commands::{AbiMapping, BreakpointHit, DebugCommand, DebugResponse, RegisterValue}; use crate::{ error::{Error, Result}, names::register_name, types::AbiMap, ContractId, FuelClient, RunResult, Transaction, }; use fuel_tx::Receipt; use fuel_vm::consts::{VM_REGISTER_COUNT, WORD_...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-debug/tests/cli_integration.rs
forc-plugins/forc-debug/tests/cli_integration.rs
#![deny(unused_must_use)] use escargot::CargoBuild; use rexpect::session::spawn_command; use std::process::Command; #[test] fn test_cli() { let port = portpicker::pick_unused_port().expect("No ports free"); #[allow(clippy::zombie_processes)] let mut fuel_core = Command::new("fuel-core") .arg("run")...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-debug/tests/server_integration.rs
forc-plugins/forc-debug/tests/server_integration.rs
use dap::{ events::{Event, OutputEventBody}, requests::{Command, LaunchRequestArguments, SetBreakpointsArguments, VariablesArguments}, responses::ResponseBody, types::{ OutputEventCategory, Source, SourceBreakpoint, StartDebuggingRequestKind, StoppedEventReason, Variable, }, }; use f...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-debug/examples/client_usage.rs
forc-plugins/forc-debug/examples/client_usage.rs
use forc_debug::{ContractId, FuelClient, Transaction}; #[tokio::main] async fn main() { run_example().await.expect("Running example failed"); } async fn run_example() -> Result<(), anyhow::Error> { let client = FuelClient::new("http://localhost:4000/graphql")?; let session_id = client.start_session().awa...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-client/build.rs
forc-plugins/forc-client/build.rs
use std::fs; use std::path::{Path, PathBuf}; fn minify_json(json: &str) -> String { let mut result = String::with_capacity(json.len()); let mut in_string = false; let mut previous_char: Option<char> = None; for c in json.chars() { if in_string { result.push(c); if c == ...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-client/src/lib.rs
forc-plugins/forc-client/src/lib.rs
pub mod cmd; pub mod constants; pub mod op; pub mod util; use clap::Parser; use forc_pkg::manifest::Network; use serde::{Deserialize, Serialize}; use util::target::Target; /// Flags for specifying the node to target. #[derive(Debug, Default, Clone, Parser, Deserialize, Serialize)] pub struct NodeTarget { /// The ...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-client/src/constants.rs
forc-plugins/forc-client/src/constants.rs
/// Default to localhost to favour the common case of testing. pub const NODE_URL: &str = sway_utils::constants::DEFAULT_NODE_URL; pub const MAINNET_ENDPOINT_URL: &str = "https://mainnet.fuel.network"; pub const TESTNET_ENDPOINT_URL: &str = "https://testnet.fuel.network"; pub const DEVNET_ENDPOINT_URL: &str = "https:/...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-client/src/util/aws.rs
forc-plugins/forc-client/src/util/aws.rs
use async_trait::async_trait; use aws_config::{default_provider::credentials::DefaultCredentialsChain, Region, SdkConfig}; use aws_sdk_kms::config::Credentials; use aws_sdk_kms::operation::get_public_key::GetPublicKeyOutput; use aws_sdk_kms::primitives::Blob; use aws_sdk_kms::types::{MessageType, SigningAlgorithmSpec};...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false
FuelLabs/sway
https://github.com/FuelLabs/sway/blob/cc8f867043f3ec2c14ec4088d449cde603929a80/forc-plugins/forc-client/src/util/encode.rs
forc-plugins/forc-client/src/util/encode.rs
use anyhow::Context; use fuel_abi_types::abi::full_program::FullTypeApplication; use std::str::FromStr; use sway_types::u256::U256; /// A wrapper around fuels_core::types::Token, which enables serde de/serialization. #[derive(Debug, PartialEq, serde::Serialize, serde::Deserialize)] pub(crate) struct Token(pub(crate) f...
rust
Apache-2.0
cc8f867043f3ec2c14ec4088d449cde603929a80
2026-01-04T15:31:58.694488Z
false