@abelionorg/tagger-public 1.0.0 → 1.0.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 (3) hide show
  1. package/dist/cli.js +26 -14
  2. package/dist/index.js +21 -13
  3. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -3523,21 +3523,21 @@ function injectJS(content, watermark) {
3523
3523
  const stealthTag = encodeStealth(watermark);
3524
3524
  const predicate = getOpaquePredicateJS();
3525
3525
  const guardName = "v" + Math.random().toString(36).slice(2, 7);
3526
- const guard = `
3527
- /**
3526
+ const guard = `/**
3528
3527
  * Protected by Abelion (Public)
3529
3528
  * Identity: ${watermark}
3529
+ * Integrity: ${predicate}
3530
3530
  */
3531
- (function(${guardName}){
3532
- // Integrity check
3533
- if(!${predicate}) {
3534
- console.warn("Abelion: Code integrity check failed.");
3535
- return;
3531
+ /*${stealthTag}*/
3532
+ `;
3533
+ if (content.startsWith("#!")) {
3534
+ const newlineIndex = content.indexOf(`
3535
+ `);
3536
+ if (newlineIndex !== -1) {
3537
+ return content.slice(0, newlineIndex + 1) + guard + content.slice(newlineIndex + 1);
3536
3538
  }
3537
-
3538
- ${content}
3539
- })(function ${guardName}(){/*${stealthTag}*/});`;
3540
- return guard;
3539
+ }
3540
+ return guard + content;
3541
3541
  }
3542
3542
  // src/drivers/python.ts
3543
3543
  function injectPython(content, watermark) {
@@ -3580,10 +3580,18 @@ function injectPHP(content, watermark) {
3580
3580
  */
3581
3581
  `;
3582
3582
  if (content.trim().startsWith("<?php")) {
3583
- return content.replace("<?php", guard);
3583
+ return content.replace(/^<\?php/, guard.trim());
3584
3584
  }
3585
- return guard + `
3585
+ if (content.trim().startsWith("#!") || content.trim().startsWith("<!DOCTYPE") || content.trim().startsWith("<html")) {
3586
+ return `<?php
3587
+ /**
3588
+ * @license Abelion Integrity Guard v1.3 (c) 2026${stealthTag}
3589
+ * Owner: ${watermark}
3590
+ */
3591
+ ?>
3586
3592
  ` + content;
3593
+ }
3594
+ return guard + content;
3587
3595
  }
3588
3596
  // src/drivers/cpp.ts
3589
3597
  function injectCPP(content, watermark) {
@@ -3770,8 +3778,12 @@ function keygenAction() {
3770
3778
  }
3771
3779
 
3772
3780
  // src/cli.ts
3781
+ import { readFileSync as readFileSync3 } from "fs";
3782
+ import { join as join2 } from "path";
3783
+ var __dirname = "/media/abelion/Isaf/ican/project/Web/abelion-tagger/packages/tagger-public/src";
3773
3784
  var program2 = new Command;
3774
- program2.name("abelion-tagger-public").description("CLI for public code watermarking and ownership verification").version("1.1.0");
3785
+ var packageJson = JSON.parse(readFileSync3(join2(__dirname, "../package.json"), "utf-8"));
3786
+ program2.name("abelion-tagger-public").description("CLI for public code watermarking and ownership verification").version(packageJson.version);
3775
3787
  program2.command("keygen").description("Generate RSA key pair for signing/verification").action(keygenAction);
3776
3788
  program2.command("tag").description("Tag a directory or file with ownership watermark").argument("<path>", "Target path").option("-m, --message <string>", "Ownership message", "abelion_owner").option("--dry-run", "Preview files that will be tagged without modifying them").action(tagAction);
3777
3789
  program2.command("verify").description("Verify ownership of a file").argument("<file>", "File path").action(verifyAction);
package/dist/index.js CHANGED
@@ -167,21 +167,21 @@ function injectJS(content, watermark) {
167
167
  const stealthTag = encodeStealth(watermark);
168
168
  const predicate = getOpaquePredicateJS();
169
169
  const guardName = "v" + Math.random().toString(36).slice(2, 7);
170
- const guard = `
171
- /**
170
+ const guard = `/**
172
171
  * Protected by Abelion (Public)
173
172
  * Identity: ${watermark}
173
+ * Integrity: ${predicate}
174
174
  */
175
- (function(${guardName}){
176
- // Integrity check
177
- if(!${predicate}) {
178
- console.warn("Abelion: Code integrity check failed.");
179
- return;
175
+ /*${stealthTag}*/
176
+ `;
177
+ if (content.startsWith("#!")) {
178
+ const newlineIndex = content.indexOf(`
179
+ `);
180
+ if (newlineIndex !== -1) {
181
+ return content.slice(0, newlineIndex + 1) + guard + content.slice(newlineIndex + 1);
180
182
  }
181
-
182
- ${content}
183
- })(function ${guardName}(){/*${stealthTag}*/});`;
184
- return guard;
183
+ }
184
+ return guard + content;
185
185
  }
186
186
  // src/drivers/python.ts
187
187
  function injectPython(content, watermark) {
@@ -224,10 +224,18 @@ function injectPHP(content, watermark) {
224
224
  */
225
225
  `;
226
226
  if (content.trim().startsWith("<?php")) {
227
- return content.replace("<?php", guard);
227
+ return content.replace(/^<\?php/, guard.trim());
228
228
  }
229
- return guard + `
229
+ if (content.trim().startsWith("#!") || content.trim().startsWith("<!DOCTYPE") || content.trim().startsWith("<html")) {
230
+ return `<?php
231
+ /**
232
+ * @license Abelion Integrity Guard v1.3 (c) 2026${stealthTag}
233
+ * Owner: ${watermark}
234
+ */
235
+ ?>
230
236
  ` + content;
237
+ }
238
+ return guard + content;
231
239
  }
232
240
  // src/drivers/cpp.ts
233
241
  function injectCPP(content, watermark) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abelionorg/tagger-public",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Stealth tagging and anti-theft system for Abelion ecosystem",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org",