@basou/core 0.33.0 → 0.34.0
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/dist/index.d.ts +297 -174
- package/dist/index.js +232 -107
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1771,6 +1771,193 @@ var JA = {
|
|
|
1771
1771
|
headingIntegrity: "## \u6574\u5408\u6027"
|
|
1772
1772
|
}
|
|
1773
1773
|
};
|
|
1774
|
+
function resolveRepoContentLanguage(language) {
|
|
1775
|
+
return language === "ja" ? "ja" : "en";
|
|
1776
|
+
}
|
|
1777
|
+
function resolveAnchorContentLanguage(repos) {
|
|
1778
|
+
return resolveRepoContentLanguage(repos.find((r) => r.anchor === true)?.language);
|
|
1779
|
+
}
|
|
1780
|
+
function presetStrings(language) {
|
|
1781
|
+
return language === "ja" ? PRESET_JA : PRESET_EN;
|
|
1782
|
+
}
|
|
1783
|
+
var PRESET_EN = {
|
|
1784
|
+
repoBlock: {
|
|
1785
|
+
heading: "## Project configuration (generated by basou \u2014 the manifest is the source of truth)",
|
|
1786
|
+
intro: "This section is generated by `basou project preset` from the declarations in `.basou/manifest.yaml`. Edit the manifest, not this block (content outside the markers is preserved).",
|
|
1787
|
+
visibilityLabel: (v) => {
|
|
1788
|
+
switch (v) {
|
|
1789
|
+
case "public":
|
|
1790
|
+
return "public (the git history is public)";
|
|
1791
|
+
case "private":
|
|
1792
|
+
return "private (the git history is not public)";
|
|
1793
|
+
case "future-public":
|
|
1794
|
+
return "future-public (private today, planned to go public)";
|
|
1795
|
+
default:
|
|
1796
|
+
return "unset";
|
|
1797
|
+
}
|
|
1798
|
+
},
|
|
1799
|
+
sourceLanguageLabel: (l) => {
|
|
1800
|
+
switch (l) {
|
|
1801
|
+
case "en":
|
|
1802
|
+
return "en (commits, comments, and code in English)";
|
|
1803
|
+
case "ja":
|
|
1804
|
+
return "ja (commits, comments, and code in Japanese)";
|
|
1805
|
+
case "en+ja":
|
|
1806
|
+
return "en+ja (commits, comments, and code in English and Japanese)";
|
|
1807
|
+
default:
|
|
1808
|
+
return "unset";
|
|
1809
|
+
}
|
|
1810
|
+
},
|
|
1811
|
+
publishKindLabel: (k) => k === "web" ? "web (deployed)" : "npm (package)",
|
|
1812
|
+
publishVisibilityLabel: (v) => {
|
|
1813
|
+
switch (v) {
|
|
1814
|
+
case "public":
|
|
1815
|
+
return "public";
|
|
1816
|
+
case "private":
|
|
1817
|
+
return "private";
|
|
1818
|
+
case "future-public":
|
|
1819
|
+
return "future-public";
|
|
1820
|
+
default:
|
|
1821
|
+
return "visibility unset";
|
|
1822
|
+
}
|
|
1823
|
+
},
|
|
1824
|
+
contentLanguageLabel: (l) => l ?? "language unset",
|
|
1825
|
+
sourceVisibilityLabel: "Source visibility",
|
|
1826
|
+
sourceLanguageLineLabel: "Source language",
|
|
1827
|
+
publishesNone: "- Published surfaces: none",
|
|
1828
|
+
publishesHeader: "- Published surfaces:"
|
|
1829
|
+
},
|
|
1830
|
+
viewBlock: {
|
|
1831
|
+
heading: "## Workspace view layout (generated by basou \u2014 the manifest is the source of truth)",
|
|
1832
|
+
intro: "This section is generated by `basou project preset` from the declarations in `.basou/manifest.yaml`. Edit the manifest, not this block (content outside the markers is preserved).",
|
|
1833
|
+
selfNote: (viewName) => `This AGENTS.md is itself generated by basou (canonical: \`agents/${viewName}/AGENTS.md\`; content outside the markers is preserved).`,
|
|
1834
|
+
aggregates: (n) => `This directory is a **view** aggregating the ${n} declared repo(s) via symlinks. It holds no content of its own and is not under git.`,
|
|
1835
|
+
reposHeading: "### Aggregated repos",
|
|
1836
|
+
tableHeader: "| repo | visibility | language | instructions |",
|
|
1837
|
+
instructionsAnchor: "anchor (hand-maintained)",
|
|
1838
|
+
instructionsSelf: "self (the repo owns it)",
|
|
1839
|
+
instructionsHub: "hub (generated by basou)",
|
|
1840
|
+
unsetShort: "unset",
|
|
1841
|
+
commitHeading: "### Where to commit",
|
|
1842
|
+
commitBody: "You cannot commit in the view (it is not under git). Always `cd` into the actual repo before committing.",
|
|
1843
|
+
conventionsHeading: "### Required reading",
|
|
1844
|
+
conventionsBody: "The working conventions live in each repo's AGENTS.md. Read these before working.",
|
|
1845
|
+
principlesHeading: "### Key principles",
|
|
1846
|
+
principleStateless: "- This directory holds no state (not under git)",
|
|
1847
|
+
principleNoFiles: "- Do not place important files here directly (they belong in the repos)"
|
|
1848
|
+
},
|
|
1849
|
+
anchorStarter: {
|
|
1850
|
+
identityLine: (title) => `> This repository is the **planning master (anchor) of ${title}**. AI agents working here should read this file first.`,
|
|
1851
|
+
starterNote: "> This file is a starter that `basou project derive` generated **once** at greenfield bring-up. Hand-maintain it from here \u2014 basou never regenerates or overwrites it (there are no BASOU:GENERATED markers; edit freely).",
|
|
1852
|
+
basicsHeading: "## Project basics",
|
|
1853
|
+
basicsTodo: "<!-- TODO: these cannot be derived from the manifest. Fill them in. -->",
|
|
1854
|
+
commitHeading: "## Where to commit",
|
|
1855
|
+
commitPlanning: "- **This repository (the planning master)**: plans, designs, strategy docs.",
|
|
1856
|
+
commitImplementation: "- **Each implementation repo**: implementation code. Always `cd` into the target repo before committing.",
|
|
1857
|
+
commitView: "- **The workspace view**: not under git. You cannot commit in the view.",
|
|
1858
|
+
conventionsHeading: "## Required reading",
|
|
1859
|
+
conventionsBody: "The working conventions live in each repo's AGENTS.md. Read these before working.",
|
|
1860
|
+
viewPointerLine: (viewName) => `- ${viewName}/AGENTS.md (the workspace view, generated by basou) \u2014 **the authoritative, up-to-date repo roster (the live roster) lives there**`,
|
|
1861
|
+
policyHeading: "## Working policy (project specifics)",
|
|
1862
|
+
policyTodo: [
|
|
1863
|
+
"<!-- TODO: describe these for your project.",
|
|
1864
|
+
" - Current phase / key documents",
|
|
1865
|
+
" - Secrets handling (where NOT to write them)",
|
|
1866
|
+
" - Language policy (commits / comments / docs)",
|
|
1867
|
+
" - Commit discipline (avoid mixed commits, etc.)",
|
|
1868
|
+
"-->"
|
|
1869
|
+
]
|
|
1870
|
+
}
|
|
1871
|
+
};
|
|
1872
|
+
var PRESET_JA = {
|
|
1873
|
+
repoBlock: {
|
|
1874
|
+
heading: "## \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u69CB\u6210(basou \u304C\u751F\u6210 \u2014 manifest \u304C\u6B63\u672C)",
|
|
1875
|
+
intro: "\u3053\u306E\u30BB\u30AF\u30B7\u30E7\u30F3\u306F `.basou/manifest.yaml` \u306E\u5BA3\u8A00\u304B\u3089 `basou project preset` \u304C\u751F\u6210\u3057\u307E\u3059\u3002\u7DE8\u96C6\u306F manifest \u5074\u3067\u884C\u3063\u3066\u304F\u3060\u3055\u3044(\u30DE\u30FC\u30AB\u30FC\u5916\u306E\u8A18\u8FF0\u306F\u4FDD\u6301\u3055\u308C\u307E\u3059)\u3002",
|
|
1876
|
+
visibilityLabel: (v) => {
|
|
1877
|
+
switch (v) {
|
|
1878
|
+
case "public":
|
|
1879
|
+
return "public(git \u5C65\u6B74\u306F\u516C\u958B)";
|
|
1880
|
+
case "private":
|
|
1881
|
+
return "private(git \u5C65\u6B74\u306F\u975E\u516C\u958B)";
|
|
1882
|
+
case "future-public":
|
|
1883
|
+
return "future-public(\u73FE\u5728\u306F\u975E\u516C\u958B\u30FB\u5C06\u6765\u516C\u958B\u4E88\u5B9A)";
|
|
1884
|
+
default:
|
|
1885
|
+
return "\u672A\u8A2D\u5B9A";
|
|
1886
|
+
}
|
|
1887
|
+
},
|
|
1888
|
+
sourceLanguageLabel: (l) => {
|
|
1889
|
+
switch (l) {
|
|
1890
|
+
case "en":
|
|
1891
|
+
return "en(commit\u30FB\u30B3\u30E1\u30F3\u30C8\u30FB\u30B3\u30FC\u30C9\u306F\u82F1\u8A9E)";
|
|
1892
|
+
case "ja":
|
|
1893
|
+
return "ja(commit\u30FB\u30B3\u30E1\u30F3\u30C8\u30FB\u30B3\u30FC\u30C9\u306F\u65E5\u672C\u8A9E)";
|
|
1894
|
+
case "en+ja":
|
|
1895
|
+
return "en+ja(commit\u30FB\u30B3\u30E1\u30F3\u30C8\u30FB\u30B3\u30FC\u30C9\u306F\u65E5\u82F1)";
|
|
1896
|
+
default:
|
|
1897
|
+
return "\u672A\u8A2D\u5B9A";
|
|
1898
|
+
}
|
|
1899
|
+
},
|
|
1900
|
+
publishKindLabel: (k) => k === "web" ? "web(\u30C7\u30D7\u30ED\u30A4)" : "npm(\u30D1\u30C3\u30B1\u30FC\u30B8)",
|
|
1901
|
+
publishVisibilityLabel: (v) => {
|
|
1902
|
+
switch (v) {
|
|
1903
|
+
case "public":
|
|
1904
|
+
return "\u516C\u958B";
|
|
1905
|
+
case "private":
|
|
1906
|
+
return "\u975E\u516C\u958B";
|
|
1907
|
+
case "future-public":
|
|
1908
|
+
return "\u5C06\u6765\u516C\u958B";
|
|
1909
|
+
default:
|
|
1910
|
+
return "\u53EF\u8996\u6027\u672A\u8A2D\u5B9A";
|
|
1911
|
+
}
|
|
1912
|
+
},
|
|
1913
|
+
contentLanguageLabel: (l) => l ?? "\u8A00\u8A9E\u672A\u8A2D\u5B9A",
|
|
1914
|
+
sourceVisibilityLabel: "\u30BD\u30FC\u30B9\u53EF\u8996\u6027",
|
|
1915
|
+
sourceLanguageLineLabel: "\u30BD\u30FC\u30B9\u8A00\u8A9E",
|
|
1916
|
+
publishesNone: "- \u914D\u4FE1\u7269: \u306A\u3057",
|
|
1917
|
+
publishesHeader: "- \u914D\u4FE1\u7269:"
|
|
1918
|
+
},
|
|
1919
|
+
viewBlock: {
|
|
1920
|
+
heading: "## workspace view \u69CB\u6210(basou \u304C\u751F\u6210 \u2014 manifest \u304C\u6B63\u672C)",
|
|
1921
|
+
intro: "\u3053\u306E\u30BB\u30AF\u30B7\u30E7\u30F3\u306F `.basou/manifest.yaml` \u306E\u5BA3\u8A00\u304B\u3089 `basou project preset` \u304C\u751F\u6210\u3057\u307E\u3059\u3002\u7DE8\u96C6\u306F manifest \u5074\u3067\u884C\u3063\u3066\u304F\u3060\u3055\u3044(\u30DE\u30FC\u30AB\u30FC\u5916\u306E\u8A18\u8FF0\u306F\u4FDD\u6301\u3055\u308C\u307E\u3059)\u3002",
|
|
1922
|
+
selfNote: (viewName) => `\u3053\u306E AGENTS.md \u81EA\u8EAB\u3082 basou \u306E\u751F\u6210\u7269\u3067\u3059(\u5B9F\u4F53: \`agents/${viewName}/AGENTS.md\`\u3001\u30DE\u30FC\u30AB\u30FC\u5916\u306E\u8A18\u8FF0\u306F\u4FDD\u6301\u3055\u308C\u307E\u3059)\u3002`,
|
|
1923
|
+
aggregates: (n) => `\u3053\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306F\u3001\u5BA3\u8A00\u3055\u308C\u305F ${n} \u500B\u306E repo \u3092 symlink \u3067\u96C6\u7D04\u3059\u308B **view** \u3067\u3059\u3002\u5B9F\u4F53\u3092\u6301\u305F\u305A\u3001git \u7BA1\u7406\u5916\u3067\u3059\u3002`,
|
|
1924
|
+
reposHeading: "### \u96C6\u7D04\u3057\u3066\u3044\u308B repo",
|
|
1925
|
+
tableHeader: "| repo | \u53EF\u8996\u6027 | \u8A00\u8A9E | \u6307\u793A\u66F8 |",
|
|
1926
|
+
instructionsAnchor: "anchor(\u624B\u7BA1\u7406)",
|
|
1927
|
+
instructionsSelf: "self(repo \u304C\u81EA\u5DF1\u7BA1\u7406)",
|
|
1928
|
+
instructionsHub: "hub(basou \u304C\u751F\u6210)",
|
|
1929
|
+
unsetShort: "\u672A\u8A2D\u5B9A",
|
|
1930
|
+
commitHeading: "### \u3069\u3053\u3067 commit \u3059\u308B\u304B",
|
|
1931
|
+
commitBody: "view \u3067\u306F commit \u3067\u304D\u307E\u305B\u3093(git \u7BA1\u7406\u5916)\u3002\u5909\u66F4\u306F\u5FC5\u305A\u5B9F\u4F53\u306E repo \u306B `cd` \u3057\u3066\u304B\u3089 commit \u3057\u3066\u304F\u3060\u3055\u3044\u3002",
|
|
1932
|
+
conventionsHeading: "### \u5FC5\u305A\u8AAD\u3080\u3079\u304D\u898F\u7D04",
|
|
1933
|
+
conventionsBody: "\u4F5C\u696D\u898F\u7D04\u306F\u5404 repo \u306E AGENTS.md \u306B\u3042\u308A\u307E\u3059\u3002\u4EE5\u4E0B\u3092\u8AAD\u3093\u3067\u304B\u3089\u4F5C\u696D\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
|
|
1934
|
+
principlesHeading: "### \u91CD\u8981\u539F\u5247",
|
|
1935
|
+
principleStateless: "- \u3053\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306F\u72B6\u614B\u3092\u6301\u305F\u306A\u3044(git \u7BA1\u7406\u5916)",
|
|
1936
|
+
principleNoFiles: "- \u91CD\u8981\u306A\u30D5\u30A1\u30A4\u30EB\u3092\u3053\u3053\u306B\u76F4\u63A5\u7F6E\u304B\u306A\u3044(\u5B9F\u4F53\u306F\u5404 repo \u306B\u7F6E\u304F)"
|
|
1937
|
+
},
|
|
1938
|
+
anchorStarter: {
|
|
1939
|
+
identityLine: (title) => `> \u3053\u306E\u30EA\u30DD\u30B8\u30C8\u30EA\u306F **${title} \u306E planning master(anchor)** \u3067\u3059\u3002\u3053\u3053\u3067\u4F5C\u696D\u3059\u308B AI \u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u306F\u3001\u307E\u305A\u3053\u306E\u30D5\u30A1\u30A4\u30EB\u3092\u8AAD\u3093\u3067\u304F\u3060\u3055\u3044\u3002`,
|
|
1940
|
+
starterNote: "> \u3053\u306E\u30D5\u30A1\u30A4\u30EB\u306F `basou project derive` \u304C greenfield \u7ACB\u3061\u4E0A\u3052\u6642\u306B **\u4E00\u5EA6\u3060\u3051\u751F\u6210\u3057\u305F starter** \u3067\u3059\u3002\u4EE5\u5F8C\u306F\u624B\u7BA1\u7406\u3057\u3066\u304F\u3060\u3055\u3044 \u2014 basou \u306F\u518D\u751F\u6210\u3082\u4E0A\u66F8\u304D\u3082\u3057\u307E\u305B\u3093(BASOU:GENERATED \u30DE\u30FC\u30AB\u30FC\u306F\u7121\u304F\u3001\u81EA\u7531\u306B\u7DE8\u96C6\u3067\u304D\u307E\u3059)\u3002",
|
|
1941
|
+
basicsHeading: "## \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306E\u57FA\u672C\u60C5\u5831",
|
|
1942
|
+
basicsTodo: "<!-- TODO: manifest \u304B\u3089\u306F\u5C0E\u51FA\u3067\u304D\u306A\u3044\u9805\u76EE\u3067\u3059\u3002\u57CB\u3081\u3066\u304F\u3060\u3055\u3044\u3002 -->",
|
|
1943
|
+
commitHeading: "## \u3069\u3053\u3067 commit \u3059\u308B\u304B",
|
|
1944
|
+
commitPlanning: "- **\u3053\u306E\u30EA\u30DD\u30B8\u30C8\u30EA(planning master)**: \u69CB\u60F3\u30FB\u8A08\u753B\u30FB\u8A2D\u8A08\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3002",
|
|
1945
|
+
commitImplementation: "- **\u5404\u5B9F\u88C5 repo**: \u5B9F\u88C5\u30B3\u30FC\u30C9\u3002\u5FC5\u305A\u5BFE\u8C61 repo \u306B `cd` \u3057\u3066\u304B\u3089 commit \u3057\u3066\u304F\u3060\u3055\u3044\u3002",
|
|
1946
|
+
commitView: "- **workspace view**: git \u7BA1\u7406\u5916\u3002view \u3067\u306F commit \u3067\u304D\u307E\u305B\u3093\u3002",
|
|
1947
|
+
conventionsHeading: "## \u5FC5\u305A\u8AAD\u3080\u3079\u304D\u898F\u7D04",
|
|
1948
|
+
conventionsBody: "\u4F5C\u696D\u898F\u7D04\u306F\u5404 repo \u306E AGENTS.md \u306B\u3042\u308A\u307E\u3059\u3002\u4EE5\u4E0B\u3092\u8AAD\u3093\u3067\u304B\u3089\u4F5C\u696D\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
|
|
1949
|
+
viewPointerLine: (viewName) => `- ${viewName}/AGENTS.md(workspace view\u30FBbasou \u304C\u751F\u6210)\u2014 **\u6700\u65B0\u306E repo \u69CB\u6210(roster)\u306F\u3053\u3053\u3092\u6B63\u3068\u3059\u308B**`,
|
|
1950
|
+
policyHeading: "## \u4F5C\u696D\u65B9\u91DD(\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u56FA\u6709\u4E8B\u9805)",
|
|
1951
|
+
policyTodo: [
|
|
1952
|
+
"<!-- TODO: \u4EE5\u4E0B\u3092\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306B\u5408\u308F\u305B\u3066\u8A18\u8FF0\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
|
|
1953
|
+
" - \u73FE\u5728\u306E\u30D5\u30A7\u30FC\u30BA / \u91CD\u8981\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8",
|
|
1954
|
+
" - \u6A5F\u5BC6\u60C5\u5831\u306E\u6271\u3044(\u3069\u3053\u306B\u66F8\u304B\u306A\u3044\u304B)",
|
|
1955
|
+
" - \u8A00\u8A9E\u30DD\u30EA\u30B7\u30FC(commit / \u30B3\u30E1\u30F3\u30C8 / \u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u8A00\u8A9E)",
|
|
1956
|
+
" - commit \u904B\u7528(\u6DF7\u5728\u30B3\u30DF\u30C3\u30C8\u3092\u907F\u3051\u308B \u7B49)",
|
|
1957
|
+
"-->"
|
|
1958
|
+
]
|
|
1959
|
+
}
|
|
1960
|
+
};
|
|
1774
1961
|
|
|
1775
1962
|
// src/storage/sessions.ts
|
|
1776
1963
|
import { readdir as readdir2 } from "fs/promises";
|
|
@@ -5697,21 +5884,18 @@ function shortId(id) {
|
|
|
5697
5884
|
|
|
5698
5885
|
// src/project/anchor-starter.ts
|
|
5699
5886
|
function renderAnchorStarter(input) {
|
|
5887
|
+
const t = presetStrings(resolveAnchorContentLanguage(input.repos)).anchorStarter;
|
|
5700
5888
|
const lines = [];
|
|
5701
5889
|
const title = input.projectName ?? input.anchorName;
|
|
5702
5890
|
lines.push(`# AGENTS.md (${input.anchorName})`);
|
|
5703
5891
|
lines.push("");
|
|
5704
|
-
lines.push(
|
|
5705
|
-
`> \u3053\u306E\u30EA\u30DD\u30B8\u30C8\u30EA\u306F **${title} \u306E planning master(anchor)** \u3067\u3059\u3002\u3053\u3053\u3067\u4F5C\u696D\u3059\u308B AI \u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u306F\u3001\u307E\u305A\u3053\u306E\u30D5\u30A1\u30A4\u30EB\u3092\u8AAD\u3093\u3067\u304F\u3060\u3055\u3044\u3002`
|
|
5706
|
-
);
|
|
5892
|
+
lines.push(t.identityLine(title));
|
|
5707
5893
|
lines.push(">");
|
|
5708
|
-
lines.push(
|
|
5709
|
-
"> \u3053\u306E\u30D5\u30A1\u30A4\u30EB\u306F `basou project derive` \u304C greenfield \u7ACB\u3061\u4E0A\u3052\u6642\u306B **\u4E00\u5EA6\u3060\u3051\u751F\u6210\u3057\u305F starter** \u3067\u3059\u3002\u4EE5\u5F8C\u306F\u624B\u7BA1\u7406\u3057\u3066\u304F\u3060\u3055\u3044 \u2014 basou \u306F\u518D\u751F\u6210\u3082\u4E0A\u66F8\u304D\u3082\u3057\u307E\u305B\u3093(BASOU:GENERATED \u30DE\u30FC\u30AB\u30FC\u306F\u7121\u304F\u3001\u81EA\u7531\u306B\u7DE8\u96C6\u3067\u304D\u307E\u3059)\u3002"
|
|
5710
|
-
);
|
|
5894
|
+
lines.push(t.starterNote);
|
|
5711
5895
|
lines.push("");
|
|
5712
|
-
lines.push(
|
|
5896
|
+
lines.push(t.basicsHeading);
|
|
5713
5897
|
lines.push("");
|
|
5714
|
-
lines.push(
|
|
5898
|
+
lines.push(t.basicsTodo);
|
|
5715
5899
|
lines.push("");
|
|
5716
5900
|
lines.push("```text");
|
|
5717
5901
|
lines.push(`Product name: ${input.projectName ?? "<!-- TODO -->"}`);
|
|
@@ -5722,34 +5906,27 @@ function renderAnchorStarter(input) {
|
|
|
5722
5906
|
lines.push("License: <!-- TODO -->");
|
|
5723
5907
|
lines.push("```");
|
|
5724
5908
|
lines.push("");
|
|
5725
|
-
lines.push(
|
|
5909
|
+
lines.push(t.commitHeading);
|
|
5726
5910
|
lines.push("");
|
|
5727
|
-
lines.push(
|
|
5728
|
-
lines.push(
|
|
5729
|
-
lines.push(
|
|
5911
|
+
lines.push(t.commitPlanning);
|
|
5912
|
+
lines.push(t.commitImplementation);
|
|
5913
|
+
lines.push(t.commitView);
|
|
5730
5914
|
lines.push("");
|
|
5731
|
-
lines.push(
|
|
5915
|
+
lines.push(t.conventionsHeading);
|
|
5732
5916
|
lines.push("");
|
|
5733
|
-
lines.push(
|
|
5917
|
+
lines.push(t.conventionsBody);
|
|
5734
5918
|
lines.push("");
|
|
5735
5919
|
for (const r of input.repos) {
|
|
5736
5920
|
if (r.anchor === true) continue;
|
|
5737
5921
|
lines.push(`- ${r.name}/AGENTS.md`);
|
|
5738
5922
|
}
|
|
5739
5923
|
if (input.viewName !== void 0) {
|
|
5740
|
-
lines.push(
|
|
5741
|
-
`- ${input.viewName}/AGENTS.md(workspace view\u30FBbasou \u304C\u751F\u6210)\u2014 **\u6700\u65B0\u306E repo \u69CB\u6210(roster)\u306F\u3053\u3053\u3092\u6B63\u3068\u3059\u308B**`
|
|
5742
|
-
);
|
|
5924
|
+
lines.push(t.viewPointerLine(input.viewName));
|
|
5743
5925
|
}
|
|
5744
5926
|
lines.push("");
|
|
5745
|
-
lines.push(
|
|
5927
|
+
lines.push(t.policyHeading);
|
|
5746
5928
|
lines.push("");
|
|
5747
|
-
lines.push(
|
|
5748
|
-
lines.push(" - \u73FE\u5728\u306E\u30D5\u30A7\u30FC\u30BA / \u91CD\u8981\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8");
|
|
5749
|
-
lines.push(" - \u6A5F\u5BC6\u60C5\u5831\u306E\u6271\u3044(\u3069\u3053\u306B\u66F8\u304B\u306A\u3044\u304B)");
|
|
5750
|
-
lines.push(" - \u8A00\u8A9E\u30DD\u30EA\u30B7\u30FC(commit / \u30B3\u30E1\u30F3\u30C8 / \u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u8A00\u8A9E)");
|
|
5751
|
-
lines.push(" - commit \u904B\u7528(\u6DF7\u5728\u30B3\u30DF\u30C3\u30C8\u3092\u907F\u3051\u308B \u7B49)");
|
|
5752
|
-
lines.push("-->");
|
|
5929
|
+
lines.push(...t.policyTodo);
|
|
5753
5930
|
return `${lines.join("\n")}
|
|
5754
5931
|
`;
|
|
5755
5932
|
}
|
|
@@ -5839,131 +6016,76 @@ function planGitignore(input) {
|
|
|
5839
6016
|
}
|
|
5840
6017
|
|
|
5841
6018
|
// src/project/preset.ts
|
|
5842
|
-
function visibilityLabel(v) {
|
|
5843
|
-
switch (v) {
|
|
5844
|
-
case "public":
|
|
5845
|
-
return "public(git \u5C65\u6B74\u306F\u516C\u958B)";
|
|
5846
|
-
case "private":
|
|
5847
|
-
return "private(git \u5C65\u6B74\u306F\u975E\u516C\u958B)";
|
|
5848
|
-
case "future-public":
|
|
5849
|
-
return "future-public(\u73FE\u5728\u306F\u975E\u516C\u958B\u30FB\u5C06\u6765\u516C\u958B\u4E88\u5B9A)";
|
|
5850
|
-
default:
|
|
5851
|
-
return "\u672A\u8A2D\u5B9A";
|
|
5852
|
-
}
|
|
5853
|
-
}
|
|
5854
|
-
function sourceLanguageLabel(l) {
|
|
5855
|
-
switch (l) {
|
|
5856
|
-
case "en":
|
|
5857
|
-
return "en(commit\u30FB\u30B3\u30E1\u30F3\u30C8\u30FB\u30B3\u30FC\u30C9\u306F\u82F1\u8A9E)";
|
|
5858
|
-
case "ja":
|
|
5859
|
-
return "ja(commit\u30FB\u30B3\u30E1\u30F3\u30C8\u30FB\u30B3\u30FC\u30C9\u306F\u65E5\u672C\u8A9E)";
|
|
5860
|
-
case "en+ja":
|
|
5861
|
-
return "en+ja(commit\u30FB\u30B3\u30E1\u30F3\u30C8\u30FB\u30B3\u30FC\u30C9\u306F\u65E5\u82F1)";
|
|
5862
|
-
default:
|
|
5863
|
-
return "\u672A\u8A2D\u5B9A";
|
|
5864
|
-
}
|
|
5865
|
-
}
|
|
5866
|
-
function publishKindLabel(k) {
|
|
5867
|
-
return k === "web" ? "web(\u30C7\u30D7\u30ED\u30A4)" : "npm(\u30D1\u30C3\u30B1\u30FC\u30B8)";
|
|
5868
|
-
}
|
|
5869
|
-
function publishVisibilityLabel(v) {
|
|
5870
|
-
switch (v) {
|
|
5871
|
-
case "public":
|
|
5872
|
-
return "\u516C\u958B";
|
|
5873
|
-
case "private":
|
|
5874
|
-
return "\u975E\u516C\u958B";
|
|
5875
|
-
case "future-public":
|
|
5876
|
-
return "\u5C06\u6765\u516C\u958B";
|
|
5877
|
-
default:
|
|
5878
|
-
return "\u53EF\u8996\u6027\u672A\u8A2D\u5B9A";
|
|
5879
|
-
}
|
|
5880
|
-
}
|
|
5881
|
-
function contentLanguageLabel(l) {
|
|
5882
|
-
return l ?? "\u8A00\u8A9E\u672A\u8A2D\u5B9A";
|
|
5883
|
-
}
|
|
5884
6019
|
function isRenderable(repo) {
|
|
5885
6020
|
return repo.visibility !== void 0 || repo.language !== void 0 || repo.publishes !== void 0 && repo.publishes.length > 0;
|
|
5886
6021
|
}
|
|
5887
6022
|
function renderPresetBlock(repo) {
|
|
6023
|
+
const t = presetStrings(resolveRepoContentLanguage(repo.language)).repoBlock;
|
|
5888
6024
|
const lines = [];
|
|
5889
|
-
lines.push(
|
|
6025
|
+
lines.push(t.heading);
|
|
5890
6026
|
lines.push("");
|
|
5891
|
-
lines.push(
|
|
5892
|
-
"\u3053\u306E\u30BB\u30AF\u30B7\u30E7\u30F3\u306F `.basou/manifest.yaml` \u306E\u5BA3\u8A00\u304B\u3089 `basou project preset` \u304C\u751F\u6210\u3057\u307E\u3059\u3002\u7DE8\u96C6\u306F manifest \u5074\u3067\u884C\u3063\u3066\u304F\u3060\u3055\u3044(\u30DE\u30FC\u30AB\u30FC\u5916\u306E\u8A18\u8FF0\u306F\u4FDD\u6301\u3055\u308C\u307E\u3059)\u3002"
|
|
5893
|
-
);
|
|
6027
|
+
lines.push(t.intro);
|
|
5894
6028
|
lines.push("");
|
|
5895
|
-
lines.push(`-
|
|
5896
|
-
lines.push(`-
|
|
6029
|
+
lines.push(`- ${t.sourceVisibilityLabel}: ${t.visibilityLabel(repo.visibility)}`);
|
|
6030
|
+
lines.push(`- ${t.sourceLanguageLineLabel}: ${t.sourceLanguageLabel(repo.language)}`);
|
|
5897
6031
|
const publishes = repo.publishes ?? [];
|
|
5898
6032
|
if (publishes.length === 0) {
|
|
5899
|
-
lines.push(
|
|
6033
|
+
lines.push(t.publishesNone);
|
|
5900
6034
|
} else {
|
|
5901
|
-
lines.push(
|
|
6035
|
+
lines.push(t.publishesHeader);
|
|
5902
6036
|
for (const p of publishes) {
|
|
5903
6037
|
lines.push(
|
|
5904
|
-
` - ${publishKindLabel(p.kind)} \u2014 ${publishVisibilityLabel(p.visibility)} / ${contentLanguageLabel(p.language)}`
|
|
6038
|
+
` - ${t.publishKindLabel(p.kind)} \u2014 ${t.publishVisibilityLabel(p.visibility)} / ${t.contentLanguageLabel(p.language)}`
|
|
5905
6039
|
);
|
|
5906
6040
|
}
|
|
5907
6041
|
}
|
|
5908
6042
|
return lines.join("\n");
|
|
5909
6043
|
}
|
|
5910
|
-
function visibilityShortLabel(v) {
|
|
5911
|
-
return v ?? "\u672A\u8A2D\u5B9A";
|
|
5912
|
-
}
|
|
5913
|
-
function languageShortLabel(l) {
|
|
5914
|
-
return l ?? "\u672A\u8A2D\u5B9A";
|
|
5915
|
-
}
|
|
5916
|
-
function instructionsLabel(repo) {
|
|
5917
|
-
if (repo.anchor === true) return "anchor(\u624B\u7BA1\u7406)";
|
|
5918
|
-
return repo.self === true ? "self(repo \u304C\u81EA\u5DF1\u7BA1\u7406)" : "hub(basou \u304C\u751F\u6210)";
|
|
5919
|
-
}
|
|
5920
6044
|
function renderViewPresetBlock(input) {
|
|
6045
|
+
const t = presetStrings(resolveAnchorContentLanguage(input.repos)).viewBlock;
|
|
6046
|
+
const shortLabel = (v) => v ?? t.unsetShort;
|
|
6047
|
+
const instructionsLabel = (repo) => {
|
|
6048
|
+
if (repo.anchor === true) return t.instructionsAnchor;
|
|
6049
|
+
return repo.self === true ? t.instructionsSelf : t.instructionsHub;
|
|
6050
|
+
};
|
|
5921
6051
|
const lines = [];
|
|
5922
|
-
lines.push(
|
|
6052
|
+
lines.push(t.heading);
|
|
5923
6053
|
lines.push("");
|
|
5924
|
-
lines.push(
|
|
5925
|
-
|
|
5926
|
-
);
|
|
5927
|
-
lines.push(
|
|
5928
|
-
`\u3053\u306E AGENTS.md \u81EA\u8EAB\u3082 basou \u306E\u751F\u6210\u7269\u3067\u3059(\u5B9F\u4F53: \`agents/${input.viewName}/AGENTS.md\`\u3001\u30DE\u30FC\u30AB\u30FC\u5916\u306E\u8A18\u8FF0\u306F\u4FDD\u6301\u3055\u308C\u307E\u3059)\u3002`
|
|
5929
|
-
);
|
|
6054
|
+
lines.push(t.intro);
|
|
6055
|
+
lines.push(t.selfNote(input.viewName));
|
|
5930
6056
|
lines.push("");
|
|
5931
|
-
lines.push(
|
|
5932
|
-
`\u3053\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306F\u3001\u5BA3\u8A00\u3055\u308C\u305F ${input.repos.length} \u500B\u306E repo \u3092 symlink \u3067\u96C6\u7D04\u3059\u308B **view** \u3067\u3059\u3002\u5B9F\u4F53\u3092\u6301\u305F\u305A\u3001git \u7BA1\u7406\u5916\u3067\u3059\u3002`
|
|
5933
|
-
);
|
|
6057
|
+
lines.push(t.aggregates(input.repos.length));
|
|
5934
6058
|
lines.push("");
|
|
5935
|
-
lines.push(
|
|
6059
|
+
lines.push(t.reposHeading);
|
|
5936
6060
|
lines.push("");
|
|
5937
|
-
lines.push(
|
|
6061
|
+
lines.push(t.tableHeader);
|
|
5938
6062
|
lines.push("|---|---|---|---|");
|
|
5939
6063
|
for (const r of input.repos) {
|
|
5940
6064
|
lines.push(
|
|
5941
|
-
`| ${r.name} | ${
|
|
6065
|
+
`| ${r.name} | ${shortLabel(r.visibility)} | ${shortLabel(r.language)} | ${instructionsLabel(r)} |`
|
|
5942
6066
|
);
|
|
5943
6067
|
}
|
|
5944
6068
|
lines.push("");
|
|
5945
|
-
lines.push(
|
|
6069
|
+
lines.push(t.commitHeading);
|
|
5946
6070
|
lines.push("");
|
|
5947
|
-
lines.push(
|
|
5948
|
-
"view \u3067\u306F commit \u3067\u304D\u307E\u305B\u3093(git \u7BA1\u7406\u5916)\u3002\u5909\u66F4\u306F\u5FC5\u305A\u5B9F\u4F53\u306E repo \u306B `cd` \u3057\u3066\u304B\u3089 commit \u3057\u3066\u304F\u3060\u3055\u3044\u3002"
|
|
5949
|
-
);
|
|
6071
|
+
lines.push(t.commitBody);
|
|
5950
6072
|
lines.push("");
|
|
5951
6073
|
for (const r of input.repos) {
|
|
5952
6074
|
lines.push(`- ${r.name} \u2192 \`cd ${r.name}\``);
|
|
5953
6075
|
}
|
|
5954
6076
|
lines.push("");
|
|
5955
|
-
lines.push(
|
|
6077
|
+
lines.push(t.conventionsHeading);
|
|
5956
6078
|
lines.push("");
|
|
5957
|
-
lines.push(
|
|
6079
|
+
lines.push(t.conventionsBody);
|
|
5958
6080
|
lines.push("");
|
|
5959
6081
|
for (const r of input.repos) {
|
|
5960
6082
|
lines.push(`- ${r.name}/AGENTS.md`);
|
|
5961
6083
|
}
|
|
5962
6084
|
lines.push("");
|
|
5963
|
-
lines.push(
|
|
6085
|
+
lines.push(t.principlesHeading);
|
|
5964
6086
|
lines.push("");
|
|
5965
|
-
lines.push(
|
|
5966
|
-
lines.push(
|
|
6087
|
+
lines.push(t.principleStateless);
|
|
6088
|
+
lines.push(t.principleNoFiles);
|
|
5967
6089
|
return lines.join("\n");
|
|
5968
6090
|
}
|
|
5969
6091
|
function normalizeBlock(s) {
|
|
@@ -8499,6 +8621,7 @@ export {
|
|
|
8499
8621
|
planRosterAdoption,
|
|
8500
8622
|
planWorkspaceView,
|
|
8501
8623
|
prefixedUlid,
|
|
8624
|
+
presetStrings,
|
|
8502
8625
|
readAllEvents,
|
|
8503
8626
|
readManifest,
|
|
8504
8627
|
readMarkdownFile,
|
|
@@ -8524,9 +8647,11 @@ export {
|
|
|
8524
8647
|
renderViewPresetBlock,
|
|
8525
8648
|
renderWithMarkers,
|
|
8526
8649
|
replayEvents,
|
|
8650
|
+
resolveAnchorContentLanguage,
|
|
8527
8651
|
resolveBasouRepositoryRoot,
|
|
8528
8652
|
resolveClaudeCodeCommand,
|
|
8529
8653
|
resolveCodexCommand,
|
|
8654
|
+
resolveRepoContentLanguage,
|
|
8530
8655
|
resolveRepositoryRoot,
|
|
8531
8656
|
resolveSessionId,
|
|
8532
8657
|
resolveTaskId,
|