moltblock 0.11.5 → 0.11.7
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/cli.js +16 -1
- package/dist/config.js +6 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/signing.js +3 -8
- package/package.json +1 -1
- package/skill/SKILL.md +18 -13
package/dist/cli.js
CHANGED
|
@@ -70,7 +70,22 @@ async function main() {
|
|
|
70
70
|
});
|
|
71
71
|
await program.parseAsync(process.argv);
|
|
72
72
|
}
|
|
73
|
+
/** Sanitize error messages to strip sensitive data before logging. */
|
|
74
|
+
function sanitizeError(err) {
|
|
75
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
76
|
+
return msg
|
|
77
|
+
.replace(/[A-Za-z0-9_\-]{20,}/g, "[REDACTED]")
|
|
78
|
+
.replace(/https?:\/\/[^\s]+/g, (url) => {
|
|
79
|
+
try {
|
|
80
|
+
const u = new URL(url);
|
|
81
|
+
return `${u.protocol}//${u.hostname}/...`;
|
|
82
|
+
}
|
|
83
|
+
catch {
|
|
84
|
+
return "[REDACTED_URL]";
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
}
|
|
73
88
|
main().catch((err) => {
|
|
74
|
-
console.error(err);
|
|
89
|
+
console.error(`Error: ${sanitizeError(err)}`);
|
|
75
90
|
process.exit(1);
|
|
76
91
|
});
|
package/dist/config.js
CHANGED
|
@@ -67,7 +67,12 @@ export const ModelBindingSchema = z.object({
|
|
|
67
67
|
function isAllowedConfigPath(filePath) {
|
|
68
68
|
const resolved = path.resolve(filePath);
|
|
69
69
|
const allowed = [path.resolve(process.cwd()), path.resolve(os.homedir()), path.resolve(os.tmpdir())];
|
|
70
|
-
return allowed.some((dir) =>
|
|
70
|
+
return allowed.some((dir) => {
|
|
71
|
+
if (resolved === dir)
|
|
72
|
+
return true;
|
|
73
|
+
const rel = path.relative(dir, resolved);
|
|
74
|
+
return !!rel && !rel.startsWith("..") && !path.isAbsolute(rel);
|
|
75
|
+
});
|
|
71
76
|
}
|
|
72
77
|
/**
|
|
73
78
|
* Resolve moltblock config file: MOLTBLOCK_CONFIG env, then ./moltblock.json, ./.moltblock/moltblock.json, ~/.moltblock/moltblock.json.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Moltblock — framework for evolving composite intelligences (Entities).
|
|
3
3
|
*/
|
|
4
|
-
export declare const VERSION = "0.11.
|
|
4
|
+
export declare const VERSION = "0.11.7";
|
|
5
5
|
export type { ModelBinding, BindingEntry, AgentConfig, MoltblockConfig, ChatMessage, VerifiedMemoryEntry, CheckpointEntry, OutcomeEntry, InboxEntry, StrategySuggestion, ReceivedArtifact, GovernanceConfig, } from "./types.js";
|
|
6
6
|
export { WorkingMemory } from "./memory.js";
|
|
7
7
|
export { signArtifact, verifyArtifact, artifactHash } from "./signing.js";
|
package/dist/index.js
CHANGED
package/dist/signing.js
CHANGED
|
@@ -42,14 +42,9 @@ function getSecret(entityId) {
|
|
|
42
42
|
return key;
|
|
43
43
|
}
|
|
44
44
|
catch {
|
|
45
|
-
//
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
`Set MOLTBLOCK_SIGNING_KEY for signing, or set MOLTBLOCK_INSECURE_DEV_SIGNING=1 to allow weak dev fallback.`);
|
|
49
|
-
}
|
|
50
|
-
console.warn(`Warning: Using weak default signing key for entity "${entityId}". ` +
|
|
51
|
-
`Set MOLTBLOCK_SIGNING_KEY for secure artifact signing.`);
|
|
52
|
-
return Buffer.from(`dev-only-insecure-key-${entityId}`, "utf-8");
|
|
45
|
+
// No weak deterministic fallback — require explicit key material
|
|
46
|
+
throw new Error(`No MOLTBLOCK_SIGNING_KEY set and filesystem unavailable for dev key generation. ` +
|
|
47
|
+
`Set MOLTBLOCK_SIGNING_KEY or MOLTBLOCK_SIGNING_KEY_${entityId.toUpperCase()} environment variable.`);
|
|
53
48
|
}
|
|
54
49
|
}
|
|
55
50
|
const keyBytes = Buffer.from(envKey, "utf-8");
|
package/package.json
CHANGED
package/skill/SKILL.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: moltblock - Trust Layer for AI Agents
|
|
3
3
|
description: Verification gating for AI-generated artifacts. Policy checks to catch dangerous patterns before execution.
|
|
4
|
-
version: 0.11.
|
|
4
|
+
version: 0.11.7
|
|
5
5
|
homepage: https://github.com/moltblock/moltblock
|
|
6
6
|
repository: https://github.com/moltblock/moltblock
|
|
7
7
|
metadata:
|
|
@@ -10,9 +10,9 @@ metadata:
|
|
|
10
10
|
anyBins:
|
|
11
11
|
- npx
|
|
12
12
|
- node
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
optionalConfig:
|
|
14
|
+
- moltblock.json
|
|
15
|
+
- ~/.moltblock/moltblock.json
|
|
16
16
|
primaryEnv: OPENAI_API_KEY
|
|
17
17
|
optionalEnv:
|
|
18
18
|
- ANTHROPIC_API_KEY
|
|
@@ -21,7 +21,7 @@ metadata:
|
|
|
21
21
|
homepage: https://github.com/moltblock/moltblock
|
|
22
22
|
install:
|
|
23
23
|
- kind: node
|
|
24
|
-
package: moltblock@0.11.
|
|
24
|
+
package: moltblock@0.11.7
|
|
25
25
|
bins: [moltblock]
|
|
26
26
|
---
|
|
27
27
|
|
|
@@ -34,9 +34,10 @@ Moltblock provides verification gating for AI-generated artifacts. It runs polic
|
|
|
34
34
|
**What moltblock does:**
|
|
35
35
|
- Generates artifacts via LLM API calls, then runs policy checks against the output
|
|
36
36
|
- Returns a structured verification result (pass/fail with evidence)
|
|
37
|
-
-
|
|
37
|
+
- Optionally reads config files (`moltblock.json`, `~/.moltblock/moltblock.json`) if present — no config is required
|
|
38
38
|
- API keys are read from environment variables at runtime and sent only to the configured LLM provider endpoint
|
|
39
|
-
- **
|
|
39
|
+
- **When used as a skill (without `--test`):** only policy checks run — no code is generated, written to disk, or executed
|
|
40
|
+
- **The `--test` flag** (developer-only, not exposed to agents via this skill) additionally runs code verification via vitest in an isolated temp directory
|
|
40
41
|
|
|
41
42
|
## When to Use
|
|
42
43
|
|
|
@@ -53,7 +54,7 @@ Verify a task before execution.
|
|
|
53
54
|
### Usage
|
|
54
55
|
|
|
55
56
|
```bash
|
|
56
|
-
npx moltblock@0.11.
|
|
57
|
+
npx moltblock@0.11.7 "<task description>" --provider <provider> --json
|
|
57
58
|
```
|
|
58
59
|
|
|
59
60
|
### Parameters
|
|
@@ -77,7 +78,7 @@ Moltblock auto-detects the LLM provider from whichever API key is set. If no key
|
|
|
77
78
|
|
|
78
79
|
```bash
|
|
79
80
|
# Verify a task
|
|
80
|
-
npx moltblock@0.11.
|
|
81
|
+
npx moltblock@0.11.7 "implement a function that validates email addresses" --json
|
|
81
82
|
```
|
|
82
83
|
|
|
83
84
|
### Output (JSON mode)
|
|
@@ -98,13 +99,13 @@ npx moltblock@0.11.5 "implement a function that validates email addresses" --jso
|
|
|
98
99
|
Use directly with npx (recommended, no install needed):
|
|
99
100
|
|
|
100
101
|
```bash
|
|
101
|
-
npx moltblock@0.11.
|
|
102
|
+
npx moltblock@0.11.7 "your task" --json
|
|
102
103
|
```
|
|
103
104
|
|
|
104
105
|
Or install globally:
|
|
105
106
|
|
|
106
107
|
```bash
|
|
107
|
-
npm install -g moltblock@0.11.
|
|
108
|
+
npm install -g moltblock@0.11.7
|
|
108
109
|
```
|
|
109
110
|
|
|
110
111
|
## Configuration
|
|
@@ -135,9 +136,13 @@ See the [full configuration docs](https://github.com/moltblock/moltblock#configu
|
|
|
135
136
|
|
|
136
137
|
## Security
|
|
137
138
|
|
|
138
|
-
When
|
|
139
|
+
**Skill surface (agent-facing):** When invoked via `npx moltblock "<task>" --json`, the tool makes LLM API calls and runs regex-based policy checks against the generated output. No code is written to disk or executed. Task descriptions and generated artifacts are transmitted to the configured LLM provider endpoint.
|
|
139
140
|
|
|
140
|
-
The CLI
|
|
141
|
+
**Developer-only CLI surface:** The CLI supports a `--test <path>` flag that additionally runs code verification via vitest in an isolated temp directory. This flag is **not exposed to agents** through this skill and is documented here only for transparency. It should only be used directly by developers in sandboxed environments.
|
|
142
|
+
|
|
143
|
+
**npm install behavior:** The package has no `postinstall` scripts. `better-sqlite3` (a dependency) uses `prebuild-install` to download prebuilt native binaries — no compilation occurs unless prebuilds are unavailable. Inspect via `npm pack --dry-run` or review the [source on GitHub](https://github.com/moltblock/moltblock).
|
|
144
|
+
|
|
145
|
+
**API key scope:** Consider using a limited-scope API key dedicated to verification rather than a key with broader permissions.
|
|
141
146
|
|
|
142
147
|
## Disclaimer
|
|
143
148
|
|