Repository Public MIT
1// swift-tools-version: 6.22// =============================================================================3// SP BOUCHER | SOFTWARE & RESEARCH4// ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING5// =============================================================================6//7// PROJECT METADATA8// -----------------------------------------------------------------------------9// Project : ORIX Astra10// File : Package.swift11// Repository : https://git.spboucher.ai/orix-astra12// Created : 2026-11-2113// Last Modified : 2026-11-2214//15// =============================================================================16// AUTHOR & PROFESSIONAL AFFILIATION17// =============================================================================18//19// Author : Simon-Pierre Boucher20// Position : Professor of Finance21// Institution : Université du Québec en Outaouais (UQO)22// Department : Département des sciences administratives23// Organization : SP Boucher24//25// Website : https://spboucher.ai26// Git : https://git.spboucher.ai27//28// =============================================================================29// OFFICIAL CONTACT DIRECTORY30// =============================================================================31//32// General : info@spboucher.ai33// Professional : contact@spboucher.ai34// Direct : simon@spboucher.ai35// Research : research@spboucher.ai36// Development : dev@spboucher.ai37// Support : support@spboucher.ai38// Security/Admin : admin@spboucher.ai39// Notifications : notifications@spboucher.ai40//41// Preferred Contact: support@spboucher.ai42//43// =============================================================================44// COPYRIGHT & INTELLECTUAL PROPERTY45// =============================================================================46//47// Copyright (c) 202648// Simon-Pierre Boucher49//50// All rights reserved where applicable.51//52// This file is governed by the applicable project license,53// copyright notices, institutional agreements and relevant law.54//55// Unless expressly authorized by the applicable license or56// rights holder, copying, redistribution, sublicensing,57// publication and commercial exploitation are not permitted.58//59// Existing third-party rights and notices remain unaffected.60//61// =============================================================================62// CONFIDENTIALITY & SECURITY63// =============================================================================64//65// Classification : Public66// Distribution : Public repository; use is governed by the project license67// Security Contact : admin@spboucher.ai68//69// Access to this source does not independently grant permission70// to redistribute or disclose confidential materials.71//72// Do not embed credentials, private keys, access tokens,73// certificates or confidential personal information.74//75// =============================================================================76// LICENSE & MAINTENANCE77// =============================================================================78//79// License : Proprietary, all rights reserved (see license file)80// License File : LICENSE81// Maintainer : Simon-Pierre Boucher82// Technical Contact: dev@spboucher.ai83//84// =============================================================================85// END OF SP BOUCHER SOURCE HEADER86// =============================================================================8788import PackageDescription8990let mlx: [Target.Dependency] = [91 .product(name: "MLXLLM", package: "mlx-swift-lm"),92 .product(name: "MLXVLM", package: "mlx-swift-lm"),93 .product(name: "MLXLMCommon", package: "mlx-swift-lm"),94 .product(name: "MLX", package: "mlx-swift"),95 .product(name: "Tokenizers", package: "swift-transformers"),96 .product(name: "Jinja", package: "swift-jinja"),97]9899func module(_ name: String, _ deps: [Target.Dependency] = [], resources: [Resource]? = nil) -> Target {100 .target(name: name, dependencies: deps, path: "Packages/\(name)/Sources", resources: resources,101 swiftSettings: [.swiftLanguageMode(.v6)])102}103func tests(_ name: String, _ deps: [Target.Dependency], resources: [Resource]? = nil) -> Target {104 .testTarget(name: name, dependencies: deps, path: "Tests/\(name)", resources: resources, swiftSettings: [.swiftLanguageMode(.v6)])105}106107// ASTRA_NO_MLX=1 leaves out the modules that link MLX (and the UI built on them): the pure-Swift modules then build and test in seconds on macOS.108let light = Context.environment["ASTRA_NO_MLX"] == "1"109let heavy: Set<String> = ["AstraLocal", "AstraUI", "AstraLocalTests"]110// ASTRA_NO_UI=1 leaves out only the SwiftUI layer, which is iOS-only: the MLX runtime and its tests then build on macOS111// (`ASTRA_NO_UI=1 swift test --filter AstraLocalTests`), which is where real MLX inference is verified.112let noUI = Context.environment["ASTRA_NO_UI"] == "1"113let excluded: Set<String> = light ? heavy : (noUI ? ["AstraUI"] : [])114let grdb: Target.Dependency = .product(name: "GRDB", package: "GRDB.swift")115116let package = Package(117 name: "AstraKit",118 defaultLocalization: "en",119 platforms: [.macOS(.v15), .iOS(.v18)],120 products: [121 .library(name: "AstraKit", targets: [122 "AstraCore", "AstraProviders", "AstraPersistence", "AstraAgents", "AstraDesign", "AstraLocal", "AstraUI",123 ].filter { !excluded.contains($0) }),124 ],125 dependencies: (light ? [] : [126 .package(url: "https://github.com/ml-explore/mlx-swift-lm", exact: "3.33.0"),127 .package(url: "https://github.com/ml-explore/mlx-swift", .upToNextMinor(from: "0.33.0")),128 .package(url: "https://github.com/huggingface/swift-transformers", exact: "1.4.0"),129 .package(url: "https://github.com/huggingface/swift-jinja.git", "2.4.2"..<"4.0.0"),130 .package(url: "https://github.com/mgriebling/SwiftMath.git", exact: "1.7.3"),131 .package(url: "https://github.com/swiftlang/swift-markdown.git", exact: "0.7.3"),132 ]) + [133 .package(url: "https://github.com/groue/GRDB.swift", exact: "7.12.0"),134 ],135 targets: [136 module("AstraCore"),137 module("AstraProviders", ["AstraCore"]),138 module("AstraPersistence", ["AstraCore", grdb]),139 module("AstraAgents", ["AstraCore"]),140 module("AstraDesign"),141 module("AstraLocal", ["AstraCore"] + mlx),142 module("AstraUI", [143 "AstraCore", "AstraProviders", "AstraPersistence", "AstraAgents", "AstraDesign", "AstraLocal",144 .product(name: "SwiftMath", package: "SwiftMath"),145 .product(name: "Markdown", package: "swift-markdown"),146 ], resources: [.process("Resources")]),147 tests("AstraCoreTests", ["AstraCore"]),148 tests("AstraProvidersTests", ["AstraCore", "AstraProviders"], resources: [.copy("Fixtures")]),149 tests("AstraPersistenceTests", ["AstraCore", "AstraPersistence"]),150 tests("AstraAgentsTests", ["AstraCore", "AstraAgents"]),151 tests("AstraLocalTests", ["AstraCore", "AstraLocal"]),152 ].filter { !excluded.contains($0.name) }153)154