coaiajs 0.2.1 → 0.3.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.
@@ -10,7 +10,8 @@
10
10
  "Bash(git push *)"
11
11
  ],
12
12
  "additionalDirectories": [
13
- "/src/coaiapy"
13
+ "/src/coaiapy",
14
+ "/workspace/repos/jgwill/miadi-orchestration-kit"
14
15
  ]
15
16
  }
16
17
  }
@@ -0,0 +1,26 @@
1
+ {
2
+ "name": "coaiajs-marketplace",
3
+ "owner": {
4
+ "name": "Guillaume Isabelle",
5
+ "email": "jgi@jgwill.com",
6
+ "url": "https://github.com/jgwill"
7
+ },
8
+ "metadata": {
9
+ "description": "CoAIA Claude Code plugins",
10
+ "version": "0.3.0"
11
+ },
12
+ "plugins": [
13
+ {
14
+ "name": "coaiajs-langfuse",
15
+ "source": "./coaiajs-langfuse-claude-plugin",
16
+ "description": "CoAIA unified MCP — 64+ tools (structural tension charts, narrative knowledge graph, PDE, planning, Redis tash/fetch, Langfuse tracing).",
17
+ "version": "0.3.0",
18
+ "author": {
19
+ "name": "Guillaume Isabelle",
20
+ "url": "https://github.com/jgwill"
21
+ },
22
+ "license": "MIT",
23
+ "keywords": ["coaia", "mcp", "structural-tension", "narrative", "pde", "planning", "langfuse"]
24
+ }
25
+ ]
26
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "coaiajs-marketplace",
3
+ "owner": { "name": "Guillaume Isabelle", "email": "jgi@jgwill.com", "url": "https://github.com/jgwill" },
4
+ "metadata": { "description": "CoAIA Claude Code plugins", "version": "0.3.0" },
5
+ "plugins": [
6
+ {
7
+ "name": "coaiajs-langfuse",
8
+ "source": "./",
9
+ "description": "CoAIA unified MCP — 64+ tools (structural tension, narrative graph, PDE, planning, Redis tash/fetch, Langfuse tracing).",
10
+ "version": "0.3.0",
11
+ "author": { "name": "Guillaume Isabelle", "url": "https://github.com/jgwill" },
12
+ "license": "MIT",
13
+ "keywords": ["coaia", "mcp", "structural-tension", "narrative", "pde", "planning", "langfuse"]
14
+ }
15
+ ]
16
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "coaiajs-langfuse",
3
+ "description": "CoAIA unified MCP for Claude Code — 64+ tools across structural-tension charts, narrative knowledge graph, Prompt Decomposition Engine (PDE), action planning, Redis tash/fetch, and Langfuse tracing. Bundles the published `coaiajs` npm package's `coaiajs-mcp` server via npx.",
4
+ "version": "0.3.0",
5
+ "author": { "name": "Guillaume Isabelle", "email": "jgi@jgwill.com", "url": "https://github.com/jgwill" },
6
+ "homepage": "https://github.com/jgwill/coaiajs/tree/master/coaiajs-langfuse-claude-plugin",
7
+ "repository": "https://github.com/jgwill/coaiajs",
8
+ "license": "MIT",
9
+ "keywords": ["coaia", "mcp", "structural-tension", "narrative", "pde", "planning", "langfuse"]
10
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "mcpServers": {
3
+ "coaia": {
4
+ "command": "npx",
5
+ "args": ["-y", "--package=coaiajs", "coaiajs-mcp"]
6
+ }
7
+ }
8
+ }
@@ -0,0 +1,60 @@
1
+ # coaiajs-langfuse — Claude Code Plugin
2
+
3
+ A Claude Code plugin that registers the `coaiajs-mcp` server — 64+ tools, 3 prompts, and 3 resources — as an MCP server inside Claude Code. It does not bundle its own copy of the server; it launches the published `coaiajs` npm package on demand via `npx`:
4
+
5
+ ```
6
+ npx -y --package=coaiajs coaiajs-mcp
7
+ ```
8
+
9
+ That command is declared in `.mcp.json` at the root of this plugin, which Claude Code auto-loads on install.
10
+
11
+ ## Install
12
+
13
+ From a marketplace source (GitHub):
14
+
15
+ ```
16
+ claude plugin marketplace add https://github.com/jgwill/coaiajs
17
+ claude plugin install coaiajs-langfuse@coaiajs-marketplace
18
+ ```
19
+
20
+ Or from a local checkout:
21
+
22
+ ```
23
+ claude plugin marketplace add /a/src/coaiajs/coaiajs-langfuse-claude-plugin
24
+ claude plugin install coaiajs-langfuse@coaiajs-marketplace
25
+ ```
26
+
27
+ Confirm it registered:
28
+
29
+ ```
30
+ claude plugin list
31
+ ```
32
+
33
+ ## Tool families
34
+
35
+ - **Structural-tension charts** — desired outcome / current reality / action steps, the core CoAIA data model.
36
+ - **Narrative knowledge graph** — entities, relations, and graph queries (from coaia-narrative).
37
+ - **PDE (Prompt Decomposition Engine)** — decompose complex prompts into actionable intent maps.
38
+ - **Action planning** — structural tension plans and action-step management (from coaia-planning).
39
+ - **Redis tash/fetch** — SET/GET shorthand against a Redis store.
40
+ - **Langfuse tracing** — trace, span, and observation tools for Langfuse-backed observability.
41
+
42
+ ## Environment variables
43
+
44
+ The server boots with no configuration — it connects to nothing at import time. Individual tool families activate only when their own credentials are present in the environment Claude Code runs in:
45
+
46
+ | Variable | Used by |
47
+ | --- | --- |
48
+ | `REDIS_URL` | tash/fetch |
49
+ | `OPENAI_API_KEY` | LLM-backed tools |
50
+ | `LANGFUSE_PUBLIC_KEY` | Langfuse tracing |
51
+ | `LANGFUSE_SECRET_KEY` | Langfuse tracing |
52
+ | `LANGFUSE_BASE_URL` | Langfuse tracing |
53
+ | `GITHUB_TOKEN` | GitHub-integration tools |
54
+ | AWS credentials (`AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, etc.) | Polly audio tools |
55
+
56
+ None of these are set by the plugin itself — they are inherited from whatever shell/environment Claude Code is launched in. Set them in your shell profile, `.env`, or however you normally manage secrets for this machine.
57
+
58
+ ## Versioning
59
+
60
+ This plugin tracks the published npm `coaiajs` package rather than vendoring source. `.mcp.json` calls `npx -y --package=coaiajs coaiajs-mcp`, which always resolves the latest published version at launch time. To pin a specific version, edit `.mcp.json` and change `--package=coaiajs` to `--package=coaiajs@<version>` (e.g. `coaiajs@0.3.0`).
@@ -12,6 +12,7 @@ import { tash as redisTash, fetch as redisFetch } from '../src/redis.js';
12
12
  import { ALL_TOOL_DEFINITIONS as NARRATIVE_TOOL_DEFINITIONS, handleToolCall as handleNarrativeTool, KnowledgeGraphManager, } from '../src/narrative/index.js';
13
13
  import { PDE_MCP_TOOLS, handlePdeTool } from '../src/pde/index.js';
14
14
  import { PLANNING_MCP_TOOLS, handlePlanningTool } from '../src/planning/index.js';
15
+ import { getPackageVersion } from '../src/version.js';
15
16
  // Langfuse imports
16
17
  import { addTrace, patchTraceOutput, listTraces, getTrace, formatTracesMarkdown, formatTraceTree, } from '../src/langfuse/traces.js';
17
18
  import { addObservation, getObservation, formatObservationDisplay } from '../src/langfuse/observations.js';
@@ -22,7 +23,7 @@ import { listComments, getComment, createComment } from '../src/langfuse/comment
22
23
  import { uploadAndAttachMedia, getMedia, formatMediaDisplay } from '../src/langfuse/media.js';
23
24
  // ─── Server Info ────────────────────────────────────────────────────
24
25
  const SERVER_NAME = 'coaiajs-mcp';
25
- const SERVER_VERSION = '0.1.1';
26
+ const SERVER_VERSION = getPackageVersion();
26
27
  // ─── Parse CLI args ─────────────────────────────────────────────────
27
28
  function parseArgs() {
28
29
  const args = process.argv.slice(2);
package/dist/src/cli.js CHANGED
@@ -8,6 +8,7 @@ import { readConfig } from './config.js';
8
8
  import { llm as llmCall, transcribeAudio, abstractProcess } from './llm.js';
9
9
  import { listIssues, getIssue } from './github.js';
10
10
  import { createEnvironment, findEnvironment } from './environment.js';
11
+ import { getPackageVersion } from './version.js';
11
12
  import { formatTable, formatJson, formatError, formatSuccess, truncate, formatDate, formatProgress, setColorEnabled, } from './cli-helpers.js';
12
13
  // ---------------------------------------------------------------------------
13
14
  // Helpers
@@ -1084,7 +1085,7 @@ async function main() {
1084
1085
  const program = new Command();
1085
1086
  program
1086
1087
  .name('coaia')
1087
- .version('0.1.3', '-V, --version')
1088
+ .version(getPackageVersion(), '-V, --version')
1088
1089
  .description('CoAIA unified CLI — structural tension, narrative, and DevOps tooling')
1089
1090
  .option('--env <path>', 'Load environment file')
1090
1091
  .option('-M, --memory-path <path>', 'JSONL memory file path')
@@ -0,0 +1,3 @@
1
+ /** Resolved version of the installed `coaiajs` package. */
2
+ export declare function getPackageVersion(): string;
3
+ //# sourceMappingURL=version.d.ts.map
@@ -0,0 +1,33 @@
1
+ // coaiajs/src/version.ts — single source of truth for the runtime version.
2
+ // Reads package.json at runtime so the CLI banner, the MCP handshake, and the
3
+ // published package can never drift apart again.
4
+ import { readFileSync } from 'node:fs';
5
+ import { dirname, join } from 'node:path';
6
+ import { fileURLToPath } from 'node:url';
7
+ const PACKAGE_NAME = 'coaiajs';
8
+ let cached;
9
+ /** Resolved version of the installed `coaiajs` package. */
10
+ export function getPackageVersion() {
11
+ if (cached)
12
+ return cached;
13
+ const here = dirname(fileURLToPath(import.meta.url));
14
+ // dist/src/version.js -> package root is two levels up.
15
+ // src/version.ts (ts-node/tsx) -> package root is one level up.
16
+ const candidates = [join(here, '..', '..', 'package.json'), join(here, '..', 'package.json')];
17
+ for (const candidate of candidates) {
18
+ let raw;
19
+ try {
20
+ raw = readFileSync(candidate, 'utf8');
21
+ }
22
+ catch {
23
+ continue; // not at this depth; try the next candidate
24
+ }
25
+ const pkg = JSON.parse(raw);
26
+ if (pkg.name === PACKAGE_NAME && pkg.version) {
27
+ cached = pkg.version;
28
+ return cached;
29
+ }
30
+ }
31
+ throw new Error(`Unable to resolve ${PACKAGE_NAME} version: no package.json found near ${here}`);
32
+ }
33
+ //# sourceMappingURL=version.js.map
package/mcp/server.ts CHANGED
@@ -28,6 +28,7 @@ import {
28
28
  import { PDE_MCP_TOOLS, handlePdeTool } from '../src/pde/index.js';
29
29
  import { PLANNING_MCP_TOOLS, handlePlanningTool } from '../src/planning/index.js';
30
30
  import type { McpToolResult } from '../src/types.js';
31
+ import { getPackageVersion } from '../src/version.js';
31
32
 
32
33
  // Langfuse imports
33
34
  import {
@@ -46,7 +47,7 @@ import { uploadAndAttachMedia, getMedia, formatMediaDisplay } from '../src/langf
46
47
  // ─── Server Info ────────────────────────────────────────────────────
47
48
 
48
49
  const SERVER_NAME = 'coaiajs-mcp';
49
- const SERVER_VERSION = '0.1.1';
50
+ const SERVER_VERSION = getPackageVersion();
50
51
 
51
52
  // ─── Parse CLI args ─────────────────────────────────────────────────
52
53
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coaiajs",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "type": "module",
5
5
  "description": "CoAIA unified TypeScript monorepo — CLI, MCP server, and library consolidating coaia-narrative, coaia-pde, coaia-planning, and coaiapy patterns into one package.",
6
6
  "bin": {
package/src/cli.ts CHANGED
@@ -9,6 +9,7 @@ import { readConfig, getConfig } from './config.js';
9
9
  import { llm as llmCall, transcribeAudio, abstractProcess } from './llm.js';
10
10
  import { listIssues, getIssue } from './github.js';
11
11
  import { createEnvironment, findEnvironment } from './environment.js';
12
+ import { getPackageVersion } from './version.js';
12
13
  import {
13
14
  formatTable, formatJson, formatError, formatSuccess,
14
15
  truncate, formatDate, formatProgress, setColorEnabled,
@@ -1221,7 +1222,7 @@ async function main(): Promise<void> {
1221
1222
 
1222
1223
  program
1223
1224
  .name('coaia')
1224
- .version('0.1.3', '-V, --version')
1225
+ .version(getPackageVersion(), '-V, --version')
1225
1226
  .description('CoAIA unified CLI — structural tension, narrative, and DevOps tooling')
1226
1227
  .option('--env <path>', 'Load environment file')
1227
1228
  .option('-M, --memory-path <path>', 'JSONL memory file path')
package/src/version.ts ADDED
@@ -0,0 +1,39 @@
1
+ // coaiajs/src/version.ts — single source of truth for the runtime version.
2
+ // Reads package.json at runtime so the CLI banner, the MCP handshake, and the
3
+ // published package can never drift apart again.
4
+
5
+ import { readFileSync } from 'node:fs';
6
+ import { dirname, join } from 'node:path';
7
+ import { fileURLToPath } from 'node:url';
8
+
9
+ const PACKAGE_NAME = 'coaiajs';
10
+
11
+ let cached: string | undefined;
12
+
13
+ /** Resolved version of the installed `coaiajs` package. */
14
+ export function getPackageVersion(): string {
15
+ if (cached) return cached;
16
+
17
+ const here = dirname(fileURLToPath(import.meta.url));
18
+ // dist/src/version.js -> package root is two levels up.
19
+ // src/version.ts (ts-node/tsx) -> package root is one level up.
20
+ const candidates = [join(here, '..', '..', 'package.json'), join(here, '..', 'package.json')];
21
+
22
+ for (const candidate of candidates) {
23
+ let raw: string;
24
+ try {
25
+ raw = readFileSync(candidate, 'utf8');
26
+ } catch {
27
+ continue; // not at this depth; try the next candidate
28
+ }
29
+ const pkg = JSON.parse(raw) as { name?: string; version?: string };
30
+ if (pkg.name === PACKAGE_NAME && pkg.version) {
31
+ cached = pkg.version;
32
+ return cached;
33
+ }
34
+ }
35
+
36
+ throw new Error(
37
+ `Unable to resolve ${PACKAGE_NAME} version: no package.json found near ${here}`,
38
+ );
39
+ }