@launch11/srgical 0.0.4 → 0.0.5

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/CHANGELOG.md ADDED
@@ -0,0 +1,11 @@
1
+ # Changelog
2
+
3
+ Release history is tracked through git tags, GitHub Releases, GitHub Packages, and npm.
4
+
5
+ The repo keeps a base version line in `package.json`, and CI computes the next patch version at release time.
6
+
7
+ ## Notes
8
+
9
+ - Detailed per-release notes currently live on GitHub Releases.
10
+ - Run `srgical changelog` to jump straight to the installed version's release notes.
11
+ - Run `srgical about` for package, release, and support details.
package/README.md CHANGED
@@ -27,9 +27,15 @@ plan. It creates momentum:
27
27
 
28
28
  This repo currently ships the foundation for:
29
29
 
30
+ - `srgical --version`
31
+ Prints the installed version with release-note links instead of only echoing the semver.
30
32
  - `srgical doctor`
31
33
  Reports whether the current workspace has a planning pack, which supported agent is active, and which supported
32
34
  agents are available locally.
35
+ - `srgical about`
36
+ Shows package details, release links, and the currently supported agent adapters.
37
+ - `srgical changelog`
38
+ Points straight at the installed version's release notes and the local packaged changelog.
33
39
  - `srgical init`
34
40
  Creates a local `.srgical/` planning pack from built-in templates.
35
41
  - `srgical studio`
@@ -138,7 +144,10 @@ npm run dev -- studio
138
144
  Typical flow once a workspace has a pack:
139
145
 
