@karmaniverous/stan-cli 0.11.6 → 0.12.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/README.md +19 -18
- package/dist/cjs/classifier-Bqzr65UC-D9z0tWqn.js +1 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cli/{capture-DKrVoDyl.js → capture-CiVimFuL.js} +1 -1
- package/dist/cli/classifier-Bqzr65UC-BlsMFS8t.js +7 -0
- package/dist/cli/{config-fallback-CV720XTz.js → config-fallback-CL_TDiMw.js} +1 -1
- package/dist/cli/{context-PS5ukh8q.js → context-BzEQ3A1v.js} +1 -1
- package/dist/cli/{index-Cq8YEju6.js → index-DXJaQ46Q.js} +1236 -867
- package/dist/cli/stan.js +958 -171
- package/dist/mjs/classifier-Bqzr65UC-DJLYQY2b.js +1 -0
- package/dist/mjs/index.js +1 -1
- package/dist/types/index.d.ts +30 -2
- package/package.json +27 -27
- package/dist/cjs/classifier-DeYwffC_-CjzCgatc.js +0 -1
- package/dist/cli/classifier-DeYwffC_-DftahF7h.js +0 -7
- package/dist/mjs/classifier-DeYwffC_-C7wwqop3.js +0 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -9,12 +9,26 @@
|
|
|
9
9
|
*/
|
|
10
10
|
declare const renderAvailableScriptsHelp: (cwd: string) => string;
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
/** Object form of a configured script entry. */
|
|
13
|
+
type ScriptObject = {
|
|
14
|
+
/** Shell command to execute for this script key. */
|
|
13
15
|
script: string;
|
|
16
|
+
/**
|
|
17
|
+
* Optional regular expression pattern used to classify output as a warning
|
|
18
|
+
* even when the process exits with code 0.
|
|
19
|
+
*/
|
|
14
20
|
warnPattern?: string;
|
|
15
21
|
/** Optional regex flags that override the default flags behavior for warnPattern. */
|
|
16
22
|
warnPatternFlags?: string;
|
|
17
23
|
};
|
|
24
|
+
/**
|
|
25
|
+
* Script entry in `stan-cli.scripts`.
|
|
26
|
+
*
|
|
27
|
+
* - string: shorthand command (e.g., "npm run test")
|
|
28
|
+
* - object: extended form with a `script` command and optional warning pattern
|
|
29
|
+
*/
|
|
30
|
+
type ScriptEntry = string | ScriptObject;
|
|
31
|
+
/** Map of script keys to their configured commands (string shorthand or object form). */
|
|
18
32
|
type ScriptMap = Record<string, ScriptEntry>;
|
|
19
33
|
|
|
20
34
|
/**
|
|
@@ -26,18 +40,24 @@ type Selection = string[] | null;
|
|
|
26
40
|
/** Execution strategy for running scripts. */
|
|
27
41
|
type ExecutionMode = 'concurrent' | 'sequential';
|
|
28
42
|
|
|
43
|
+
/** Runner-local configuration (CLI-owned scripts + engine selection inputs). */
|
|
29
44
|
type RunnerConfig = {
|
|
45
|
+
/** STAN workspace directory name (e.g., ".stan"). */
|
|
30
46
|
stanPath: string;
|
|
47
|
+
/** CLI-owned scripts mapping (script key -\> command config). */
|
|
31
48
|
scripts: ScriptMap;
|
|
32
49
|
/**
|
|
33
50
|
* Optional engine selection context (propagated to the archive phase).
|
|
34
51
|
* When present, these are honored by createArchive/createArchiveDiff.
|
|
35
52
|
*/
|
|
36
53
|
includes?: string[];
|
|
54
|
+
/** Deny-list globs (engine config excludes plus any overlay-composed excludes). */
|
|
37
55
|
excludes?: string[];
|
|
56
|
+
/** Optional imports map used to stage external context into <stanPath>/imports. */
|
|
38
57
|
imports?: Record<string, string[]>;
|
|
39
58
|
/** High-precedence re-includes (passed to core; subject to reserved denials). */
|
|
40
59
|
anchors?: string[];
|
|
60
|
+
/** Optional extra plan lines (facet view) printed in the run plan. */
|
|
41
61
|
overlayPlan?: string[];
|
|
42
62
|
};
|
|
43
63
|
/**
|
|
@@ -48,13 +68,21 @@ type RunnerConfig = {
|
|
|
48
68
|
* - `plan`: when false, suppress printing the run plan before execution.
|
|
49
69
|
*/
|
|
50
70
|
type RunBehavior = {
|
|
71
|
+
/** Include script outputs inside archives and remove them from disk afterward. */
|
|
51
72
|
combine?: boolean;
|
|
73
|
+
/** Keep (do not clear) the output directory before running. */
|
|
52
74
|
keep?: boolean;
|
|
75
|
+
/** Create archive.tar and archive.diff.tar. */
|
|
53
76
|
archive?: boolean;
|
|
77
|
+
/** Enable the live TTY UI when available. */
|
|
54
78
|
live?: boolean;
|
|
79
|
+
/** Seconds of inactivity before warning/stalled labeling (TTY only). */
|
|
55
80
|
hangWarn?: number;
|
|
81
|
+
/** Seconds of inactivity before terminating the process tree (TTY only). */
|
|
56
82
|
hangKill?: number;
|
|
83
|
+
/** Seconds to wait after SIGTERM before SIGKILL (TTY only). */
|
|
57
84
|
hangKillGrace?: number;
|
|
85
|
+
/** When false, suppress printing the plan header before execution. */
|
|
58
86
|
plan?: boolean;
|
|
59
87
|
/** Plan-only display string for resolved system prompt source (when present). */
|
|
60
88
|
prompt?: string;
|
|
@@ -81,4 +109,4 @@ type RunBehavior = {
|
|
|
81
109
|
declare const runSelected: (cwd: string, config: RunnerConfig, selection?: string[] | null, mode?: ExecutionMode, behaviorMaybe?: RunBehavior, promptChoice?: string) => Promise<string[]>;
|
|
82
110
|
|
|
83
111
|
export { renderAvailableScriptsHelp, runSelected };
|
|
84
|
-
export type { ExecutionMode, RunBehavior, RunnerConfig, ScriptEntry, ScriptMap, Selection };
|
|
112
|
+
export type { ExecutionMode, RunBehavior, RunnerConfig, ScriptEntry, ScriptMap, ScriptObject, Selection };
|
package/package.json
CHANGED
|
@@ -13,24 +13,24 @@
|
|
|
13
13
|
"url": "https://github.com/karmaniverous/stan-cli/issues"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@karmaniverous/stan-core": "^0.4.
|
|
17
|
-
"@vitest/eslint-plugin": "^1.4
|
|
16
|
+
"@karmaniverous/stan-core": "^0.4.7",
|
|
17
|
+
"@vitest/eslint-plugin": "^1.6.4",
|
|
18
18
|
"chalk": "^5.6.2",
|
|
19
|
-
"clipboardy": "^5.0.
|
|
19
|
+
"clipboardy": "^5.0.2",
|
|
20
20
|
"commander": "^14.0.2",
|
|
21
|
-
"fs-extra": "^11.3.
|
|
22
|
-
"inquirer": "^
|
|
21
|
+
"fs-extra": "^11.3.3",
|
|
22
|
+
"inquirer": "^13.1.0",
|
|
23
23
|
"package-directory": "^8.1.0",
|
|
24
24
|
"signal-exit": "^4.1.0",
|
|
25
25
|
"table": "^6.9.0",
|
|
26
26
|
"tree-kill": "^1.2.2",
|
|
27
|
-
"yaml": "^2.8.
|
|
28
|
-
"zod": "^4.1
|
|
27
|
+
"yaml": "^2.8.2",
|
|
28
|
+
"zod": "^4.2.1"
|
|
29
29
|
},
|
|
30
30
|
"description": "STAN is a CLI that bridges your IDE with your favorite LLM and drives a rapid, powerful, low-friction, design-first iterative development process. Real-world AI-assisted development for professional engineers!",
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@dotenvx/dotenvx": "^1.51.
|
|
33
|
-
"@eslint/js": "^9.39.
|
|
32
|
+
"@dotenvx/dotenvx": "^1.51.2",
|
|
33
|
+
"@eslint/js": "^9.39.2",
|
|
34
34
|
"@rollup/plugin-alias": "^6.0.0",
|
|
35
35
|
"@rollup/plugin-commonjs": "^29.0.0",
|
|
36
36
|
"@rollup/plugin-json": "^6.1.0",
|
|
@@ -39,34 +39,34 @@
|
|
|
39
39
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
40
40
|
"@types/eslint-config-prettier": "^6.11.3",
|
|
41
41
|
"@types/fs-extra": "^11.0.4",
|
|
42
|
-
"@types/node": "^
|
|
43
|
-
"@vitest/coverage-v8": "^4.0.
|
|
42
|
+
"@types/node": "^25.0.3",
|
|
43
|
+
"@vitest/coverage-v8": "^4.0.16",
|
|
44
44
|
"auto-changelog": "^2.5.0",
|
|
45
45
|
"cross-env": "^10.1.0",
|
|
46
|
-
"eslint": "^9.39.
|
|
46
|
+
"eslint": "^9.39.2",
|
|
47
47
|
"eslint-config-prettier": "^10.1.8",
|
|
48
48
|
"eslint-plugin-jsonc": "^2.21.0",
|
|
49
49
|
"eslint-plugin-prettier": "^5.5.4",
|
|
50
50
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
51
|
-
"eslint-plugin-tsdoc": "^0.
|
|
52
|
-
"happy-dom": "^20.0.
|
|
53
|
-
"jsonc-eslint-parser": "^2.4.
|
|
54
|
-
"knip": "^5.
|
|
55
|
-
"lefthook": "^2.0.
|
|
56
|
-
"prettier": "^3.
|
|
57
|
-
"release-it": "^19.
|
|
58
|
-
"rimraf": "^6.1.
|
|
59
|
-
"rollup": "^4.
|
|
60
|
-
"rollup-plugin-dts": "^6.
|
|
51
|
+
"eslint-plugin-tsdoc": "^0.5.0",
|
|
52
|
+
"happy-dom": "^20.0.11",
|
|
53
|
+
"jsonc-eslint-parser": "^2.4.2",
|
|
54
|
+
"knip": "^5.78.0",
|
|
55
|
+
"lefthook": "^2.0.13",
|
|
56
|
+
"prettier": "^3.7.4",
|
|
57
|
+
"release-it": "^19.2.2",
|
|
58
|
+
"rimraf": "^6.1.2",
|
|
59
|
+
"rollup": "^4.54.0",
|
|
60
|
+
"rollup-plugin-dts": "^6.3.0",
|
|
61
61
|
"tslib": "^2.8.1",
|
|
62
|
-
"tsx": "^4.
|
|
63
|
-
"typedoc": "^0.28.
|
|
62
|
+
"tsx": "^4.21.0",
|
|
63
|
+
"typedoc": "^0.28.15",
|
|
64
64
|
"typedoc-plugin-mdn-links": "^5.0.10",
|
|
65
65
|
"typedoc-plugin-replace-text": "^4.2.0",
|
|
66
66
|
"typedoc-plugin-zod": "^1.4.3",
|
|
67
67
|
"typescript": "^5.9.3",
|
|
68
|
-
"typescript-eslint": "^8.
|
|
69
|
-
"vitest": "^4.0.
|
|
68
|
+
"typescript-eslint": "^8.50.1",
|
|
69
|
+
"vitest": "^4.0.16"
|
|
70
70
|
},
|
|
71
71
|
"engines": {
|
|
72
72
|
"node": ">=20"
|
|
@@ -164,5 +164,5 @@
|
|
|
164
164
|
},
|
|
165
165
|
"type": "module",
|
|
166
166
|
"types": "dist/types/index.d.ts",
|
|
167
|
-
"version": "0.
|
|
167
|
+
"version": "0.12.0"
|
|
168
168
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var t=require("node:fs/promises"),e=require("node:path");const s=1048576;exports.classifyForArchive=async(n,r)=>{const a=[],i=[],o=[];await Promise.all(r.map(async r=>{const c=r.replace(/\\/g,"/"),l=e.resolve(n,r);let h=0;try{h=(await t.stat(l)).size}catch{return}let u,p=!1;try{p=await(async e=>{try{const s=await t.open(e,"r");try{const t=Buffer.allocUnsafe(8192),{bytesRead:e}=await s.read(t,0,t.length,0);for(let s=0;s<e;s+=1)if(0===t[s])return!0;return!1}finally{await s.close().catch(()=>{})}}catch{return!1}})(l)}catch{p=!1}if(p)i.push({path:c,size:h});else{a.push(c);try{(h<=s||h<5*s)&&(u=(t=>{const e=t.replace(/\r\n/g,"\n");return 0===e.length?0:e.split("\n").length})(await t.readFile(l,"utf8")))}catch{}(h>s||"number"==typeof u&&u>3e3)&&o.push({path:c,size:h,loc:u})}}));const c=[];if(i.length>0){c.push(`Binary files excluded from archive (${i.length.toString()}):`);for(const t of i)c.push(` - ${t.path} (${t.size.toString()} bytes)`);c.push("")}if(o.length>0){c.push(`Large text files (included; consider excludes if unwanted) (${o.length.toString()}):`);for(const t of o){const e=[` - ${t.path}`,`(${t.size.toString()} bytes)`];"number"==typeof t.loc&&e.push(`${t.loc.toString()} LOC`),c.push(e.join(" "))}c.push(""),c.push(`Thresholds: size > ${s.toString()} bytes or LOC > ${3e3.toString()}`)}0===c.length&&c.push("No archive warnings.");const l=c.join("\n")+(c.length?"\n":"");return{textFiles:a,excludedBinaries:i,largeText:o,warningsBody:l}};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { stat, open, readFile } from 'node:fs/promises';
|
|
3
|
-
import { resolve } from 'node:path';
|
|
4
|
-
|
|
5
|
-
const s=1048576,o=async(o,i)=>{const a=[],c=[],h=[];await Promise.all(i.map(async i=>{const l=i.replace(/\\/g,"/");const u=resolve(o,i);let p=0;try{p=(await stat(u)).size;}catch{return}let f,g=false;try{g=await(async t=>{try{const e=await open(t,"r");try{const t=Buffer.allocUnsafe(8192),{bytesRead:n}=await e.read(t,0,t.length,0);for(let e=0;e<n;e+=1)if(0===t[e])return !0;return !1}finally{await e.close().catch(()=>{});}}catch{return !1}})(u);}catch{g=false;}if(g)return void c.push({path:l,size:p});a.push(l);try{if(p<=s||p<5*s){f=(t=>{const e=t.replace(/\r\n/g,"\n");return 0===e.length?0:e.split("\n").length})(await readFile(u,"utf8"));}}catch{}(p>s||"number"==typeof f&&f>3e3)&&h.push({path:l,size:p,loc:f});}));const l=[];if(c.length>0){l.push(`Binary files excluded from archive (${c.length.toString()}):`);for(const t of c)l.push(` - ${t.path} (${t.size.toString()} bytes)`);l.push("");}if(h.length>0){l.push(`Large text files (included; consider excludes if unwanted) (${h.length.toString()}):`);for(const t of h){const e=[` - ${t.path}`,`(${t.size.toString()} bytes)`];"number"==typeof t.loc&&e.push(`${t.loc.toString()} LOC`),l.push(e.join(" "));}l.push(""),l.push(`Thresholds: size > ${s.toString()} bytes or LOC > ${3e3.toString()}`);}0===l.length&&l.push("No archive warnings.");const u=l.join("\n")+(l.length?"\n":"");return {textFiles:a,excludedBinaries:c,largeText:h,warningsBody:u}};
|
|
6
|
-
|
|
7
|
-
export { o as classifyForArchive };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{stat as t,open as e,readFile as n}from"node:fs/promises";import{resolve as s}from"node:path";const r=1048576,o=async(o,a)=>{const i=[],c=[],h=[];await Promise.all(a.map(async a=>{const l=a.replace(/\\/g,"/"),p=s(o,a);let u=0;try{u=(await t(p)).size}catch{return}let f,g=!1;try{g=await(async t=>{try{const n=await e(t,"r");try{const t=Buffer.allocUnsafe(8192),{bytesRead:e}=await n.read(t,0,t.length,0);for(let n=0;n<e;n+=1)if(0===t[n])return!0;return!1}finally{await n.close().catch(()=>{})}}catch{return!1}})(p)}catch{g=!1}if(g)c.push({path:l,size:u});else{i.push(l);try{(u<=r||u<5*r)&&(f=(t=>{const e=t.replace(/\r\n/g,"\n");return 0===e.length?0:e.split("\n").length})(await n(p,"utf8")))}catch{}(u>r||"number"==typeof f&&f>3e3)&&h.push({path:l,size:u,loc:f})}}));const l=[];if(c.length>0){l.push(`Binary files excluded from archive (${c.length.toString()}):`);for(const t of c)l.push(` - ${t.path} (${t.size.toString()} bytes)`);l.push("")}if(h.length>0){l.push(`Large text files (included; consider excludes if unwanted) (${h.length.toString()}):`);for(const t of h){const e=[` - ${t.path}`,`(${t.size.toString()} bytes)`];"number"==typeof t.loc&&e.push(`${t.loc.toString()} LOC`),l.push(e.join(" "))}l.push(""),l.push(`Thresholds: size > ${r.toString()} bytes or LOC > ${3e3.toString()}`)}0===l.length&&l.push("No archive warnings.");const p=l.join("\n")+(l.length?"\n":"");return{textFiles:i,excludedBinaries:c,largeText:h,warningsBody:p}};export{o as classifyForArchive};
|