apiblaze 0.21.38 → 0.21.39

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 +44 -7
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -34,7 +34,7 @@ var __toESM = (mod, isNodeMode, target2) => (target2 = mod != null ? __create(__
34
34
  var version;
35
35
  var init_package = __esm({
36
36
  "package.json"() {
37
- version = "0.21.38";
37
+ version = "0.21.39";
38
38
  }
39
39
  });
40
40
 
@@ -8703,7 +8703,7 @@ async function journey(label3, work, home, checks) {
8703
8703
  }
8704
8704
  async function runOpAnon(o = {}) {
8705
8705
  const t0 = Date.now();
8706
- const root = import_fs10.default.mkdtempSync(import_path7.default.join(import_os2.default.tmpdir(), `${B.cli}-op-anon-`));
8706
+ const root = import_fs10.default.mkdtempSync(import_path7.default.join(import_os3.default.tmpdir(), `${B.cli}-op-anon-`));
8707
8707
  const home = import_path7.default.join(root, "home");
8708
8708
  const work = import_path7.default.join(root, "work");
8709
8709
  import_fs10.default.mkdirSync(home);
@@ -8745,12 +8745,12 @@ async function runOpAnon(o = {}) {
8745
8745
  if (failed) process.exitCode = 1;
8746
8746
  return { ok: !failed, checks };
8747
8747
  }
8748
- var import_fs10, import_os2, import_path7, import_child_process5, import_chalk70, SECRET;
8748
+ var import_fs10, import_os3, import_path7, import_child_process5, import_chalk70, SECRET;
8749
8749
  var init_op_anon = __esm({
8750
8750
  "src/commands/op-anon.ts"() {
8751
8751
  "use strict";
8752
8752
  import_fs10 = __toESM(require("fs"));
8753
- import_os2 = __toESM(require("os"));
8753
+ import_os3 = __toESM(require("os"));
8754
8754
  import_path7 = __toESM(require("path"));
8755
8755
  import_child_process5 = require("child_process");
8756
8756
  import_chalk70 = __toESM(require("chalk"));
@@ -9280,6 +9280,7 @@ init_create();
9280
9280
 
9281
9281
  // src/commands/skill.ts
9282
9282
  var import_fs7 = __toESM(require("fs"));
9283
+ var import_os2 = __toESM(require("os"));
9283
9284
  var import_path6 = __toESM(require("path"));
9284
9285
  var import_chalk25 = __toESM(require("chalk"));
9285
9286
  init_brand();
@@ -9602,7 +9603,32 @@ function folderReport(f, opts = {}) {
9602
9603
  ownApi: true
9603
9604
  };
9604
9605
  }
9605
- function heroMarkdown(found) {
9606
+ function blockedMarkdown() {
9607
+ return `## If a command is blocked or fails
9608
+
9609
+ A permission prompt declined, a command denied, or a step needing access you do not have:
9610
+ - **A step the rest depends on** (the tunnel, creating the proxy, its key): stop there. In one
9611
+ line, say what it was for and give the user the exact command to run themselves
9612
+ (\`! <command>\` in Claude Code). Then wait. If they would rather not, say it stops here.
9613
+ - **An optional step** (groups, admins, widgets, a rule, limits): skip it. Say in one line what
9614
+ is missing because of it, and carry on with what does not need it.
9615
+ - **Always:** never retry it in pieces, take another route, or write code to replace it. Never
9616
+ say something works until you have checked it: a call that answered, or a page you loaded.
9617
+ `;
9618
+ }
9619
+ function staleSkillCopies(cwd = process.cwd(), home = import_os2.default.homedir()) {
9620
+ const current = skillMarkdown();
9621
+ const out = [];
9622
+ for (const dir of /* @__PURE__ */ new Set([cwd, home])) {
9623
+ const f = import_path6.default.join(dir, SKILL_RELATIVE_PATH);
9624
+ try {
9625
+ if (import_fs7.default.readFileSync(f, "utf8") !== current) out.push(f);
9626
+ } catch {
9627
+ }
9628
+ }
9629
+ return out;
9630
+ }
9631
+ function heroMarkdown(found, stale = []) {
9606
9632
  const P = B.product;
9607
9633
  const run2 = `npx ${B.cli}@latest`;
9608
9634
  const report = found ? folderReport(found) : null;
@@ -9644,6 +9670,15 @@ description: Use when the user asks what ${P} (or ${B.cli}) does or can do for t
9644
9670
 
9645
9671
  # ${P}
9646
9672
 
9673
+ This output is current: it replaces any copy of this skill loaded earlier.
9674
+ ${stale.length ? `
9675
+ ## Outdated copies are installed: ignore them
9676
+
9677
+ ${stale.map((f) => `- \`${f}\``).join("\n")}
9678
+
9679
+ They hold an older walkthrough. Follow only what this output says. Tell the user once that the
9680
+ file is outdated (re-run \`${run2} skills --install --force\` in that folder to refresh it).
9681
+ ` : ""}
9647
9682
  ${folder}
9648
9683
  ## Explain: they ask what ${P} does or can do for them
9649
9684
 
@@ -9670,6 +9705,7 @@ Rules for the demo: keep each update to one line. Do not narrate steps, read the
9670
9705
  files, open logs, run other commands, or write code. Never show a key: the demo saves it
9671
9706
  in \`.env.local\` and never prints it.
9672
9707
 
9708
+ ${blockedMarkdown()}
9673
9709
  ## Their own app: they say yes after the demo
9674
9710
 
9675
9711
  Their app runs on this machine \u2192 it will use \`${run2} dev\`; it is deployed \u2192 \`${run2} create\`.
@@ -9702,7 +9738,8 @@ No code yet? Write the smallest plain backend that does exactly that, plus its \
9702
9738
  `;
9703
9739
  return withLatest(`# Put ${B.product} in front of their app
9704
9740
 
9705
- ${backendRules}${at >= 0 ? legacy.slice(at) : legacy}`);
9741
+ ${backendRules}${blockedMarkdown()}
9742
+ ${at >= 0 ? legacy.slice(at) : legacy}`);
9706
9743
  }
9707
9744
  function skillMarkdown() {
9708
9745
  return `${heroMarkdown()}
@@ -10169,7 +10206,7 @@ async function runSkill(opts = {}) {
10169
10206
  }
10170
10207
  const found = await detectBackend(process.cwd());
10171
10208
  if (readByAgent(opts)) {
10172
- process.stdout.write(heroMarkdown(found));
10209
+ process.stdout.write(heroMarkdown(found, staleSkillCopies()));
10173
10210
  return;
10174
10211
  }
10175
10212
  await runForPerson(found);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apiblaze",
3
- "version": "0.21.38",
3
+ "version": "0.21.39",
4
4
  "description": "APIblaze CLI — Chat with your APIs, Manage your API keys, users and groups with the APIblaze serverless proxy",
5
5
  "keywords": [
6
6
  "apiblaze",