140
146
  ```bash
147
+ node dist/index.js --version
148
+ node dist/index.js about
141
149
  node dist/index.js doctor
150
+ node dist/index.js changelog
142
151
  node dist/index.js run-next --dry-run
143
152
  node dist/index.js run-next
144
153
  ```
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.runAboutCommand = runAboutCommand;
7
+ exports.renderAboutSummary = renderAboutSummary;
8
+ const node_process_1 = __importDefault(require("node:process"));
9
+ const agent_1 = require("../core/agent");
10
+ const package_info_1 = require("../core/package-info");
11
+ function runAboutCommand() {
12
+ node_process_1.default.stdout.write(`${renderAboutSummary()}\n`);
13
+ }
14
+ function renderAboutSummary() {
15
+ const info = (0, package_info_1.readInstalledPackageInfo)();
16
+ const supportedAgents = (0, agent_1.getSupportedAgentAdapters)().map((adapter) => adapter.id).join(", ");
17
+ return [
18
+ "srgical",
19
+ `Version: ${info.version}`,
20
+ `Package: ${info.name}`,
21
+ `Description: ${info.description}`,
22
+ info.homepage ? `Homepage: ${info.homepage}` : null,
23
+ info.repositoryUrl ? `Repository: ${info.repositoryUrl}` : null,
24
+ info.issuesUrl ? `Issues: ${info.issuesUrl}` : null,
25
+ info.releaseNotesUrl ? `Release notes: ${info.releaseNotesUrl}` : null,
26
+ info.releasesUrl ? `All releases: ${info.releasesUrl}` : null,
27
+ `Supported agents: ${supportedAgents || "none registered"}`,
28
+ "Next steps: `srgical doctor`, `srgical studio`, or `srgical changelog`"
29
+ ]
30
+ .filter(Boolean)
31
+ .join("\n");
32
+ }
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.runChangelogCommand = runChangelogCommand;
7
+ exports.renderChangelogSummary = renderChangelogSummary;
8
+ const node_process_1 = __importDefault(require("node:process"));
9
+ const package_info_1 = require("../core/package-info");
10
+ function runChangelogCommand() {
11
+ node_process_1.default.stdout.write(`${renderChangelogSummary()}\n`);
12
+ }
13
+ function renderChangelogSummary() {
14
+ const info = (0, package_info_1.readInstalledPackageInfo)();
15
+ const changelog = (0, package_info_1.readLocalChangelog)();
16
+ const placeholder = (0, package_info_1.isPlaceholderChangelog)(changelog);
17
+ return [
18
+ `Installed version: ${info.version}`,
19
+ info.releaseNotesUrl ? `Release notes: ${info.releaseNotesUrl}` : null,
20
+ info.releasesUrl ? `All releases: ${info.releasesUrl}` : null,
21
+ "",
22
+ placeholder
23
+ ? "Local package changelog is currently minimal. Use the release notes URL above for the detailed upgrade notes."
24
+ : "Local CHANGELOG.md:",
25
+ !placeholder && changelog ? changelog : null
26
+ ]
27
+ .filter((line) => line !== null)
28
+ .join("\n");
29
+ }
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.runVersionCommand = runVersionCommand;
7
+ exports.renderVersionSummary = renderVersionSummary;
8
+ const node_process_1 = __importDefault(require("node:process"));
9
+ const package_info_1 = require("../core/package-info");
10
+ function runVersionCommand() {
11
+ node_process_1.default.stdout.write(`${renderVersionSummary()}\n`);
12
+ }
13
+ function renderVersionSummary() {
14
+ const info = (0, package_info_1.readInstalledPackageInfo)();
15
+ return [
16
+ `srgical ${info.version}`,
17
+ info.description,
18
+ `Package: ${info.name}`,
19
+ info.releaseNotesUrl ? `Release notes: ${info.releaseNotesUrl}` : null,
20
+ info.releasesUrl ? `All releases: ${info.releasesUrl}` : null,
21
+ "More: run `srgical about`"
22
+ ]
23
+ .filter(Boolean)
24
+ .join("\n");
25
+ }
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.readInstalledPackageInfo = readInstalledPackageInfo;
7
+ exports.readLocalChangelog = readLocalChangelog;
8
+ exports.isPlaceholderChangelog = isPlaceholderChangelog;
9
+ const node_fs_1 = require("node:fs");
10
+ const node_path_1 = __importDefault(require("node:path"));
11
+ function readInstalledPackageInfo() {
12
+ const packageRoot = resolvePackageRoot();
13
+ const packageJsonPath = node_path_1.default.join(packageRoot, "package.json");
14
+ const packageJson = JSON.parse((0, node_fs_1.readFileSync)(packageJsonPath, "utf8"));
15
+ const repositoryUrl = normalizeRepositoryUrl(packageJson.repository);
16
+ const releasesUrl = repositoryUrl ? `${repositoryUrl}/releases` : undefined;
17
+ const version = packageJson.version ?? "0.0.0";
18
+ return {
19
+ packageRoot,
20
+ name: packageJson.name ?? "srgical",
21
+ version,
22
+ description: packageJson.description ?? "Local-first AI planning and execution orchestration.",
23
+ homepage: packageJson.homepage,
24
+ repositoryUrl,
25
+ issuesUrl: packageJson.bugs?.url,
26
+ releasesUrl,
27
+ releaseNotesUrl: releasesUrl ? `${releasesUrl}/tag/v${version}` : undefined,
28
+ changelogPath: node_path_1.default.join(packageRoot, "CHANGELOG.md")
29
+ };
30
+ }
31
+ function readLocalChangelog() {
32
+ const info = readInstalledPackageInfo();
33
+ try {
34
+ return (0, node_fs_1.readFileSync)(info.changelogPath, "utf8").trim();
35
+ }
36
+ catch {
37
+ return null;
38
+ }
39
+ }
40
+ function isPlaceholderChangelog(content) {
41
+ if (!content) {
42
+ return true;
43
+ }
44
+ const normalized = content.replace(/\r\n/g, "\n").trim();
45
+ return (normalized ===
46
+ "# Changelog\n\nRelease history is tracked through git tags, GitHub Releases, GitHub Packages, and npm.\n\nThe repo keeps a base version line in `package.json`, and CI computes the next patch version at release time.");
47
+ }
48
+ function resolvePackageRoot() {
49
+ return node_path_1.default.resolve(__dirname, "..", "..");
50
+ }
51
+ function normalizeRepositoryUrl(repository) {
52
+ const raw = typeof repository === "string"
53
+ ? repository
54
+ : repository && typeof repository === "object"
55
+ ? repository.url
56
+ : undefined;
57
+ if (!raw) {
58
+ return undefined;
59
+ }
60
+ return raw.replace(/^git\+/, "").replace(/\.git$/, "");
61
+ }
package/dist/index.js CHANGED
@@ -1,22 +1,43 @@
1
1
  #!/usr/bin/env node
2
2
  "use strict";
3
- var __importDefault = (this && this.__importDefault) || function (mod) {
4
- return (mod && mod.__esModule) ? mod : { "default": mod };
5
- };
6
3
  Object.defineProperty(exports, "__esModule", { value: true });
7
- const node_fs_1 = require("node:fs");
8
- const node_path_1 = __importDefault(require("node:path"));
9
4
  const commander_1 = require("commander");
5
+ const about_1 = require("./commands/about");
6
+ const changelog_1 = require("./commands/changelog");
10
7
  const doctor_1 = require("./commands/doctor");
11
8
  const init_1 = require("./commands/init");
12
9
  const run_next_1 = require("./commands/run-next");
13
10
  const studio_1 = require("./commands/studio");
11
+ const version_1 = require("./commands/version");
12
+ const package_info_1 = require("./core/package-info");
14
13
  const program = new commander_1.Command();
15
- const packageVersion = readPackageVersion();
14
+ const packageInfo = (0, package_info_1.readInstalledPackageInfo)();
15
+ if (isStandaloneVersionRequest(process.argv.slice(2))) {
16
+ (0, version_1.runVersionCommand)();
17
+ process.exit(0);
18
+ }
16
19
  program
