pi-harness-runtime 1.1.422 → 1.1.423

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 (134) hide show
  1. package/index.ts +32 -1
  2. package/package.json +1 -1
  3. package/packages/a2a-adapter/package.json +1 -1
  4. package/packages/agent-policy/package.json +1 -1
  5. package/packages/architecture-generator/package.json +1 -1
  6. package/packages/auth/package.json +1 -1
  7. package/packages/autonomous-refactor/package.json +1 -1
  8. package/packages/autonomous-runtime/package.json +1 -1
  9. package/packages/cache-strategy/package.json +1 -1
  10. package/packages/capability-registry/package.json +1 -1
  11. package/packages/checkpoint/package.json +1 -1
  12. package/packages/cli-plugin-sdk/package.json +1 -1
  13. package/packages/clipboard/package.json +1 -1
  14. package/packages/clipboard-plugin/package.json +1 -1
  15. package/packages/code-generation/package.json +1 -1
  16. package/packages/code-review/package.json +1 -1
  17. package/packages/codex-adapter/package.json +1 -1
  18. package/packages/codex-watcher/package.json +1 -1
  19. package/packages/config-capture/package.json +1 -1
  20. package/packages/connection-runtime/package.json +1 -1
  21. package/packages/context-compiler/package.json +1 -1
  22. package/packages/context-discovery/package.json +1 -1
  23. package/packages/context-manager/package.json +1 -1
  24. package/packages/contracts/package.json +1 -1
  25. package/packages/cookie-sanitizer/package.json +1 -1
  26. package/packages/cost-optimizer/package.json +1 -1
  27. package/packages/dependency-analyzer/package.json +1 -1
  28. package/packages/django-plugin/package.json +1 -1
  29. package/packages/doc-generator/package.json +1 -1
  30. package/packages/durable-review/package.json +1 -1
  31. package/packages/e2e-tester/package.json +1 -1
  32. package/packages/evaluation-engine/package.json +1 -1
  33. package/packages/evaluation-runner/package.json +1 -1
  34. package/packages/event-bus/package.json +1 -1
  35. package/packages/event-sink/package.json +1 -1
  36. package/packages/event-store/package.json +1 -1
  37. package/packages/experience-replay/package.json +1 -1
  38. package/packages/feedback-collector/package.json +1 -1
  39. package/packages/file-copy-helper/package.json +1 -1
  40. package/packages/framework-detector/package.json +1 -1
  41. package/packages/framework-plugin-sdk/package.json +1 -1
  42. package/packages/frappe-plugin/package.json +1 -1
  43. package/packages/generic-web-plugin/package.json +1 -1
  44. package/packages/health-monitor/package.json +1 -1
  45. package/packages/intent-analyzer/package.json +1 -1
  46. package/packages/jev-judge/package.json +1 -1
  47. package/packages/knowledge-graph/package.json +1 -1
  48. package/packages/knowledge-retrieval/package.json +1 -1
  49. package/packages/laravel-plugin/package.json +1 -1
  50. package/packages/learning-engine/package.json +1 -1
  51. package/packages/logging/package.json +1 -1
  52. package/packages/mcp-adapter/package.json +1 -1
  53. package/packages/memory-engine/package.json +1 -1
  54. package/packages/milestone-manager/package.json +1 -1
  55. package/packages/model-registry/package.json +1 -1
  56. package/packages/nextjs-plugin/package.json +1 -1
  57. package/packages/notification/package.json +1 -1
  58. package/packages/observability/package.json +1 -1
  59. package/packages/okf-indexer/package.json +1 -1
  60. package/packages/paperclip-integration/package.json +1 -1
  61. package/packages/performance-optimizer/package.json +1 -1
  62. package/packages/permission-mode/package.json +1 -1
  63. package/packages/privilege-broker/package.json +1 -1
  64. package/packages/project-analyzer/package.json +1 -1
  65. package/packages/project-bootstrap/package.json +1 -1
  66. package/packages/projection-engine/package.json +1 -1
  67. package/packages/prompt-compiler/package.json +1 -1
  68. package/packages/prompt-versioning/package.json +1 -1
  69. package/packages/provider-adapter-sdk/package.json +1 -1
  70. package/packages/provider-router/package.json +1 -1
  71. package/packages/provider-selector/package.json +1 -1
  72. package/packages/providers/package.json +1 -1
  73. package/packages/qdrant-skills/package.json +1 -1
  74. package/packages/quota-manager/package.json +1 -1
  75. package/packages/rate-limiter/package.json +1 -1
  76. package/packages/react-vite-plugin/package.json +1 -1
  77. package/packages/relay/package.json +1 -1
  78. package/packages/release-manager/package.json +1 -1
  79. package/packages/requirement-compiler/package.json +1 -1
  80. package/packages/runtime/package.json +1 -1
  81. package/packages/scheduler/package.json +1 -1
  82. package/packages/scheduler-adapter/package.json +1 -1
  83. package/packages/session/package.json +1 -1
  84. package/packages/session-api/package.json +1 -1
  85. package/packages/session-export/package.json +1 -1
  86. package/packages/shared-context/package.json +1 -1
  87. package/packages/skill-mcp-client/package.json +1 -1
  88. package/packages/skill-registry/package.json +1 -1
  89. package/packages/skills/dist/index.d.ts.map +1 -1
  90. package/packages/skills/dist/index.js +12 -4
  91. package/packages/skills/dist/index.js.map +1 -1
  92. package/packages/skills/dist/sanitize-rules.d.ts +93 -0
  93. package/packages/skills/dist/sanitize-rules.d.ts.map +1 -0
  94. package/packages/skills/dist/sanitize-rules.js +173 -0
  95. package/packages/skills/dist/sanitize-rules.js.map +1 -0
  96. package/packages/skills/dist/sanitize.d.ts +13 -2
  97. package/packages/skills/dist/sanitize.d.ts.map +1 -1
  98. package/packages/skills/dist/sanitize.js +14 -48
  99. package/packages/skills/dist/sanitize.js.map +1 -1
  100. package/packages/skills/dist/vector-schema.d.ts +7 -1
  101. package/packages/skills/dist/vector-schema.d.ts.map +1 -1
  102. package/packages/skills/dist/vector-schema.js +10 -5
  103. package/packages/skills/dist/vector-schema.js.map +1 -1
  104. package/packages/skills/package.json +1 -1
  105. package/packages/skills/src/index.ts +12 -5
  106. package/packages/skills/src/sanitize-rules.ts +218 -0
  107. package/packages/skills/src/sanitize.ts +26 -56
  108. package/packages/skills/src/vector-schema.ts +22 -14
  109. package/packages/skills/test/remote-skills.test.ts +33 -6
  110. package/packages/skills/test/sanitize.test.ts +163 -44
  111. package/packages/sprint-planner/package.json +1 -1
  112. package/packages/subscription-engine/package.json +1 -1
  113. package/packages/task-compiler/package.json +1 -1
  114. package/packages/telegram/package.json +1 -1
  115. package/packages/tencentdb-memory/package.json +1 -1
  116. package/packages/tencentdb-sync/package.json +1 -1
  117. package/packages/test-data-generator/package.json +1 -1
  118. package/packages/test-generator/package.json +1 -1
  119. package/packages/todo-bd-sync/package.json +1 -1
  120. package/packages/token-estimation/package.json +1 -1
  121. package/packages/token-optimizer/package.json +1 -1
  122. package/packages/tooling-preference/package.json +1 -1
  123. package/packages/trajectory/package.json +1 -1
  124. package/packages/tui/package.json +1 -1
  125. package/packages/two-phase-review/package.json +1 -1
  126. package/packages/types/package.json +1 -1
  127. package/packages/voice-api/package.json +1 -1
  128. package/packages/webmcp-tester/package.json +1 -1
  129. package/packages/wiki/package.json +1 -1
  130. package/packages/workflow-events/package.json +1 -1
  131. package/packages/workspace-scanner/package.json +1 -1
  132. package/packages/worktree/package.json +1 -1
  133. package/packages/write-review/package.json +1 -1
  134. package/scripts/sync-to-qdrant.ts +5 -9
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/project-analyzer",
3
- "version": "1.1.422",
3
+ "version": "1.1.423",
4
4
  "description": "Project analysis system for pi-harness-runtime - detects frameworks, rules, and project structure",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/project-bootstrap",
