@monosmith/plugin-sdk 2.0.0-beta.4 → 2.0.0-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@monosmith/plugin-sdk",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.6",
|
|
4
4
|
"description": "The TypeScript SDK for writing smith plugins: the protocol's types, the serve loop, a test host, the conformance checks, templating and key-order-keeping JSON editing. No runtime dependencies.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -175,6 +175,28 @@ export const protocolSchema = {
|
|
|
175
175
|
"capability": "dependencies",
|
|
176
176
|
"notification": false
|
|
177
177
|
},
|
|
178
|
+
"dependencies/link": {
|
|
179
|
+
"description": "Makes a project depend on a library of the same workspace and language, in the ecosystem's own form, then installs or locks as that needs.",
|
|
180
|
+
"params": {
|
|
181
|
+
"$ref": "#/$defs/LinkParams"
|
|
182
|
+
},
|
|
183
|
+
"result": {
|
|
184
|
+
"$ref": "#/$defs/LinkResult"
|
|
185
|
+
},
|
|
186
|
+
"capability": "link",
|
|
187
|
+
"notification": false
|
|
188
|
+
},
|
|
189
|
+
"dependencies/unlink": {
|
|
190
|
+
"description": "Removes the dependency of a project on a library of the same workspace.",
|
|
191
|
+
"params": {
|
|
192
|
+
"$ref": "#/$defs/UnlinkParams"
|
|
193
|
+
},
|
|
194
|
+
"result": {
|
|
195
|
+
"$ref": "#/$defs/DependencyResult"
|
|
196
|
+
},
|
|
197
|
+
"capability": "link",
|
|
198
|
+
"notification": false
|
|
199
|
+
},
|
|
178
200
|
"dependencies/declared": {
|
|
179
201
|
"description": "Lists the dependencies the manifests of the plugin's projects declare.",
|
|
180
202
|
"params": {
|
|
@@ -589,6 +611,10 @@ export const protocolSchema = {
|
|
|
589
611
|
"type": "boolean",
|
|
590
612
|
"description": "Dependencies installs and uninstalls packages in its projects."
|
|
591
613
|
},
|
|
614
|
+
"link": {
|
|
615
|
+
"type": "boolean",
|
|
616
|
+
"description": "Link makes a project depend on a library of the same workspace in the ecosystem's own form (a workspace dependency, a path dependency, a project reference), and takes it out again. A plugin without it is refused by the host with one sentence that tells the user to add the dependency by hand."
|
|
617
|
+
},
|
|
592
618
|
"declarations": {
|
|
593
619
|
"type": "boolean",
|
|
594
620
|
"description": "Declarations lists and rewrites declared dependency specs (sync, up)."
|
|
@@ -692,6 +718,21 @@ export const protocolSchema = {
|
|
|
692
718
|
"description": {
|
|
693
719
|
"type": "string"
|
|
694
720
|
},
|
|
721
|
+
"title": {
|
|
722
|
+
"type": "string",
|
|
723
|
+
"description": "Title is the name shown to a person (\"Electron\" for electron). Without it the name is shown."
|
|
724
|
+
},
|
|
725
|
+
"aliases": {
|
|
726
|
+
"type": "array",
|
|
727
|
+
"items": {
|
|
728
|
+
"type": "string"
|
|
729
|
+
},
|
|
730
|
+
"description": "Aliases are words that find the choice when a person searches the catalogue (smith compose): \"desktop\", \"serverless\", \"web\"."
|
|
731
|
+
},
|
|
732
|
+
"layer": {
|
|
733
|
+
"type": "string",
|
|
734
|
+
"description": "Layer is where the choice sits in the stack of a project: \"framework\", \"shell\" (a desktop shell), \"host\" (where cloud code runs), \"test\", \"lint\", \"style\" or a layer of the plugin's own. Without it the layer is the axis. It is for display and grouping: the axis decides conflicts."
|
|
735
|
+
},
|
|
695
736
|
"language": {
|
|
696
737
|
"type": "string",
|
|
697
738
|
"description": "Language is the language plugin the choice applies to (\"node\")."
|
|
@@ -714,6 +755,10 @@ export const protocolSchema = {
|
|
|
714
755
|
"type": "boolean",
|
|
715
756
|
"description": "Default marks the choice the host adds when a selection needs its axis and has no choice on it."
|
|
716
757
|
},
|
|
758
|
+
"suggested": {
|
|
759
|
+
"type": "boolean",
|
|
760
|
+
"description": "Suggested marks the choice an asker pre-selects on its axis. The solver never adds it by itself: an axis that a choice needs and that has no Default is asked, and the person answers (ADR 0072)."
|
|
761
|
+
},
|
|
717
762
|
"many": {
|
|
718
763
|
"type": "boolean",
|
|
719
764
|
"description": "Many allows the choice next to other choices of its axis that are Many too. By default a selection has one choice per axis."
|
|
@@ -1589,6 +1634,13 @@ export const protocolSchema = {
|
|
|
1589
1634
|
"$ref": "#/$defs/Choice"
|
|
1590
1635
|
},
|
|
1591
1636
|
"description": "Choices are the options on an axis (framework, test, style) the plugin owns. The host lists them (smith choices) and checks a selection of them (smith add --with). Absent means the plugin owns none."
|
|
1637
|
+
},
|
|
1638
|
+
"tools": {
|
|
1639
|
+
"type": "array",
|
|
1640
|
+
"items": {
|
|
1641
|
+
"$ref": "#/$defs/ToolNeed"
|
|
1642
|
+
},
|
|
1643
|
+
"description": "Tools are the programs the plugin needs on the person's machine. The host detects them and, when one is missing, presents the ways to get it (smith tools). Absent means the plugin declares none."
|
|
1592
1644
|
}
|
|
1593
1645
|
},
|
|
1594
1646
|
"required": [
|
|
@@ -1685,6 +1737,94 @@ export const protocolSchema = {
|
|
|
1685
1737
|
}
|
|
1686
1738
|
}
|
|
1687
1739
|
},
|
|
1740
|
+
"LinkOption": {
|
|
1741
|
+
"description": "LinkOption is one way to write the dependency, with its consequence in words a person who read no manual can follow.",
|
|
1742
|
+
"type": "object",
|
|
1743
|
+
"properties": {
|
|
1744
|
+
"spec": {
|
|
1745
|
+
"type": "string",
|
|
1746
|
+
"description": "Spec is the value passed back in LinkParams.Spec."
|
|
1747
|
+
},
|
|
1748
|
+
"label": {
|
|
1749
|
+
"type": "string",
|
|
1750
|
+
"description": "Label is the option in a few words."
|
|
1751
|
+
},
|
|
1752
|
+
"meaning": {
|
|
1753
|
+
"type": "string",
|
|
1754
|
+
"description": "Meaning says what happens with this option."
|
|
1755
|
+
}
|
|
1756
|
+
},
|
|
1757
|
+
"required": [
|
|
1758
|
+
"spec",
|
|
1759
|
+
"label",
|
|
1760
|
+
"meaning"
|
|
1761
|
+
]
|
|
1762
|
+
},
|
|
1763
|
+
"LinkParams": {
|
|
1764
|
+
"description": "LinkParams asks a plugin to make Project depend on Library, a lib or package of the same workspace and language, in the ecosystem's own form, and to install or lock as that needs. The host has checked that both exist, that the languages match, that Library is not an app, and that the link makes no cycle; the plugin answers with an error that names the file when it cannot write the dependency.",
|
|
1765
|
+
"type": "object",
|
|
1766
|
+
"properties": {
|
|
1767
|
+
"project": {
|
|
1768
|
+
"$ref": "#/$defs/Project",
|
|
1769
|
+
"description": "Project is the project that gains the dependency."
|
|
1770
|
+
},
|
|
1771
|
+
"library": {
|
|
1772
|
+
"$ref": "#/$defs/Project",
|
|
1773
|
+
"description": "Library is the project it depends on."
|
|
1774
|
+
},
|
|
1775
|
+
"quiet": {
|
|
1776
|
+
"type": "boolean",
|
|
1777
|
+
"description": "Quiet keeps the package manager's output unless it fails."
|
|
1778
|
+
},
|
|
1779
|
+
"plan": {
|
|
1780
|
+
"type": "boolean",
|
|
1781
|
+
"description": "Plan asks for the plan only: the plugin writes nothing and answers with the manifest, the line it would write and the choices the user has."
|
|
1782
|
+
},
|
|
1783
|
+
"spec": {
|
|
1784
|
+
"type": "string",
|
|
1785
|
+
"description": "Spec is the version range the user chose from LinkResult.Options; empty means the plugin's default, or the form the workspace already uses."
|
|
1786
|
+
}
|
|
1787
|
+
},
|
|
1788
|
+
"required": [
|
|
1789
|
+
"project",
|
|
1790
|
+
"library"
|
|
1791
|
+
]
|
|
1792
|
+
},
|
|
1793
|
+
"LinkResult": {
|
|
1794
|
+
"description": "LinkResult is what a link wrote, or with LinkParams.Plan would write.",
|
|
1795
|
+
"type": "object",
|
|
1796
|
+
"properties": {
|
|
1797
|
+
"files": {
|
|
1798
|
+
"type": "array",
|
|
1799
|
+
"items": {
|
|
1800
|
+
"type": "string"
|
|
1801
|
+
},
|
|
1802
|
+
"description": "Files are the workspace-relative files changed (or to be changed)."
|
|
1803
|
+
},
|
|
1804
|
+
"notes": {
|
|
1805
|
+
"type": "array",
|
|
1806
|
+
"items": {
|
|
1807
|
+
"type": "string"
|
|
1808
|
+
},
|
|
1809
|
+
"description": "Notes are for the user."
|
|
1810
|
+
},
|
|
1811
|
+
"manifest": {
|
|
1812
|
+
"type": "string",
|
|
1813
|
+
"description": "Manifest is the file the dependency goes into, workspace-relative."
|
|
1814
|
+
},
|
|
1815
|
+
"line": {
|
|
1816
|
+
"type": "string",
|
|
1817
|
+
"description": "Line is the dependency as it is written there, for the plan shown before anything is written (\"@acme/core\": \"*\")."
|
|
1818
|
+
},
|
|
1819
|
+
"options": {
|
|
1820
|
+
"type": "array",
|
|
1821
|
+
"items": {
|
|
1822
|
+
"$ref": "#/$defs/LinkOption"
|
|
1823
|
+
},
|
|
1824
|
+
"description": "Options are the real choices of the range written, with the default first. Empty when the ecosystem has none, or the workspace already follows a convention (then Line shows it)."
|
|
1825
|
+
}
|
|
1826
|
+
}
|
|
1827
|
+
},
|
|
1688
1828
|
"PackageStore": {
|
|
1689
1829
|
"description": "PackageStore is where a package manager keeps what it downloaded (npm's ~/.npm, Go's module cache). A generated pipeline restores it before setup and saves it after a run, keyed on Files, so `npm ci` or `go mod download` fetches only what changed. A pull request from a fork restores it and never writes the base repository's cache.",
|
|
1690
1830
|
"type": "object",
|
|
@@ -1924,6 +2064,13 @@ export const protocolSchema = {
|
|
|
1924
2064
|
"registry": {
|
|
1925
2065
|
"type": "string"
|
|
1926
2066
|
},
|
|
2067
|
+
"notes": {
|
|
2068
|
+
"type": "array",
|
|
2069
|
+
"items": {
|
|
2070
|
+
"type": "string"
|
|
2071
|
+
},
|
|
2072
|
+
"description": "Notes are things the person must know about a publish that succeeded, such as a dist-tag that was not moved; the host prints them and the report keeps them."
|
|
2073
|
+
},
|
|
1927
2074
|
"assets": {
|
|
1928
2075
|
"type": "array",
|
|
1929
2076
|
"items": {
|
|
@@ -2402,6 +2549,121 @@ export const protocolSchema = {
|
|
|
2402
2549
|
"command"
|
|
2403
2550
|
]
|
|
2404
2551
|
},
|
|
2552
|
+
"ToolInstall": {
|
|
2553
|
+
"description": "ToolInstall is one way to get a tool with a package manager. Manager is one of: \"winget\", \"brew\", \"brew-cask\", \"apt\", \"dnf\", \"pacman\", \"npm\", \"uv\", \"fnm\" and \"rustup\". The host builds the exact command from the manager and Package; Package may hold {major} and {major.minor}, which the pinned or suggested version fills. The language's own installers (uv, fnm, rustup) are offered only when they are already on the machine.",
|
|
2554
|
+
"type": "object",
|
|
2555
|
+
"properties": {
|
|
2556
|
+
"manager": {
|
|
2557
|
+
"type": "string"
|
|
2558
|
+
},
|
|
2559
|
+
"package": {
|
|
2560
|
+
"type": "string"
|
|
2561
|
+
},
|
|
2562
|
+
"note": {
|
|
2563
|
+
"type": "string",
|
|
2564
|
+
"description": "Note adds a sentence the person needs before choosing (\"a new terminal is needed\")."
|
|
2565
|
+
}
|
|
2566
|
+
},
|
|
2567
|
+
"required": [
|
|
2568
|
+
"manager",
|
|
2569
|
+
"package"
|
|
2570
|
+
]
|
|
2571
|
+
},
|
|
2572
|
+
"ToolNeed": {
|
|
2573
|
+
"description": "ToolNeed is a program on the person's machine that a plugin needs to build, test or run its projects (Python, the .NET SDK, Docker). A plugin publishes the tools it needs in InitializeResult.Tools. The host detects them, and when one is missing it presents the ways to get it (ADR 0077): it never installs in silence. The plugin writes facts only (what the tool is, how to detect it, how each system gets it); the host decides how to ask.",
|
|
2574
|
+
"type": "object",
|
|
2575
|
+
"properties": {
|
|
2576
|
+
"name": {
|
|
2577
|
+
"type": "string",
|
|
2578
|
+
"description": "Name identifies the tool across plugins and in commands (smith tools install python). Two plugins that need the same tool use the same Name."
|
|
2579
|
+
},
|
|
2580
|
+
"title": {
|
|
2581
|
+
"type": "string",
|
|
2582
|
+
"description": "Title is what the tool is called in text: \"Python\", \"the .NET SDK\". Doctor words the check \"<Title> is installed\"."
|
|
2583
|
+
},
|
|
2584
|
+
"why": {
|
|
2585
|
+
"type": "string",
|
|
2586
|
+
"description": "Why says in plain words what smith needs the tool for."
|
|
2587
|
+
},
|
|
2588
|
+
"consequence": {
|
|
2589
|
+
"type": "string",
|
|
2590
|
+
"description": "Consequence says what stops working while the tool is missing, as the end of a sentence that starts \"If you skip it, \": \"smith test and smith build fail for the python projects\"."
|
|
2591
|
+
},
|
|
2592
|
+
"program": {
|
|
2593
|
+
"type": "string",
|
|
2594
|
+
"description": "Program is the program that carries the tool on PATH (\"python3\")."
|
|
2595
|
+
},
|
|
2596
|
+
"alternatives": {
|
|
2597
|
+
"type": "array",
|
|
2598
|
+
"items": {
|
|
2599
|
+
"type": "string"
|
|
2600
|
+
},
|
|
2601
|
+
"description": "Alternatives are other programs that also count (\"python\", \"py\")."
|
|
2602
|
+
},
|
|
2603
|
+
"versionArgs": {
|
|
2604
|
+
"type": "array",
|
|
2605
|
+
"items": {
|
|
2606
|
+
"type": "string"
|
|
2607
|
+
},
|
|
2608
|
+
"description": "VersionArgs are the arguments that make Program print its version. Absent means --version."
|
|
2609
|
+
},
|
|
2610
|
+
"pins": {
|
|
2611
|
+
"type": "array",
|
|
2612
|
+
"items": {
|
|
2613
|
+
"$ref": "#/$defs/ToolVersionPin"
|
|
2614
|
+
},
|
|
2615
|
+
"description": "Pins are the files where a workspace pins the version it wants. The first pin the host finds gives the version range. Absent means any version counts."
|
|
2616
|
+
},
|
|
2617
|
+
"choice": {
|
|
2618
|
+
"type": "string",
|
|
2619
|
+
"description": "Choice limits the tool to stacks that have this choice (\"azure-functions\"): the tool is not needed by a project built without it. Absent means every project of the plugin needs it."
|
|
2620
|
+
},
|
|
2621
|
+
"systems": {
|
|
2622
|
+
"type": "array",
|
|
2623
|
+
"items": {
|
|
2624
|
+
"type": "string"
|
|
2625
|
+
},
|
|
2626
|
+
"description": "Systems limits the tool to these systems, named as Go names them (\"windows\", \"darwin\", \"linux\"): the Xcode Command Line Tools exist only on \"darwin\". Absent means every system."
|
|
2627
|
+
},
|
|
2628
|
+
"suggested": {
|
|
2629
|
+
"type": "string",
|
|
2630
|
+
"description": "Suggested is the version smith installs when no pin says one: \"3.13\". It fills {major} and {major.minor} in the install entries."
|
|
2631
|
+
},
|
|
2632
|
+
"optional": {
|
|
2633
|
+
"type": "boolean",
|
|
2634
|
+
"description": "Optional marks a tool whose absence only costs a feature (running a function app locally). Doctor reports it as a warning, not a failure."
|
|
2635
|
+
},
|
|
2636
|
+
"install": {
|
|
2637
|
+
"type": "array",
|
|
2638
|
+
"items": {
|
|
2639
|
+
"$ref": "#/$defs/ToolInstall"
|
|
2640
|
+
},
|
|
2641
|
+
"description": "Install are the ways to get the tool, per package manager and system."
|
|
2642
|
+
},
|
|
2643
|
+
"download": {
|
|
2644
|
+
"type": "string",
|
|
2645
|
+
"description": "Download is the official page of the tool, for the person who installs it by hand or has no package manager."
|
|
2646
|
+
},
|
|
2647
|
+
"source": {
|
|
2648
|
+
"type": "string",
|
|
2649
|
+
"description": "Source is the address of the page the Install entries were checked against."
|
|
2650
|
+
},
|
|
2651
|
+
"checked": {
|
|
2652
|
+
"type": "string",
|
|
2653
|
+
"description": "Checked is the date (YYYY-MM-DD) the entries were last checked."
|
|
2654
|
+
}
|
|
2655
|
+
},
|
|
2656
|
+
"required": [
|
|
2657
|
+
"name",
|
|
2658
|
+
"title",
|
|
2659
|
+
"why",
|
|
2660
|
+
"consequence",
|
|
2661
|
+
"program",
|
|
2662
|
+
"download",
|
|
2663
|
+
"source",
|
|
2664
|
+
"checked"
|
|
2665
|
+
]
|
|
2666
|
+
},
|
|
2405
2667
|
"ToolPin": {
|
|
2406
2668
|
"description": "ToolPin is a tool the plugin installs at a pinned version (in CI, the dev container, the venv) against the newest release; informational.",
|
|
2407
2669
|
"type": "object",
|
|
@@ -2426,6 +2688,23 @@ export const protocolSchema = {
|
|
|
2426
2688
|
"pinned"
|
|
2427
2689
|
]
|
|
2428
2690
|
},
|
|
2691
|
+
"ToolVersionPin": {
|
|
2692
|
+
"description": "ToolVersionPin names a file that pins the version of a tool and how to read it. Format is one of: \"text\" (the first word of the file, as in .nvmrc and .python-version), \"go-mod\" (the toolchain line, else the go line), \"pyproject\" (requires-python), \"global-json\" (sdk.version) and \"rust-toolchain\" (the channel).",
|
|
2693
|
+
"type": "object",
|
|
2694
|
+
"properties": {
|
|
2695
|
+
"file": {
|
|
2696
|
+
"type": "string",
|
|
2697
|
+
"description": "File is the base name of the file, looked up at the workspace root and in the folders of the projects that use the tool."
|
|
2698
|
+
},
|
|
2699
|
+
"format": {
|
|
2700
|
+
"type": "string"
|
|
2701
|
+
}
|
|
2702
|
+
},
|
|
2703
|
+
"required": [
|
|
2704
|
+
"file",
|
|
2705
|
+
"format"
|
|
2706
|
+
]
|
|
2707
|
+
},
|
|
2429
2708
|
"Toolchain": {
|
|
2430
2709
|
"description": "Toolchain is a runtime the pipeline must install, and how. Plugins asking for the same name share one setup step (the first plugin's).",
|
|
2431
2710
|
"type": "object",
|
|
@@ -2477,6 +2756,22 @@ export const protocolSchema = {
|
|
|
2477
2756
|
"packages"
|
|
2478
2757
|
]
|
|
2479
2758
|
},
|
|
2759
|
+
"UnlinkParams": {
|
|
2760
|
+
"description": "UnlinkParams asks a plugin to remove the dependency of Project on Library. Notes of the result say so when the manifest held no such dependency.",
|
|
2761
|
+
"type": "object",
|
|
2762
|
+
"properties": {
|
|
2763
|
+
"project": {
|
|
2764
|
+
"$ref": "#/$defs/Project"
|
|
2765
|
+
},
|
|
2766
|
+
"library": {
|
|
2767
|
+
"$ref": "#/$defs/Project"
|
|
2768
|
+
}
|
|
2769
|
+
},
|
|
2770
|
+
"required": [
|
|
2771
|
+
"project",
|
|
2772
|
+
"library"
|
|
2773
|
+
]
|
|
2774
|
+
},
|
|
2480
2775
|
"VersionParams": {
|
|
2481
2776
|
"description": "VersionParams asks a plugin to record a new version in a project manifest.",
|
|
2482
2777
|
"type": "object",
|
|
@@ -177,6 +177,13 @@ export interface Capabilities {
|
|
|
177
177
|
published?: boolean;
|
|
178
178
|
/** Dependencies installs and uninstalls packages in its projects. */
|
|
179
179
|
dependencies?: boolean;
|
|
180
|
+
/**
|
|
181
|
+
* Link makes a project depend on a library of the same workspace in the ecosystem's own form (a
|
|
182
|
+
* workspace dependency, a path dependency, a project reference), and takes it out again. A plugin
|
|
183
|
+
* without it is refused by the host with one sentence that tells the user to add the dependency
|
|
184
|
+
* by hand.
|
|
185
|
+
*/
|
|
186
|
+
link?: boolean;
|
|
180
187
|
/** Declarations lists and rewrites declared dependency specs (sync, up). */
|
|
181
188
|
declarations?: boolean;
|
|
182
189
|
/** Latest reports the newest releases of dependencies and pinned tools. */
|
|
@@ -272,6 +279,19 @@ export interface Choice {
|
|
|
272
279
|
*/
|
|
273
280
|
name: string;
|
|
274
281
|
description?: string;
|
|
282
|
+
/** Title is the name shown to a person ("Electron" for electron). Without it the name is shown. */
|
|
283
|
+
title?: string;
|
|
284
|
+
/**
|
|
285
|
+
* Aliases are words that find the choice when a person searches the catalogue (smith compose):
|
|
286
|
+
* "desktop", "serverless", "web".
|
|
287
|
+
*/
|
|
288
|
+
aliases?: string[];
|
|
289
|
+
/**
|
|
290
|
+
* Layer is where the choice sits in the stack of a project: "framework", "shell" (a desktop
|
|
291
|
+
* shell), "host" (where cloud code runs), "test", "lint", "style" or a layer of the plugin's own.
|
|
292
|
+
* Without it the layer is the axis. It is for display and grouping: the axis decides conflicts.
|
|
293
|
+
*/
|
|
294
|
+
layer?: string;
|
|
275
295
|
/** Language is the language plugin the choice applies to ("node"). */
|
|
276
296
|
language: string;
|
|
277
297
|
/**
|
|
@@ -287,6 +307,12 @@ export interface Choice {
|
|
|
287
307
|
needs?: string[];
|
|
288
308
|
/** Default marks the choice the host adds when a selection needs its axis and has no choice on it. */
|
|
289
309
|
default?: boolean;
|
|
310
|
+
/**
|
|
311
|
+
* Suggested marks the choice an asker pre-selects on its axis. The solver never adds it by
|
|
312
|
+
* itself: an axis that a choice needs and that has no Default is asked, and the person answers
|
|
313
|
+
* (ADR 0072).
|
|
314
|
+
*/
|
|
315
|
+
suggested?: boolean;
|
|
290
316
|
/**
|
|
291
317
|
* Many allows the choice next to other choices of its axis that are Many too. By default a
|
|
292
318
|
* selection has one choice per axis.
|
|
@@ -773,6 +799,12 @@ export interface InitializeResult {
|
|
|
773
799
|
* owns none.
|
|
774
800
|
*/
|
|
775
801
|
choices?: Choice[];
|
|
802
|
+
/**
|
|
803
|
+
* Tools are the programs the plugin needs on the person's machine. The host detects them and,
|
|
804
|
+
* when one is missing, presents the ways to get it (smith tools). Absent means the plugin
|
|
805
|
+
* declares none.
|
|
806
|
+
*/
|
|
807
|
+
tools?: ToolNeed[];
|
|
776
808
|
}
|
|
777
809
|
/**
|
|
778
810
|
* Input is one input of an ActionStep. Values are written as quoted YAML strings, except true and
|
|
@@ -825,6 +857,62 @@ export interface LatestResult {
|
|
|
825
857
|
unreachable?: Record<string, string>;
|
|
826
858
|
tools?: ToolPin[];
|
|
827
859
|
}
|
|
860
|
+
/**
|
|
861
|
+
* LinkOption is one way to write the dependency, with its consequence in words a person who read no
|
|
862
|
+
* manual can follow.
|
|
863
|
+
*/
|
|
864
|
+
export interface LinkOption {
|
|
865
|
+
/** Spec is the value passed back in LinkParams.Spec. */
|
|
866
|
+
spec: string;
|
|
867
|
+
/** Label is the option in a few words. */
|
|
868
|
+
label: string;
|
|
869
|
+
/** Meaning says what happens with this option. */
|
|
870
|
+
meaning: string;
|
|
871
|
+
}
|
|
872
|
+
/**
|
|
873
|
+
* LinkParams asks a plugin to make Project depend on Library, a lib or package of the same
|
|
874
|
+
* workspace and language, in the ecosystem's own form, and to install or lock as that needs. The
|
|
875
|
+
* host has checked that both exist, that the languages match, that Library is not an app, and that
|
|
876
|
+
* the link makes no cycle; the plugin answers with an error that names the file when it cannot
|
|
877
|
+
* write the dependency.
|
|
878
|
+
*/
|
|
879
|
+
export interface LinkParams {
|
|
880
|
+
/** Project is the project that gains the dependency. */
|
|
881
|
+
project: Project;
|
|
882
|
+
/** Library is the project it depends on. */
|
|
883
|
+
library: Project;
|
|
884
|
+
/** Quiet keeps the package manager's output unless it fails. */
|
|
885
|
+
quiet?: boolean;
|
|
886
|
+
/**
|
|
887
|
+
* Plan asks for the plan only: the plugin writes nothing and answers with the manifest, the line
|
|
888
|
+
* it would write and the choices the user has.
|
|
889
|
+
*/
|
|
890
|
+
plan?: boolean;
|
|
891
|
+
/**
|
|
892
|
+
* Spec is the version range the user chose from LinkResult.Options; empty means the plugin's
|
|
893
|
+
* default, or the form the workspace already uses.
|
|
894
|
+
*/
|
|
895
|
+
spec?: string;
|
|
896
|
+
}
|
|
897
|
+
/** LinkResult is what a link wrote, or with LinkParams.Plan would write. */
|
|
898
|
+
export interface LinkResult {
|
|
899
|
+
/** Files are the workspace-relative files changed (or to be changed). */
|
|
900
|
+
files?: string[];
|
|
901
|
+
/** Notes are for the user. */
|
|
902
|
+
notes?: string[];
|
|
903
|
+
/** Manifest is the file the dependency goes into, workspace-relative. */
|
|
904
|
+
manifest?: string;
|
|
905
|
+
/**
|
|
906
|
+
* Line is the dependency as it is written there, for the plan shown before anything is written
|
|
907
|
+
* ("@acme/core": "*").
|
|
908
|
+
*/
|
|
909
|
+
line?: string;
|
|
910
|
+
/**
|
|
911
|
+
* Options are the real choices of the range written, with the default first. Empty when the
|
|
912
|
+
* ecosystem has none, or the workspace already follows a convention (then Line shows it).
|
|
913
|
+
*/
|
|
914
|
+
options?: LinkOption[];
|
|
915
|
+
}
|
|
828
916
|
/**
|
|
829
917
|
* PackageStore is where a package manager keeps what it downloaded (npm's ~/.npm, Go's module
|
|
830
918
|
* cache). A generated pipeline restores it before setup and saves it after a run, keyed on Files,
|
|
@@ -1012,6 +1100,11 @@ export interface PublishResult {
|
|
|
1012
1100
|
published: boolean;
|
|
1013
1101
|
skipped?: string;
|
|
1014
1102
|
registry?: string;
|
|
1103
|
+
/**
|
|
1104
|
+
* Notes are things the person must know about a publish that succeeded, such as a dist-tag that
|
|
1105
|
+
* was not moved; the host prints them and the report keeps them.
|
|
1106
|
+
*/
|
|
1107
|
+
notes?: string[];
|
|
1015
1108
|
/**
|
|
1016
1109
|
* Assets are the workspace-relative files built for the release, in upload order; in a dry run,
|
|
1017
1110
|
* the files that would be built.
|
|
@@ -1258,6 +1351,87 @@ export interface Task {
|
|
|
1258
1351
|
/** ServeTimeout is how long to wait for ServeURL, as a Go duration ("60s"); empty means 60s. */
|
|
1259
1352
|
serveTimeout?: string;
|
|
1260
1353
|
}
|
|
1354
|
+
/**
|
|
1355
|
+
* ToolInstall is one way to get a tool with a package manager. Manager is one of: "winget", "brew",
|
|
1356
|
+
* "brew-cask", "apt", "dnf", "pacman", "npm", "uv", "fnm" and "rustup". The host builds the exact
|
|
1357
|
+
* command from the manager and Package; Package may hold {major} and {major.minor}, which the
|
|
1358
|
+
* pinned or suggested version fills. The language's own installers (uv, fnm, rustup) are offered
|
|
1359
|
+
* only when they are already on the machine.
|
|
1360
|
+
*/
|
|
1361
|
+
export interface ToolInstall {
|
|
1362
|
+
manager: string;
|
|
1363
|
+
package: string;
|
|
1364
|
+
/** Note adds a sentence the person needs before choosing ("a new terminal is needed"). */
|
|
1365
|
+
note?: string;
|
|
1366
|
+
}
|
|
1367
|
+
/**
|
|
1368
|
+
* ToolNeed is a program on the person's machine that a plugin needs to build, test or run its
|
|
1369
|
+
* projects (Python, the .NET SDK, Docker). A plugin publishes the tools it needs in
|
|
1370
|
+
* InitializeResult.Tools. The host detects them, and when one is missing it presents the ways to
|
|
1371
|
+
* get it (ADR 0077): it never installs in silence. The plugin writes facts only (what the tool is,
|
|
1372
|
+
* how to detect it, how each system gets it); the host decides how to ask.
|
|
1373
|
+
*/
|
|
1374
|
+
export interface ToolNeed {
|
|
1375
|
+
/**
|
|
1376
|
+
* Name identifies the tool across plugins and in commands (smith tools install python). Two
|
|
1377
|
+
* plugins that need the same tool use the same Name.
|
|
1378
|
+
*/
|
|
1379
|
+
name: string;
|
|
1380
|
+
/**
|
|
1381
|
+
* Title is what the tool is called in text: "Python", "the .NET SDK". Doctor words the check
|
|
1382
|
+
* "<Title> is installed".
|
|
1383
|
+
*/
|
|
1384
|
+
title: string;
|
|
1385
|
+
/** Why says in plain words what smith needs the tool for. */
|
|
1386
|
+
why: string;
|
|
1387
|
+
/**
|
|
1388
|
+
* Consequence says what stops working while the tool is missing, as the end of a sentence that
|
|
1389
|
+
* starts "If you skip it, ": "smith test and smith build fail for the python projects".
|
|
1390
|
+
*/
|
|
1391
|
+
consequence: string;
|
|
1392
|
+
/** Program is the program that carries the tool on PATH ("python3"). */
|
|
1393
|
+
program: string;
|
|
1394
|
+
/** Alternatives are other programs that also count ("python", "py"). */
|
|
1395
|
+
alternatives?: string[];
|
|
1396
|
+
/** VersionArgs are the arguments that make Program print its version. Absent means --version. */
|
|
1397
|
+
versionArgs?: string[];
|
|
1398
|
+
/**
|
|
1399
|
+
* Pins are the files where a workspace pins the version it wants. The first pin the host finds
|
|
1400
|
+
* gives the version range. Absent means any version counts.
|
|
1401
|
+
*/
|
|
1402
|
+
pins?: ToolVersionPin[];
|
|
1403
|
+
/**
|
|
1404
|
+
* Choice limits the tool to stacks that have this choice ("azure-functions"): the tool is not
|
|
1405
|
+
* needed by a project built without it. Absent means every project of the plugin needs it.
|
|
1406
|
+
*/
|
|
1407
|
+
choice?: string;
|
|
1408
|
+
/**
|
|
1409
|
+
* Systems limits the tool to these systems, named as Go names them ("windows", "darwin",
|
|
1410
|
+
* "linux"): the Xcode Command Line Tools exist only on "darwin". Absent means every system.
|
|
1411
|
+
*/
|
|
1412
|
+
systems?: string[];
|
|
1413
|
+
/**
|
|
1414
|
+
* Suggested is the version smith installs when no pin says one: "3.13". It fills {major} and
|
|
1415
|
+
* {major.minor} in the install entries.
|
|
1416
|
+
*/
|
|
1417
|
+
suggested?: string;
|
|
1418
|
+
/**
|
|
1419
|
+
* Optional marks a tool whose absence only costs a feature (running a function app locally).
|
|
1420
|
+
* Doctor reports it as a warning, not a failure.
|
|
1421
|
+
*/
|
|
1422
|
+
optional?: boolean;
|
|
1423
|
+
/** Install are the ways to get the tool, per package manager and system. */
|
|
1424
|
+
install?: ToolInstall[];
|
|
1425
|
+
/**
|
|
1426
|
+
* Download is the official page of the tool, for the person who installs it by hand or has no
|
|
1427
|
+
* package manager.
|
|
1428
|
+
*/
|
|
1429
|
+
download: string;
|
|
1430
|
+
/** Source is the address of the page the Install entries were checked against. */
|
|
1431
|
+
source: string;
|
|
1432
|
+
/** Checked is the date (YYYY-MM-DD) the entries were last checked. */
|
|
1433
|
+
checked: string;
|
|
1434
|
+
}
|
|
1261
1435
|
/**
|
|
1262
1436
|
* ToolPin is a tool the plugin installs at a pinned version (in CI, the dev container, the venv)
|
|
1263
1437
|
* against the newest release; informational.
|
|
@@ -1270,6 +1444,20 @@ export interface ToolPin {
|
|
|
1270
1444
|
/** Newer is true when Latest is a release the pin does not cover. */
|
|
1271
1445
|
newer?: boolean;
|
|
1272
1446
|
}
|
|
1447
|
+
/**
|
|
1448
|
+
* ToolVersionPin names a file that pins the version of a tool and how to read it. Format is one of:
|
|
1449
|
+
* "text" (the first word of the file, as in .nvmrc and .python-version), "go-mod" (the toolchain
|
|
1450
|
+
* line, else the go line), "pyproject" (requires-python), "global-json" (sdk.version) and
|
|
1451
|
+
* "rust-toolchain" (the channel).
|
|
1452
|
+
*/
|
|
1453
|
+
export interface ToolVersionPin {
|
|
1454
|
+
/**
|
|
1455
|
+
* File is the base name of the file, looked up at the workspace root and in the folders of the
|
|
1456
|
+
* projects that use the tool.
|
|
1457
|
+
*/
|
|
1458
|
+
file: string;
|
|
1459
|
+
format: string;
|
|
1460
|
+
}
|
|
1273
1461
|
/**
|
|
1274
1462
|
* Toolchain is a runtime the pipeline must install, and how. Plugins asking for the same name share
|
|
1275
1463
|
* one setup step (the first plugin's).
|
|
@@ -1297,6 +1485,14 @@ export interface UninstallParams {
|
|
|
1297
1485
|
project: Project;
|
|
1298
1486
|
packages: string[];
|
|
1299
1487
|
}
|
|
1488
|
+
/**
|
|
1489
|
+
* UnlinkParams asks a plugin to remove the dependency of Project on Library. Notes of the result
|
|
1490
|
+
* say so when the manifest held no such dependency.
|
|
1491
|
+
*/
|
|
1492
|
+
export interface UnlinkParams {
|
|
1493
|
+
project: Project;
|
|
1494
|
+
library: Project;
|
|
1495
|
+
}
|
|
1300
1496
|
/** VersionParams asks a plugin to record a new version in a project manifest. */
|
|
1301
1497
|
export interface VersionParams {
|
|
1302
1498
|
project: Project;
|
|
@@ -1433,6 +1629,21 @@ export interface ProtocolMethods {
|
|
|
1433
1629
|
result: DependencyResult;
|
|
1434
1630
|
capability: 'dependencies';
|
|
1435
1631
|
};
|
|
1632
|
+
/**
|
|
1633
|
+
* Makes a project depend on a library of the same workspace and language, in the ecosystem's own
|
|
1634
|
+
* form, then installs or locks as that needs.
|
|
1635
|
+
*/
|
|
1636
|
+
'dependencies/link': {
|
|
1637
|
+
params: LinkParams;
|
|
1638
|
+
result: LinkResult;
|
|
1639
|
+
capability: 'link';
|
|
1640
|
+
};
|
|
1641
|
+
/** Removes the dependency of a project on a library of the same workspace. */
|
|
1642
|
+
'dependencies/unlink': {
|
|
1643
|
+
params: UnlinkParams;
|
|
1644
|
+
result: DependencyResult;
|
|
1645
|
+
capability: 'link';
|
|
1646
|
+
};
|
|
1436
1647
|
/** Lists the dependencies the manifests of the plugin's projects declare. */
|
|
1437
1648
|
'dependencies/declared': {
|
|
1438
1649
|
params: DeclaredParams;
|
package/serve/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { serve, serveStreams } from './serve.use-case.ts';
|
|
2
2
|
export { capabilitiesOf, implementsMethod } from './capabilities-of.algorithm.ts';
|
|
3
|
-
export type { APISurfaceReader, Awaitable, Cancellable, CIContributor, ComponentLister, Contributor, DeclarationEditor, DependencyManager, Deriver, Discoverer, DoctorContributor, Generator, KindChanger, LatestReader, Plugin, PluginDescription, Publisher, RegistryReader, Remover, SmithPlugin, Versioner, } from './plugin.contract.ts';
|
|
3
|
+
export type { APISurfaceReader, Awaitable, Cancellable, CIContributor, ComponentLister, Contributor, DeclarationEditor, DependencyManager, Deriver, Discoverer, DoctorContributor, Generator, KindChanger, LatestReader, Linker, Plugin, PluginDescription, Publisher, RegistryReader, Remover, SmithPlugin, Versioner, } from './plugin.contract.ts';
|
|
4
4
|
export type { FrameSink, ServeStreams } from './protocol-streams.contract.ts';
|
|
@@ -20,6 +20,8 @@ export const PLUGIN_MEMBERS = {
|
|
|
20
20
|
'published': { member: 'published', requires: ['published'] },
|
|
21
21
|
'dependencies/install': { member: 'install', requires: ['install', 'uninstall'] },
|
|
22
22
|
'dependencies/uninstall': { member: 'uninstall', requires: ['install', 'uninstall'] },
|
|
23
|
+
'dependencies/link': { member: 'link', requires: ['link', 'unlink'] },
|
|
24
|
+
'dependencies/unlink': { member: 'unlink', requires: ['link', 'unlink'] },
|
|
23
25
|
'dependencies/declared': { member: 'declared', requires: ['declared', 'rewrite'] },
|
|
24
26
|
'dependencies/rewrite': { member: 'rewrite', requires: ['declared', 'rewrite'] },
|
|
25
27
|
'dependencies/latest': { member: 'latest', requires: ['latest'] },
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DeriveParams, DeriveResult, APISurfaceParams, APISurfaceResult, ChangeKindParams, ChangeKindResult, CIParams, CIResult, ComponentsParams, ComponentsResult, ContributeParams, ContributeResult, DeclaredParams, DeclaredResult, DependencyResult, DiscoverParams, DiscoverResult, DoctorParams, DoctorResult, GenerateParams, GenerateResult, InitializeParams, InitializeResult, InstallParams, LatestParams, LatestResult, PublishedParams, PublishedResult, PublishParams, PublishResult, RemoveParams, RemoveResult, RewriteParams, UninstallParams, VersionParams, VersionResult } from '../protocol/index.ts';
|
|
1
|
+
import type { DeriveParams, DeriveResult, APISurfaceParams, APISurfaceResult, ChangeKindParams, ChangeKindResult, CIParams, CIResult, ComponentsParams, ComponentsResult, ContributeParams, ContributeResult, DeclaredParams, DeclaredResult, DependencyResult, DiscoverParams, DiscoverResult, DoctorParams, DoctorResult, GenerateParams, GenerateResult, InitializeParams, InitializeResult, InstallParams, LatestParams, LatestResult, LinkParams, LinkResult, PublishedParams, PublishedResult, PublishParams, PublishResult, RemoveParams, RemoveResult, RewriteParams, UninstallParams, UnlinkParams, VersionParams, VersionResult } from '../protocol/index.ts';
|
|
2
2
|
/** A result now or later: every method of a plugin may be `async`. */
|
|
3
3
|
export type Awaitable<T> = T | Promise<T>;
|
|
4
4
|
/** What a plugin says about itself. The serve loop fills in `protocolVersion` and `capabilities`. */
|
|
@@ -61,6 +61,11 @@ export interface DependencyManager {
|
|
|
61
61
|
install: (params: InstallParams, signal: AbortSignal) => Awaitable<DependencyResult>;
|
|
62
62
|
uninstall: (params: UninstallParams, signal: AbortSignal) => Awaitable<DependencyResult>;
|
|
63
63
|
}
|
|
64
|
+
/** `dependencies/link` and `dependencies/unlink`: both, or the capability is not advertised. */
|
|
65
|
+
export interface Linker {
|
|
66
|
+
link: (params: LinkParams, signal: AbortSignal) => Awaitable<LinkResult>;
|
|
67
|
+
unlink: (params: UnlinkParams, signal: AbortSignal) => Awaitable<DependencyResult>;
|
|
68
|
+
}
|
|
64
69
|
/** `dependencies/declared` and `dependencies/rewrite`: both, or the capability is not advertised. */
|
|
65
70
|
export interface DeclarationEditor {
|
|
66
71
|
declared: (params: DeclaredParams, signal: AbortSignal) => Awaitable<DeclaredResult>;
|
|
@@ -93,4 +98,4 @@ export interface Cancellable {
|
|
|
93
98
|
* from `cancellable`. How many requests it can work on at once is declared in
|
|
94
99
|
* `describe`'s `concurrency`: omit it for one at a time, in order.
|
|
95
100
|
*/
|
|
96
|
-
export type SmithPlugin = Plugin & Partial<Discoverer & Generator & Versioner & Publisher & RegistryReader & CIContributor & DoctorContributor & Remover & KindChanger & ComponentLister & Deriver & APISurfaceReader & DependencyManager & DeclarationEditor & LatestReader & Contributor & Cancellable>;
|
|
101
|
+
export type SmithPlugin = Plugin & Partial<Discoverer & Generator & Versioner & Publisher & RegistryReader & CIContributor & DoctorContributor & Remover & KindChanger & ComponentLister & Deriver & APISurfaceReader & DependencyManager & Linker & DeclarationEditor & LatestReader & Contributor & Cancellable>;
|