@sanctuary-framework/mcp-server 0.5.10 → 0.5.11

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/index.cjs CHANGED
@@ -11084,11 +11084,57 @@ var TOOL_API_SCOPED = {
11084
11084
  ],
11085
11085
  default_action: "redact"
11086
11086
  };
11087
+ var REMOTE_INFERENCE_SANITIZE = {
11088
+ id: "remote-inference-sanitize",
11089
+ name: "Remote Inference Sanitization",
11090
+ description: "Maximum privacy for remote/cloud LLM calls. Strips all identity, financial, location, and personal data before passing queries to external models. Inspired by Vitalik Buterin's 2-of-2 sovereignty model.",
11091
+ use_when: "Your local agent needs to call a remote LLM for tasks beyond local model capability (complex coding, deep research) and you want to minimize data leakage to the remote provider. The remote model gets only the task, query, format requirements, and stripped code context.",
11092
+ rules: [
11093
+ {
11094
+ provider: "inference",
11095
+ allow: [
11096
+ "task",
11097
+ "task_description",
11098
+ "current_query",
11099
+ "query",
11100
+ "prompt",
11101
+ "question",
11102
+ "instruction",
11103
+ "output_format",
11104
+ "format",
11105
+ "language",
11106
+ "code_context",
11107
+ // Stripped code snippets for coding tasks
11108
+ "error_message"
11109
+ // For debugging help
11110
+ ],
11111
+ redact: [
11112
+ ...ALWAYS_REDACT_SECRETS,
11113
+ ...PII_PATTERNS,
11114
+ ...INTERNAL_STATE_PATTERNS,
11115
+ ...HISTORY_PATTERNS,
11116
+ "tool_results",
11117
+ "previous_results",
11118
+ // Additional redactions for remote inference
11119
+ "model_data",
11120
+ "agent_state",
11121
+ "runtime_config",
11122
+ "capabilities",
11123
+ "tool_list"
11124
+ ],
11125
+ // Deny patterns — these must NEVER reach the remote model, not even redacted
11126
+ hash: [],
11127
+ summarize: []
11128
+ }
11129
+ ],
11130
+ default_action: "deny"
11131
+ };
11087
11132
  var TEMPLATES = {
11088
11133
  "inference-minimal": INFERENCE_MINIMAL,
11089
11134
  "inference-standard": INFERENCE_STANDARD,
11090
11135
  "logging-strict": LOGGING_STRICT,
11091
- "tool-api-scoped": TOOL_API_SCOPED
11136
+ "tool-api-scoped": TOOL_API_SCOPED,
11137
+ "remote-inference-sanitize": REMOTE_INFERENCE_SANITIZE
11092
11138
  };
