@shield-agent/kya 0.12.0 → 0.13.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/.mcp.json +1 -1
- package/README.md +17 -3
- package/amp/settings.example.json +1 -1
- package/claude/claude_desktop_config.example.json +1 -1
- package/cline/cline_mcp_settings.example.json +1 -1
- package/copilot/mcp-config.example.json +1 -1
- package/dist/gate/binary.js +1 -1
- package/dist/gate/binary.js.map +1 -1
- package/dist/sdk/a2a.d.ts +27 -0
- package/dist/sdk/a2a.d.ts.map +1 -0
- package/dist/sdk/a2a.js +33 -0
- package/dist/sdk/a2a.js.map +1 -0
- package/dist/sdk/adapters/claude-agent.d.ts +16 -0
- package/dist/sdk/adapters/claude-agent.d.ts.map +1 -0
- package/dist/sdk/adapters/claude-agent.js +24 -0
- package/dist/sdk/adapters/claude-agent.js.map +1 -0
- package/dist/sdk/adapters/langgraph.d.ts +14 -0
- package/dist/sdk/adapters/langgraph.d.ts.map +1 -0
- package/dist/sdk/adapters/langgraph.js +19 -0
- package/dist/sdk/adapters/langgraph.js.map +1 -0
- package/dist/sdk/adapters/mastra.d.ts +14 -0
- package/dist/sdk/adapters/mastra.d.ts.map +1 -0
- package/dist/sdk/adapters/mastra.js +19 -0
- package/dist/sdk/adapters/mastra.js.map +1 -0
- package/dist/sdk/adapters/openai-agents.d.ts +17 -0
- package/dist/sdk/adapters/openai-agents.d.ts.map +1 -0
- package/dist/sdk/adapters/openai-agents.js +32 -0
- package/dist/sdk/adapters/openai-agents.js.map +1 -0
- package/dist/sdk/adapters/vercel-ai.d.ts +18 -0
- package/dist/sdk/adapters/vercel-ai.d.ts.map +1 -0
- package/dist/sdk/adapters/vercel-ai.js +20 -0
- package/dist/sdk/adapters/vercel-ai.js.map +1 -0
- package/dist/sdk/govern.d.ts +52 -0
- package/dist/sdk/govern.d.ts.map +1 -0
- package/dist/sdk/govern.js +95 -0
- package/dist/sdk/govern.js.map +1 -0
- package/dist/sdk/index.d.ts +14 -0
- package/dist/sdk/index.d.ts.map +1 -0
- package/dist/sdk/index.js +13 -0
- package/dist/sdk/index.js.map +1 -0
- package/droid/README.md +1 -1
- package/droid/mcp.example.json +1 -1
- package/gemini/settings.example.json +1 -1
- package/grok/README.md +1 -1
- package/kilo/kilo.example.json +1 -1
- package/kimi/mcp.example.json +1 -1
- package/kiro/mcp.example.json +1 -1
- package/manifest.json +1 -1
- package/mastracode/mcp.example.json +1 -1
- package/mcp.json +1 -1
- package/openai/codex.config.example.toml +1 -1
- package/opencode/opencode.example.json +1 -1
- package/package.json +5 -1
- package/qwen/settings.example.json +1 -1
- package/server.json +2 -2
package/.mcp.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"mcpServers": {
|
|
3
3
|
"shield-kya": {
|
|
4
4
|
"command": "npx",
|
|
5
|
-
"args": ["--no-install", "@shield-agent/kya@0.
|
|
5
|
+
"args": ["--no-install", "@shield-agent/kya@0.13.0", "serve-mcp", "--stdio"],
|
|
6
6
|
"env": {
|
|
7
7
|
"KYA_BASE_URL": "https://shield-agent.com",
|
|
8
8
|
"KYA_API_KEY": "${KYA_API_KEY}",
|
package/README.md
CHANGED
|
@@ -165,7 +165,7 @@ MCP Registry entry: `server.json` plus package `mcpName` `io.github.The-Pixel-Bo
|
|
|
165
165
|
"mcpServers": {
|
|
166
166
|
"shield-kya": {
|
|
167
167
|
"command": "npx",
|
|
168
|
-
"args": ["--no-install", "@shield-agent/kya@0.
|
|
168
|
+
"args": ["--no-install", "@shield-agent/kya@0.13.0", "serve-mcp", "--stdio"],
|
|
169
169
|
"env": {
|
|
170
170
|
"KYA_BASE_URL": "http://127.0.0.1:8090",
|
|
171
171
|
"KYA_API_KEY": "${KYA_API_KEY}",
|
|
@@ -186,13 +186,26 @@ npx @shield-agent/kya reject --id <approval-id>
|
|
|
186
186
|
|
|
187
187
|
`wrap` evaluates and may open a pending ticket. It never executes the side effect. `invoke` asks the live plane to authorize after Allow or APPROVED. It does not run the write on this machine. The TUI (`dash`) can `a`/`x` decide only after `y` confirm with a JWT (`sk_*` refused).
|
|
188
188
|
|
|
189
|
+
## In-process SDK shims
|
|
190
|
+
|
|
191
|
+
Agents built on LangGraph.js, the Vercel AI SDK, Mastra, OpenAI Agents TS, or the Claude Agent SDK can route tool calls through the same evaluate path without a gateway:
|
|
192
|
+
|
|
193
|
+
```ts
|
|
194
|
+
import { governed, governLangGraphTool, KyaDeniedError } from "@shield-agent/kya/sdk";
|
|
195
|
+
|
|
196
|
+
const run = governed({ toolId: "write_file", server: "filesystem", fn: myWrite });
|
|
197
|
+
await run({ path: "out.txt", content: "hi" }); // throws KyaDeniedError on DENY
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
Offline evaluate by default (no network, no hosted plane); an explicit config honors the live plane. `governA2aSend` gates in-process agent-to-agent sends. Python frameworks (LangGraph, CrewAI, Pydantic AI, ADK, AutoGen, smolagents) use the `shield-kya` shim (`sdks/kya-python/`), which delegates to the local kya CLI. Support matrix and recipes: `docs/sdk-integrations.md`; runnable scripts: `examples/sdk/`.
|
|
201
|
+
|
|
189
202
|
## Claude connector
|
|
190
203
|
|
|
191
204
|
**Desktop / Claude Code (local stdio):**
|
|
192
205
|
|
|
193
206
|
```bash
|
|
194
207
|
# Prefer a preinstalled package (no registry auto-install):
|
|
195
|
-
npx --no-install @shield-agent/kya@0.
|
|
208
|
+
npx --no-install @shield-agent/kya@0.13.0 serve-mcp --stdio
|
|
196
209
|
# Or after npm i -g / local install:
|
|
197
210
|
kya serve-mcp --stdio
|
|
198
211
|
```
|
|
@@ -203,7 +216,7 @@ Copy `claude/claude_desktop_config.example.json` into Claude Desktop MCP setting
|
|
|
203
216
|
|
|
204
217
|
## OpenAI (Codex / Responses)
|
|
205
218
|
|
|
206
|
-
**Codex CLI / IDE:** copy `openai/codex.config.example.toml` into `~/.codex/config.toml`. Local stdio uses `npx --no-install @shield-agent/kya@0.
|
|
219
|
+
**Codex CLI / IDE:** copy `openai/codex.config.example.toml` into `~/.codex/config.toml`. Local stdio uses `npx --no-install @shield-agent/kya@0.13.0 serve-mcp --stdio`. Hosted Codex uses `url = "https://shield-agent.com/mcp"` with `bearer_token_env_var = "KYA_API_KEY"`.
|
|
207
220
|
|
|
208
221
|
**Responses API:** see `openai/responses-mcp.example.json` (`server_url` + `Authorization: Bearer <KYA_API_KEY>`).
|
|
209
222
|
|
|
@@ -307,6 +320,7 @@ pnpm build
|
|
|
307
320
|
- [OTLP metrics (OSS + hosted)](docs/otlp.md)
|
|
308
321
|
- [OWASP MCP governance map](docs/owasp-mcp-governance.md)
|
|
309
322
|
- [kya certify — Agent Trust Baseline gap reports](docs/certify.md)
|
|
323
|
+
- [SDK & framework integrations (in-process shims)](docs/sdk-integrations.md)
|
|
310
324
|
- [Hosted operator SSO / SCIM (not in OSS CLI)](docs/hosted-operator-sso.md)
|
|
311
325
|
- See also `LIMITATIONS.md` in this repo
|
|
312
326
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"amp.mcpServers": {
|
|
3
3
|
"shield-kya": {
|
|
4
4
|
"command": "npx",
|
|
5
|
-
"args": ["--no-install", "@shield-agent/kya@0.
|
|
5
|
+
"args": ["--no-install", "@shield-agent/kya@0.13.0", "serve-mcp", "--stdio"],
|
|
6
6
|
"env": {
|
|
7
7
|
"KYA_BASE_URL": "https://shield-agent.com",
|
|
8
8
|
"KYA_API_KEY": "${KYA_API_KEY}",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"mcpServers": {
|
|
3
3
|
"shield-kya": {
|
|
4
4
|
"command": "npx",
|
|
5
|
-
"args": ["--no-install", "@shield-agent/kya@0.
|
|
5
|
+
"args": ["--no-install", "@shield-agent/kya@0.13.0", "serve-mcp", "--stdio"],
|
|
6
6
|
"env": {
|
|
7
7
|
"KYA_BASE_URL": "https://shield-agent.com",
|
|
8
8
|
"KYA_API_KEY": "${KYA_API_KEY}",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"mcpServers": {
|
|
3
3
|
"shield-kya": {
|
|
4
4
|
"command": "npx",
|
|
5
|
-
"args": ["--no-install", "@shield-agent/kya@0.
|
|
5
|
+
"args": ["--no-install", "@shield-agent/kya@0.13.0", "serve-mcp", "--stdio"],
|
|
6
6
|
"env": {
|
|
7
7
|
"KYA_BASE_URL": "https://shield-agent.com",
|
|
8
8
|
"KYA_API_KEY": "${KYA_API_KEY}",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"mcpServers": {
|
|
3
3
|
"shield-kya": {
|
|
4
4
|
"command": "npx",
|
|
5
|
-
"args": ["--no-install", "@shield-agent/kya@0.
|
|
5
|
+
"args": ["--no-install", "@shield-agent/kya@0.13.0", "serve-mcp", "--stdio"],
|
|
6
6
|
"env": {
|
|
7
7
|
"KYA_BASE_URL": "https://shield-agent.com",
|
|
8
8
|
"KYA_API_KEY": "${KYA_API_KEY}",
|
package/dist/gate/binary.js
CHANGED
|
@@ -99,7 +99,7 @@ export async function ensureGateBinary(deps = {}) {
|
|
|
99
99
|
try {
|
|
100
100
|
const [tgzRes, sumRes] = [await fetchFn(base), await fetchFn(`${base}.sha256`)];
|
|
101
101
|
if (!tgzRes.ok || !sumRes.ok) {
|
|
102
|
-
throw new KyaError(`gateway artifact ${name} not available (HTTP ${!tgzRes.ok ? tgzRes.status : sumRes.status}) —
|
|
102
|
+
throw new KyaError(`gateway artifact ${name} not available (HTTP ${!tgzRes.ok ? tgzRes.status : sumRes.status}) — gateway binaries are published by the kya release pipeline (see legal/THIRD-PARTY.md); check the release tag gate-v${GATE_VERSION}`, "GATE_DOWNLOAD_FAILED");
|
|
103
103
|
}
|
|
104
104
|
const tgz = Buffer.from(await tgzRes.arrayBuffer());
|
|
105
105
|
const expected = parseSha256File(await sumRes.text());
|
package/dist/gate/binary.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"binary.js","sourceRoot":"","sources":["../../src/gate/binary.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;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AAI,CAAC,CAAC;QAClC,aAAa,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QAC5B,CAAC,IAAI,CAAC,OAAO,IAAI,cAAc,CAAC,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QACjD,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,EAAE,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;QAClF,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;YAC3B,MAAM,IAAI,QAAQ,CAChB,oBAAoB,IAAI,sDAAsD,EAC9E,uBAAuB,CACxB,CAAC;QACJ,CAAC;QACD,gEAAgE;QAChE,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,EAAE,aAAa,OAAO,CAAC,GAAG,MAAM,CAAC,CAAC;QAC/D,aAAa,CAAC,SAAS,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC;QAClD,IAAI,QAAQ,KAAK,OAAO;YAAE,SAAS,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;QACtD,UAAU,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;QAC5B,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC;IAC1D,CAAC;YAAS,CAAC;QACT,MAAM,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IAClD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* In-process boundary check for agent-to-agent sends (ADK / BeeAI / CrewAI
|
|
3
|
+
* style frameworks): evaluate `a2a__<peerId>__<action>` before the caller
|
|
4
|
+
* performs the send. `a2a` is a registry-unknown server, so offline evaluate
|
|
5
|
+
* lands on the safe REQUIRE_APPROVE/UNKNOWN path unless the action is
|
|
6
|
+
* declared irreversible. Fleet-level A2A governance (mTLS identity, org
|
|
7
|
+
* policy between runtimes) is the kya gateway's job — this is the
|
|
8
|
+
* single-process complement.
|
|
9
|
+
*/
|
|
10
|
+
import type { ResolvedConfig } from "../config.js";
|
|
11
|
+
export interface GovernA2aSendOptions {
|
|
12
|
+
readonly peerId: string;
|
|
13
|
+
readonly peerUrl?: string;
|
|
14
|
+
readonly action: string;
|
|
15
|
+
/** Short human description of the payload — trail summary only, never the body. */
|
|
16
|
+
readonly payloadSummary?: string;
|
|
17
|
+
readonly irreversible?: boolean;
|
|
18
|
+
readonly config?: ResolvedConfig;
|
|
19
|
+
}
|
|
20
|
+
export interface A2aGateResult {
|
|
21
|
+
/** true for ALLOW and observed REQUIRE_APPROVE; false for DENY/unknown. */
|
|
22
|
+
readonly allow: boolean;
|
|
23
|
+
readonly verdict: string;
|
|
24
|
+
readonly reasonCode: string;
|
|
25
|
+
}
|
|
26
|
+
export declare function governA2aSend(options: GovernA2aSendOptions): Promise<A2aGateResult>;
|
|
27
|
+
//# sourceMappingURL=a2a.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"a2a.d.ts","sourceRoot":"","sources":["../../src/sdk/a2a.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAInD,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,mFAAmF;IACnF,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;IAChC,QAAQ,CAAC,MAAM,CAAC,EAAE,cAAc,CAAC;CAClC;AAED,MAAM,WAAW,aAAa;IAC5B,2EAA2E;IAC3E,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED,wBAAsB,aAAa,CACjC,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,aAAa,CAAC,CAoBxB"}
|
package/dist/sdk/a2a.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* In-process boundary check for agent-to-agent sends (ADK / BeeAI / CrewAI
|
|
3
|
+
* style frameworks): evaluate `a2a__<peerId>__<action>` before the caller
|
|
4
|
+
* performs the send. `a2a` is a registry-unknown server, so offline evaluate
|
|
5
|
+
* lands on the safe REQUIRE_APPROVE/UNKNOWN path unless the action is
|
|
6
|
+
* declared irreversible. Fleet-level A2A governance (mTLS identity, org
|
|
7
|
+
* policy between runtimes) is the kya gateway's job — this is the
|
|
8
|
+
* single-process complement.
|
|
9
|
+
*/
|
|
10
|
+
import { runEvalTool } from "../commands/eval-tool.js";
|
|
11
|
+
import { recordSdkTrail, resolveSdkConfig } from "./govern.js";
|
|
12
|
+
export async function governA2aSend(options) {
|
|
13
|
+
const toolId = `a2a__${options.peerId.trim()}__${options.action.trim()}`;
|
|
14
|
+
const config = resolveSdkConfig(options.config);
|
|
15
|
+
const args = {
|
|
16
|
+
peer: options.peerId,
|
|
17
|
+
...(options.peerUrl ? { url: options.peerUrl } : {}),
|
|
18
|
+
...(options.payloadSummary ? { note: options.payloadSummary } : {}),
|
|
19
|
+
};
|
|
20
|
+
const evalResult = await runEvalTool(config, {
|
|
21
|
+
toolId,
|
|
22
|
+
args,
|
|
23
|
+
irreversible: options.irreversible,
|
|
24
|
+
});
|
|
25
|
+
recordSdkTrail(config, evalResult, args);
|
|
26
|
+
const verdict = (evalResult.response.verdict ?? "").toUpperCase();
|
|
27
|
+
return {
|
|
28
|
+
allow: verdict === "ALLOW" || verdict === "REQUIRE_APPROVE",
|
|
29
|
+
verdict: verdict || "DENY",
|
|
30
|
+
reasonCode: evalResult.response.reasonCode ?? "",
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=a2a.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"a2a.js","sourceRoot":"","sources":["../../src/sdk/a2a.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAmB/D,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,OAA6B;IAE7B,MAAM,MAAM,GAAG,QAAQ,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC;IACzE,MAAM,MAAM,GAAG,gBAAgB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAChD,MAAM,IAAI,GAAG;QACX,IAAI,EAAE,OAAO,CAAC,MAAM;QACpB,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACpD,GAAG,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACpE,CAAC;IACF,MAAM,UAAU,GAAG,MAAM,WAAW,CAAC,MAAM,EAAE;QAC3C,MAAM;QACN,IAAI;QACJ,YAAY,EAAE,OAAO,CAAC,YAAY;KACnC,CAAC,CAAC;IACH,cAAc,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC;IACzC,MAAM,OAAO,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;IAClE,OAAO;QACL,KAAK,EAAE,OAAO,KAAK,OAAO,IAAI,OAAO,KAAK,iBAAiB;QAC3D,OAAO,EAAE,OAAO,IAAI,MAAM;QAC1B,UAAU,EAAE,UAAU,CAAC,QAAQ,CAAC,UAAU,IAAI,EAAE;KACjD,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Anthropic Agent SDK tool adapter. Structural only — no
|
|
3
|
+
* @anthropic-ai/claude-agent-sdk import. Matches the
|
|
4
|
+
* `{ name, description, inputSchema, handler }` in-process tool shape where
|
|
5
|
+
* handler receives parsed args plus SDK extras; returns the same shape with
|
|
6
|
+
* a governed handler.
|
|
7
|
+
*/
|
|
8
|
+
import { type GovernanceOptions } from "../govern.js";
|
|
9
|
+
export interface ClaudeAgentToolLike<TArgs = unknown, TResult = unknown> {
|
|
10
|
+
readonly name: string;
|
|
11
|
+
readonly description: string;
|
|
12
|
+
readonly inputSchema: unknown;
|
|
13
|
+
readonly handler: (args: TArgs, extra?: unknown) => Promise<TResult> | TResult;
|
|
14
|
+
}
|
|
15
|
+
export declare function governClaudeAgentTool<TArgs, TResult>(tool: ClaudeAgentToolLike<TArgs, TResult>, options?: GovernanceOptions): ClaudeAgentToolLike<TArgs, TResult>;
|
|
16
|
+
//# sourceMappingURL=claude-agent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-agent.d.ts","sourceRoot":"","sources":["../../../src/sdk/adapters/claude-agent.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAmB,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEvE,MAAM,WAAW,mBAAmB,CAAC,KAAK,GAAG,OAAO,EAAE,OAAO,GAAG,OAAO;IACrE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;CAChF;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,EAClD,IAAI,EAAE,mBAAmB,CAAC,KAAK,EAAE,OAAO,CAAC,EACzC,OAAO,GAAE,iBAAsB,GAC9B,mBAAmB,CAAC,KAAK,EAAE,OAAO,CAAC,CAcrC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Anthropic Agent SDK tool adapter. Structural only — no
|
|
3
|
+
* @anthropic-ai/claude-agent-sdk import. Matches the
|
|
4
|
+
* `{ name, description, inputSchema, handler }` in-process tool shape where
|
|
5
|
+
* handler receives parsed args plus SDK extras; returns the same shape with
|
|
6
|
+
* a governed handler.
|
|
7
|
+
*/
|
|
8
|
+
import { createGateCheck } from "../govern.js";
|
|
9
|
+
export function governClaudeAgentTool(tool, options = {}) {
|
|
10
|
+
const check = createGateCheck({
|
|
11
|
+
toolId: tool.name,
|
|
12
|
+
server: options.server,
|
|
13
|
+
irreversible: options.irreversible,
|
|
14
|
+
config: options.config,
|
|
15
|
+
});
|
|
16
|
+
return {
|
|
17
|
+
...tool,
|
|
18
|
+
handler: async (args, extra) => {
|
|
19
|
+
await check(args);
|
|
20
|
+
return tool.handler(args, extra);
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=claude-agent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-agent.js","sourceRoot":"","sources":["../../../src/sdk/adapters/claude-agent.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,eAAe,EAA0B,MAAM,cAAc,CAAC;AASvE,MAAM,UAAU,qBAAqB,CACnC,IAAyC,EACzC,UAA6B,EAAE;IAE/B,MAAM,KAAK,GAAG,eAAe,CAAC;QAC5B,MAAM,EAAE,IAAI,CAAC,IAAI;QACjB,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,YAAY,EAAE,OAAO,CAAC,YAAY;QAClC,MAAM,EAAE,OAAO,CAAC,MAAM;KACvB,CAAC,CAAC;IACH,OAAO;QACL,GAAG,IAAI;QACP,OAAO,EAAE,KAAK,EAAE,IAAW,EAAE,KAAe,EAAoB,EAAE;YAChE,MAAM,KAAK,CAAC,IAAI,CAAC,CAAC;YAClB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QACnC,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LangGraph.js-style tool adapter. Structural only — no @langgraph imports.
|
|
3
|
+
* Matches the `{ name, description, schema, func }` tool shape; returns the
|
|
4
|
+
* same shape with a governed func.
|
|
5
|
+
*/
|
|
6
|
+
import { type GovernanceOptions } from "../govern.js";
|
|
7
|
+
export interface LangGraphToolLike<TArgs = unknown, TResult = unknown> {
|
|
8
|
+
readonly name: string;
|
|
9
|
+
readonly description: string;
|
|
10
|
+
readonly schema: unknown;
|
|
11
|
+
readonly func: (args: TArgs) => Promise<TResult> | TResult;
|
|
12
|
+
}
|
|
13
|
+
export declare function governLangGraphTool<TArgs, TResult>(tool: LangGraphToolLike<TArgs, TResult>, options?: GovernanceOptions): LangGraphToolLike<TArgs, TResult>;
|
|
14
|
+
//# sourceMappingURL=langgraph.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"langgraph.d.ts","sourceRoot":"","sources":["../../../src/sdk/adapters/langgraph.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAY,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEhE,MAAM,WAAW,iBAAiB,CAAC,KAAK,GAAG,OAAO,EAAE,OAAO,GAAG,OAAO;IACnE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;CAC5D;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,EAChD,IAAI,EAAE,iBAAiB,CAAC,KAAK,EAAE,OAAO,CAAC,EACvC,OAAO,GAAE,iBAAsB,GAC9B,iBAAiB,CAAC,KAAK,EAAE,OAAO,CAAC,CAWnC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LangGraph.js-style tool adapter. Structural only — no @langgraph imports.
|
|
3
|
+
* Matches the `{ name, description, schema, func }` tool shape; returns the
|
|
4
|
+
* same shape with a governed func.
|
|
5
|
+
*/
|
|
6
|
+
import { governed } from "../govern.js";
|
|
7
|
+
export function governLangGraphTool(tool, options = {}) {
|
|
8
|
+
return {
|
|
9
|
+
...tool,
|
|
10
|
+
func: governed({
|
|
11
|
+
toolId: tool.name,
|
|
12
|
+
server: options.server,
|
|
13
|
+
irreversible: options.irreversible,
|
|
14
|
+
config: options.config,
|
|
15
|
+
fn: tool.func,
|
|
16
|
+
}),
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=langgraph.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"langgraph.js","sourceRoot":"","sources":["../../../src/sdk/adapters/langgraph.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAA0B,MAAM,cAAc,CAAC;AAShE,MAAM,UAAU,mBAAmB,CACjC,IAAuC,EACvC,UAA6B,EAAE;IAE/B,OAAO;QACL,GAAG,IAAI;QACP,IAAI,EAAE,QAAQ,CAAC;YACb,MAAM,EAAE,IAAI,CAAC,IAAI;YACjB,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,YAAY,EAAE,OAAO,CAAC,YAAY;YAClC,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,EAAE,EAAE,IAAI,CAAC,IAAI;SACd,CAAC;KACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mastra-style tool adapter. Structural only — no @mastra imports. Matches
|
|
3
|
+
* the `{ id, description, inputSchema, execute }` tool shape; returns the
|
|
4
|
+
* same shape with a governed execute.
|
|
5
|
+
*/
|
|
6
|
+
import { type GovernanceOptions } from "../govern.js";
|
|
7
|
+
export interface MastraToolLike<TArgs = unknown, TResult = unknown> {
|
|
8
|
+
readonly id: string;
|
|
9
|
+
readonly description: string;
|
|
10
|
+
readonly inputSchema: unknown;
|
|
11
|
+
readonly execute: (args: TArgs) => Promise<TResult> | TResult;
|
|
12
|
+
}
|
|
13
|
+
export declare function governMastraTool<TArgs, TResult>(tool: MastraToolLike<TArgs, TResult>, options?: GovernanceOptions): MastraToolLike<TArgs, TResult>;
|
|
14
|
+
//# sourceMappingURL=mastra.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mastra.d.ts","sourceRoot":"","sources":["../../../src/sdk/adapters/mastra.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAY,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEhE,MAAM,WAAW,cAAc,CAAC,KAAK,GAAG,OAAO,EAAE,OAAO,GAAG,OAAO;IAChE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;CAC/D;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,EAC7C,IAAI,EAAE,cAAc,CAAC,KAAK,EAAE,OAAO,CAAC,EACpC,OAAO,GAAE,iBAAsB,GAC9B,cAAc,CAAC,KAAK,EAAE,OAAO,CAAC,CAWhC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mastra-style tool adapter. Structural only — no @mastra imports. Matches
|
|
3
|
+
* the `{ id, description, inputSchema, execute }` tool shape; returns the
|
|
4
|
+
* same shape with a governed execute.
|
|
5
|
+
*/
|
|
6
|
+
import { governed } from "../govern.js";
|
|
7
|
+
export function governMastraTool(tool, options = {}) {
|
|
8
|
+
return {
|
|
9
|
+
...tool,
|
|
10
|
+
execute: governed({
|
|
11
|
+
toolId: tool.id,
|
|
12
|
+
server: options.server,
|
|
13
|
+
irreversible: options.irreversible,
|
|
14
|
+
config: options.config,
|
|
15
|
+
fn: tool.execute,
|
|
16
|
+
}),
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=mastra.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mastra.js","sourceRoot":"","sources":["../../../src/sdk/adapters/mastra.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAA0B,MAAM,cAAc,CAAC;AAShE,MAAM,UAAU,gBAAgB,CAC9B,IAAoC,EACpC,UAA6B,EAAE;IAE/B,OAAO;QACL,GAAG,IAAI;QACP,OAAO,EAAE,QAAQ,CAAC;YAChB,MAAM,EAAE,IAAI,CAAC,EAAE;YACf,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,YAAY,EAAE,OAAO,CAAC,YAAY;YAClC,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,EAAE,EAAE,IAAI,CAAC,OAAO;SACjB,CAAC;KACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenAI Agents TS function-tool adapter. Structural only — no
|
|
3
|
+
* @openai/agents import. Matches the `{ name, description, parameters,
|
|
4
|
+
* invoke }` function-tool shape where invoke receives the run context and a
|
|
5
|
+
* JSON string input; returns the same shape with a governed invoke. The
|
|
6
|
+
* parsed input is what gets evaluated; the original string is what the tool
|
|
7
|
+
* receives.
|
|
8
|
+
*/
|
|
9
|
+
import { type GovernanceOptions } from "../govern.js";
|
|
10
|
+
export interface OpenAiAgentsToolLike<TResult = unknown> {
|
|
11
|
+
readonly name: string;
|
|
12
|
+
readonly description: string;
|
|
13
|
+
readonly parameters: unknown;
|
|
14
|
+
readonly invoke: (runContext: unknown, input: string) => Promise<TResult> | TResult;
|
|
15
|
+
}
|
|
16
|
+
export declare function governOpenAiAgentsTool<TResult>(tool: OpenAiAgentsToolLike<TResult>, options?: GovernanceOptions): OpenAiAgentsToolLike<TResult>;
|
|
17
|
+
//# sourceMappingURL=openai-agents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openai-agents.d.ts","sourceRoot":"","sources":["../../../src/sdk/adapters/openai-agents.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAmB,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEvE,MAAM,WAAW,oBAAoB,CAAC,OAAO,GAAG,OAAO;IACrD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,CAAC,UAAU,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;CACrF;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAC5C,IAAI,EAAE,oBAAoB,CAAC,OAAO,CAAC,EACnC,OAAO,GAAE,iBAAsB,GAC9B,oBAAoB,CAAC,OAAO,CAAC,CAoB/B"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenAI Agents TS function-tool adapter. Structural only — no
|
|
3
|
+
* @openai/agents import. Matches the `{ name, description, parameters,
|
|
4
|
+
* invoke }` function-tool shape where invoke receives the run context and a
|
|
5
|
+
* JSON string input; returns the same shape with a governed invoke. The
|
|
6
|
+
* parsed input is what gets evaluated; the original string is what the tool
|
|
7
|
+
* receives.
|
|
8
|
+
*/
|
|
9
|
+
import { createGateCheck } from "../govern.js";
|
|
10
|
+
export function governOpenAiAgentsTool(tool, options = {}) {
|
|
11
|
+
const check = createGateCheck({
|
|
12
|
+
toolId: tool.name,
|
|
13
|
+
server: options.server,
|
|
14
|
+
irreversible: options.irreversible,
|
|
15
|
+
config: options.config,
|
|
16
|
+
});
|
|
17
|
+
return {
|
|
18
|
+
...tool,
|
|
19
|
+
invoke: async (runContext, input) => {
|
|
20
|
+
let args = input;
|
|
21
|
+
try {
|
|
22
|
+
args = JSON.parse(input);
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
/* evaluate the raw string when input is not JSON */
|
|
26
|
+
}
|
|
27
|
+
await check(args);
|
|
28
|
+
return tool.invoke(runContext, input);
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=openai-agents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openai-agents.js","sourceRoot":"","sources":["../../../src/sdk/adapters/openai-agents.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,eAAe,EAA0B,MAAM,cAAc,CAAC;AASvE,MAAM,UAAU,sBAAsB,CACpC,IAAmC,EACnC,UAA6B,EAAE;IAE/B,MAAM,KAAK,GAAG,eAAe,CAAC;QAC5B,MAAM,EAAE,IAAI,CAAC,IAAI;QACjB,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,YAAY,EAAE,OAAO,CAAC,YAAY;QAClC,MAAM,EAAE,OAAO,CAAC,MAAM;KACvB,CAAC,CAAC;IACH,OAAO;QACL,GAAG,IAAI;QACP,MAAM,EAAE,KAAK,EAAE,UAAmB,EAAE,KAAa,EAAoB,EAAE;YACrE,IAAI,IAAI,GAAY,KAAK,CAAC;YAC1B,IAAI,CAAC;gBACH,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YAC3B,CAAC;YAAC,MAAM,CAAC;gBACP,oDAAoD;YACtD,CAAC;YACD,MAAM,KAAK,CAAC,IAAI,CAAC,CAAC;YAClB,OAAO,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;QACxC,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vercel AI SDK tool adapter. Structural only — no `ai` import. Matches the
|
|
3
|
+
* `{ description, parameters, execute }` tool shape; returns the same shape
|
|
4
|
+
* with a governed execute. AI SDK tools are keyed by name in the tools
|
|
5
|
+
* record, so the name is an explicit adapter option.
|
|
6
|
+
*/
|
|
7
|
+
import { type GovernanceOptions } from "../govern.js";
|
|
8
|
+
export interface VercelAiToolLike<TArgs = unknown, TResult = unknown> {
|
|
9
|
+
readonly description?: string;
|
|
10
|
+
readonly parameters: unknown;
|
|
11
|
+
readonly execute: (args: TArgs) => Promise<TResult> | TResult;
|
|
12
|
+
}
|
|
13
|
+
export interface GovernVercelAiOptions extends GovernanceOptions {
|
|
14
|
+
/** Tool name — the key this definition is registered under. */
|
|
15
|
+
readonly name: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function governVercelAiTool<TArgs, TResult>(tool: VercelAiToolLike<TArgs, TResult>, options: GovernVercelAiOptions): VercelAiToolLike<TArgs, TResult>;
|
|
18
|
+
//# sourceMappingURL=vercel-ai.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vercel-ai.d.ts","sourceRoot":"","sources":["../../../src/sdk/adapters/vercel-ai.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAY,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEhE,MAAM,WAAW,gBAAgB,CAAC,KAAK,GAAG,OAAO,EAAE,OAAO,GAAG,OAAO;IAClE,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;CAC/D;AAED,MAAM,WAAW,qBAAsB,SAAQ,iBAAiB;IAC9D,+DAA+D;IAC/D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,EAC/C,IAAI,EAAE,gBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC,EACtC,OAAO,EAAE,qBAAqB,GAC7B,gBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC,CAWlC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vercel AI SDK tool adapter. Structural only — no `ai` import. Matches the
|
|
3
|
+
* `{ description, parameters, execute }` tool shape; returns the same shape
|
|
4
|
+
* with a governed execute. AI SDK tools are keyed by name in the tools
|
|
5
|
+
* record, so the name is an explicit adapter option.
|
|
6
|
+
*/
|
|
7
|
+
import { governed } from "../govern.js";
|
|
8
|
+
export function governVercelAiTool(tool, options) {
|
|
9
|
+
return {
|
|
10
|
+
...tool,
|
|
11
|
+
execute: governed({
|
|
12
|
+
toolId: options.name,
|
|
13
|
+
server: options.server,
|
|
14
|
+
irreversible: options.irreversible,
|
|
15
|
+
config: options.config,
|
|
16
|
+
fn: tool.execute,
|
|
17
|
+
}),
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=vercel-ai.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vercel-ai.js","sourceRoot":"","sources":["../../../src/sdk/adapters/vercel-ai.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,QAAQ,EAA0B,MAAM,cAAc,CAAC;AAahE,MAAM,UAAU,kBAAkB,CAChC,IAAsC,EACtC,OAA8B;IAE9B,OAAO;QACL,GAAG,IAAI;QACP,OAAO,EAAE,QAAQ,CAAC;YAChB,MAAM,EAAE,OAAO,CAAC,IAAI;YACpB,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,YAAY,EAAE,OAAO,CAAC,YAAY;YAClC,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,EAAE,EAAE,IAAI,CAAC,OAAO;SACjB,CAAC;KACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* In-process governance shim: evaluate a tool call through the same path
|
|
3
|
+
* `kya wrap` uses (offline sample evaluate by default — no network, no hosted
|
|
4
|
+
* plane required), record the trail event, then ALLOW/REQUIRE_APPROVE run the
|
|
5
|
+
* function while DENY throws KyaDeniedError without running it.
|
|
6
|
+
*
|
|
7
|
+
* Importing this module starts nothing: config resolves lazily on first call.
|
|
8
|
+
*
|
|
9
|
+
* Deliberate coupling: the trail write is fail-closed — a governance shim
|
|
10
|
+
* where the audit record cannot be written does not run the action.
|
|
11
|
+
*/
|
|
12
|
+
import type { ResolvedConfig } from "../config.js";
|
|
13
|
+
import { KyaError } from "../errors.js";
|
|
14
|
+
import { type EvalToolResult } from "../commands/eval-tool.js";
|
|
15
|
+
export declare class KyaDeniedError extends KyaError {
|
|
16
|
+
readonly verdict: string;
|
|
17
|
+
readonly reasonCode: string;
|
|
18
|
+
readonly toolId: string;
|
|
19
|
+
constructor(input: {
|
|
20
|
+
verdict: string;
|
|
21
|
+
reasonCode: string;
|
|
22
|
+
toolId: string;
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
export interface GovernanceOptions {
|
|
26
|
+
/** MCP server id; toolId becomes `<server>__<toolId>` so the taxonomy lights up. */
|
|
27
|
+
readonly server?: string;
|
|
28
|
+
readonly irreversible?: boolean;
|
|
29
|
+
/** Explicit config (hosted plane honored). Default: lazy offline resolve. */
|
|
30
|
+
readonly config?: ResolvedConfig;
|
|
31
|
+
}
|
|
32
|
+
export interface GovernedOptions<TArgs, TResult> extends GovernanceOptions {
|
|
33
|
+
readonly toolId: string;
|
|
34
|
+
readonly fn: (args: TArgs) => Promise<TResult> | TResult;
|
|
35
|
+
}
|
|
36
|
+
/** `<server>__<name>` when a server is given, else the bare name. */
|
|
37
|
+
export declare function deriveSdkToolId(name: string, server?: string): string;
|
|
38
|
+
export declare function resolveSdkConfig(config?: ResolvedConfig): ResolvedConfig;
|
|
39
|
+
/** Trail parity with wrap: verdict/mode/reasonCode + change fields when derivable. */
|
|
40
|
+
export declare function recordSdkTrail(config: ResolvedConfig, evalResult: EvalToolResult, args: unknown, env?: NodeJS.ProcessEnv): void;
|
|
41
|
+
export interface GateCheckOptions extends GovernanceOptions {
|
|
42
|
+
readonly toolId: string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* The evaluate + trail half of governed(), constructed once per wrapped tool
|
|
46
|
+
* so the lazy config cache hits across calls. Adapters whose execution path
|
|
47
|
+
* closes over per-call context use this directly and invoke the framework
|
|
48
|
+
* callable themselves after the check passes.
|
|
49
|
+
*/
|
|
50
|
+
export declare function createGateCheck(options: GateCheckOptions): (args: unknown) => Promise<void>;
|
|
51
|
+
export declare function governed<TArgs, TResult>(options: GovernedOptions<TArgs, TResult>): (args: TArgs) => Promise<TResult>;
|
|
52
|
+
//# sourceMappingURL=govern.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"govern.d.ts","sourceRoot":"","sources":["../../src/sdk/govern.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MA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,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,gBAAgB,GACxB,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAqBlC;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,EACrC,OAAO,EAAE,eAAe,CAAC,KAAK,EAAE,OAAO,CAAC,GACvC,CAAC,IAAI,EAAE,KAAK,KAAK,OAAO,CAAC,OAAO,CAAC,CAMnC"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* In-process governance shim: evaluate a tool call through the same path
|
|
3
|
+
* `kya wrap` uses (offline sample evaluate by default — no network, no hosted
|
|
4
|
+
* plane required), record the trail event, then ALLOW/REQUIRE_APPROVE run the
|
|
5
|
+
* function while DENY throws KyaDeniedError without running it.
|
|
6
|
+
*
|
|
7
|
+
* Importing this module starts nothing: config resolves lazily on first call.
|
|
8
|
+
*
|
|
9
|
+
* Deliberate coupling: the trail write is fail-closed — a governance shim
|
|
10
|
+
* where the audit record cannot be written does not run the action.
|
|
11
|
+
*/
|
|
12
|
+
import { resolveConfig } from "../config.js";
|
|
13
|
+
import { KyaError } from "../errors.js";
|
|
14
|
+
import { runEvalTool } from "../commands/eval-tool.js";
|
|
15
|
+
import { appendTrail, defaultSessionId } from "../trail.js";
|
|
16
|
+
import { deriveWireChangeFields } from "../diff-preview.js";
|
|
17
|
+
export class KyaDeniedError extends KyaError {
|
|
18
|
+
verdict;
|
|
19
|
+
reasonCode;
|
|
20
|
+
toolId;
|
|
21
|
+
constructor(input) {
|
|
22
|
+
super(`kya ${input.verdict}: ${input.toolId} (${input.reasonCode || "no reason"}) — function not executed`, "KYA_DENIED", 1);
|
|
23
|
+
this.name = "KyaDeniedError";
|
|
24
|
+
this.verdict = input.verdict;
|
|
25
|
+
this.reasonCode = input.reasonCode;
|
|
26
|
+
this.toolId = input.toolId;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/** `<server>__<name>` when a server is given, else the bare name. */
|
|
30
|
+
export function deriveSdkToolId(name, server) {
|
|
31
|
+
const n = name.trim();
|
|
32
|
+
const s = server?.trim();
|
|
33
|
+
return s ? `${s}__${n}` : n;
|
|
34
|
+
}
|
|
35
|
+
export function resolveSdkConfig(config) {
|
|
36
|
+
return config ?? resolveConfig({ offline: true, allowMissingApiKey: true });
|
|
37
|
+
}
|
|
38
|
+
/** Trail parity with wrap: verdict/mode/reasonCode + change fields when derivable. */
|
|
39
|
+
export function recordSdkTrail(config, evalResult, args, env = process.env) {
|
|
40
|
+
const reason = evalResult.response.reasonCode ?? "";
|
|
41
|
+
const toolId = evalResult.response.toolId ?? "";
|
|
42
|
+
const mode = evalResult.offline || config.offline ? "offline" : "observe";
|
|
43
|
+
const fields = deriveWireChangeFields(toolId, args, env);
|
|
44
|
+
appendTrail(config.cwd, {
|
|
45
|
+
ts: new Date().toISOString(),
|
|
46
|
+
sessionId: defaultSessionId(env),
|
|
47
|
+
host: config.host,
|
|
48
|
+
toolId,
|
|
49
|
+
verdict: evalResult.response.verdict,
|
|
50
|
+
reasonCode: reason,
|
|
51
|
+
mode,
|
|
52
|
+
neverEvent: reason === "NEVER_EVENT",
|
|
53
|
+
argsHash: evalResult.argsHash,
|
|
54
|
+
...(fields?.summary ? { summary: fields.summary } : {}),
|
|
55
|
+
...(fields?.diffPreview ? { diffPreview: fields.diffPreview } : {}),
|
|
56
|
+
...(fields?.targetPath ? { targetPath: fields.targetPath } : {}),
|
|
57
|
+
}, env);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* The evaluate + trail half of governed(), constructed once per wrapped tool
|
|
61
|
+
* so the lazy config cache hits across calls. Adapters whose execution path
|
|
62
|
+
* closes over per-call context use this directly and invoke the framework
|
|
63
|
+
* callable themselves after the check passes.
|
|
64
|
+
*/
|
|
65
|
+
export function createGateCheck(options) {
|
|
66
|
+
const toolId = deriveSdkToolId(options.toolId, options.server);
|
|
67
|
+
let cached = options.config;
|
|
68
|
+
return async (args) => {
|
|
69
|
+
if (!cached)
|
|
70
|
+
cached = resolveSdkConfig();
|
|
71
|
+
const evalResult = await runEvalTool(cached, {
|
|
72
|
+
toolId,
|
|
73
|
+
args,
|
|
74
|
+
irreversible: options.irreversible,
|
|
75
|
+
});
|
|
76
|
+
recordSdkTrail(cached, evalResult, args);
|
|
77
|
+
const verdict = (evalResult.response.verdict ?? "").toUpperCase();
|
|
78
|
+
if (verdict === "ALLOW" || verdict === "REQUIRE_APPROVE") {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
throw new KyaDeniedError({
|
|
82
|
+
verdict: verdict || "DENY",
|
|
83
|
+
reasonCode: evalResult.response.reasonCode ?? "",
|
|
84
|
+
toolId: evalResult.response.toolId ?? toolId,
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
export function governed(options) {
|
|
89
|
+
const check = createGateCheck(options);
|
|
90
|
+
return async (args) => {
|
|
91
|
+
await check(args);
|
|
92
|
+
return options.fn(args);
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=govern.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"govern.js","sourceRoot":"","sources":["../../src/sdk/govern.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,WAAW,EAAuB,MAAM,0BAA0B,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,MAAM,OAAO,cAAe,SAAQ,QAAQ;IACjC,OAAO,CAAS;IAChB,UAAU,CAAS;IACnB,MAAM,CAAS;I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AAY;SACnC,CAAC,CAAC;QACH,cAAc,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC;QACzC,MAAM,OAAO,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;QAClE,IAAI,OAAO,KAAK,OAAO,IAAI,OAAO,KAAK,iBAAiB,EAAE,CAAC;YACzD,OAAO;QACT,CAAC;QACD,MAAM,IAAI,cAAc,CAAC;YACvB,OAAO,EAAE,OAAO,IAAI,MAAM;YAC1B,UAAU,EAAE,UAAU,CAAC,QAAQ,CAAC,UAAU,IAAI,EAAE;YAChD,MAAM,EAAE,UAAU,CAAC,QAAQ,CAAC,MAAM,IAAI,MAAM;SAC7C,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,QAAQ,CACtB,OAAwC;IAExC,MAAM,KAAK,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;IACvC,OAAO,KAAK,EAAE,IAAW,EAAoB,EAAE;QAC7C,MAAM,KAAK,CAAC,IAAI,CAAC,CAAC;QAClB,OAAO,OAAO,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @shield-agent/kya/sdk — in-process governance shims for agent frameworks.
|
|
3
|
+
* Importing this surface starts no daemons, telemetry, or network clients;
|
|
4
|
+
* evaluation defaults to the offline sample path.
|
|
5
|
+
*/
|
|
6
|
+
export { governed, deriveSdkToolId, KyaDeniedError, type GovernedOptions, type GovernanceOptions, } from "./govern.js";
|
|
7
|
+
export { governA2aSend, type GovernA2aSendOptions, type A2aGateResult, } from "./a2a.js";
|
|
8
|
+
export { governLangGraphTool, type LangGraphToolLike } from "./adapters/langgraph.js";
|
|
9
|
+
export { governVercelAiTool, type VercelAiToolLike, type GovernVercelAiOptions, } from "./adapters/vercel-ai.js";
|
|
10
|
+
export { governMastraTool, type MastraToolLike } from "./adapters/mastra.js";
|
|
11
|
+
export { governOpenAiAgentsTool, type OpenAiAgentsToolLike, } from "./adapters/openai-agents.js";
|
|
12
|
+
export { governClaudeAgentTool, type ClaudeAgentToolLike, } from "./adapters/claude-agent.js";
|
|
13
|
+
export type { ResolvedConfig } from "../config.js";
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sdk/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,QAAQ,EACR,eAAe,EACf,cAAc,EACd,KAAK,eAAe,EACpB,KAAK,iBAAiB,GACvB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,aAAa,EACb,KAAK,oBAAoB,EACzB,KAAK,aAAa,GACnB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,mBAAmB,EAAE,KAAK,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACtF,OAAO,EACL,kBAAkB,EAClB,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,GAC3B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EACL,sBAAsB,EACtB,KAAK,oBAAoB,GAC1B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,qBAAqB,EACrB,KAAK,mBAAmB,GACzB,MAAM,4BAA4B,CAAC;AACpC,YAAY,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @shield-agent/kya/sdk — in-process governance shims for agent frameworks.
|
|
3
|
+
* Importing this surface starts no daemons, telemetry, or network clients;
|
|
4
|
+
* evaluation defaults to the offline sample path.
|
|
5
|
+
*/
|
|
6
|
+
export { governed, deriveSdkToolId, KyaDeniedError, } from "./govern.js";
|
|
7
|
+
export { governA2aSend, } from "./a2a.js";
|
|
8
|
+
export { governLangGraphTool } from "./adapters/langgraph.js";
|
|
9
|
+
export { governVercelAiTool, } from "./adapters/vercel-ai.js";
|
|
10
|
+
export { governMastraTool } from "./adapters/mastra.js";
|
|
11
|
+
export { governOpenAiAgentsTool, } from "./adapters/openai-agents.js";
|
|
12
|
+
export { governClaudeAgentTool, } from "./adapters/claude-agent.js";
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/sdk/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,QAAQ,EACR,eAAe,EACf,cAAc,GAGf,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,aAAa,GAGd,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,mBAAmB,EAA0B,MAAM,yBAAyB,CAAC;AACtF,OAAO,EACL,kBAAkB,GAGnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAuB,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EACL,sBAAsB,GAEvB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,qBAAqB,GAEtB,MAAM,4BAA4B,CAAC"}
|
package/droid/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Droid (Factory) + Shield KYA
|
|
2
2
|
|
|
3
|
-
Preferred path is Droid's own CLI: `droid mcp add shield-kya "npx --no-install @shield-agent/kya@0.
|
|
3
|
+
Preferred path is Droid's own CLI: `droid mcp add shield-kya "npx --no-install @shield-agent/kya@0.13.0 serve-mcp --stdio" --env KYA_BASE_URL=https://shield-agent.com --env KYA_API_KEY=$KYA_API_KEY --env KYA_HOST=ide`.
|
|
4
4
|
|
|
5
5
|
`mcp.example.json` shows the expected on-disk shape (`~/.factory/mcp.json`) — **schema not yet verified against a live Droid install**; treat as a starting point and prefer `droid mcp add`.
|
|
6
6
|
|
package/droid/mcp.example.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"mcpServers": {
|
|
3
3
|
"shield-kya": {
|
|
4
4
|
"command": "npx",
|
|
5
|
-
"args": ["--no-install", "@shield-agent/kya@0.
|
|
5
|
+
"args": ["--no-install", "@shield-agent/kya@0.13.0", "serve-mcp", "--stdio"],
|
|
6
6
|
"env": {
|
|
7
7
|
"KYA_BASE_URL": "https://shield-agent.com",
|
|
8
8
|
"KYA_API_KEY": "${KYA_API_KEY}",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"mcpServers": {
|
|
3
3
|
"shield-kya": {
|
|
4
4
|
"command": "npx",
|
|
5
|
-
"args": ["--no-install", "@shield-agent/kya@0.
|
|
5
|
+
"args": ["--no-install", "@shield-agent/kya@0.13.0", "serve-mcp", "--stdio"],
|
|
6
6
|
"env": {
|
|
7
7
|
"KYA_BASE_URL": "https://shield-agent.com",
|
|
8
8
|
"KYA_API_KEY": "${KYA_API_KEY}",
|
package/grok/README.md
CHANGED
|
@@ -40,7 +40,7 @@ chat = client.chat.create(
|
|
|
40
40
|
There is no grok.com stdio path. For a local agent host use the same stdio launch as Claude:
|
|
41
41
|
|
|
42
42
|
```bash
|
|
43
|
-
npx --no-install @shield-agent/kya@0.
|
|
43
|
+
npx --no-install @shield-agent/kya@0.13.0 serve-mcp --stdio
|
|
44
44
|
```
|
|
45
45
|
|
|
46
46
|
Env: `KYA_BASE_URL`, `KYA_API_KEY`, `KYA_HOST`. Codex and Gemini example configs in this package show the full snippets.
|
package/kilo/kilo.example.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"mcp": {
|
|
3
3
|
"shield-kya": {
|
|
4
4
|
"type": "local",
|
|
5
|
-
"command": ["npx", "--no-install", "@shield-agent/kya@0.
|
|
5
|
+
"command": ["npx", "--no-install", "@shield-agent/kya@0.13.0", "serve-mcp", "--stdio"],
|
|
6
6
|
"enabled": true,
|
|
7
7
|
"environment": {
|
|
8
8
|
"KYA_BASE_URL": "https://shield-agent.com",
|
package/kimi/mcp.example.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"mcpServers": {
|
|
3
3
|
"shield-kya": {
|
|
4
4
|
"command": "npx",
|
|
5
|
-
"args": ["--no-install", "@shield-agent/kya@0.
|
|
5
|
+
"args": ["--no-install", "@shield-agent/kya@0.13.0", "serve-mcp", "--stdio"],
|
|
6
6
|
"env": {
|
|
7
7
|
"KYA_BASE_URL": "https://shield-agent.com",
|
|
8
8
|
"KYA_API_KEY": "${KYA_API_KEY}",
|
package/kiro/mcp.example.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"mcpServers": {
|
|
3
3
|
"shield-kya": {
|
|
4
4
|
"command": "npx",
|
|
5
|
-
"args": ["--no-install", "@shield-agent/kya@0.
|
|
5
|
+
"args": ["--no-install", "@shield-agent/kya@0.13.0", "serve-mcp", "--stdio"],
|
|
6
6
|
"env": {
|
|
7
7
|
"KYA_BASE_URL": "https://shield-agent.com",
|
|
8
8
|
"KYA_API_KEY": "${KYA_API_KEY}",
|
package/manifest.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"manifest_version": "0.3",
|
|
3
3
|
"name": "shield-kya",
|
|
4
4
|
"display_name": "Shield KYA",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.13.0",
|
|
6
6
|
"description": "Know Your Agent MCP gate: ALLOW / DENY / REQUIRE_APPROVE. Sole PEP is Shield.",
|
|
7
7
|
"long_description": "Local Claude Desktop extension that runs the packaged `dist/cli.js serve-mcp --stdio` against your Shield control plane (local or https://shield-agent.com). Tools evaluate policy, ingest session risk, and open Hold tickets. They never execute irreversible side effects.",
|
|
8
8
|
"author": {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"mcpServers": {
|
|
3
3
|
"shield-kya": {
|
|
4
4
|
"command": "npx",
|
|
5
|
-
"args": ["--no-install", "@shield-agent/kya@0.
|
|
5
|
+
"args": ["--no-install", "@shield-agent/kya@0.13.0", "serve-mcp", "--stdio"],
|
|
6
6
|
"env": {
|
|
7
7
|
"KYA_BASE_URL": "https://shield-agent.com",
|
|
8
8
|
"KYA_API_KEY": "${KYA_API_KEY}",
|
package/mcp.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"shield-kya": {
|
|
4
4
|
"description": "Know Your Agent local MCP gate: wrap-before-write, named-agent registry, Hold/Clear.",
|
|
5
5
|
"command": "npx",
|
|
6
|
-
"args": ["--no-install", "@shield-agent/kya@0.
|
|
6
|
+
"args": ["--no-install", "@shield-agent/kya@0.13.0", "serve-mcp", "--stdio"],
|
|
7
7
|
"env": {
|
|
8
8
|
"KYA_BASE_URL": "${KYA_BASE_URL}",
|
|
9
9
|
"KYA_API_KEY": "${KYA_API_KEY}",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
# --- Local stdio (OSS) ---
|
|
12
12
|
[mcp_servers.shield-kya]
|
|
13
13
|
command = "npx"
|
|
14
|
-
args = ["--no-install", "@shield-agent/kya@0.
|
|
14
|
+
args = ["--no-install", "@shield-agent/kya@0.13.0", "serve-mcp", "--stdio"]
|
|
15
15
|
startup_timeout_sec = 20
|
|
16
16
|
env_vars = ["KYA_BASE_URL", "KYA_API_KEY", "KYA_HOST", "KYA_AGENT_ID"]
|
|
17
17
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"mcp": {
|
|
3
3
|
"shield-kya": {
|
|
4
4
|
"type": "local",
|
|
5
|
-
"command": ["npx", "--no-install", "@shield-agent/kya@0.
|
|
5
|
+
"command": ["npx", "--no-install", "@shield-agent/kya@0.13.0", "serve-mcp", "--stdio"],
|
|
6
6
|
"enabled": true,
|
|
7
7
|
"environment": {
|
|
8
8
|
"KYA_BASE_URL": "https://shield-agent.com",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shield-agent/kya",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "Audit trail & traceability for AI agents — local MCP gate (Allow/Review/Deny), live receipt dashboard, trust-baseline certification.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -16,6 +16,10 @@
|
|
|
16
16
|
".": {
|
|
17
17
|
"types": "./dist/index.d.ts",
|
|
18
18
|
"import": "./dist/index.js"
|
|
19
|
+
},
|
|
20
|
+
"./sdk": {
|
|
21
|
+
"types": "./dist/sdk/index.d.ts",
|
|
22
|
+
"import": "./dist/sdk/index.js"
|
|
19
23
|
}
|
|
20
24
|
},
|
|
21
25
|
"files": [
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"mcpServers": {
|
|
3
3
|
"shield-kya": {
|
|
4
4
|
"command": "npx",
|
|
5
|
-
"args": ["--no-install", "@shield-agent/kya@0.
|
|
5
|
+
"args": ["--no-install", "@shield-agent/kya@0.13.0", "serve-mcp", "--stdio"],
|
|
6
6
|
"env": {
|
|
7
7
|
"KYA_BASE_URL": "https://shield-agent.com",
|
|
8
8
|
"KYA_API_KEY": "${KYA_API_KEY}",
|
package/server.json
CHANGED
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
"url": "https://github.com/The-Pixel-Boys/shield-kya",
|
|
8
8
|
"source": "github"
|
|
9
9
|
},
|
|
10
|
-
"version": "0.
|
|
10
|
+
"version": "0.13.0",
|
|
11
11
|
"packages": [
|
|
12
12
|
{
|
|
13
13
|
"registryType": "npm",
|
|
14
14
|
"identifier": "@shield-agent/kya",
|
|
15
|
-
"version": "0.
|
|
15
|
+
"version": "0.13.0",
|
|
16
16
|
"transport": {
|
|
17
17
|
"type": "stdio"
|
|
18
18
|
},
|