3
- "version": "1.1.422",
3
+ "version": "1.1.423",
4
4
  "description": "Project scaffolding from typed ProjectSpec",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/projection-engine",
3
- "version": "1.1.422",
3
+ "version": "1.1.423",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/prompt-compiler",
3
- "version": "1.1.422",
3
+ "version": "1.1.423",
4
4
  "description": "Deterministic prompt compiler for pi-harness-runtime",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/prompt-versioning",
3
- "version": "1.1.422",
3
+ "version": "1.1.423",
4
4
  "type": "module",
5
5
  "description": "Version control for prompts with rollback support (RFC-0019)",
6
6
  "main": "dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/provider-adapter-sdk",
3
- "version": "1.1.422",
3
+ "version": "1.1.423",
4
4
  "description": "SDK for building, testing, and registering AI provider adapters",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/provider-router",
3
- "version": "1.1.422",
3
+ "version": "1.1.423",
4
4
  "description": "Enhanced Provider Router for pi-harness-runtime — intelligent routing with capabilities, costs, and quotas",
5
5
  "type": "module",
6
6
  "main": "./dist/provider-router.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/provider-selector",
3
- "version": "1.1.422",
3
+ "version": "1.1.423",
4
4
  "description": "Multi-Provider Selector — route requests by cost, quality, and latency (RFC-0012)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/providers",