11093
11139
  function listTemplateIds() {
11094
11140
  return Object.keys(TEMPLATES);
@@ -12576,6 +12622,101 @@ function createL2HardeningTools(storagePath, auditLog) {
12576
12622
  // src/index.ts
12577
12623
  init_encoding();
12578
12624
 
12625
+ // src/l2-operational/model-provenance.ts
12626
+ var InMemoryModelProvenanceStore = class {
12627
+ models = /* @__PURE__ */ new Map();
12628
+ primaryModelId = null;
12629
+ declare(provenance) {
12630
+ if (!provenance.model_id) {
12631
+ throw new Error("ModelProvenance requires a model_id");
12632
+ }
12633
+ if (!provenance.model_name) {
12634
+ throw new Error("ModelProvenance requires a model_name");
12635
+ }
12636
+ if (!provenance.provider) {
12637
+ throw new Error("ModelProvenance requires a provider");
12638
+ }
12639
+ this.models.set(provenance.model_id, provenance);
12640
+ if (this.primaryModelId === null) {
12641
+ this.primaryModelId = provenance.model_id;
12642
+ }
12643
+ }
12644
+ get(model_id) {
12645
+ return this.models.get(model_id);
12646
+ }
12647
+ list() {
12648
+ return Array.from(this.models.values());
12649
+ }
12650
+ primary() {
12651
+ if (!this.primaryModelId) return void 0;
12652
+ return this.models.get(this.primaryModelId);
12653
+ }
12654
+ setPrimary(model_id) {
12655
+ if (!this.models.has(model_id)) {
12656
+ throw new Error(`Model ${model_id} not found in store`);
12657
+ }
12658
+ this.primaryModelId = model_id;
12659
+ }
12660
+ };
12661
+ var MODEL_PRESETS = {
12662
+ /**
12663
+ * Claude Opus 4 via Anthropic API (cloud inference, closed weights/source)
12664
+ */
12665
+ claudeOpus4: () => ({
12666
+ model_id: "claude-opus-4",
12667
+ model_name: "Claude Opus 4",
12668
+ model_version: "4.0",
12669
+ provider: "Anthropic",
12670
+ license: "proprietary",
12671
+ open_weights: false,
12672
+ open_source: false,
12673
+ local_inference: false,
12674
+ declared_at: (/* @__PURE__ */ new Date()).toISOString()
12675
+ }),
12676
+ /**
12677
+ * Qwen 3.5 via local inference (open weights, proprietary training)
12678
+ */
12679
+ qwen35Local: () => ({
12680
+ model_id: "qwen-3.5-35b",
12681
+ model_name: "Qwen 3.5 35B",
12682
+ model_version: "3.5",
12683
+ provider: "Alibaba Cloud",
12684
+ license: "Apache-2.0",
12685
+ open_weights: true,
12686
+ open_source: false,
12687
+ local_inference: true,
12688
+ declared_at: (/* @__PURE__ */ new Date()).toISOString()
12689
+ }),
12690
+ /**
12691
+ * Llama 3.3 70B via local inference (open weights and code)
12692
+ */
12693
+ llama33Local: () => ({
12694
+ model_id: "llama-3.3-70b-instruct",
12695
+ model_name: "Llama 3.3 70B Instruct",
12696
+ model_version: "3.3",
12697
+ provider: "Meta",
12698
+ license: "Apache-2.0",
12699
+ open_weights: true,
12700
+ open_source: true,
12701
+ local_inference: true,
12702
+ declared_at: (/* @__PURE__ */ new Date()).toISOString()
12703
+ }),
12704
+ /**
12705
+ * Mistral 7B (open weights, open code, local inference)
12706
+ */
12707
+ mistral7bLocal: () => ({
12708
+ model_id: "mistral-7b-instruct",
12709
+ model_name: "Mistral 7B Instruct",
12710
+ model_version: "7",
12711
+ provider: "Mistral AI",
12712
+ license: "Apache-2.0",
12713
+ open_weights: true,
12714
+ open_source: true,
12715
+ local_inference: true,
12716
+ declared_at: (/* @__PURE__ */ new Date()).toISOString()
12717
+ })
12718
+ };
12719
+
12579
12720
  // src/storage/memory.ts
12580
12721
  var MemoryStorage = class {
12581
12722
  store = /* @__PURE__ */ new Map();
@@ -13110,7 +13251,9 @@ exports.ContextGatePolicyStore = ContextGatePolicyStore;
13110
13251
  exports.DashboardApprovalChannel = DashboardApprovalChannel;
13111
13252
  exports.FederationRegistry = FederationRegistry;
13112
13253
  exports.FilesystemStorage = FilesystemStorage;
13254
+ exports.InMemoryModelProvenanceStore = InMemoryModelProvenanceStore;
13113
13255
  exports.InjectionDetector = InjectionDetector;
13256
+ exports.MODEL_PRESETS = MODEL_PRESETS;
13114
13257
  exports.MemoryStorage = MemoryStorage;
13115
13258
  exports.PolicyStore = PolicyStore;
13116
13259
  exports.ReputationStore = ReputationStore;