17
20
  .name("srgical")
18
21
  .description("Local-first AI planning and execution orchestration.")
19
- .version(packageVersion);
22
+ .version(packageInfo.version, "-V, --version", "Show installed version and release info.");
23
+ program
24
+ .command("version")
25
+ .description("Show installed version and release info.")
26
+ .action(() => {
27
+ (0, version_1.runVersionCommand)();
28
+ });
29
+ program
30
+ .command("about")
31
+ .description("Show package, release, and supported-agent information.")
32
+ .action(() => {
33
+ (0, about_1.runAboutCommand)();
34
+ });
35
+ program
36
+ .command("changelog")
37
+ .description("Show where to find upgrade notes for the installed version.")
38
+ .action(() => {
39
+ (0, changelog_1.runChangelogCommand)();
40
+ });
20
41
  program
21
42
  .command("doctor")
22
43
  .description("Inspect the workspace and local agent availability.")
@@ -53,8 +74,6 @@ program.parseAsync(process.argv).catch((error) => {
53
74
  process.stderr.write(`${message}\n`);
54
75
  process.exitCode = 1;
55
76
  });
56
- function readPackageVersion() {
57
- const packageJsonPath = node_path_1.default.resolve(__dirname, "..", "package.json");
58
- const packageJson = JSON.parse((0, node_fs_1.readFileSync)(packageJsonPath, "utf8"));
59
- return packageJson.version ?? "0.0.0";
77
+ function isStandaloneVersionRequest(args) {
78
+ return args.length === 1 && (args[0] === "--version" || args[0] === "-V");
60
79
  }
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.runPostinstall = runPostinstall;
7
+ exports.renderPostinstallMessage = renderPostinstallMessage;
8
+ exports.shouldRenderPostinstallMessage = shouldRenderPostinstallMessage;
9
+ const node_process_1 = __importDefault(require("node:process"));
10
+ const package_info_1 = require("./core/package-info");
11
+ if (require.main === module) {
12
+ runPostinstall();
13
+ }
14
+ function runPostinstall() {
15
+ if (shouldRenderPostinstallMessage(node_process_1.default.env, node_process_1.default.stdout.isTTY === true)) {
16
+ node_process_1.default.stdout.write(`${renderPostinstallMessage()}\n`);
17
+ }
18
+ }
19
+ function renderPostinstallMessage() {
20
+ const info = (0, package_info_1.readInstalledPackageInfo)();
21
+ return [
22
+ "",
23
+ `srgical ${info.version} is ready.`,
24
+ info.releaseNotesUrl ? `Release notes: ${info.releaseNotesUrl}` : null,
25
+ "Start here: srgical doctor",
26
+ "More: srgical about",
27
+ ""
28
+ ]
29
+ .filter(Boolean)
30
+ .join("\n");
31
+ }
32
+ function shouldRenderPostinstallMessage(env, isTTY) {
33
+ const globalInstall = env.npm_config_global === "true" || env.npm_config_location === "global";
34
+ const logLevel = (env.npm_config_loglevel ?? "").toLowerCase();
35
+ const quietLogLevel = logLevel === "silent" || logLevel === "error";
36
+ return globalInstall && isTTY && env.CI !== "true" && !quietLogLevel;
37
+ }
package/package.json CHANGED
@@ -1,10 +1,12 @@
1
1
  {
2
2
  "name": "@launch11/srgical",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "description": "A polished local-first CLI for planning and executing long AI-driven delivery sequences.",
5
5
  "files": [
6
6
  "dist",
7
7
  "README.md",
8
+ "CHANGELOG.md",
9
+ "postinstall.js",
8
10
  "docs",
9
11
  "LICENSE"
10
12
  ],
@@ -15,6 +17,7 @@
15
17
  "build": "tsc -p tsconfig.json",
16
18
  "dev": "tsx src/index.ts",
17
19
  "start": "node dist/index.js",
20
+ "postinstall": "node postinstall.js",
18
21
  "doctor": "tsx src/index.ts doctor",
19
22
  "test": "tsx --test test/**/*.test.ts",
20
23
  "test:coverage": "tsx --test --experimental-test-coverage test/**/*.test.ts"
package/postinstall.js ADDED
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+
3
+ const fs = require("node:fs");
4
+ const path = require("node:path");
5
+
6
+ const compiledEntry = path.join(__dirname, "dist", "postinstall.js");
7
+
8
+ if (fs.existsSync(compiledEntry)) {
9
+ const postinstall = require(compiledEntry);
10
+
11
+ if (postinstall && typeof postinstall.runPostinstall === "function") {
12
+ postinstall.runPostinstall();
13
+ }
14
+ }