pipe-kan 0.29.0 → 0.29.1

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/pipe-kan.js +23 -12
  2. package/package.json +1 -1
package/dist/pipe-kan.js CHANGED
@@ -11831,12 +11831,17 @@ function permissionOptionForDecision(options, decision) {
11831
11831
  // src/server/agent/skills.ts
11832
11832
  import { existsSync as existsSync3, readFileSync as readFileSync4, readdirSync } from "node:fs";
11833
11833
  import { homedir as homedir4 } from "node:os";
11834
- import { join as join6 } from "node:path";
11835
- function createSkillRegistry(bundledDir = join6(import.meta.dirname, "..", "..", "..", ".agents", "skills")) {
11834
+ import { dirname as dirname3, join as join6 } from "node:path";
11835
+ import { fileURLToPath } from "node:url";
11836
+ function moduleDirname(meta) {
11837
+ return meta.dirname ?? dirname3(fileURLToPath(meta.url));
11838
+ }
11839
+ function createSkillRegistry(bundledDir) {
11840
+ const dir = bundledDir ?? join6(moduleDirname(import.meta), "..", "..", "..", ".agents", "skills");
11836
11841
  const userDir = join6(homedir4(), ".pi", "agent", "skills");
11837
11842
  return {
11838
11843
  list() {
11839
- const bundled = listSkills(bundledDir);
11844
+ const bundled = listSkills(dir);
11840
11845
  const user = existsSync3(userDir) ? listSkills(userDir) : [];
11841
11846
  const map = new Map;
11842
11847
  for (const skill of bundled)
@@ -11849,7 +11854,7 @@ function createSkillRegistry(bundledDir = join6(import.meta.dirname, "..", "..",
11849
11854
  const userPath = skillPath(userDir, id);
11850
11855
  if (existsSync3(userPath))
11851
11856
  return readSkill(userPath, id);
11852
- const bundledPath = skillPath(bundledDir, id);
11857
+ const bundledPath = skillPath(dir, id);
11853
11858
  if (existsSync3(bundledPath))
11854
11859
  return readSkill(bundledPath, id);
11855
11860
  return;
@@ -11982,7 +11987,10 @@ var TOOLS = [
11982
11987
  mutates: true
11983
11988
  }
11984
11989
  ];
11985
- var skills = createSkillRegistry();
11990
+ var skills;
11991
+ function skillRegistry() {
11992
+ return skills ??= createSkillRegistry();
11993
+ }
11986
11994
  var EXECUTORS = {
11987
11995
  board_state(_, app) {
11988
11996
  const board = app.board();
@@ -12005,7 +12013,7 @@ var EXECUTORS = {
12005
12013
  const skillId = String(args.skillId ?? "");
12006
12014
  if (!skillId)
12007
12015
  return { ok: false, error: "Missing skillId" };
12008
- const skill = skills.load(skillId);
12016
+ const skill = skillRegistry().load(skillId);
12009
12017
  if (!skill)
12010
12018
  return { ok: false, error: `Skill not found: ${skillId}` };
12011
12019
  const block = skillContextBlock(skill);
@@ -12153,7 +12161,10 @@ function createToolRegistry() {
12153
12161
  var sessions = new Map;
12154
12162
  var connecting = null;
12155
12163
  var startEpoch = 0;
12156
- var skills2 = createSkillRegistry();
12164
+ var skills2;
12165
+ function skillRegistry2() {
12166
+ return skills2 ??= createSkillRegistry();
12167
+ }
12157
12168
  var tools = createToolRegistry();
12158
12169
  function json2(res, status, body) {
12159
12170
  res.statusCode = status;
@@ -12213,7 +12224,7 @@ function handleAgentApi(req, res, app) {
12213
12224
  return true;
12214
12225
  }
12215
12226
  if (url.pathname === "/api/agent/skills" && method === "GET") {
12216
- json2(res, 200, skills2.list().map((s) => ({ id: s.id, name: s.name, description: s.description })));
12227
+ json2(res, 200, skillRegistry2().list().map((s) => ({ id: s.id, name: s.name, description: s.description })));
12217
12228
  return true;
12218
12229
  }
12219
12230
  if (url.pathname === "/api/agent/session" && method === "POST") {
@@ -12291,7 +12302,7 @@ function handleAgentApi(req, res, app) {
12291
12302
  }
12292
12303
  const context = [tools.systemBlock(), ...withPipedBoardContext(app.board(), body.context ?? [])];
12293
12304
  if (body.skillId) {
12294
- const skill = skills2.load(body.skillId);
12305
+ const skill = skillRegistry2().load(body.skillId);
12295
12306
  if (skill)
12296
12307
  context.push(skillContextBlock(skill));
12297
12308
  }
@@ -12619,8 +12630,8 @@ function stdinStat() {
12619
12630
 
12620
12631
  // src/ui.ts
12621
12632
  import { createReadStream, existsSync as existsSync4, statSync } from "node:fs";
12622
- import { dirname as dirname3, extname, join as join9, resolve as resolve2, sep } from "node:path";
12623
- import { fileURLToPath } from "node:url";
12633
+ import { dirname as dirname4, extname, join as join9, resolve as resolve2, sep } from "node:path";
12634
+ import { fileURLToPath as fileURLToPath2 } from "node:url";
12624
12635
  var types = {
12625
12636
  ".css": "text/css; charset=utf-8",
12626
12637
  ".html": "text/html; charset=utf-8",
@@ -12633,7 +12644,7 @@ var types = {
12633
12644
  ".woff2": "font/woff2"
12634
12645
  };
12635
12646
  function packageRoot(from = import.meta.url) {
12636
- return resolve2(dirname3(fileURLToPath(from)), "..");
12647
+ return resolve2(dirname4(fileURLToPath2(from)), "..");
12637
12648
  }
12638
12649
  function uiDir(root) {
12639
12650
  return join9(root, "dist", "ui");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pipe-kan",
3
- "version": "0.29.0",
3
+ "version": "0.29.1",
4
4
  "description": "Local Kanban for jira-cli",
5
5
  "license": "MIT",
6
6
  "type": "module",