@intentrax/sdk 1.0.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.
@@ -0,0 +1,27 @@
1
+ # Claude Code Adapter Quickstart
2
+
3
+ Use the packaged CLI quickstart when you want a contract-admissible Claude Code hook in under a minute:
4
+
5
+ ~~~bash
6
+ npx @intentrax/sdk init claude-code --output-dir .
7
+ ~~~
8
+
9
+ The command writes `.intentrax/agent-adapter.json`,
10
+ `.intentrax/sample-admission-request.json`, `.intentrax/action-receipt.json`,
11
+ and
12
+ `.intentrax/hooks/claude-code-pre-tool-use.mjs`, plus
13
+ `.intentrax/wiring/claude-code-host-wiring.md`. Open the wiring guide to import
14
+ `beforeClaudeCodeToolUse` from the host pre-tool-use hook. Submit the sample
15
+ only after setting the runtime credential in your shell:
16
+
17
+ ~~~bash
18
+ export INTENTRAX_API_KEY="..."
19
+ curl -sS "http://127.0.0.1:8080/v1/agent/admissions" \
20
+ -H "content-type: application/json" \
21
+ -H "X-Intentrax-Tenant-ID: tenant-local-dev" \
22
+ -H "X-Intentrax-Api-Key: $INTENTRAX_API_KEY" \
23
+ -H "X-Intentrax-Idempotency-Key: <sample idempotency_key_hash>" \
24
+ --data-binary @.intentrax/sample-admission-request.json
25
+ ~~~
26
+
27
+ The generated request maps Claude Code tool hooks onto `MCP_TOOL_CALL` with the `GENERIC_MCP_PROOF_ADAPTER`. Tool execution, payload mutation, policy re-evaluation, and proof generation stay outside the adapter boundary.
@@ -0,0 +1,27 @@
1
+ # Cursor Adapter Quickstart
2
+
3
+ Use the packaged CLI quickstart when you want a contract-admissible Cursor shell or tool hook in under a minute:
4
+
5
+ ~~~bash
6
+ npx @intentrax/sdk init cursor --output-dir .
7
+ ~~~
8
+
9
+ The command writes `.intentrax/agent-adapter.json`,
10
+ `.intentrax/sample-admission-request.json`, `.intentrax/action-receipt.json`,
11
+ and
12
+ `.intentrax/hooks/cursor-before-shell-execution.mjs`, plus
13
+ `.intentrax/wiring/cursor-host-wiring.md`. Open the wiring guide to import
14
+ `beforeCursorShellExecution` from the host shell-execution hook. Submit the
15
+ sample only after setting the runtime credential in your shell:
16
+
17
+ ~~~bash
18
+ export INTENTRAX_API_KEY="..."
19
+ curl -sS "http://127.0.0.1:8080/v1/agent/admissions" \
20
+ -H "content-type: application/json" \
21
+ -H "X-Intentrax-Tenant-ID: tenant-local-dev" \
22
+ -H "X-Intentrax-Api-Key: $INTENTRAX_API_KEY" \
23
+ -H "X-Intentrax-Idempotency-Key: <sample idempotency_key_hash>" \
24
+ --data-binary @.intentrax/sample-admission-request.json
25
+ ~~~
26
+
27
+ The generated request maps Cursor execution hooks onto `MCP_TOOL_CALL` with the `GENERIC_MCP_PROOF_ADAPTER`. Intentrax receives proof references and hashes only; the adapter does not execute tools or mutate prompts.
@@ -0,0 +1,27 @@
1
+ # LangChain Adapter Quickstart
2
+
3
+ Use the packaged CLI quickstart when you want a contract-admissible LangChain callback or tool wrapper in under a minute:
4
+
5
+ ~~~bash
6
+ npx @intentrax/sdk init langchain --output-dir .
7
+ ~~~
8
+
9
+ The command writes `.intentrax/agent-adapter.json`,
10
+ `.intentrax/sample-admission-request.json`, `.intentrax/action-receipt.json`,
11
+ and
12
+ `.intentrax/hooks/langchain-callback-wrapper.mjs`, plus
13
+ `.intentrax/wiring/langchain-host-wiring.md`. Open the wiring guide to import
14
+ `withIntentraxLangChainCallback` from the callback or tool wrapper boundary.
15
+ Submit the sample only after setting the runtime credential in your shell:
16
+
17
+ ~~~bash
18
+ export INTENTRAX_API_KEY="..."
19
+ curl -sS "http://127.0.0.1:8080/v1/agent/admissions" \
20
+ -H "content-type: application/json" \
21
+ -H "X-Intentrax-Tenant-ID: tenant-local-dev" \
22
+ -H "X-Intentrax-Api-Key: $INTENTRAX_API_KEY" \
23
+ -H "X-Intentrax-Idempotency-Key: <sample idempotency_key_hash>" \
24
+ --data-binary @.intentrax/sample-admission-request.json
25
+ ~~~
26
+
27
+ The generated request maps LangChain callbacks onto `SDK_AGENT_CALL` with the `SDK_AGENT_PROOF_ADAPTER`. The adapter submits hash-bound evidence references and does not re-run policy or generate proof.
@@ -0,0 +1,28 @@
1
+ # LangGraph Adapter Quickstart
2
+
3
+ Use the packaged CLI quickstart when you want a contract-admissible LangGraph node middleware path in under a minute:
4
+
5
+ ~~~bash
6
+ npx @intentrax/sdk init langgraph --output-dir .
7
+ ~~~
8
+
9
+ The command writes `.intentrax/agent-adapter.json`,
10
+ `.intentrax/sample-admission-request.json`, `.intentrax/action-receipt.json`,
11
+ and
12
+ `.intentrax/hooks/langgraph-node-middleware.mjs`, plus
13
+ `.intentrax/wiring/langgraph-host-wiring.md`. Open the wiring guide to import
14
+ `withIntentraxLangGraphNode` from node middleware before checkpointed state
15
+ commits. Submit the sample only after setting the runtime credential in your
16
+ shell:
17
+
18
+ ~~~bash
19
+ export INTENTRAX_API_KEY="..."
20
+ curl -sS "http://127.0.0.1:8080/v1/agent/admissions" \
21
+ -H "content-type: application/json" \
22
+ -H "X-Intentrax-Tenant-ID: tenant-local-dev" \
23
+ -H "X-Intentrax-Api-Key: $INTENTRAX_API_KEY" \
24
+ -H "X-Intentrax-Idempotency-Key: <sample idempotency_key_hash>" \
25
+ --data-binary @.intentrax/sample-admission-request.json
26
+ ~~~
27
+
28
+ The generated request maps LangGraph middleware onto `SDK_AGENT_CALL` with the `SDK_AGENT_PROOF_ADAPTER`. Graph execution stays in the application; Intentrax receives normalized admission evidence.
@@ -0,0 +1,27 @@
1
+ # Generic MCP Adapter Quickstart
2
+
3
+ Use the packaged CLI quickstart when you want a contract-admissible generic MCP tool-call admission path in under a minute:
4
+
5
+ ~~~bash
6
+ npx @intentrax/sdk init mcp --output-dir .
7
+ ~~~
8
+
9
+ The command writes `.intentrax/agent-adapter.json`,
10
+ `.intentrax/sample-admission-request.json`, `.intentrax/action-receipt.json`,
11
+ and
12
+ `.intentrax/hooks/mcp-tool-call-admission.mjs`, plus
13
+ `.intentrax/wiring/mcp-host-wiring.md`. Open the wiring guide to import
14
+ `beforeMCPToolCall` before forwarding `tools/call` to the upstream handler.
15
+ Submit the sample only after setting the runtime credential in your shell:
16
+
17
+ ~~~bash
18
+ export INTENTRAX_API_KEY="..."
19
+ curl -sS "http://127.0.0.1:8080/v1/agent/admissions" \
20
+ -H "content-type: application/json" \
21
+ -H "X-Intentrax-Tenant-ID: tenant-local-dev" \
22
+ -H "X-Intentrax-Api-Key: $INTENTRAX_API_KEY" \
23
+ -H "X-Intentrax-Idempotency-Key: <sample idempotency_key_hash>" \
24
+ --data-binary @.intentrax/sample-admission-request.json
25
+ ~~~
26
+
27
+ The generated request maps MCP `tools/call` evidence onto `MCP_TOOL_CALL` with the `GENERIC_MCP_PROOF_ADAPTER`. MCP protocol truth remains upstream; AEVN/AEP evidence remains authoritative inside Intentrax.
@@ -0,0 +1,28 @@
1
+ # Vercel AI SDK Adapter Quickstart
2
+
3
+ Use the packaged CLI quickstart when you want a contract-admissible Vercel AI SDK route wrapper in under a minute:
4
+
5
+ ~~~bash
6
+ npx @intentrax/sdk init vercel-ai-sdk --output-dir .
7
+ ~~~
8
+
9
+ The command writes `.intentrax/agent-adapter.json`,
10
+ `.intentrax/sample-admission-request.json`, `.intentrax/action-receipt.json`,
11
+ and
12
+ `.intentrax/hooks/vercel-ai-sdk-route-wrapper.mjs`, plus
13
+ `.intentrax/wiring/vercel-ai-sdk-host-wiring.md`. Open the wiring guide to
14
+ import `withIntentraxVercelAIRoute` inside the route handler before side effects
15
+ proceed. Submit the sample only after setting the runtime credential in your
16
+ shell:
17
+
18
+ ~~~bash
19
+ export INTENTRAX_API_KEY="..."
20
+ curl -sS "http://127.0.0.1:8080/v1/agent/admissions" \
21
+ -H "content-type: application/json" \
22
+ -H "X-Intentrax-Tenant-ID: tenant-local-dev" \
23
+ -H "X-Intentrax-Api-Key: $INTENTRAX_API_KEY" \
24
+ -H "X-Intentrax-Idempotency-Key: <sample idempotency_key_hash>" \
25
+ --data-binary @.intentrax/sample-admission-request.json
26
+ ~~~
27
+
28
+ The generated request maps TypeScript route wrapper evidence onto `SDK_AGENT_CALL` with the `SDK_AGENT_PROOF_ADAPTER`. The SDK wrapper preserves AEVN/AEP authority and never stores private key material.
@@ -0,0 +1,72 @@
1
+ # TypeScript Agent Gateway Admission Example
2
+
3
+ This generated example is downstream from the locked runtime Agent Gateway fixture.
4
+
5
+ - SDK/client reference: sdk/typescript/http.js
6
+ - Shared spec: sdk/shared-specs/agent-gateway-admission-examples.v1.json
7
+ - Endpoint: POST /v1/agent/admissions
8
+ - Required API scope: agent.gateway.admit
9
+
10
+ The SDK lane should submit the normalized admission request body exactly as shown after deriving it from the MCP or A2A protocol envelope. The SDK must not execute tools, deliver A2A messages, re-evaluate policy, generate proofs, mutate proof artifacts, or handle private key material in this path.
11
+
12
+ ## MCP Admission Request Body
13
+
14
+ ~~~json
15
+ {
16
+ "schema_version": "intentrax.runtime.agent_admission_request/1.0",
17
+ "tenant_id": "tenant-alpha",
18
+ "surface_id": "MCP_TOOL_CALL",
19
+ "action": "GET_PROOF",
20
+ "adapter_id": "GENERIC_MCP_PROOF_ADAPTER",
21
+ "evidence_refs": [
22
+ "sha256:46f136e995bf1921533652a0721e8ea47816d250aee0da951258bec5645754af",
23
+ "sha256:4c6a9a6ce776170fa968682c51efafdd39301390f94176b2029e22594917ee1f",
24
+ "sha256:8a6d71f9e60ab0ef32de1eb63d049adb3820104c30489a5c42e7acaeeb222ce1",
25
+ "sha256:8c63d17014da7fd015b77c10fb702bcf005f0ed1dee1516991747e230c3dbfc0",
26
+ "sha256:b4c6a6ab375273436e38f7b5fb58b1c270a453297a184c019c4cabab3007e698",
27
+ "sha256:b9d82729f18f8720ee4d8575192966b9aec2320b25a8e79c6e2862c005053787"
28
+ ],
29
+ "proof_refs": [
30
+ "sha256:46f136e995bf1921533652a0721e8ea47816d250aee0da951258bec5645754af",
31
+ "sha256:4c6a9a6ce776170fa968682c51efafdd39301390f94176b2029e22594917ee1f",
32
+ "sha256:8a6d71f9e60ab0ef32de1eb63d049adb3820104c30489a5c42e7acaeeb222ce1",
33
+ "sha256:8c63d17014da7fd015b77c10fb702bcf005f0ed1dee1516991747e230c3dbfc0",
34
+ "sha256:b4c6a6ab375273436e38f7b5fb58b1c270a453297a184c019c4cabab3007e698",
35
+ "sha256:b9d82729f18f8720ee4d8575192966b9aec2320b25a8e79c6e2862c005053787"
36
+ ],
37
+ "request_payload_hash": "6ae40172c3a90cd17e4e20800103a0255ec4e0c1ea34dab4cd3623c337284b6b",
38
+ "protocol_payload_ref": "sha256:6ae40172c3a90cd17e4e20800103a0255ec4e0c1ea34dab4cd3623c337284b6b",
39
+ "idempotency_key_hash": "78f5d628566a249e99a7468f670dcfa0fb175464a4540626294460179801e808"
40
+ }
41
+ ~~~
42
+
43
+ ## A2A Admission Request Body
44
+
45
+ ~~~json
46
+ {
47
+ "schema_version": "intentrax.runtime.agent_admission_request/1.0",
48
+ "tenant_id": "tenant-alpha",
49
+ "surface_id": "A2A_DELEGATION",
50
+ "action": "HAND_OFF_PROOF",
51
+ "adapter_id": "GENERIC_A2A_PROOF_ADAPTER",
52
+ "evidence_refs": [
53
+ "sha256:46f136e995bf1921533652a0721e8ea47816d250aee0da951258bec5645754af",
54
+ "sha256:4c6a9a6ce776170fa968682c51efafdd39301390f94176b2029e22594917ee1f",
55
+ "sha256:8a6d71f9e60ab0ef32de1eb63d049adb3820104c30489a5c42e7acaeeb222ce1",
56
+ "sha256:8c63d17014da7fd015b77c10fb702bcf005f0ed1dee1516991747e230c3dbfc0",
57
+ "sha256:b4c6a6ab375273436e38f7b5fb58b1c270a453297a184c019c4cabab3007e698",
58
+ "sha256:b9d82729f18f8720ee4d8575192966b9aec2320b25a8e79c6e2862c005053787"
59
+ ],
60
+ "proof_refs": [
61
+ "sha256:46f136e995bf1921533652a0721e8ea47816d250aee0da951258bec5645754af",
62
+ "sha256:4c6a9a6ce776170fa968682c51efafdd39301390f94176b2029e22594917ee1f",
63
+ "sha256:8a6d71f9e60ab0ef32de1eb63d049adb3820104c30489a5c42e7acaeeb222ce1",
64
+ "sha256:8c63d17014da7fd015b77c10fb702bcf005f0ed1dee1516991747e230c3dbfc0",
65
+ "sha256:b4c6a6ab375273436e38f7b5fb58b1c270a453297a184c019c4cabab3007e698",
66
+ "sha256:b9d82729f18f8720ee4d8575192966b9aec2320b25a8e79c6e2862c005053787"
67
+ ],
68
+ "request_payload_hash": "60ca15bd3edbdf8086638d66ab7fa735c51c63bcd044b29f620038fcc0df6add",
69
+ "protocol_payload_ref": "sha256:60ca15bd3edbdf8086638d66ab7fa735c51c63bcd044b29f620038fcc0df6add",
70
+ "idempotency_key_hash": "ca33f77093da4a962f26fe1f0f41f5b478a8fc30772d358e46a1412de8d9701f"
71
+ }
72
+ ~~~
@@ -0,0 +1,94 @@
1
+ # One-Command Adapter Init
2
+
3
+ The TypeScript SDK package exposes a small `intentrax` CLI for local adapter
4
+ onboarding.
5
+
6
+ ```bash
7
+ npx @intentrax/sdk init claude-code --dry-run
8
+ npx @intentrax/sdk init cursor
9
+ npx @intentrax/sdk init mcp --output-dir .
10
+ npx @intentrax/sdk init langchain
11
+ npx @intentrax/sdk init langgraph
12
+ npx @intentrax/sdk init vercel-ai-sdk
13
+ npx @intentrax/sdk init cursor --force
14
+ npx @intentrax/sdk check-init --output-dir .
15
+ ```
16
+
17
+ The six commands above are the MVP-native one-command adapters. Expanded
18
+ scaffold aliases are also available for `custom-agent`, `crewai`, `autogen`,
19
+ `openclaw`, `n8n`, and `deepflow`; they emit the same no-secret files and pass
20
+ the same offline `check-init` verifier, but remain scaffold aliases rather than
21
+ MVP-native hooks.
22
+
23
+ On Windows PowerShell shells that block npm/npx `.ps1` shims, use `npx.cmd`
24
+ with the same arguments.
25
+
26
+ Without `--dry-run`, the command writes:
27
+
28
+ - `.intentrax/agent-adapter.json`
29
+ - `.intentrax/sample-admission-request.json`
30
+ - `.intentrax/action-receipt.json`
31
+ - `.intentrax/submit_sample.curl`
32
+ - `.intentrax/hooks/<adapter-native-hook>.mjs`
33
+ - `.intentrax/wiring/<adapter-host-wiring>.md`
34
+
35
+ The files contain adapter metadata and a deterministic sample admission
36
+ envelope plus a no-secret native hook or wrapper starter and a concrete host
37
+ wiring guide. The local action receipt is a non-authoritative developer summary
38
+ that binds the sample, hook starter, host wiring guide, submit command, and
39
+ future AEVN/AEP evidence path by hash. The sample is contract-admissible for
40
+ the locked private-alpha Agent Gateway bundle and the selected adapter surface.
41
+ It does not contain API keys, tenant secrets, signing keys, or private key
42
+ material.
43
+
44
+ `intentrax init` is safe to rerun when the generated files are unchanged. If an
45
+ existing `.intentrax` file has local edits, the CLI refuses to overwrite it and
46
+ exits before writing anything. Use `--force` only after reviewing local changes
47
+ that should be replaced by freshly generated scaffolding.
48
+
49
+ The hook starter sanitizes auth-like fields before building event hashes and
50
+ fails closed when runtime admission is denied or unavailable. It is still a
51
+ bridge into the Intentrax runtime only: tool execution, payload mutation,
52
+ policy re-evaluation, and proof generation remain outside the adapter.
53
+
54
+ After initialization, verify the generated adapter offline:
55
+
56
+ ```bash
57
+ npx @intentrax/sdk check-init --output-dir . --json
58
+ ```
59
+
60
+ `check-init` requires no `INTENTRAX_API_KEY` and does not submit to the runtime.
61
+ It verifies the expected `.intentrax` files, recomputes the action receipt,
62
+ hook source, and host wiring guide hash bindings, validates the Agent Gateway
63
+ sample fixture, and imports the generated hook in no-submit mode with a
64
+ secret-bearing fixture to prove the starter does not leak secrets or require
65
+ network access.
66
+
67
+ The CLI output also writes `.intentrax/submit_sample.curl`, a no-secret command
68
+ file that uses the generated sample unchanged:
69
+
70
+ ```bash
71
+ curl -sS "http://127.0.0.1:8080/v1/agent/admissions" -H "content-type: application/json" -H "X-Intentrax-Tenant-ID: tenant-local-dev" -H "X-Intentrax-Api-Key: $INTENTRAX_API_KEY" -H "X-Intentrax-Idempotency-Key: <sample idempotency_key_hash>" --data-binary "@.intentrax/sample-admission-request.json"
72
+ ```
73
+
74
+ MVP adapter sample shapes:
75
+
76
+ | Adapter | Surface | Adapter ID | Action |
77
+ | --- | --- | --- | --- |
78
+ | `claude-code` | `MCP_TOOL_CALL` | `GENERIC_MCP_PROOF_ADAPTER` | `GET_PROOF` |
79
+ | `cursor` | `MCP_TOOL_CALL` | `GENERIC_MCP_PROOF_ADAPTER` | `GET_PROOF` |
80
+ | `mcp` | `MCP_TOOL_CALL` | `GENERIC_MCP_PROOF_ADAPTER` | `GET_PROOF` |
81
+ | `langchain` | `SDK_AGENT_CALL` | `SDK_AGENT_PROOF_ADAPTER` | `SUBMIT_INTENT` |
82
+ | `langgraph` | `SDK_AGENT_CALL` | `SDK_AGENT_PROOF_ADAPTER` | `SUBMIT_INTENT` |
83
+ | `vercel-ai-sdk` | `SDK_AGENT_CALL` | `SDK_AGENT_PROOF_ADAPTER` | `SUBMIT_INTENT` |
84
+
85
+ Expanded scaffold sample shapes:
86
+
87
+ | Adapter | Surface | Adapter ID | Action |
88
+ | --- | --- | --- | --- |
89
+ | `custom-agent` | `DIRECT_TOOL_CALL` | `DIRECT_TOOL_PROOF_ADAPTER` | `GET_PROOF` |
90
+ | `crewai` | `SDK_AGENT_CALL` | `SDK_AGENT_PROOF_ADAPTER` | `SUBMIT_INTENT` |
91
+ | `autogen` | `A2A_DELEGATION` | `GENERIC_A2A_PROOF_ADAPTER` | `HAND_OFF_PROOF` |
92
+ | `openclaw` | `SDK_AGENT_CALL` | `SDK_AGENT_PROOF_ADAPTER` | `SUBMIT_INTENT` |
93
+ | `n8n` | `DIRECT_TOOL_CALL` | `DIRECT_TOOL_PROOF_ADAPTER` | `GET_PROOF` |
94
+ | `deepflow` | `SDK_AGENT_CALL` | `SDK_AGENT_PROOF_ADAPTER` | `SUBMIT_INTENT` |