@tenderprompt/cli 0.1.8 → 0.1.9

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.
Files changed (2) hide show
  1. package/dist/index.js +34 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,11 +1,38 @@
1
1
  #!/usr/bin/env node
2
2
  import { spawn } from "node:child_process";
3
+ import { readFileSync } from "node:fs";
3
4
  import { mkdir, readFile, rename, writeFile } from "node:fs/promises";
4
5
  import os from "node:os";
5
6
  import path from "node:path";
6
7
  import { fileURLToPath } from "node:url";
7
8
  import { generateTenderAppEnvTypes, validateTenderApp, } from "@tenderprompt/tender-app-validator";
8
9
  import { collectTenderAppFiles } from "./local-files.js";
10
+ const CLI_PACKAGE_NAME = "@tenderprompt/cli";
11
+ const UNKNOWN_CLI_VERSION = "0.0.0";
12
+ const RECOMMENDED_TENDER_PROMPT_SKILL = {
13
+ name: "tender-prompt",
14
+ version: "0.1.1",
15
+ source: "git@github.com:tenderprompt/skills.git",
16
+ path: "skills/tender-prompt/SKILL.md",
17
+ updateHint: "Refresh the tender-prompt skill from git@github.com:tenderprompt/skills.git when the local skill version is older.",
18
+ };
19
+ function readCliPackageVersion() {
20
+ try {
21
+ const packageJsonPath = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../package.json");
22
+ const parsed = JSON.parse(readFileSync(packageJsonPath, "utf8"));
23
+ if (typeof parsed === "object" &&
24
+ parsed !== null &&
25
+ "version" in parsed &&
26
+ typeof parsed.version === "string") {
27
+ return parsed.version;
28
+ }
29
+ }
30
+ catch {
31
+ return UNKNOWN_CLI_VERSION;
32
+ }
33
+ return UNKNOWN_CLI_VERSION;
34
+ }
35
+ const CLI_PACKAGE_VERSION = readCliPackageVersion();
9
36
  class TenderCliUsageError extends Error {
10
37
  constructor(message) {
11
38
  super(message);
@@ -638,9 +665,15 @@ function tenderCliCapabilities() {
638
665
  return {
639
666
  ok: true,
640
667
  surface: "tender_cli",
668
+ cli: {
669
+ name: CLI_PACKAGE_NAME,
670
+ version: CLI_PACKAGE_VERSION,
671
+ latestRunner: "npm exec --yes @tenderprompt/cli@latest --",
672
+ },
673
+ recommendedSkill: RECOMMENDED_TENDER_PROMPT_SKILL,
641
674
  description: "Agent-safe Tender App source, lifecycle, analytics, and local scaffold controls.",
642
675
  discovery: {
643
- primary: "tender capabilities --json",
676
+ primary: "npm exec --yes @tenderprompt/cli@latest -- capabilities --json",
644
677
  layeredHelp: [
645
678
  "tender --help",
646
679
  "tender auth --help",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tenderprompt/cli",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "tender": "bin/tender.js"