@mcpherson-ai/observa-edge-n8n 1.3.0 → 1.4.0
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/README.md +44 -8
- package/linux-x64/README.md +1 -1
- package/linux-x64/files.json +1 -1
- package/observa-edge-n8n +6 -0
- package/package.json +9 -6
- package/pair-entry.mjs +114 -0
- package/payload/README.md +1 -1
- package/payload/files.json +1 -1
- package/peer-pins.json +18 -0
package/README.md
CHANGED
|
@@ -1,17 +1,33 @@
|
|
|
1
|
-
# Observa Edge for n8n
|
|
1
|
+
# Observa Edge for n8n — Local governance for invoice-review workflows
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Let a workflow review one authorized invoice and keep signed evidence of the decision.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## What Edge does
|
|
6
6
|
|
|
7
|
-
Edge
|
|
7
|
+
Edge governs **Observa Review Invoice**, the terminal action in a bound, published Webhook v2 POST workflow that handles one item.
|
|
8
8
|
|
|
9
|
-
##
|
|
9
|
+
## Why use it
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
A workflow builder can preview which invoice requests would pass. A service owner can approve the exact workflow and target before allowing a change to local business data.
|
|
12
|
+
|
|
13
|
+
## Available controls
|
|
14
|
+
|
|
15
|
+
Bind the workflow, terminal node and selected SQLite invoice. Preview policy in Shadow, authorize enforcement in Guard, refuse other eligible invoice IDs and inspect local signed evidence.
|
|
16
|
+
|
|
17
|
+
## How it works
|
|
18
|
+
|
|
19
|
+
Shadow signs a decision without dispatching the write. After owner activation, Guard can move the selected invoice from NEW at revision 0 to REVIEWED at revision 1. Edge reads the committed state on a separate connection and signs the result.
|
|
20
|
+
|
|
21
|
+
## Build your own governance stack
|
|
22
|
+
|
|
23
|
+
Observa Modular Governance is a collection of independently usable products. Edge decides whether a qualified action may run. Lite independently reads the downstream source to verify its state. Start with either product. Pair them locally when the Edge route and Lite source support the same operation.
|
|
24
|
+
|
|
25
|
+
Basic is free, accountless, local-first and non-metered. Standard is under development at $9.99/month, with unlimited ordinary customization through the existing Wizard and seven-day local retention. Pro targets $29.99/month, thirty-day local retention, local and Hosted cluster management, and human support. Basic is the available offer. [Explore the Observa catalog](https://mcphersonai.com/observa).
|
|
26
|
+
|
|
27
|
+
## Installation and getting started
|
|
12
28
|
|
|
13
29
|
~~~
|
|
14
|
-
npm install --global --ignore-scripts @mcpherson-ai/observa-edge-n8n@1.
|
|
30
|
+
npm install --global --ignore-scripts @mcpherson-ai/observa-edge-n8n@1.4.0
|
|
15
31
|
observa-edge-n8n --help
|
|
16
32
|
~~~
|
|
17
33
|
|
|
@@ -23,4 +39,24 @@ observa-edge-n8n test pair
|
|
|
23
39
|
observa-edge-n8n test pair --member LITE_INSTALLATION_ID
|
|
24
40
|
~~~
|
|
25
41
|
|
|
26
|
-
The paired check challenges an enrolled Lite installation and reads its selected source. Select the member explicitly when
|
|
42
|
+
The paired check challenges an enrolled Lite installation and reads its selected source. Select the member explicitly when multiple members are enrolled. Successful configured checks also test allowed and protected invoices in a temporary Shadow fixture. The report contains signed test receipts. Configured readiness dispatches zero business actions. See `payload/README.md` for fixture options and exit codes.
|
|
43
|
+
|
|
44
|
+
## Simplified Local Governance Loop pairing
|
|
45
|
+
|
|
46
|
+
Install Lite and your chosen Edge control in either order. Use the qualified Node runtime for that product. Put the installed launchers on PATH under a prefix controlled by the owner. The guide verifies the packaged files before invoking a counterpart. For a project-local Claude install, include its node_modules/.bin directory. Complete Edge setup or binding and configure the independent read-only source with `observa-lite auth`.
|
|
47
|
+
|
|
48
|
+
Start with `observa-edge-n8n pair` in a terminal. Select the local n8n installation and the SQLite invoice row for its bound terminal review action. Review the installation, route and source. Enter PAIR to authorize this membership. Cancel before confirmation to leave membership unchanged.
|
|
49
|
+
|
|
50
|
+
The guide runs the signed, dispatch-free readiness check after enrollment. READY means the selected pair answered the check. HOLD or UNKNOWN requires inspection before relying on the pair. Edge records its action decision. Lite separately reads and signs the observed outcome. Causation remains UNKNOWN.
|
|
51
|
+
|
|
52
|
+
Run `observa-edge-n8n test pair` to check again and `observa-edge-n8n members` to inspect membership. Use `observa-edge-n8n unpair lite LITE_ID` with the identity from members, or run bare `unpair` on this launcher for a membership created through the guide. Use the same Edge installation selector as for the paired profile.
|
|
53
|
+
|
|
54
|
+
An Edge can pair with multiple Lite installations. Each Lite installation pairs with one Edge at a time. Three simultaneous Lite members were independently qualified on macOS. Basic pairing is optional, free, local and accountless. Keep the two products’ credentials and evidence in their own installations.
|
|
55
|
+
|
|
56
|
+
## Supported coverage and limitations
|
|
57
|
+
|
|
58
|
+
Use stock n8n 2.45.7 in regular, single-main mode with Node 24.18.0 and Python 3.9 or later. Supported hosts are Apple silicon macOS and Debian 12 on ARM64 or x64. Coverage is limited to one item and the bound terminal action. Queue workers, multi-main deployments, arbitrary SQL and other workflow actions are outside the qualified scope.
|
|
59
|
+
|
|
60
|
+
## Technical reference and security
|
|
61
|
+
|
|
62
|
+
See [workflow binding, service setup and SQLite schema](payload/core/README.md) and the [owner commands, test receipts and exit codes](payload/README.md). The package includes [distribution terms](payload/LICENSE.txt) and [notices](payload/core/NOTICE.txt).
|
package/linux-x64/README.md
CHANGED
|
@@ -6,6 +6,6 @@ Use the installed CTL on macOS ARM64 or Debian 12 ARM64 with stock n8n 2.45.7 an
|
|
|
6
6
|
observa-edge-n8n test pair
|
|
7
7
|
observa-edge-n8n test pair --member LITE_INSTALLATION_ID
|
|
8
8
|
|
|
9
|
-
The paired check challenges the enrolled Lite installation and reads its selected source. With
|
|
9
|
+
The paired check challenges the enrolled Lite installation and reads its selected source. With multiple members, select one explicitly. An Edge can pair with multiple Lite installations. Each Lite installation pairs with one Edge at a time. Three simultaneous Lite members were independently qualified on macOS. Each successful configured check starts a separate temporary stock n8n fixture and tests allowed and protected invoices in Shadow. The JSON report contains the signed test receipts and fixture evidence. Configured readiness involves zero business dispatches. The temporary owner, workflows, SQLite invoice database and keys are deleted when the command finishes.
|
|
10
10
|
|
|
11
11
|
Add --sandbox-guard to request the per-run Guard prompt. Enter the displayed confirmation to authorize a real mutation of one disposable invoice and a refusal for the protected fixture invoice. The configured owner retains its operating mode. Exit codes are 0 for READY, 2 for HOLD or UNPAIRED and 3 for UNKNOWN.
|
package/linux-x64/files.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"LICENSE.txt": "b2bd6e3e93df01afc0fcd94a670d674fe469d17aaabfb5e3e42d18bb10269094",
|
|
3
|
-
"README.md": "
|
|
3
|
+
"README.md": "75fb32a4117be6e3820c0286a866903fbb336939dfd66903fd882ae5f2353a4a",
|
|
4
4
|
"core/NOTICE.txt": "74319adfaa4aeb47d7667c9853812fa9e12fc03b6d7b46be86153ec61da6276f",
|
|
5
5
|
"core/README.md": "686eeb087c232b3b7a3858b6603e8365221313788ea0d93e6a3aa904d666b9c9",
|
|
6
6
|
"core/extension/EMBEDDED-SDK-TERMS.md": "949cf139691a46fe33da443ddb039a40cd72fcdd2b28f7670f40e812143256ad",
|
package/observa-edge-n8n
CHANGED
|
@@ -16,5 +16,11 @@ elif sys.platform == 'linux' and machine in ('aarch64', 'x86_64'):
|
|
|
16
16
|
payload = 'linux-x64' if machine == 'x86_64' else 'payload'
|
|
17
17
|
else:
|
|
18
18
|
sys.exit('Unsupported operating system or architecture')
|
|
19
|
+
if sys.argv[1:] in (['pair'], ['unpair']):
|
|
20
|
+
os.execvp('node', ['node', str(root / 'pair-entry.mjs'), 'observa-edge-n8n', str(root / 'observa-edge-n8n'),sys.argv[1]])
|
|
21
|
+
if len(sys.argv)==3 and sys.argv[1] in ('pair','unpair') and sys.argv[2] in ('--help','-h'):
|
|
22
|
+
if sys.argv[1] == 'pair':
|
|
23
|
+
print('An Edge can pair with multiple Lite installations. Each Lite installation pairs with one Edge at a time. Three simultaneous Lite members were independently qualified on macOS.', flush=True)
|
|
24
|
+
print(f'Run observa-edge-n8n {sys.argv[1]} for guided local selection. Explicit syntax follows.', flush=True)
|
|
19
25
|
ctl = root / payload / 'observa-edge-n8n'
|
|
20
26
|
os.execv(ctl, [str(ctl), *sys.argv[1:]])
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mcpherson-ai/observa-edge-n8n",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.4.0",
|
|
4
|
+
"description": "Preview and enforce local guardrails for a bound n8n invoice-review action, with owner-authorized writes and signed workflow evidence.",
|
|
5
5
|
"license": "SEE LICENSE IN payload/LICENSE.txt",
|
|
6
6
|
"bin": {
|
|
7
7
|
"observa-edge-n8n": "observa-edge-n8n"
|
|
@@ -30,14 +30,17 @@
|
|
|
30
30
|
},
|
|
31
31
|
"keywords": [
|
|
32
32
|
"n8n",
|
|
33
|
-
"modular-governance",
|
|
34
33
|
"workflow-governance",
|
|
34
|
+
"ai-governance",
|
|
35
|
+
"guardrails",
|
|
35
36
|
"policy-enforcement",
|
|
36
|
-
"
|
|
37
|
-
"
|
|
37
|
+
"workflow-automation",
|
|
38
|
+
"sqlite",
|
|
39
|
+
"signed-evidence"
|
|
38
40
|
],
|
|
39
41
|
"repository": {
|
|
40
42
|
"type": "git",
|
|
41
43
|
"url": "git+https://github.com/McphersonAI/observa-local-node.git"
|
|
42
|
-
}
|
|
44
|
+
},
|
|
45
|
+
"homepage": "https://mcphersonai.com/observa"
|
|
43
46
|
}
|
package/pair-entry.mjs
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
// The guided path accepts exact installed package contents from this release or its public predecessors.
|
|
2
|
+
import { createHash } from 'node:crypto';
|
|
3
|
+
import { accessSync, constants, lstatSync, readFileSync, readdirSync, realpathSync } from 'node:fs';
|
|
4
|
+
import { delimiter, dirname, isAbsolute, join, relative } from 'node:path';
|
|
5
|
+
import { fileURLToPath } from 'node:url';
|
|
6
|
+
import { spawnSync } from 'node:child_process';
|
|
7
|
+
import { createInterface } from 'node:readline/promises';
|
|
8
|
+
|
|
9
|
+
// Guided child processes import shipped Python sources even if a normal prior run made .pyc files.
|
|
10
|
+
// /dev/null cannot contain a cache. Advanced entry points keep their original environments.
|
|
11
|
+
export function sourceOnlyPython() {
|
|
12
|
+
process.env.PYTHONPYCACHEPREFIX='/dev/null/observa-cache';
|
|
13
|
+
process.env.PYTHONDONTWRITEBYTECODE='1';
|
|
14
|
+
}
|
|
15
|
+
function trustedAncestors(root) {
|
|
16
|
+
for (let dir=root;;dir=dirname(dir)) {
|
|
17
|
+
const stat=lstatSync(dir);
|
|
18
|
+
const sticky=dir!==root && (stat.mode & 0o1000);
|
|
19
|
+
if (!stat.isDirectory() || ![0,process.getuid()].includes(stat.uid) ||
|
|
20
|
+
((stat.mode & 0o022) && !sticky)) throw Error('SOURCE_CTL_PERMISSIONS');
|
|
21
|
+
if (dirname(dir)===dir) return;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
25
|
+
export const products = {
|
|
26
|
+
'observa-lite': ['Observa Lite', 'cli.mjs'],
|
|
27
|
+
'observa-edge': ['OpenClaw Edge', 'observa-edge'],
|
|
28
|
+
'observa-claude': ['Claude Edge', 'cli.mjs'],
|
|
29
|
+
'observa-edge-n8n': ['n8n Edge', 'observa-edge-n8n'],
|
|
30
|
+
};
|
|
31
|
+
function fingerprint(root) {
|
|
32
|
+
const files = [];
|
|
33
|
+
let bytes=0;
|
|
34
|
+
let entries=0;
|
|
35
|
+
function visit(dir) {
|
|
36
|
+
for (const entry of readdirSync(dir, {withFileTypes:true})) {
|
|
37
|
+
const path = join(dir, entry.name);
|
|
38
|
+
const stat = lstatSync(path);
|
|
39
|
+
bytes+=stat.isFile()?stat.size:0;
|
|
40
|
+
if (++entries>4096 || bytes>32*1024*1024) throw Error('SOURCE_CTL_CAPACITY');
|
|
41
|
+
if (![0,process.getuid()].includes(stat.uid) || (stat.mode & 0o022)) throw Error('SOURCE_CTL_PERMISSIONS');
|
|
42
|
+
if (entry.isDirectory()) visit(path);
|
|
43
|
+
else if (entry.isFile()) {
|
|
44
|
+
// Only ordinary cache entries for an existing shipped source can be disregarded.
|
|
45
|
+
const cache=/^(.+)\.cpython-[0-9]+(?:\.opt-[12])?\.pyc$/.exec(entry.name);
|
|
46
|
+
if (dir.endsWith('/__pycache__') && cache && lstatSync(join(dirname(dir),cache[1]+'.py'),{throwIfNoEntry:false})?.isFile()) continue;
|
|
47
|
+
files.push(relative(root,path));
|
|
48
|
+
}
|
|
49
|
+
else throw Error('SOURCE_CTL_FILE');
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
visit(root);
|
|
53
|
+
const hash = createHash('sha256');
|
|
54
|
+
for (const file of files.sort()) {
|
|
55
|
+
if (file === 'peer-pins.json') continue;
|
|
56
|
+
const digest = createHash('sha256').update(readFileSync(join(root,file))).digest('hex');
|
|
57
|
+
hash.update(file+'\0'+digest+'\n');
|
|
58
|
+
}
|
|
59
|
+
return hash.digest('hex');
|
|
60
|
+
}
|
|
61
|
+
export function installed(name, path) {
|
|
62
|
+
if (!Object.hasOwn(products,name) || !isAbsolute(path)) throw Error('SOURCE_CTL');
|
|
63
|
+
const ctl = realpathSync(path);
|
|
64
|
+
const root = dirname(ctl);
|
|
65
|
+
const pins = readFileSync(join(here,'peer-pins.json'),'utf8');
|
|
66
|
+
const allowed = JSON.parse(pins)[name];
|
|
67
|
+
if (ctl !== join(root,products[name][1])) throw Error('SOURCE_CTL');
|
|
68
|
+
trustedAncestors(root);
|
|
69
|
+
const expected = {'observa-lite':'observa-lite','observa-edge':'observa-edge-basic-openclaw','observa-claude':'observa-edge-basic-claude','observa-edge-n8n':'observa-edge-n8n'};
|
|
70
|
+
const manifestStat = lstatSync(join(root,'package.json'));
|
|
71
|
+
if (!manifestStat.isFile() || manifestStat.size>65536) throw Error('SOURCE_CTL_IDENTITY');
|
|
72
|
+
const manifest = JSON.parse(readFileSync(join(root,'package.json'),'utf8'));
|
|
73
|
+
if (manifest.name !== '@mcpherson-ai/'+expected[name]) throw Error('SOURCE_CTL_IDENTITY');
|
|
74
|
+
accessSync(ctl,constants.X_OK);
|
|
75
|
+
const digest = fingerprint(root);
|
|
76
|
+
if (digest !== allowed.current && digest !== allowed.previous) throw Error('SOURCE_CTL_IDENTITY');
|
|
77
|
+
if (digest === allowed.current && readFileSync(join(root,'peer-pins.json'),'utf8') !== pins) throw Error('SOURCE_CTL_IDENTITY');
|
|
78
|
+
return {name,ctl,current:digest===allowed.current};
|
|
79
|
+
}
|
|
80
|
+
export function discover(names) {
|
|
81
|
+
const found = new Map();
|
|
82
|
+
for (const dir of (process.env.PATH ?? '').split(delimiter).filter(isAbsolute)) {
|
|
83
|
+
for (const name of names) {
|
|
84
|
+
try {
|
|
85
|
+
const peer = installed(name, join(dir,name));
|
|
86
|
+
found.set(peer.ctl,peer);
|
|
87
|
+
} catch { /* Unavailable or unrecognized executable. */ }
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return [...found.values()];
|
|
91
|
+
}
|
|
92
|
+
export async function startEdge(name, ctl, operation='pair') {
|
|
93
|
+
if (!['pair','unpair'].includes(operation)) throw Error('Unknown membership operation.');
|
|
94
|
+
if (!process.stdin.isTTY || !process.stderr.isTTY) throw Error('Guided pairing requires a terminal. Use pair lite HOME for automation.');
|
|
95
|
+
sourceOnlyPython();
|
|
96
|
+
const peers = discover(['observa-lite']).filter(peer=>peer.current);
|
|
97
|
+
if (!peers.length) throw Error('Put the matching Observa Lite npm launcher on PATH and run observa-lite auth.');
|
|
98
|
+
const term = createInterface({input:process.stdin,output:process.stderr});
|
|
99
|
+
let selected;
|
|
100
|
+
try {
|
|
101
|
+
peers.forEach((p,i)=>process.stderr.write((i+1)+') Observa Lite '+JSON.stringify(p.ctl)+'\n'));
|
|
102
|
+
const input = await term.question('Select Lite launcher'+(peers.length===1?' [1]':' [number]')+': ');
|
|
103
|
+
selected = peers[input==='' && peers.length===1 ? 0 : /^[1-9][0-9]*$/.test(input) ? Number(input)-1 : -1];
|
|
104
|
+
if (!selected) throw Error('Select one listed Lite installation.');
|
|
105
|
+
} finally { term.close(); }
|
|
106
|
+
const peer = installed('observa-lite',selected.ctl);
|
|
107
|
+
const child = spawnSync(peer.ctl,[operation,'--from-edge',name,realpathSync(ctl)],{stdio:'inherit'});
|
|
108
|
+
if (child.error) throw child.error;
|
|
109
|
+
process.exitCode = child.status ?? 2;
|
|
110
|
+
}
|
|
111
|
+
if (import.meta.main) {
|
|
112
|
+
try { await startEdge(process.argv[2],process.argv[3],process.argv[4]); }
|
|
113
|
+
catch (error) { console.error(error.message); process.exitCode=2; }
|
|
114
|
+
}
|
package/payload/README.md
CHANGED
|
@@ -6,6 +6,6 @@ Use the installed CTL on macOS ARM64 or Debian 12 ARM64 with stock n8n 2.45.7 an
|
|
|
6
6
|
observa-edge-n8n test pair
|
|
7
7
|
observa-edge-n8n test pair --member LITE_INSTALLATION_ID
|
|
8
8
|
|
|
9
|
-
The paired check challenges the enrolled Lite installation and reads its selected source. With
|
|
9
|
+
The paired check challenges the enrolled Lite installation and reads its selected source. With multiple members, select one explicitly. An Edge can pair with multiple Lite installations. Each Lite installation pairs with one Edge at a time. Three simultaneous Lite members were independently qualified on macOS. Each successful configured check starts a separate temporary stock n8n fixture and tests allowed and protected invoices in Shadow. The JSON report contains the signed test receipts and fixture evidence. Configured readiness involves zero business dispatches. The temporary owner, workflows, SQLite invoice database and keys are deleted when the command finishes.
|
|
10
10
|
|
|
11
11
|
Add --sandbox-guard to request the per-run Guard prompt. Enter the displayed confirmation to authorize a real mutation of one disposable invoice and a refusal for the protected fixture invoice. The configured owner retains its operating mode. Exit codes are 0 for READY, 2 for HOLD or UNPAIRED and 3 for UNKNOWN.
|
package/payload/files.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"LICENSE.txt": "b2bd6e3e93df01afc0fcd94a670d674fe469d17aaabfb5e3e42d18bb10269094",
|
|
3
|
-
"README.md": "
|
|
3
|
+
"README.md": "75fb32a4117be6e3820c0286a866903fbb336939dfd66903fd882ae5f2353a4a",
|
|
4
4
|
"core/NOTICE.txt": "74319adfaa4aeb47d7667c9853812fa9e12fc03b6d7b46be86153ec61da6276f",
|
|
5
5
|
"core/README.md": "686eeb087c232b3b7a3858b6603e8365221313788ea0d93e6a3aa904d666b9c9",
|
|
6
6
|
"core/extension/EMBEDDED-SDK-TERMS.md": "949cf139691a46fe33da443ddb039a40cd72fcdd2b28f7670f40e812143256ad",
|
package/peer-pins.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"observa-claude": {
|
|
3
|
+
"current": "68dc4bbcab6e91082c3ad4af6276e0e0a5093efd542f39c1300da44fd550cbe1",
|
|
4
|
+
"previous": "2343b35127495923f1d9ffd821925d57d3b46c43e691454413759cfc59d4bc6d"
|
|
5
|
+
},
|
|
6
|
+
"observa-edge": {
|
|
7
|
+
"current": "60fc6d8bbc035270a993d24b8f89232211911132af5102cb780eab09d88bc6cb",
|
|
8
|
+
"previous": "494616356a644bb5df969b2f349bd79ae24537e5a59c134672140cf6b66aaeb7"
|
|
9
|
+
},
|
|
10
|
+
"observa-edge-n8n": {
|
|
11
|
+
"current": "b65a6159f83f02e1d2ab22a4f080474050a9d7e2b11a0f2f75f3f3fbdf8c3f36",
|
|
12
|
+
"previous": "d42dece69e2329071e8f4f97f8b64414ea737b5fc2dbe1400d61bb95f9c995b9"
|
|
13
|
+
},
|
|
14
|
+
"observa-lite": {
|
|
15
|
+
"current": "7f4d0197299deecfed67cfd764c5fb0c820bd510701ba3185d838235eaf8ca1e",
|
|
16
|
+
"previous": "780ee627e878a1e0ad634fddc839a17ffb81ea82b881d11ea37473cc6e0b5612"
|
|
17
|
+
}
|
|
18
|
+
}
|