@tinoy/pi-canon 0.6.0 → 0.6.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/index.ts +19 -1
  2. package/package.json +1 -1
package/index.ts CHANGED
@@ -764,7 +764,25 @@ export default function (pi: ExtensionAPI) {
764
764
  const payload = event.payload as Partial<CanonNotice> | null;
765
765
  if (!payload || payload.type !== "canon" || !payload.scope || !payload.id)
766
766
  return;
767
- if (!matches(payload.scope, currentModel(), audiences)) return;
767
+ if (!matches(payload.scope, currentModel(), audiences)) {
768
+ // Withholding is otherwise unattributable: nothing is delivered and nothing is
769
+ // sent back, so a scope mismatch leaves no trace on either side. The decision is
770
+ // unchanged here — only the record of it is added.
771
+ hookLog("canon", "notice-withheld", {
772
+ namespace: NAMESPACE,
773
+ id: payload.id,
774
+ op: payload.op,
775
+ entryModel: payload.scope.model,
776
+ entryAudience: payload.scope.audience,
777
+ sessionModel: currentModel(),
778
+ sessionAudience: sessionLabel(audiences),
779
+ mismatch:
780
+ payload.scope.audience !== "all" && !audiences.has(payload.scope.audience)
781
+ ? "audience"
782
+ : "model",
783
+ });
784
+ return;
785
+ }
768
786
  const sender = payload.sender?.trim() || event.fromSessionId.slice(0, 8);
769
787
  const verb =
770
788
  payload.op === "remove" || payload.op === "category_remove"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinoy/pi-canon",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "Durable system-prompt rules for pi: an on-disk canon store, its tools, and the /canon commands.",
5
5
  "license": "MIT",
6
6
  "repository": {