@karmaniverous/stan-cli 0.8.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.
@@ -0,0 +1,60 @@
1
+ import { ContextConfig } from '@karmaniverous/stan-core';
2
+
3
+ /**
4
+ * Render a help footer that lists available script keys and examples. *
5
+ * @param cwd - Repo root (or descendant) used to locate `stan.config.*`.
6
+ * @returns Multi‑line string (empty when config cannot be loaded).
7
+ *
8
+ * Notes:
9
+ * - Examples reflect the new flags (`-s`, `-x`, `-q`) and defaults (run all + archives).
10
+ * - When `STAN_DEBUG=1`, logs the reason configuration could not be loaded.
11
+ */
12
+ declare const renderAvailableScriptsHelp: (cwd: string) => string;
13
+
14
+ /**
15
+ * Script selection:
16
+ * - `string[]` selects the listed keys,
17
+ * - `null` denotes “all configured scripts”.
18
+ */
19
+ type Selection = string[] | null;
20
+ /** Execution strategy for running scripts. */
21
+ type ExecutionMode = 'concurrent' | 'sequential';
22
+ /**
23
+ * Behavior flags controlling archive/combine/keep semantics:
24
+ * - `archive`: create archive.tar and archive.diff.tar.
25
+ * - `combine`: include script outputs inside archives and remove them on disk.
26
+ * - `keep`: do not clear the output directory before running.
27
+ * - `plan`: when false, suppress printing the run plan before execution.
28
+ */
29
+ type RunBehavior = {
30
+ combine?: boolean;
31
+ keep?: boolean;
32
+ archive?: boolean;
33
+ live?: boolean;
34
+ hangWarn?: number;
35
+ hangKill?: number;
36
+ hangKillGrace?: number;
37
+ plan?: boolean;
38
+ };
39
+
40
+ /**
41
+ * High‑level runner for `stan run`.
42
+ *
43
+ * Responsibilities:
44
+ * - Preflight docs/version (best‑effort).
45
+ * - Ensure output/diff directories.
46
+ * - Print the run plan.
47
+ * - Execute selected scripts (in the chosen mode).
48
+ * - Optionally create regular and diff archives (combine/keep behaviors).
49
+ *
50
+ * @param cwd - Repo root for execution.
51
+ * @param config - Resolved configuration.
52
+ * @param selection - Explicit list of script keys (or `null` to run all).
53
+ * @param mode - Execution mode (`concurrent` by default).
54
+ * @param behaviorMaybe - Archive/combine/keep flags.
55
+ * @returns Absolute paths to created artifacts (script outputs and/or archives).
56
+ */
57
+ declare const runSelected: (cwd: string, config: ContextConfig, selection?: string[] | null, mode?: ExecutionMode, behaviorMaybe?: RunBehavior) => Promise<string[]>;
58
+
59
+ export { renderAvailableScriptsHelp, runSelected };
60
+ export type { ExecutionMode, RunBehavior, Selection };
package/package.json ADDED
@@ -0,0 +1,167 @@
1
+ {
2
+ "author": "Jason Williscroft",
3
+ "auto-changelog": {
4
+ "output": "CHANGELOG.md",
5
+ "unreleased": true,
6
+ "commitLimit": false,
7
+ "hideCredit": true
8
+ },
9
+ "bin": {
10
+ "stan": "./dist/cli/stan.js"
11
+ },
12
+ "bugs": {
13
+ "url": "https://github.com/karmaniverous/stan-cli/issues"
14
+ },
15
+ "dependencies": {
16
+ "@karmaniverous/stan-core": "^0.1.1",
17
+ "@vitest/eslint-plugin": "^1.3.16",
18
+ "chalk": "^5.6.2",
19
+ "clipboardy": "^5.0.0",
20
+ "commander": "^14.0.1",
21
+ "fs-extra": "^11.3.2",
22
+ "inquirer": "^12.9.6",
23
+ "log-update": "^7.0.1",
24
+ "package-directory": "^8.1.0",
25
+ "signal-exit": "^4.1.0",
26
+ "table": "^6.9.0",
27
+ "tree-kill": "^1.2.2",
28
+ "yaml": "^2.8.1"
29
+ },
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
+ "devDependencies": {
32
+ "@dotenvx/dotenvx": "^1.51.0",
33
+ "@eslint/js": "^9.37.0",
34
+ "@rollup/plugin-alias": "^5.1.1",
35
+ "@rollup/plugin-commonjs": "^28.0.6",
36
+ "@rollup/plugin-json": "^6.1.0",
37
+ "@rollup/plugin-node-resolve": "^16.0.2",
38
+ "@rollup/plugin-terser": "^0.4.4",
39
+ "@rollup/plugin-typescript": "^12.1.4",
40
+ "@types/eslint-config-prettier": "^6.11.3",
41
+ "@types/fs-extra": "^11.0.4",
42
+ "@types/node": "^24.7.0",
43
+ "@vitest/coverage-v8": "^3.2.4",
44
+ "auto-changelog": "^2.5.0",
45
+ "eslint": "^9.37.0",
46
+ "eslint-config-prettier": "^10.1.8",
47
+ "eslint-plugin-jsonc": "^2.21.0",
48
+ "eslint-plugin-prettier": "^5.5.4",
49
+ "eslint-plugin-simple-import-sort": "^12.1.1",
50
+ "eslint-plugin-tsdoc": "^0.4.0",
51
+ "happy-dom": "^19.0.2",
52
+ "jsonc-eslint-parser": "^2.4.1",
53
+ "knip": "^5.64.2",
54
+ "lefthook": "^1.13.6",
55
+ "prettier": "^3.6.2",
56
+ "release-it": "^19.0.5",
57
+ "rimraf": "^6.0.1",
58
+ "rollup": "^4.52.4",
59
+ "rollup-plugin-dts": "^6.2.3",
60
+ "tslib": "^2.8.1",
61
+ "tsx": "^4.20.6",
62
+ "typedoc": "^0.28.13",
63
+ "typedoc-plugin-mdn-links": "^5.0.9",
64
+ "typedoc-plugin-replace-text": "^4.2.0",
65
+ "typedoc-plugin-zod": "^1.4.2",
66
+ "typescript": "^5.9.3",
67
+ "typescript-eslint": "^8.46.0",
68
+ "vitest": "^3.2.4"
69
+ },
70
+ "engines": {
71
+ "node": ">=20"
72
+ },
73
+ "exports": {
74
+ ".": {
75
+ "import": {
76
+ "types": "./dist/index.d.ts",
77
+ "default": "./dist/mjs/index.js"
78
+ },
79
+ "require": {
80
+ "types": "./dist/index.d.ts",
81
+ "default": "./dist/cjs/index.js"
82
+ }
83
+ }
84
+ },
85
+ "files": [
86
+ "dist"
87
+ ],
88
+ "homepage": "https://github.com/karmaniverous/stan-cli#readme",
89
+ "keywords": [
90
+ "ai",
91
+ "ai-assisted",
92
+ "ai-assisted-development",
93
+ "cli",
94
+ "snapshot",
95
+ "archive",
96
+ "tar",
97
+ "unified-diff",
98
+ "patch",
99
+ "code-review",
100
+ "context",
101
+ "typescript",
102
+ "typedoc",
103
+ "eslint",
104
+ "prettier",
105
+ "rollup",
106
+ "vitest"
107
+ ],
108
+ "license": "BSD-3-Clause",
109
+ "main": "dist/cjs/index.js",
110
+ "module": "dist/mjs/index.js",
111
+ "name": "@karmaniverous/stan-cli",
112
+ "publishConfig": {
113
+ "access": "public"
114
+ },
115
+ "release-it": {
116
+ "git": {
117
+ "changelog": "npx auto-changelog --stdout --template https://raw.githubusercontent.com/release-it/release-it/main/templates/changelog-compact.hbs",
118
+ "commitMessage": "chore: release v${version}",
119
+ "requireBranch": "main"
120
+ },
121
+ "github": {
122
+ "release": true
123
+ },
124
+ "hooks": {
125
+ "after:init": [
126
+ "npm run lint",
127
+ "npm run test",
128
+ "npm run knip",
129
+ "npm run build"
130
+ ],
131
+ "before:npm:release": [
132
+ "npx auto-changelog -p",
133
+ "npm run docs",
134
+ "git add -A"
135
+ ],
136
+ "after:release": [
137
+ "git switch -c release/${version}",
138
+ "git push -u origin release/${version}",
139
+ "git switch ${branchName}"
140
+ ]
141
+ },
142
+ "npm": {
143
+ "publish": true
144
+ }
145
+ },
146
+ "repository": {
147
+ "type": "git",
148
+ "url": "git+https://github.com/karmaniverous/stan-cli.git"
149
+ },
150
+ "scripts": {
151
+ "build": "rimraf dist .rollup.cache .tsbuildinfo && rollup --config rollup.config.ts --configPlugin @rollup/plugin-typescript",
152
+ "changelog": "auto-changelog",
153
+ "docs": "typedoc",
154
+ "knip": "knip",
155
+ "lint": "eslint .",
156
+ "lint:fix": "npm run lint -- --fix .",
157
+ "release": "dotenvx run -f .env.local -- release-it",
158
+ "release:pre": "npm run release -- --no-git.requireBranch --github.prerelease --preRelease",
159
+ "relink": "npm uninstall -g @karmaniverous/stan-cli && npm run build && npm link",
160
+ "stan": "tsx src/cli/stan/stan.ts",
161
+ "test": "vitest --run --coverage --silent",
162
+ "typecheck": "tsc"
163
+ },
164
+ "type": "module",
165
+ "types": "dist/index.d.ts",
166
+ "version": "0.8.0"
167
+ }