Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions .agent/skills/basalt-html/compose.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
//
// node .agent/skills/basalt-html/compose.mjs <body.html> [--out <page.html>] [--no-fonts] [--lang <code>] [--all]
// node .agent/skills/basalt-html/compose.mjs --usage [NAME ...]
// node .agent/skills/basalt-html/compose.mjs --marks [PREFIX ...]
//
// The body is the part of the page you write: HTML for inside <body>, which may also carry
// <title>…</title> the page title (default: the first <h1>, else "Untitled page")
Expand All @@ -24,6 +25,8 @@
// itself: then one line says so), and for each the classes, attributes and tags that bring it in (read from the manifest, the same
// file detection reads); NAME is `core` or a module. --usage alone prints SKILL.md's index
// of modules; an unknown name prints it too and exits 1. --usage reads no body and writes no page.
// --marks prints the bundled service marks a diagram card can name: each id, the words the card must say, and "(unofficial)" where it is not its owner's own
// file; PREFIX (aws, azure, gcp) keeps the ids that start with it. It reads parts/marks.json only, so the diagram usage need not list them.
//
// Source: tools/html-skill/src/compose.mjs (do not edit the copy in the skill folder).
import fs from "node:fs";
Expand Down Expand Up @@ -780,8 +783,17 @@ function indexText(skill) {
return `Modules (node .agent/skills/basalt-html/compose.mjs --usage core NAME ... prints their usage; core is layout, type, panels and buttons):\n${lines.join("\n")}\n`;
}

/** The bundled marks as the text --marks prints: one line an id with the words its card must say; `prefixes` keeps the ids that are one or start with one. */
export function marksText(prefixes = [], { parts = path.join(here, "parts") } = {}) {
const file = JSON.parse(read(parts, "marks.json"));
const unofficial = new Set(file.unofficial ?? []);
const ids = Object.keys(file.says).filter((id) => !prefixes.length || prefixes.some((p) => id === p || id.startsWith(`${p}-`)));
if (!ids.length) throw new Error(`no mark starts with ${prefixes.join(" or ")}; the marks are ${[...new Set(Object.keys(file.says).map((id) => id.split("-")[0]))].join(", ")}`);
return `${ids.map((id) => `${id}: ${file.says[id].join(", ")}${unofficial.has(id) ? " (unofficial)" : ""}`).join("\n")}\n`;
}

function usage() {
console.error("usage: node .agent/skills/basalt-html/compose.mjs <body.html> [--out <page.html>] [--no-fonts] [--lang <code>] [--all]\n node .agent/skills/basalt-html/compose.mjs --usage [NAME ...]");
console.error("usage: node .agent/skills/basalt-html/compose.mjs <body.html> [--out <page.html>] [--no-fonts] [--lang <code>] [--all]\n node .agent/skills/basalt-html/compose.mjs --usage [NAME ...]\n node .agent/skills/basalt-html/compose.mjs --marks [PREFIX ...]");
process.exit(2);
}

