@telepath-computer/television 0.1.83 → 0.1.84

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.cjs CHANGED
@@ -50093,10 +50093,18 @@ function findCardIDInNode(node, artifactID) {
50093
50093
  var import_meta = {};
50094
50094
  var DAEMON_NAME = "com.television.server";
50095
50095
  var MAX_PORT = 65535;
50096
- var HELP_POINTER = "Load/read the installed `television` skill. Start with `SKILL.md` for the mental model and the artifact-vs-chat decision. If the skill is not installed, you can use `tv skills install` (interactive, not agent-friendly) or `tv skills show` (agent-friendly, prints bundled skill files directly). For CLI commands, focus, and screen placement, read `cli-capabilities.md`. For artifact lifecycle work, read `artifact-workflow.md`. For HTML artifact work, also read `html-house-style.md` and the relevant `artifact-types/*.md` companion doc.";
50096
+ var HELP_POINTER = "Load/read the installed `television` skill. If the skill is not installed, the bundled content is reachable via `tv skills show` \u2014 no arguments lists the relative paths and their descriptions; passing a relative path prints that file. Key relative paths (arguments to `tv skills show`): `SKILL.md` for the mental model and the artifact-vs-chat decision; `cli-capabilities.md` for commands, focus, and screen placement; `artifact-workflow.md` for artifact lifecycle work; `html-house-style.md` for HTML artifact authoring; `artifact-types/<kind>.md` for kind-specific authoring.";
50097
50097
  var CLIDirectiveError = class extends Error {
50098
50098
  name = "CLIDirectiveError";
50099
50099
  };
50100
+ var CLISilentExitError = class extends Error {
50101
+ name = "CLISilentExitError";
50102
+ silentExitCode;
50103
+ constructor(silentExitCode = 1) {
50104
+ super("");
50105
+ this.silentExitCode = silentExitCode;
50106
+ }
50107
+ };
50100
50108
  function writeJSON(output, value) {
50101
50109
  output.write(`${JSON.stringify(value)}
50102
50110
  `);
@@ -50123,8 +50131,8 @@ function resolveVercelSkillsInstallerBin() {
50123
50131
  return localRequire.resolve("skills/bin/cli.mjs");
50124
50132
  }
50125
50133
  function readCLIVersion() {
50126
- if ("0.1.83".length > 0) {
50127
- return "0.1.83";
50134
+ if ("0.1.84".length > 0) {
50135
+ return "0.1.84";
50128
50136
  }
50129
50137
  const devPackageJsonPath = import_node_path7.default.join(getDevPackageDir(), "package.json");
50130
50138
  if (!(0, import_node_fs4.existsSync)(devPackageJsonPath)) {
@@ -50151,24 +50159,30 @@ function buildAgentHelpNote() {
50151
50159
  "",
50152
50160
  "Agent workflow note:",
50153
50161
  " Load/read the installed `television` skill before Television work.",
50154
- " `SKILL.md` carries the mental model and the artifact-vs-chat decision.",
50155
- " `cli-capabilities.md` covers commands, focus, and screen placement.",
50156
- " For artifact lifecycle work, read `artifact-workflow.md`.",
50157
- " For HTML artifacts, also read `html-house-style.md`.",
50158
- " Known artifact-type docs:",
50159
- formatArtifactTypeDocsList(),
50160
- " If the Television skill is not installed, you can use `tv skills install` (interactive) or `tv skills show` (agent-friendly, prints the bundled skill files directly)."
50162
+ " If the skill is not installed, the bundled content is reachable via the CLI:",
50163
+ " tv skills show lists relative paths and descriptions",
50164
+ " tv skills show <relative-path> prints one file",
50165
+ " Key relative paths (arguments to `tv skills show`):",
50166
+ " SKILL.md \u2014 mental model and artifact-vs-chat decision",
50167
+ " cli-capabilities.md \u2014 commands, focus, screen placement",
50168
+ " artifact-workflow.md \u2014 artifact lifecycle",
50169
+ " html-house-style.md \u2014 HTML artifact authoring",
50170
+ " Known artifact-type relative paths:",
50171
+ formatArtifactTypeDocsList()
50161
50172
  ].join("\n");
50162
50173
  }
50163
50174
  function buildArtifactWorkflowHelpNote(includeHTMLNote) {
50164
50175
  const lines = [
50165
50176
  "",
50166
50177
  "Agent note:",
50167
- " If you are an agent doing artifact lifecycle work, load/read the `television` skill and `artifact-workflow.md`."
50178
+ " If you are an agent doing artifact lifecycle work, load/read the `television` skill \u2014 in particular `artifact-workflow.md`.",
50179
+ " If the skill is not installed, read it with `tv skills show artifact-workflow.md`."
50168
50180
  ];
50169
50181
  if (includeHTMLNote) {
50170
- lines.push(" If you are authoring an HTML artifact, also read `html-house-style.md`.");
50171
- lines.push(" Known artifact-type docs:");
50182
+ lines.push(
50183
+ " If you are authoring an HTML artifact, also read `html-house-style.md` (`tv skills show html-house-style.md`)."
50184
+ );
50185
+ lines.push(" Known artifact-type relative paths (arguments to `tv skills show`):");
50172
50186
  lines.push(formatArtifactTypeDocsList());
50173
50187
  }
50174
50188
  return lines.join("\n");
@@ -50215,17 +50229,33 @@ function listSkillFiles(skillRoot, prefix = "") {
50215
50229
  function resolveSkillFilePath(skillRoot, relativePath) {
50216
50230
  const normalized = import_node_path7.default.posix.normalize(relativePath);
50217
50231
  if (normalized.startsWith("../") || normalized === ".." || import_node_path7.default.isAbsolute(relativePath)) {
50218
- throw createDirectiveError("tv skills show requires a relative path within the television skill root.");
50232
+ return { kind: "invalid-path" };
50219
50233
  }
50220
50234
  const resolved = import_node_path7.default.join(skillRoot, normalized);
50221
50235
  const relativeResolved = import_node_path7.default.relative(skillRoot, resolved);
50222
50236
  if (relativeResolved.startsWith("..") || import_node_path7.default.isAbsolute(relativeResolved)) {
50223
- throw createDirectiveError("tv skills show requires a relative path within the television skill root.");
50237
+ return { kind: "invalid-path" };
50224
50238
  }
50225
50239
  if (!(0, import_node_fs4.existsSync)(resolved)) {
50226
- throw createDirectiveError(`tv skills show could not find ${relativePath} in the television skill.`);
50240
+ return { kind: "not-found" };
50227
50241
  }
50228
- return resolved;
50242
+ return { kind: "ok", absolutePath: resolved };
50243
+ }
50244
+ function writeSkillListing(stdout, skillRoot) {
50245
+ const manifest = readSkillManifest(skillRoot);
50246
+ if (manifest.version !== void 0) {
50247
+ writeLine(stdout, `Television skill content version: ${manifest.version}`);
50248
+ writeLine(stdout, "");
50249
+ }
50250
+ writeLine(stdout, "Relative paths inside the bundled `television` skill:");
50251
+ writeLine(stdout, "");
50252
+ for (const file2 of listSkillFiles(skillRoot)) {
50253
+ const description = manifest.descriptions.get(file2);
50254
+ writeLine(stdout, description ? `${file2} \u2014 ${description}` : file2);
50255
+ }
50256
+ writeLine(stdout, "");
50257
+ writeLine(stdout, `Television skill root: ${skillRoot}`);
50258
+ writeLine(stdout, "To read one file directly: tv skills show <relative-path>");
50229
50259
  }
50230
50260
  function commandNameFromArgv(argv) {
50231
50261
  const commandName = argv.find((value) => !value.startsWith("-"));
@@ -50777,24 +50807,19 @@ If you wish to display temporary content to the user, use an internal artifact i
50777
50807
  throw new Error(`Could not resolve the bundled television skill root at ${skillRoot}.`);
50778
50808
  }
50779
50809
  if (relativePath === void 0) {
50780
- const manifest = readSkillManifest(skillRoot);
50781
- if (manifest.version !== void 0) {
50782
- writeLine(env.stdout, `Television skill content version: ${manifest.version}`);
50783
- writeLine(env.stdout, "");
50784
- }
50785
- writeLine(env.stdout, "Relative paths inside the bundled `television` skill:");
50786
- writeLine(env.stdout, "");
50787
- for (const file2 of listSkillFiles(skillRoot)) {
50788
- const description = manifest.descriptions.get(file2);
50789
- writeLine(env.stdout, description ? `${file2} \u2014 ${description}` : file2);
50790
- }
50791
- writeLine(env.stdout, "");
50792
- writeLine(env.stdout, `Television skill root: ${skillRoot}`);
50793
- writeLine(env.stdout, "To read one file directly: tv skills show <relative-path>");
50810
+ writeSkillListing(env.stdout, skillRoot);
50811
+ return;
50812
+ }
50813
+ const result = resolveSkillFilePath(skillRoot, relativePath);
50814
+ if (result.kind === "ok") {
50815
+ env.stdout.write((0, import_node_fs4.readFileSync)(result.absolutePath, "utf8"));
50794
50816
  return;
50795
50817
  }
50796
- const filepath = resolveSkillFilePath(skillRoot, relativePath);
50797
- env.stdout.write((0, import_node_fs4.readFileSync)(filepath, "utf8"));
50818
+ const preamble = result.kind === "invalid-path" ? `tv skills show: "${relativePath}" is not a relative path inside the bundled television skill.` : `tv skills show: no bundled Television skill file at "${relativePath}".`;
50819
+ writeLine(env.stdout, preamble);
50820
+ writeLine(env.stdout, "");
50821
+ writeSkillListing(env.stdout, skillRoot);
50822
+ throw new CLISilentExitError(1);
50798
50823
  });
50799
50824
  program2.command("stop").description("Stop the Television system service").action(async () => {
50800
50825
  const daemon = env.createDaemon();
@@ -50837,6 +50862,9 @@ async function runCLI(argv, environment = {}) {
50837
50862
  await program2.parseAsync(argv, { from: "user" });
50838
50863
  return 0;
50839
50864
  } catch (error48) {
50865
+ if (error48 instanceof CLISilentExitError) {
50866
+ return error48.silentExitCode;
50867
+ }
50840
50868
  if (error48 instanceof Error && "exitCode" in error48) {
50841
50869
  const commanderError = error48;
50842
50870
  if (commanderError.exitCode === 0) return 0;