@karmaniverous/stan-cli 0.10.0 → 0.10.1
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/cli/stan.js
CHANGED
|
@@ -21,6 +21,7 @@ import tty from 'node:tty';
|
|
|
21
21
|
import readline__default, { emitKeypressEvents } from 'node:readline';
|
|
22
22
|
import clipboardy from 'clipboardy';
|
|
23
23
|
import require$$0$2 from 'child_process';
|
|
24
|
+
import { createRequire } from 'node:module';
|
|
24
25
|
|
|
25
26
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
26
27
|
|
|
@@ -17360,7 +17361,7 @@ const readPackageJsonScripts = async (cwd) => {
|
|
|
17360
17361
|
};
|
|
17361
17362
|
/** Ask user for config values; preserve script set optionally. */
|
|
17362
17363
|
const promptForConfig = async (cwd, pkgScripts, defaults, preserveScriptsFromDefaults) => {
|
|
17363
|
-
const { default: inquirer } = (await import('./index-
|
|
17364
|
+
const { default: inquirer } = (await import('./index-BO3K2S0m.js'));
|
|
17364
17365
|
const scriptKeys = Object.keys(pkgScripts);
|
|
17365
17366
|
const defaultSelected = defaults?.scripts
|
|
17366
17367
|
? Object.keys(defaults.scripts).filter((k) => scriptKeys.includes(k))
|
|
@@ -17531,7 +17532,7 @@ const maybeMigrateLegacyToNamespaced = async (base, existingPath, opts) => {
|
|
|
17531
17532
|
let proceed = Boolean(opts?.force);
|
|
17532
17533
|
if (!proceed && legacyPresent) {
|
|
17533
17534
|
try {
|
|
17534
|
-
const { default: inquirer } = (await import('./index-
|
|
17535
|
+
const { default: inquirer } = (await import('./index-BO3K2S0m.js'));
|
|
17535
17536
|
const ans = (await inquirer.prompt([
|
|
17536
17537
|
{
|
|
17537
17538
|
type: 'confirm',
|
|
@@ -17868,7 +17869,7 @@ const performInitService = async ({ cwd = process.cwd(), force = false, preserve
|
|
|
17868
17869
|
else {
|
|
17869
17870
|
try {
|
|
17870
17871
|
if (!dryRun) {
|
|
17871
|
-
const { default: inquirer } = (await import('./index-
|
|
17872
|
+
const { default: inquirer } = (await import('./index-BO3K2S0m.js'));
|
|
17872
17873
|
const ans = (await inquirer.prompt([
|
|
17873
17874
|
{
|
|
17874
17875
|
type: 'confirm',
|
|
@@ -19579,6 +19580,35 @@ const cleanupPatchDirAfterArchive = async (cwd, stanPath) => {
|
|
|
19579
19580
|
}
|
|
19580
19581
|
};
|
|
19581
19582
|
|
|
19583
|
+
/** src/stan/prompt/resolve.ts
|
|
19584
|
+
* Resolve the packaged core prompt path with a robust fallback.
|
|
19585
|
+
* Primary: \@karmaniverous/stan-core.getPackagedSystemPromptPath()
|
|
19586
|
+
* Fallback: locate core's package root via createRequire() and join dist/stan.system.md.
|
|
19587
|
+
*/
|
|
19588
|
+
/** Resolve the absolute path to core's packaged stan.system.md, or null if unavailable. */
|
|
19589
|
+
const resolveCorePromptPath = () => {
|
|
19590
|
+
// Primary: engine helper
|
|
19591
|
+
try {
|
|
19592
|
+
const p = _h();
|
|
19593
|
+
if (p && existsSync(p))
|
|
19594
|
+
return p;
|
|
19595
|
+
}
|
|
19596
|
+
catch {
|
|
19597
|
+
/* fall through */
|
|
19598
|
+
}
|
|
19599
|
+
// Fallback: anchor at core's package root resolved relative to this module.
|
|
19600
|
+
try {
|
|
19601
|
+
const req = createRequire(import.meta.url);
|
|
19602
|
+
const pkgJson = req.resolve('@karmaniverous/stan-core/package.json');
|
|
19603
|
+
const root = path.dirname(pkgJson);
|
|
19604
|
+
const candidate = path.join(root, 'dist', 'stan.system.md');
|
|
19605
|
+
return existsSync(candidate) ? candidate : null;
|
|
19606
|
+
}
|
|
19607
|
+
catch {
|
|
19608
|
+
return null;
|
|
19609
|
+
}
|
|
19610
|
+
};
|
|
19611
|
+
|
|
19582
19612
|
/* src/stan/run/prompt.ts
|
|
19583
19613
|
* System prompt resolution and temporary materialization for archiving.
|
|
19584
19614
|
*/
|
|
@@ -19590,7 +19620,7 @@ const readBytes = async (abs) => {
|
|
|
19590
19620
|
/** Resolve the system prompt source based on the user's choice (auto|local|core|path). */
|
|
19591
19621
|
const resolvePromptSource = (cwd, stanPath, choice) => {
|
|
19592
19622
|
const localAbs = path.join(cwd, systemRel(stanPath));
|
|
19593
|
-
const coreAbs =
|
|
19623
|
+
const coreAbs = resolveCorePromptPath();
|
|
19594
19624
|
if (choice === 'local') {
|
|
19595
19625
|
if (!existsSync(localAbs)) {
|
|
19596
19626
|
throw new Error(`system prompt not found at ${path
|