md4ai 0.16.1 → 0.16.3
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.bundled.js +29 -11
- package/package.json +1 -1
package/dist/index.bundled.js
CHANGED
|
@@ -122,7 +122,7 @@ var CURRENT_VERSION;
|
|
|
122
122
|
var init_check_update = __esm({
|
|
123
123
|
"dist/check-update.js"() {
|
|
124
124
|
"use strict";
|
|
125
|
-
CURRENT_VERSION = true ? "0.16.
|
|
125
|
+
CURRENT_VERSION = true ? "0.16.3" : "0.0.0-dev";
|
|
126
126
|
}
|
|
127
127
|
});
|
|
128
128
|
|
|
@@ -1955,13 +1955,19 @@ async function scanDoppler(projectRoot, folderId) {
|
|
|
1955
1955
|
let matchedVia = "doppler-yaml";
|
|
1956
1956
|
if (!projectSlug && folderId) {
|
|
1957
1957
|
const state = await loadState();
|
|
1958
|
-
|
|
1959
|
-
if (
|
|
1958
|
+
const savedSlug = state.dopplerProjects?.[folderId] ?? null;
|
|
1959
|
+
if (savedSlug === "__none__") {
|
|
1960
|
+
return null;
|
|
1961
|
+
}
|
|
1962
|
+
if (savedSlug) {
|
|
1963
|
+
projectSlug = savedSlug;
|
|
1960
1964
|
matchedVia = "manual";
|
|
1965
|
+
}
|
|
1961
1966
|
}
|
|
1962
1967
|
if (!projectSlug) {
|
|
1963
1968
|
if (!folderId || !process.stdin.isTTY) {
|
|
1964
|
-
|
|
1969
|
+
const suggestedSlug = basename(projectRoot).toLowerCase().replace(/[^a-z0-9-]/g, "-");
|
|
1970
|
+
console.log(chalk10.dim(` Doppler: token configured but no project linked. Run: md4ai doppler set-project ${suggestedSlug}`));
|
|
1965
1971
|
return null;
|
|
1966
1972
|
}
|
|
1967
1973
|
const projects = await fetchDopplerProjects(tokenResult.token);
|
|
@@ -1979,13 +1985,25 @@ async function scanDoppler(projectRoot, folderId) {
|
|
|
1979
1985
|
projectSlug = autoMatch.slug;
|
|
1980
1986
|
console.log(chalk10.green(` Doppler: auto-matched project "${projectSlug}" from project name.`));
|
|
1981
1987
|
} else {
|
|
1982
|
-
|
|
1988
|
+
const choice = await select3({
|
|
1983
1989
|
message: `Which Doppler project holds secrets for "${projectName}"?`,
|
|
1984
|
-
choices:
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1990
|
+
choices: [
|
|
1991
|
+
...projects.map((p) => ({
|
|
1992
|
+
name: `${p.slug}${p.name !== p.slug ? ` (${p.name})` : ""}`,
|
|
1993
|
+
value: p.slug
|
|
1994
|
+
})),
|
|
1995
|
+
{ name: "None \u2014 this project does not use Doppler", value: "__none__" }
|
|
1996
|
+
]
|
|
1988
1997
|
});
|
|
1998
|
+
if (choice === "__none__") {
|
|
1999
|
+
const state2 = await loadState();
|
|
2000
|
+
const dopplerProjects2 = state2.dopplerProjects ?? {};
|
|
2001
|
+
dopplerProjects2[folderId] = "__none__";
|
|
2002
|
+
await saveState({ dopplerProjects: dopplerProjects2 });
|
|
2003
|
+
console.log(chalk10.dim(" Doppler: skipped for this project. To change later: md4ai doppler set-project <slug>"));
|
|
2004
|
+
return null;
|
|
2005
|
+
}
|
|
2006
|
+
projectSlug = choice;
|
|
1989
2007
|
}
|
|
1990
2008
|
}
|
|
1991
2009
|
const state = await loadState();
|
|
@@ -2845,7 +2863,7 @@ async function syncCommand(options) {
|
|
|
2845
2863
|
console.log(chalk15.yellow(` ${proposedAll.length} file(s) proposed for deletion \u2014 run \`md4ai scan\` to review.`));
|
|
2846
2864
|
}
|
|
2847
2865
|
try {
|
|
2848
|
-
const result = await scanProject(device.path);
|
|
2866
|
+
const result = await scanProject(device.path, device.folder_id);
|
|
2849
2867
|
const { data: allDeviceRow } = await supabase.from("devices").select("id").eq("user_id", userId).eq("device_name", device.device_name).single();
|
|
2850
2868
|
const allDeviceId = allDeviceRow?.id;
|
|
2851
2869
|
try {
|
|
@@ -2911,7 +2929,7 @@ async function syncCommand(options) {
|
|
|
2911
2929
|
if (proposedSingle?.length) {
|
|
2912
2930
|
console.log(chalk15.yellow(` ${proposedSingle.length} file(s) proposed for deletion \u2014 run \`md4ai scan\` to review.`));
|
|
2913
2931
|
}
|
|
2914
|
-
const result = await scanProject(device.path);
|
|
2932
|
+
const result = await scanProject(device.path, device.folder_id);
|
|
2915
2933
|
const { data: singleDeviceRow } = await supabase.from("devices").select("id").eq("user_id", userId).eq("device_name", device.device_name).single();
|
|
2916
2934
|
const singleDeviceId = singleDeviceRow?.id;
|
|
2917
2935
|
try {
|