@envarai/envarpay 0.2.0-alpha.15 → 0.2.0-alpha.16

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.
@@ -1,3 +1,4 @@
1
+ export declare const isSkillInstallerMetadata: (path: string) => path is ".clawhub/origin.json";
1
2
  export declare function readSkillInventory(roots: string[]): {
2
3
  name: string;
3
4
  path: string;
@@ -4,6 +4,9 @@ import { extname, join, resolve } from 'node:path';
4
4
  import { createHash } from 'node:crypto';
5
5
  import { parse } from 'yaml';
6
6
  const namePattern = /^[a-z][a-z0-9-]{0,63}$/;
7
+ // Native installer provenance is included in the source digest, but never
8
+ // copied into the executable service package or supplied to the model.
9
+ export const isSkillInstallerMetadata = (path) => path === '.clawhub/origin.json';
7
10
  export function readSkillInventory(roots) {
8
11
  const found = [];
9
12
  const seen = new Set();
@@ -54,7 +57,7 @@ export function readSkillInventory(roots) {
54
57
  supported = false;
55
58
  continue;
56
59
  }
57
- if (!['.md', '.txt'].includes(extname(name).toLowerCase()) && name !== 'LICENSE')
60
+ if (!['.md', '.txt'].includes(extname(name).toLowerCase()) && name !== 'LICENSE' && !isSkillInstallerMetadata(prefix + name))
58
61
  supported = false;
59
62
  files.push([prefix + name, createHash('sha256').update(readFileSync(file)).digest('hex')]);
60
63
  }
@@ -1,7 +1,7 @@
1
1
  /** Guided local installation. Platform input is data, never a shell command or wallet policy. */
2
2
  import { chmodSync, existsSync, lstatSync, mkdirSync, readFileSync, writeFileSync, cpSync, mkdtempSync, renameSync, rmSync, } from "node:fs";
3
3
  import { homedir } from "node:os";
4
- import { join, resolve } from "node:path";
4
+ import { join, resolve, relative, sep } from "node:path";
5
5
  import { fileURLToPath } from "node:url";
6
6
  import { randomBytes } from "node:crypto";
7
7
  import { execFileSync } from "node:child_process";
@@ -10,6 +10,7 @@ import { probeOpenClaw } from "./openclaw-setup.js";
10
10
  import { readInstalledSkills } from "./native-skills.js";
11
11
  import { loadCommerceConfig, validateUrl } from "./config.js";
12
12
  import { CommerceError } from "./types.js";
13
+ import { isSkillInstallerMetadata } from './native-inventory.js';
13
14
  const ID = /^[a-z][a-z0-9-]{0,63}$/, CONTAINER = /^[a-zA-Z0-9][a-zA-Z0-9_.-]{0,127}$/;
14
15
  export function parseSetupBundle(raw) {
15
16
  const v = raw;
@@ -40,6 +41,8 @@ export function prepareTextSkill(source, destination, name) {
40
41
  const item = lstatSync(path);
41
42
  if (item.isSymbolicLink())
42
43
  throw new CommerceError("setup_skill", "Skill symlinks are unsupported");
44
+ if (item.isFile() && isSkillInstallerMetadata(relative(source, path).split(sep).join('/')))
45
+ return false;
43
46
  if (item.isFile() &&
44
47
  !/\.(md|txt)$/i.test(path) &&
45
48
  !path.endsWith("/LICENSE"))
@@ -73,7 +73,8 @@ def inventory(home):
73
73
  if size > 1024 * 1024 or len(package) >= 128:
74
74
  supported = False
75
75
  break
76
- if file.suffix.lower() not in {".md", ".txt"} and file.name != "LICENSE":
76
+ if (file.suffix.lower() not in {".md", ".txt"} and file.name != "LICENSE"
77
+ and str(file.relative_to(entry.parent)) != ".clawhub/origin.json"):
77
78
  supported = False
78
79
  package.append(
79
80
  [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@envarai/envarpay",
3
- "version": "0.2.0-alpha.15",
3
+ "version": "0.2.0-alpha.16",
4
4
  "description": "Independent A2A service commerce, budgeted buyers and x402/MPP payments",
5
5
  "type": "module",
6
6
  "license": "MIT",