3
- "version": "1.1.422",
3
+ "version": "1.1.423",
4
4
  "description": "pi-harness-runtime — providers",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/qdrant-skills",
3
- "version": "1.1.422",
3
+ "version": "1.1.423",
4
4
  "description": "Qdrant vector search integration for Hermes-style skill system",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/quota-manager",
3
- "version": "1.1.422",
3
+ "version": "1.1.423",
4
4
  "description": "pi-harness-runtime — quota-manager",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/rate-limiter",
3
- "version": "1.1.422",
3
+ "version": "1.1.423",
4
4
  "type": "module",
5
5
  "description": "Rate limiting with token bucket algorithm (RFC-0023)",
6
6
  "main": "dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/react-vite-plugin",
3
- "version": "1.1.422",
3
+ "version": "1.1.423",
4
4
  "description": "React/Vite framework analysis — components, config, TypeScript setup",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/relay",
3
- "version": "1.1.422",
3
+ "version": "1.1.423",
4
4
  "type": "module",
5
5
  "description": "Cloud relay for remote access - T3 Connect style for pi-harness",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/release-manager",
3
- "version": "1.1.422",
3
+ "version": "1.1.423",
4
4
  "type": "module",
5
5
  "description": "Release management for pi-harness",
6
6
  "main": "dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/requirement-compiler",
3
- "version": "1.1.422",
3
+ "version": "1.1.423",
4
4
  "description": "Compiles raw requirements into validated CompiledRequirement with ambiguity detection and risk tagging",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/runtime",
3
- "version": "1.1.422",
3
+ "version": "1.1.423",
4
4
  "description": "pi-harness-runtime — runtime",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/scheduler",
3
- "version": "1.1.422",
3
+ "version": "1.1.423",
4
4
  "description": "pi-harness-runtime — scheduler",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/scheduler-adapter",
3
- "version": "1.1.422",
3
+ "version": "1.1.423",
4
4
  "description": "Scheduler Adapter — cron, systemd, launchd, internal adapters for autonomous runtime (RFC-0101 §6)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/session",
3
- "version": "1.1.422",
3
+ "version": "1.1.423",
4
4
  "description": "Session management system for pi-harness-runtime",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/session-api",
3
- "version": "1.1.422",
3
+ "version": "1.1.423",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/session-export",
3
- "version": "1.1.422",
3
+ "version": "1.1.423",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/shared-context",
3
- "version": "1.1.422",
3
+ "version": "1.1.423",
4
4
  "description": "pi-harness-runtime — shared-context",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/skill-mcp-client",
3
- "version": "1.1.422",
3
+ "version": "1.1.423",
4
4
  "description": "MCP client for Skills SaaS backend",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/skill-registry",
3
- "version": "1.1.422",
3
+ "version": "1.1.423",
4
4
  "description": "Skill Registry for pi-harness-runtime — dynamic skill discovery and invocation",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC;AAE5B,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAe,MAAM,YAAY,CAAC;AAExE,OAAO,EAA0B,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAEzE;;;;;;GAMG;AACH,MAAM,WAAW,gBAAiB,SAAQ,UAAU;IAClD,kDAAkD;IAClD,QAA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B;AAGD,eAAO,MAAM,oBAAoB,EAAE,YAYlC,CAAC"}