Expand All @@ -793,11 +805,15 @@ if (isMain) {
let input = null;
let out = null;
let usageNames = null;
let markPrefixes = null;
for (let i = 0; i < args.length; i++) {
const a = args[i];
if (a === "--usage") {
usageNames = [];
while (args[i + 1] !== undefined && !args[i + 1].startsWith("--")) usageNames.push(args[++i]);
} else if (a === "--marks") {
markPrefixes = [];
while (args[i + 1] !== undefined && !args[i + 1].startsWith("--")) markPrefixes.push(args[++i]);
} else if (a === "--no-fonts") options.fonts = false;
else if (a === "--all") options.all = true;
else if (a === "--out" || a === "--lang") {
Expand All @@ -807,7 +823,11 @@ if (isMain) {
else input = a;
}
const skill = path.join(here, "SKILL.md");
if (usageNames) {
if (markPrefixes) {
// The bundled marks: no body is read and no page is written.
if (input || out || usageNames) usage();
try { console.log(marksText(markPrefixes)); } catch (e) { console.error(`compose.mjs: ${e.message}`); process.exitCode = 1; }
} else if (usageNames) {
// The usage of modules: no body is read and no page is written.
if (input || out) usage();
const index = indexText(skill);
Expand Down
2 changes: 1 addition & 1 deletion .agent/skills/basalt-html/parts/marks.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .agent/skills/basalt-html/parts/usage/diagram.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ Boxes and the lines between them. `compose.mjs` writes the figure's words into t
- **Flow, pulse, packet:** `"flow": true` on a `main` or `plain` edge marches it (give it a label). `"pulse": ["a", "b", "c"]` runs a bead along a route; `"packet": { "path": [...], "repeat": true }` sends a dot. One of pulse and packet; never flow on the mover's route. Architecture and data flow only.
- **Run:** `"run": true` on a sequence adds "Play the run", a dot through every message.
- **Mark:** `"mark": "aws-ecs-service"` on an architecture node, 16px in the card's top end corner, the owner's file and colours; the card's words still name the service. Your own: `{ "onLight": "logo.svg", "onDark": "logo-dark.svg" }`, read into the page. A page drawing from script names its marks: `<!-- basalt:marks aws-s3-bucket temporal -->`.
- **Marks:** aws-application-load-balancer, aws-network-load-balancer, aws-cloudfront-distribution, aws-route-53-hosted-zone, aws-api-gateway-endpoint, aws-internet-gateway, aws-nat-gateway, aws-ecs-service, aws-ecs-task, aws-ecr-registry, aws-ec2-instance, aws-lambda-function, aws-s3-bucket, aws-dynamodb-table, aws-sqs-queue, aws-eventbridge-event-bus, aws-cloudwatch-logs, aws-cloudwatch-alarm, aws-parameter-store, aws-iam-role, aws-sagemaker-model, aws-bedrock, aws-client, aws-mobile-client, aws-user, aws-users, aws-internet, aws-server, aws-database, aws-application, aws-git-repository, aws-email, temporal, sonarqube, github, coderabbit, greptile, blacksmith, jenkins, servicenow, blazemeter. `aws-database` is the card for Aurora and RDS. aws-bedrock, jenkins, servicenow and blazemeter are unofficial.
- **Marks:** `aws-*`, `azure-*`, `gcp-*`, `kubernetes`, `temporal`, `sonarqube`, `github`, `coderabbit`, `greptile`, `blacksmith`, `jenkins`, `servicenow`, `blazemeter`. `node .agent/skills/basalt-html/compose.mjs --marks [aws azure gcp ...]` prints each id with the words its card must say and which are unofficial; a database card (Aurora, RDS) takes `aws-database`.
22 changes: 21 additions & 1 deletion packages/react/THIRD-PARTY-MARKS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ source, the date it was fetched and its hash. A mark is removed by deleting its

## Amazon Web Services, Inc.

Application Load Balancer (`aws-application-load-balancer`), Network Load Balancer (`aws-network-load-balancer`), Amazon CloudFront distribution (`aws-cloudfront-distribution`), Amazon Route 53 hosted zone (`aws-route-53-hosted-zone`), Amazon API Gateway endpoint (`aws-api-gateway-endpoint`), Amazon VPC internet gateway (`aws-internet-gateway`), Amazon VPC NAT gateway (`aws-nat-gateway`), Amazon ECS service (`aws-ecs-service`), Amazon ECS task (`aws-ecs-task`), Amazon ECR registry (`aws-ecr-registry`), Amazon EC2 instance (`aws-ec2-instance`), AWS Lambda function (`aws-lambda-function`), Amazon S3 bucket (`aws-s3-bucket`), Amazon DynamoDB table (`aws-dynamodb-table`), Amazon SQS queue (`aws-sqs-queue`), Amazon EventBridge event bus (`aws-eventbridge-event-bus`), Amazon CloudWatch Logs (`aws-cloudwatch-logs`), Amazon CloudWatch alarm (`aws-cloudwatch-alarm`), AWS Systems Manager Parameter Store (`aws-parameter-store`), AWS IAM role (`aws-iam-role`), Amazon SageMaker AI model (`aws-sagemaker-model`), Amazon Bedrock (`aws-bedrock`, unofficial), Client (`aws-client`), Mobile client (`aws-mobile-client`), User (`aws-user`), Users (`aws-users`), Internet (`aws-internet`), Server (`aws-server`), Database (`aws-database`), Generic application (`aws-application`), Git repository (`aws-git-repository`), Email (`aws-email`).
Application Load Balancer (`aws-application-load-balancer`), Network Load Balancer (`aws-network-load-balancer`), Amazon CloudFront distribution (`aws-cloudfront-distribution`), Amazon Route 53 hosted zone (`aws-route-53-hosted-zone`), Amazon API Gateway endpoint (`aws-api-gateway-endpoint`), Amazon VPC internet gateway (`aws-internet-gateway`), Amazon VPC NAT gateway (`aws-nat-gateway`), Amazon ECS service (`aws-ecs-service`), Amazon ECS task (`aws-ecs-task`), Amazon ECR registry (`aws-ecr-registry`), Amazon EC2 instance (`aws-ec2-instance`), AWS Lambda function (`aws-lambda-function`), Amazon S3 bucket (`aws-s3-bucket`), Amazon DynamoDB table (`aws-dynamodb-table`), Amazon SQS queue (`aws-sqs-queue`), Amazon EventBridge event bus (`aws-eventbridge-event-bus`), Amazon CloudWatch Logs (`aws-cloudwatch-logs`), Amazon CloudWatch alarm (`aws-cloudwatch-alarm`), AWS Systems Manager Parameter Store (`aws-parameter-store`), AWS IAM role (`aws-iam-role`), Amazon SageMaker AI model (`aws-sagemaker-model`), Amazon Bedrock (`aws-bedrock`, unofficial), Client (`aws-client`), Mobile client (`aws-mobile-client`), User (`aws-user`), Users (`aws-users`), Internet (`aws-internet`), Server (`aws-server`), Database (`aws-database`), Generic application (`aws-application`), Git repository (`aws-git-repository`), Email (`aws-email`), Amazon VPC (`aws-vpc`), Amazon VPC endpoints (`aws-vpc-endpoints`), AWS Site-to-Site VPN connection (`aws-vpn-connection`), AWS Transit Gateway (`aws-transit-gateway-attachment`), AWS Direct Connect gateway (`aws-direct-connect-gateway`), AWS App Mesh (`aws-app-mesh-mesh`), AWS Glue Data Catalog (`aws-glue-data-catalog`), Amazon Athena data source connectors (`aws-athena-data-source-connectors`), Amazon EMR cluster (`aws-emr-cluster`), AWS Lake Formation data lake (`aws-lake-formation-data-lake`), Amazon OpenSearch Service (`aws-opensearch-data-node`), Amazon MSK Connect (`aws-msk-connect`), Amazon EventBridge Scheduler (`aws-eventbridge-scheduler`), Amazon EventBridge Pipes (`aws-eventbridge-pipes`), Amazon DynamoDB Accelerator (`aws-dynamodb-accelerator`), AWS CloudFormation stack (`aws-cloudformation-stack`), AWS CloudTrail Lake (`aws-cloudtrail-lake`), AWS Organizations account (`aws-organizations-account`), Amazon SES (`aws-ses-email`), Amazon MQ broker (`aws-mq-broker`), AWS WAF (`aws-waf-rule`), AWS Shield Advanced (`aws-shield-advanced`), AWS Security Hub (`aws-security-hub-finding`), Amazon Inspector (`aws-inspector-agent`), AWS Network Firewall (`aws-network-firewall-endpoints`), Amazon DocumentDB (`aws-documentdb-elastic-clusters`), AWS Database Migration Service (`aws-dms-migration-job`), Amazon Rekognition (`aws-rekognition-image`), AWS DataSync (`aws-datasync-agent`), AWS Storage Gateway (`aws-storage-gateway-file-gateway`), Amazon EFS file system (`aws-efs-file-system`), AWS Backup vault (`aws-backup-vault`), AWS Elastic Beanstalk (`aws-elastic-beanstalk-application`), AWS Step Functions (`aws-step-functions`, unofficial), Amazon Kinesis (`aws-kinesis`, unofficial), AWS Fargate (`aws-fargate`, unofficial), AWS Secrets Manager (`aws-secrets-manager`, unofficial), Amazon Cognito (`aws-cognito`, unofficial), Amazon EKS (`aws-eks`, unofficial), AWS Key Management Service (`aws-kms`, unofficial).

Source: https://aws.amazon.com/architecture/icons/. Terms: https://aws.amazon.com/architecture/icons/.

Expand Down Expand Up @@ -71,3 +71,23 @@ Source: https://github.com/devicons/devicon/tree/develop/icons/servicenow. Terms
BlazeMeter (`blazemeter`, unofficial).

Source: https://simpleicons.org/?q=blazemeter. Terms: https://cdn.jsdelivr.net/npm/simple-icons@16.38.1/LICENSE.md.

## Microsoft Corporation

Azure App Service (`azure-app-service`), Azure Monitor (`azure-monitor`), Azure Functions (`azure-functions`), Azure Storage account (`azure-storage-account`), Azure Cosmos DB (`azure-cosmos-db`), Azure SQL Database (`azure-sql-database`), Azure Kubernetes Service (`azure-aks`), Azure Service Bus (`azure-service-bus`), Azure Event Hubs (`azure-event-hubs`), Azure Key Vault (`azure-key-vault`), Azure Front Door (`azure-front-door`), Azure API Management (`azure-api-management`), Microsoft Entra ID (`azure-entra-id`).

Source: https://learn.microsoft.com/en-us/azure/architecture/icons/, https://learn.microsoft.com/en-us/entra/architecture/architecture-icons. Terms: https://learn.microsoft.com/en-us/azure/architecture/icons/, https://learn.microsoft.com/en-us/entra/architecture/architecture-icons.

## Google LLC

Google Cloud Run (`gcp-cloud-run`), Google Kubernetes Engine (`gcp-gke`), Google Cloud SQL (`gcp-cloud-sql`), Google Compute Engine (`gcp-compute-engine`), Google Cloud Storage (`gcp-cloud-storage`), Google BigQuery (`gcp-bigquery`), Google Vertex AI (`gcp-vertex-ai`), Google Pub/Sub (`gcp-pubsub`), Google Cloud Functions (`gcp-cloud-functions`).

Source: https://cloud.google.com/icons. Terms: https://cloud.google.com/icons.

## The Linux Foundation

Kubernetes (`kubernetes`).

Source: https://github.com/cncf/artwork/tree/main/projects/kubernetes. Terms: https://github.com/kubernetes/kubernetes/blob/master/logo/usage_guidelines.md.

The Kubernetes logo is the Kubernetes Authors' artwork, used under Apache-2.0 (its logo folder offers a choice of Apache-2.0 or CC-BY-4.0: https://github.com/kubernetes/kubernetes/blob/master/logo/LICENSE). Kubernetes is a registered trademark of The Linux Foundation.
2 changes: 1 addition & 1 deletion packages/react/marks/generate.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ if (process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(import.me
"",
].join("\n"));
}
fs.writeFileSync(path.join(repo, "tools", "html-skill", "src", "marks.json"), `${JSON.stringify({ $comment: "Generated by packages/react/marks/generate.mjs from packages/react/marks/manifest.json. Do not edit. Every bundled mark's two forms as data URIs; compose.mjs writes into a page only the marks it names.", says: Object.fromEntries(manifest.marks.map((m) => [m.id, m.says])), marks: skill })}\n`);
fs.writeFileSync(path.join(repo, "tools", "html-skill", "src", "marks.json"), `${JSON.stringify({ $comment: "Generated by packages/react/marks/generate.mjs from packages/react/marks/manifest.json. Do not edit. Every bundled mark's two forms as data URIs; compose.mjs writes into a page only the marks it names.", says: Object.fromEntries(manifest.marks.map((m) => [m.id, m.says])), unofficial: manifest.marks.filter((m) => m.unofficial).map((m) => m.id), marks: skill })}\n`);
// The notice that ships in the package: each mark's owner, that each is its owner's trademark and not under the package's licence, and no endorsement.
const owners = [...new Set(manifest.marks.map((m) => m.owner))];
fs.writeFileSync(path.join(repo, "packages", "react", "THIRD-PARTY-MARKS.md"), [
Expand Down
Loading
Loading