agience-flare-dkg-integration 0.3.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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Manoj Modhwadia
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,68 @@
1
+ # agience-flare-dkg-integration (npm wrapper)
2
+
3
+ Thin npm wrapper around the **Agience FLARE × DKG v10 Integration** Python package shipped on PyPI as [`agience-flare-dkg-integration`](https://pypi.org/project/agience-flare-dkg-integration/).
4
+
5
+ The wrapper exists so the integration can be installed via `npm install -g` and resolved through the [OriginTrail DKG integrations registry](https://github.com/OriginTrail/dkg-integrations) `cli`-kind install flow, without bundling Python or running any install-time scripts.
6
+
7
+ ## What this package is — and is not
8
+
9
+ **Is:** a 50-line Node CLI shim that spawns the Python `agience-dkg` CLI if it is on PATH, or prints a single clear `pipx install` / `pip install` hint if it is not.
10
+
11
+ **Is not:** an alternative implementation. All logic — Working Memory writes, Shared Memory promotion, FLARE confidential retrieval, governed-mode commit-receipt projection, MCP Streamable HTTP transport, typed `agience:` RDF Knowledge Asset shaping — lives in the Python package.
12
+
13
+ ## Security posture
14
+
15
+ - **No `preinstall`, `install`, or `postinstall` scripts.** Section 8a-compliant.
16
+ - **No dynamic code loading.** No `eval`, no remote module fetch.
17
+ - **No runtime dependencies.** Zero third-party packages in `dependencies`.
18
+ - **No egress at install time.** The wrapper does nothing until you invoke `agience-dkg`.
19
+
20
+ ## Install
21
+
22
+ ```bash
23
+ npm install -g agience-flare-dkg-integration
24
+ ```
25
+
26
+ Then install the Python CLI it wraps:
27
+
28
+ ```bash
29
+ pipx install agience-flare-dkg-integration==0.3.1
30
+ # or:
31
+ python -m pip install --user agience-flare-dkg-integration==0.3.1
32
+ ```
33
+
34
+ If you invoke `agience-dkg` before the Python CLI is installed, the wrapper prints the install hint above and exits with code `127`.
35
+
36
+ ## Usage
37
+
38
+ All flags and subcommands pass through to the Python CLI unchanged:
39
+
40
+ ```bash
41
+ agience-dkg wm-write --title "session-note" --content "…"
42
+ agience-dkg promote <ual>
43
+ agience-dkg search "topic"
44
+ ```
45
+
46
+ Wrapper-only flag:
47
+
48
+ ```bash
49
+ agience-dkg --wrapper-version
50
+ ```
51
+
52
+ ## Configuration
53
+
54
+ Set on the operator's environment, not handled by the wrapper:
55
+
56
+ | Variable | Purpose |
57
+ |---|---|
58
+ | `DKG_BASE_URL` | Local DKG node base URL (default `http://localhost:8081`) |
59
+ | `DKG_TOKEN` | Bearer token for the local DKG node |
60
+ | `DKG_CONTEXT_GRAPH` | Context Graph slug to project into |
61
+ | `AGIENCE_BASE_URL` | (governed mode) Agience platform base URL |
62
+ | `AGIENCE_TOKEN` | (governed mode) Agience bearer token |
63
+
64
+ See the [parent repository README](https://github.com/Muffinman75/agience-flare-dkg-integration#readme) and [DESIGN_BRIEF.md](https://github.com/Muffinman75/agience-flare-dkg-integration/blob/main/DESIGN_BRIEF.md) for the full integration story.
65
+
66
+ ## License
67
+
68
+ MIT
@@ -0,0 +1,82 @@
1
+ #!/usr/bin/env node
2
+ // Thin Node-side wrapper around the Python `agience-dkg` CLI shipped on PyPI as
3
+ // `agience-flare-dkg-integration`. This wrapper exists purely so the integration
4
+ // can be installed via `npm install -g` (and resolved by the DKG integrations
5
+ // registry installer) without bundling Python. It does *not* download, install,
6
+ // or execute any remote code at install time: no postinstall hooks, no eval,
7
+ // no remote fetch. All it does at runtime is spawn `agience-dkg` if it is on
8
+ // PATH, or print a single clear install hint if it is not.
9
+ //
10
+ // SPDX-License-Identifier: MIT
11
+
12
+ import { spawn } from 'node:child_process';
13
+ import { existsSync } from 'node:fs';
14
+ import { resolve, dirname } from 'node:path';
15
+ import { fileURLToPath } from 'node:url';
16
+ import { createRequire } from 'node:module';
17
+
18
+ const require = createRequire(import.meta.url);
19
+ const pkg = require('../package.json');
20
+
21
+ const PYTHON_PACKAGE = 'agience-flare-dkg-integration';
22
+ const PYTHON_CLI = 'agience-dkg';
23
+ const PINNED_VERSION = pkg.version;
24
+
25
+ const args = process.argv.slice(2);
26
+
27
+ // `--wrapper-version` is a wrapper-only flag so operators can see exactly which
28
+ // npm wrapper they have without invoking the Python side. Everything else
29
+ // passes through untouched.
30
+ if (args.length === 1 && args[0] === '--wrapper-version') {
31
+ process.stdout.write(`${pkg.name}@${pkg.version} (npm wrapper)\n`);
32
+ process.exit(0);
33
+ }
34
+
35
+ run();
36
+
37
+ function run() {
38
+ const child = spawn(PYTHON_CLI, args, {
39
+ stdio: 'inherit',
40
+ shell: process.platform === 'win32',
41
+ });
42
+
43
+ child.on('error', (err) => {
44
+ if (err && err.code === 'ENOENT') {
45
+ printMissingPythonCliHint();
46
+ process.exit(127);
47
+ }
48
+ process.stderr.write(`agience-dkg: failed to launch underlying CLI: ${err.message}\n`);
49
+ process.exit(1);
50
+ });
51
+
52
+ child.on('exit', (code, signal) => {
53
+ if (signal) {
54
+ process.exit(1);
55
+ }
56
+ process.exit(code ?? 0);
57
+ });
58
+ }
59
+
60
+ function printMissingPythonCliHint() {
61
+ const lines = [
62
+ '',
63
+ `agience-dkg: underlying Python CLI '${PYTHON_CLI}' was not found on PATH.`,
64
+ '',
65
+ `This npm package (${pkg.name}@${pkg.version}) is a thin wrapper around the`,
66
+ `Python implementation shipped on PyPI as '${PYTHON_PACKAGE}'. The wrapper does`,
67
+ 'not auto-install Python dependencies (no postinstall hooks, by design).',
68
+ '',
69
+ 'One-line install:',
70
+ '',
71
+ ` pipx install ${PYTHON_PACKAGE}==${PINNED_VERSION}`,
72
+ '',
73
+ 'Or via pip:',
74
+ '',
75
+ ` python -m pip install --user ${PYTHON_PACKAGE}==${PINNED_VERSION}`,
76
+ '',
77
+ 'Then re-run the same command. Configure the local DKG node endpoint with',
78
+ 'DKG_BASE_URL and DKG_TOKEN as documented in the README.',
79
+ '',
80
+ ];
81
+ process.stderr.write(lines.join('\n'));
82
+ }
package/index.js ADDED
@@ -0,0 +1,27 @@
1
+ // Programmatic surface for the agience-flare-dkg-integration npm wrapper.
2
+ //
3
+ // The integration's library API (DkgHttpClient, AgienceClient, models) lives
4
+ // in the Python package on PyPI (`agience-flare-dkg-integration`). This npm
5
+ // package exists to make the integration installable via `npm install -g` and
6
+ // resolvable through the DKG integrations registry's `cli`-kind install flow.
7
+ //
8
+ // Node-side consumers should drive the CLI via spawn(), or call the local DKG
9
+ // node's MCP Streamable HTTP transport directly. See the repository README for
10
+ // MCP tool names and JSON-RPC shapes.
11
+ //
12
+ // SPDX-License-Identifier: MIT
13
+
14
+ import { createRequire } from 'node:module';
15
+
16
+ const require = createRequire(import.meta.url);
17
+ const pkg = require('./package.json');
18
+
19
+ export const wrapperVersion = pkg.version;
20
+ export const pythonPackage = 'agience-flare-dkg-integration';
21
+ export const pythonCli = 'agience-dkg';
22
+
23
+ export default {
24
+ wrapperVersion,
25
+ pythonPackage,
26
+ pythonCli,
27
+ };
package/package.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "agience-flare-dkg-integration",
3
+ "version": "0.3.1",
4
+ "description": "npm wrapper for the Agience FLARE \u00d7 DKG v10 Integration. Governance layer above DKG v10: commit-gated Agience artifacts \u2192 typed agience: RDF Knowledge Assets in Working Memory and Shared Memory via MCP Streamable HTTP. Wrapper delegates to the Python CLI (agience-dkg) shipped on PyPI as agience-flare-dkg-integration.",
5
+ "keywords": [
6
+ "origintrail",
7
+ "dkg",
8
+ "dkg-v10",
9
+ "working-memory",
10
+ "shared-memory",
11
+ "agience",
12
+ "flare",
13
+ "mcp",
14
+ "knowledge-graph",
15
+ "governance"
16
+ ],
17
+ "license": "MIT",
18
+ "author": "Manoj Modhwadia <manojmodhwadia@outlook.com>",
19
+ "homepage": "https://github.com/Muffinman75/agience-flare-dkg-integration#readme",
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "git+https://github.com/Muffinman75/agience-flare-dkg-integration.git",
23
+ "directory": "npm-wrapper"
24
+ },
25
+ "bugs": {
26
+ "url": "https://github.com/Muffinman75/agience-flare-dkg-integration/issues"
27
+ },
28
+ "type": "module",
29
+ "main": "index.js",
30
+ "bin": {
31
+ "agience-dkg": "bin/agience-dkg.js"
32
+ },
33
+ "files": [
34
+ "bin/",
35
+ "index.js",
36
+ "README.md",
37
+ "LICENSE"
38
+ ],
39
+ "engines": {
40
+ "node": ">=18.0.0"
41
+ },
42
+ "dependencies": {}
43
+ }