@@ -21,6 +21,9 @@ export * from "./skill-versioning.js";
21
21
  export * from "./linter.js";
22
22
  import { scanForSkillsSync } from "./scanner.js";
23
23
  import { getGlobalSkillRegistry } from "./loader.js";
24
+ import { existsSync, readdirSync } from "node:fs";
25
+ import { homedir } from "node:os";
26
+ import { join } from "node:path";
24
27
  /**
25
28
  * Initialize skills system
26
29
  *
@@ -46,14 +49,19 @@ export function initSkills(config) {
46
49
  }
47
50
  // Hint: if ~/.pi-harness-runtime/skills/ is empty, suggest the sync script
48
51
  checkEmptySkillsDir();
49
- return { ...result, registry };
52
+ // The scan can find the same skill twice: a symlinked directory is
53
+ // scanned twice, because the scanner follows the path it is given. The
54
+ // registry keeps one entry per id, so the count of the local skills is
55
+ // the count of the DISTINCT skills - and not the count of the files
56
+ // that were read.
57
+ const distinct = new Map();
58
+ for (const skill of result.skills)
59
+ distinct.set(skill.id, skill);
60
+ return { ...result, skills: [...distinct.values()], registry };
50
61
  }
51
62
  /** Show sync hint if the harness skills dir is empty. */
