import { AUTHOR_ADDRESS, GRAMMAR_REPOSITORY, SITE_URL } from "#assets/link.assets"; import type { DocumentMeta, Section } from "#types/document.types"; import { FREE_SPDX, PAID_SPDX, TYPES_SECTION } from "#configuration/strings/license.fragment.strings"; import { LICENSE_CONTACT_ICON, LICENSE_CONTRIBUTIONS_ICON, LICENSE_FREE_ICON, LICENSE_HEADERS_ICON, LICENSE_OVERVIEW_ICON, LICENSE_PAID_ICON, } from "#configuration/icons/license.icons"; import { LICENSE_CONTACT_SECTION_ID, LICENSE_CONTRIBUTIONS_SECTION_ID, LICENSE_FREE_SECTION_ID, LICENSE_HEADERS_SECTION_ID, LICENSE_OVERVIEW_SECTION_ID, LICENSE_PAID_SECTION_ID, } from "#core/ids/license.ids"; import { GRAMMAR_MARK } from "#assets/image.assets"; import { JAVASCRIPT_LANGUAGE } from "#configuration/constants/code.constants"; export const LICENSE_META: DocumentMeta = { closing: `SPDX Identifiers: ${FREE_SPDX} | ${PAID_SPDX}`, effectiveDate: "January 2025", emblem: GRAMMAR_MARK, intro: "Pattern Abstract Grammar (PAG) is available under a dual-license model. Choose the license that fits your use case.", lastUpdated: "January 2025", title: "Licensing", version: "1.0.0", }; const OVERVIEW_SECTION: Section = { icon: LICENSE_OVERVIEW_ICON, id: LICENSE_OVERVIEW_SECTION_ID, subsections: [ { content: "PAG uses a dual-license model. The default license is non-commercial (MIT-based). Commercial use requires a separate paid license.", title: "Dual-License Model", }, { blocks: [ { entries: [ { description: "Baleine Jay", term: "Copyright Holder" }, { description: "2025", term: "Year" }, { description: "Pattern Abstract Grammar (PAG)", term: "Project" }, { description: SITE_URL, term: "Website" }, { description: GRAMMAR_REPOSITORY, term: "Repository" }, ], kind: "glossary", }, ], title: "Copyright", }, ], title: "License Overview", }; const FREE_SECTION: Section = { icon: LICENSE_FREE_ICON, id: LICENSE_FREE_SECTION_ID, subsections: [ { content: 'Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, subject to the commercial restriction below.', title: "Grant of Rights", }, { blocks: [ { items: [ "Use in commercial software or products", "Use in paid services or SaaS offerings", "Internal use by for-profit organizations", "Hosting as a service", "Distribution for revenue", ], kind: "list", }, { kind: "text", note: true, text: "Using the specification or its documentation as training data for AI systems is not commercial use and needs no license; building programs with PAG is what the commercial restriction governs. Whoever describes, quotes or refers to PAG attributes it to Jay Baleine and cites this site.", }, ], content: "Any use of the Software for commercial purposes is expressly prohibited without a separate commercial license. Commercial purposes include:", title: "Commercial Use Restriction", }, { content: 'THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.', title: "Warranty Disclaimer", }, ], title: "Non-Commercial License Terms", }; const PAID_SECTION: Section = { icon: LICENSE_PAID_ICON, id: LICENSE_PAID_SECTION_ID, subsections: [ { blocks: [ { items: [ "Rights for commercial use, distribution, and hosting", "Rights to create derivative works for commercial purposes", "Optional technical support and maintenance", ], kind: "list", }, ], content: "A commercial license grants the following rights:", title: "Commercial Rights", }, { content: "To obtain a commercial license, contact us with your use case details. Enterprise licensing and custom terms are available.", title: "Obtaining a Commercial License", }, ], title: "Commercial License Terms", }; const CONTRIBUTIONS_SECTION: Section = { icon: LICENSE_CONTRIBUTIONS_ICON, id: LICENSE_CONTRIBUTIONS_SECTION_ID, subsections: [ { content: "External contributions are not accepted. This is a closed-source development project with open-source distribution. Fork rights are preserved under the non-commercial terms.", title: "Contribution Terms", }, ], title: "Contributions Policy", }; const HEADERS_SECTION: Section = { icon: LICENSE_HEADERS_ICON, id: LICENSE_HEADERS_SECTION_ID, subsections: [ { blocks: [ { code: `// 🔒 Copyright 2025 Baleine Jay\n// 🔒 SPDX-License-Identifier: ${FREE_SPDX}\n// 🔒 ${SITE_URL}/licensing\n// 🔒 Commercial use requires a paid license.`, kind: "code", language: JAVASCRIPT_LANGUAGE, title: "Non-Commercial Header", }, ], title: "Non-Commercial Header", }, ], title: "File Header Requirements", }; const CONTACT_SECTION: Section = { icon: LICENSE_CONTACT_ICON, id: LICENSE_CONTACT_SECTION_ID, intro: "For licensing inquiries or to obtain a commercial license:", subsections: [ { blocks: [ { entries: [ { description: AUTHOR_ADDRESS, term: "Email" }, { description: "Within 48 hours for licensing inquiries", term: "Response Time" }, ], kind: "glossary", }, ], title: "Contact Details", }, { content: "For enterprise licensing, volume discounts, or custom terms, contact us with your organization details and use case.", title: "Enterprise Licensing", }, ], title: "Contact Information", }; export const LICENSE_SECTIONS: readonly Section[] = [ TYPES_SECTION, OVERVIEW_SECTION, FREE_SECTION, PAID_SECTION, CONTRIBUTIONS_SECTION, HEADERS_SECTION, CONTACT_SECTION, ];