52
63
  function checkEmptySkillsDir() {
53
64
  try {
54
- const { readdirSync, existsSync } = require("node:fs");
55
- const { join } = require("node:path");
56
- const { homedir } = require("node:os");
57
65
  const harnessDir = join(homedir(), ".pi-harness-runtime", "skills");
58
66
  if (!existsSync(harnessDir))
59
67
  return;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,wBAAwB;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc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EAAE,CAAC;KACX,CAAC;IAEF,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,EAAE,MAAM,IAAI,SAAS,CAAC;QACjD,IAAI,MAAM,IAAI,QAAQ,EAAE,CAAC;YACvB,QAAQ,CAAC,MAA+B,CAAC,EAAE,CAAC;QAC9C,CAAC;aAAM,CAAC;YACN,QAAQ,CAAC,OAAO,EAAE,CAAC;QACrB,CAAC;IACH,CAAC;IAED,OAAO;QACL,KAAK,EAAE,MAAM,CAAC,MAAM;QACpB,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM;QAC7C,QAAQ;KACT,CAAC;AACJ,CAAC;AAED,wBAAwB;AACxB,MAAM,CAAC,MAAM,oBAAoB,GAAiB;IAChD,OAAO,EAAE,IAAI;IACb,SAAS,EAAE;QACT,sBAAsB;QACtB,QAAQ;QACR,gBAAgB;KACjB;IACD,cAAc,EAAE,KAAK;IACrB,qBAAqB,EAAE,CAAC;IACxB,oBAAoB,EAAE,CAAC;IACvB,sBAAsB,EAAE,IAAI;IAC5B,cAAc,EAAE,OAAO;CACxB,CAAC"}
@@ -0,0 +1,93 @@
1
+ /**
2
+ * The rules that keep a client name out of the shared collection.
3
+ *
4
+ * The names of the clients of the users of the harness are **not** in this
5
+ * repository. The repository is public, and a list of client names in it
6
+ * is a list of client names in the world - the names of the projects and
7
+ * of the clients of every person who installs the package.
8
+ *
9
+ * The rules therefore live in a local file:
10
+ *
11
+ * ~/.pi-harness-runtime/skill-sanitization.json
12
+ *
13
+ * and this module is the mechanism that reads them and applies them. The
14
+ * file is per installation, so a machine holds the rules of its own
15
+ * clients and nobody else's.
16
+ *
17
+ * The file is optional. Without it only the generic rules apply, and the
18
+ * name of a client would travel into the collection of that installation.
19
+ * `sanitizationStatus()` tells the caller which of the two is the case,
20
+ * so a missing file is a visible state and not a silent one.
21
+ *
22
+ * The format of the file:
23
+ *
24
+ * ```json
25
+ * {
26
+ * "rules": [
27
+ * { "pattern": "acme", "replacement": "[Client A]", "flags": "gi" }
28
+ * ],
29
+ * "nameMap": {
30
+ * "acme-approval-workflow": "client-a-approval-workflow"
31
+ * }
32
+ * }
33
+ * ```
34
+ *
35
+ * The pattern is the source of a regular expression and the flags default
36
+ * to "gi". The rules match a plain fragment, without a word boundary: a
37
+ * client name rarely stands alone, it appears inside a directory name
38
+ * (`erp_report_2024.json`), inside a module name (`acme_pharma`) or in a
39
+ * sentence ("integrated with Acme"). A word boundary would miss all of
40
+ * them - and `_` is a word character, so a boundary never follows an
41
+ * underscore.
42
+ */
43
+ /** A rule as it is written in the local file. */
44
+ export interface SanitizationRuleSpec {
45
+ /** The source of a regular expression. */
46
+ pattern: string;
47
+ /** What a match becomes. */
48
+ replacement: string;
49
+ /** The flags of the regular expression. Defaults to "gi". */
50
+ flags?: string;
51
+ }
52
+ /** A compiled rule. */
53
+ export interface SanitizationRule {
54
+ pattern: RegExp;
55
+ replacement: string;
56
+ }
57
+ /** The whole rule set of one installation. */
58
+ export interface SanitizationRuleSet {
59
+ /** The rules, in the order they are applied. */
60
+ rules: SanitizationRule[];
61
+ /** The names that are renamed as a whole. */
62
+ nameMap: Record<string, string>;
63
+ /** Where the rules came from. */
64
+ source: "local-file" | "generic-only";
65
+ /** Why the local file did not contribute its rules. */
66
+ error?: string;
67
+ }
68
+ /** Where the rules of this installation live. */
69
+ export declare function sanitizationFilePath(): string;
70
+ /**
71
+ * The state of the rules of this installation.
72
+ *
73
+ * `configured` is false when the local file is missing or unreadable. The
74
+ * caller shows it, because a missing file is a weaker privacy guarantee
75
+ * and not a detail.
76
+ */
77
+ export declare function sanitizationStatus(): {
78
+ configured: boolean;
79
+ path: string;
80
+ ruleCount: number;
81
+ error?: string;
82
+ };
83
+ /**
84
+ * The rules of this installation.
85
+ *
86
+ * The file is read once per process: the rules do not change while the
87
+ * harness runs, and a skill that is indexed a hundred times must not read
88
+ * a file a hundred times.
89
+ */
90
+ export declare function loadSanitizationRules(path?: string): SanitizationRuleSet;
91
+ /** Forget the cached rules. A test needs it, a new file needs it. */
92
+ export declare function resetSanitizationRulesCache(): void;
93
+ //# sourceMappingURL=sanitize-rules.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sanitize-rules.d.ts","sourceRoot":"","sources":["../src/sanitize-rules.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAMH,iDAAiD;AACjD,MAAM,WAAW,oBAAoB;IACnC,0CAA0C;IAC1C,OAAO,EAAE,MAAM,CAAC;IAChB,4BAA4B;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,6DAA6D;IAC7D,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,uBAAuB;AACvB,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,8CAA8C;AAC9C,MAAM,WAAW,mBAAmB;IAClC,gDAAgD;IAChD,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAC1B,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,iCAAiC;IACjC,MAAM,EAAE,YAAY,GAAG,cAAc,CAAC;IACtC,uDAAuD;IACvD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AA0BD,iDAAiD;AACjD,wBAAgB,oBAAoB,IAAI,MAAM,CAK7C;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,IAAI;IACpC,UAAU,EAAE,OAAO,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CASA;AAID;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,SAAyB,GAAG,mBAAmB,CAMxF;AAED,qEAAqE;AACrE,wBAAgB,2BAA2B,IAAI,IAAI,CAElD"}
@@ -0,0 +1,173 @@
1
+ /**
2
+ * The rules that keep a client name out of the shared collection.
3
+ *
4
+ * The names of the clients of the users of the harness are **not** in this
5
+ * repository. The repository is public, and a list of client names in it
6
+ * is a list of client names in the world - the names of the projects and
7
+ * of the clients of every person who installs the package.
8
+ *
9
+ * The rules therefore live in a local file:
10
+ *
11
+ * ~/.pi-harness-runtime/skill-sanitization.json
12
+ *
13
+ * and this module is the mechanism that reads them and applies them. The
14
+ * file is per installation, so a machine holds the rules of its own
15
+ * clients and nobody else's.
16
+ *
17
+ * The file is optional. Without it only the generic rules apply, and the
18
+ * name of a client would travel into the collection of that installation.
19
+ * `sanitizationStatus()` tells the caller which of the two is the case,
20
+ * so a missing file is a visible state and not a silent one.
21
+ *
22
+ * The format of the file:
23
+ *
24
+ * ```json
25
+ * {
26
+ * "rules": [
27
+ * { "pattern": "acme", "replacement": "[Client A]", "flags": "gi" }
28
+ * ],
29
+ * "nameMap": {
30
+ * "acme-approval-workflow": "client-a-approval-workflow"
31
+ * }
32
+ * }
33
+ * ```
34
+ *
35
+ * The pattern is the source of a regular expression and the flags default
36
+ * to "gi". The rules match a plain fragment, without a word boundary: a
37
+ * client name rarely stands alone, it appears inside a directory name
38
+ * (`erp_report_2024.json`), inside a module name (`acme_pharma`) or in a
39
+ * sentence ("integrated with Acme"). A word boundary would miss all of
40
+ * them - and `_` is a word character, so a boundary never follows an
41
+ * underscore.
42
+ */
43
+ import { readFileSync } from "node:fs";
44
+ import { homedir } from "node:os";
45
+ import { join } from "node:path";
46
+ /**
47
+ * The rules that hold for every installation.
48
+ *
49
+ * They are about the way a text talks about a client, not about the name
50
+ * of a client: "Company Name" is a placeholder in a template, and it
51
+ * must not become a client name in the collection.
52
+ */
53
+ const GENERIC_RULES = [
54
+ { pattern: /Company Name/gi, replacement: "[Client Name]" },
55
+ { pattern: /your company/gi, replacement: "[Client]" },
56
+ { pattern: /our client/gi, replacement: "[Client]" },
57
+ { pattern: /client-specific/gi, replacement: "[Project-specific]" },
58
+ ];
59
+ /**
60
+ * The names that are renamed as a whole, for every installation.
61
+ *
62
+ * A name that would be unreadable after the pattern rules - a name that
63
+ * carries the client name in its middle - is renamed here.
64
+ */
65
+ const GENERIC_NAME_MAP = {
66
+ whispertool: "whisper-tool",
67
+ };
68
+ /** Where the rules of this installation live. */
69
+ export function sanitizationFilePath() {
70
+ const override = process.env.PI_SKILL_SANITIZATION_FILE;
71
+ if (override && override.trim())
72
+ return override.trim();
73
+ const home = process.env.HOME || process.env.USERPROFILE || homedir();
74
+ return join(home, ".pi-harness-runtime", "skill-sanitization.json");
75
+ }
76
+ /**
77
+ * The state of the rules of this installation.
78
+ *
79
+ * `configured` is false when the local file is missing or unreadable. The
80
+ * caller shows it, because a missing file is a weaker privacy guarantee
81
+ * and not a detail.
82
+ */
83
+ export function sanitizationStatus() {
84
+ const path = sanitizationFilePath();
85
+ const set = loadSanitizationRules(path);
86
+ return {
87
+ configured: set.source === "local-file",
88
+ path,
89
+ ruleCount: set.rules.length,
90
+ ...(set.error ? { error: set.error } : {}),
91
+ };
92
+ }
93
+ let cached;
94
+ /**
95
+ * The rules of this installation.
96
+ *
97
+ * The file is read once per process: the rules do not change while the
98
+ * harness runs, and a skill that is indexed a hundred times must not read
99
+ * a file a hundred times.
100
+ */
101
+ export function loadSanitizationRules(path = sanitizationFilePath()) {
102
+ if (cached && cached.path === path)
103
+ return cached.set;
104
+ const set = readSanitizationRules(path);
105
+ cached = { path, set };
106
+ return set;
107
+ }
108
+ /** Forget the cached rules. A test needs it, a new file needs it. */
109
+ export function resetSanitizationRulesCache() {
110
+ cached = undefined;
111
+ }
112
+ function readSanitizationRules(path) {
113
+ let raw;
114
+ try {
115
+ raw = readFileSync(path, "utf8");
116
+ }
117
+ catch (err) {
118
+ const code = err?.code;
119
+ if (code !== "ENOENT") {
120
+ return {
121
+ rules: [...GENERIC_RULES],
122
+ nameMap: { ...GENERIC_NAME_MAP },
123
+ source: "generic-only",
124
+ error: `The sanitization rules at ${path} could not be read: ${err instanceof Error ? err.message : String(err)}`,
125
+ };
126
+ }
127
+ return {
128
+ rules: [...GENERIC_RULES],
129
+ nameMap: { ...GENERIC_NAME_MAP },
130
+ source: "generic-only",
131
+ };
132
+ }
133
+ let parsed;
134
+ try {
135
+ parsed = JSON.parse(raw);
136
+ }
137
+ catch (err) {
138
+ return {
139
+ rules: [...GENERIC_RULES],
140
+ nameMap: { ...GENERIC_NAME_MAP },
141
+ source: "generic-only",
142
+ error: `The sanitization rules at ${path} are not valid JSON: ${err instanceof Error ? err.message : String(err)}`,
143
+ };
144
+ }
145
+ const rules = [...GENERIC_RULES];
146
+ const nameMap = { ...GENERIC_NAME_MAP };
147
+ const file = parsed;
148
+ for (const spec of file.rules ?? []) {
149
+ if (!spec || typeof spec.pattern !== "string" || typeof spec.replacement !== "string") {
150
+ continue;
151
+ }
152
+ try {
153
+ rules.push({
154
+ pattern: new RegExp(spec.pattern, spec.flags ?? "gi"),
155
+ replacement: spec.replacement,
156
+ });
157
+ }
158
+ catch {
159
+ // A broken pattern must not take the whole rule set down: the other
160
+ // rules still hold, and the broken one is reported below.
161
+ rules.push({
162
+ pattern: /$^/,
163
+ replacement: spec.replacement,
164
+ });
165
+ }
166
+ }
167
+ for (const [from, to] of Object.entries(file.nameMap ?? {})) {
168
+ if (typeof from === "string" && typeof to === "string")
169
+ nameMap[from] = to;
170
+ }
171
+ return { rules, nameMap, source: "local-file" };
172
+ }
173
+ //# sourceMappingURL=sanitize-rules.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sanitize-rules.js","sourceRoot":"","sources":["../src/sanitize-rules.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,C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,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,OAAO,EAAE,KAAK,QAAQ;YAAE,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;IAC7E,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC;AAClD,CAAC"}
@@ -9,14 +9,25 @@
9
9
  *
10
10
  * Both writers therefore build their points with the same rules, and the
11
11
  * name of a point is the sanitized name. One skill, one point.
12
+ *
13
+ * The rules themselves are not in this file. The names of the clients of
14
+ * the users of the harness are not in this repository - it is public, and
15
+ * a list of client names in it is a list of client names in the world.
16
+ * The rules live in a local file, and `sanitize-rules.ts` reads them. See
17
+ * that module for the format.
12
18
  */
19
+ import { type SanitizationRuleSet } from "./sanitize-rules.js";
20
+ export type { SanitizationRule, SanitizationRuleSet } from "./sanitize-rules.js";
21
+ export { loadSanitizationRules, resetSanitizationRulesCache, sanitizationFilePath, sanitizationStatus, } from "./sanitize-rules.js";
13
22
  /**
14
23
  * Replace the client specific names of a text.
15
24
  *
16
25
  * The text stays the same length, so a vector that was built from it
17
26
  * keeps its shape.
27
+ *
28
+ * The rules are the ones of this installation unless a set is passed in.
18
29
  */
19
- export declare function sanitizeText(text: string): string;
30
+ export declare function sanitizeText(text: string, rules?: SanitizationRuleSet): string;
20
31
  /**
21
32
  * The name of a skill in the shared collection.
22
33
  *
@@ -28,5 +39,5 @@ export declare function sanitizeText(text: string): string;
28
39
  * returns. The replacements of the rules carry a space and brackets,
29
40
  * which no skill name may hold.
30
41
  */
31
- export declare function skillPointName(name: string): string;
42
+ export declare function skillPointName(name: string, rules?: SanitizationRuleSet): string;
32
43
  //# sourceMappingURL=sanitize.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["../src/sanitize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAwDH;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAMjD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAInD"}
1
+ {"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["../src/sanitize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAyB,KAAK,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAEtF,YAAY,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,2BAA2B,EAC3B,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAE7B;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,EACZ,KAAK,GAAE,mBAA6C,GACnD,MAAM,CAMR;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,MAAM,EACZ,KAAK,GAAE,mBAA6C,GACnD,MAAM,CAIR"}