@friskai/frisk-js 0.2.8 → 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.
- package/README.md +1 -1
- package/dist/adapters/langchain/frisk-callback-handler.d.ts +1 -2
- package/dist/adapters/langchain/frisk-callback-handler.d.ts.map +1 -1
- package/dist/adapters/langchain/frisk-tool-middleware.d.ts.map +1 -1
- package/dist/adapters/langchain/index.js +1105 -1024
- package/dist/adapters/langchain/index.js.map +24 -25
- package/dist/adapters/langchain/langchain-framework-adapter/langchain-framework-adapter.d.ts +3 -3
- package/dist/adapters/langchain/langchain-framework-adapter/langchain-framework-adapter.d.ts.map +1 -1
- package/dist/core/extensions.d.ts +30 -0
- package/dist/core/extensions.d.ts.map +1 -0
- package/dist/core/frisk-session.d.ts +30 -4
- package/dist/core/frisk-session.d.ts.map +1 -1
- package/dist/core/frisk.d.ts +14 -24
- package/dist/core/frisk.d.ts.map +1 -1
- package/dist/core/tool-call-span.d.ts +1 -2
- package/dist/core/tool-call-span.d.ts.map +1 -1
- package/dist/core/types.d.ts +5 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/errors/index.d.ts +6 -0
- package/dist/errors/index.d.ts.map +1 -1
- package/dist/framework-adapter/base-framework-adapter.d.ts +3 -3
- package/dist/framework-adapter/base-framework-adapter.d.ts.map +1 -1
- package/dist/framework-adapter/framework-adapter.d.ts +3 -3
- package/dist/framework-adapter/framework-adapter.d.ts.map +1 -1
- package/dist/framework-adapter/index.d.ts +2 -2
- package/dist/framework-adapter/index.d.ts.map +1 -1
- package/dist/generated/sdk-meta.d.ts +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +298 -178
- package/dist/index.js.map +14 -15
- package/dist/telemetry/constants.d.ts +3 -1
- package/dist/telemetry/constants.d.ts.map +1 -1
- package/dist/utils/redact.d.ts +5 -5
- package/dist/utils/redact.d.ts.map +1 -1
- package/package.json +3 -27
- package/dist/adapters/claude/claude-framework-adapter/claude-framework-adapter.d.ts +0 -99
- package/dist/adapters/claude/claude-framework-adapter/claude-framework-adapter.d.ts.map +0 -1
- package/dist/adapters/claude/claude-framework-adapter/get-claude-agent-sdk-version.d.ts +0 -2
- package/dist/adapters/claude/claude-framework-adapter/get-claude-agent-sdk-version.d.ts.map +0 -1
- package/dist/adapters/claude/claude-framework-adapter/wrap-tool-with-llm-reasoning.d.ts +0 -4
- package/dist/adapters/claude/claude-framework-adapter/wrap-tool-with-llm-reasoning.d.ts.map +0 -1
- package/dist/adapters/claude/frisk-claude-session.d.ts +0 -29
- package/dist/adapters/claude/frisk-claude-session.d.ts.map +0 -1
- package/dist/adapters/claude/frisk-claude.d.ts +0 -71
- package/dist/adapters/claude/frisk-claude.d.ts.map +0 -1
- package/dist/adapters/claude/index.d.ts +0 -3
- package/dist/adapters/claude/index.d.ts.map +0 -1
- package/dist/adapters/claude/index.js +0 -65658
- package/dist/adapters/claude/index.js.map +0 -449
- package/dist/adapters/claude/resolve-claude-tool-name.d.ts +0 -2
- package/dist/adapters/claude/resolve-claude-tool-name.d.ts.map +0 -1
- package/dist/native-bindings/index.d.ts +0 -23
- package/dist/native-bindings/index.d.ts.map +0 -1
- package/native/README.md +0 -55
- package/native/frisk-js.darwin-arm64.node +0 -0
- package/native/frisk-js.darwin-x64.node +0 -0
- package/native/frisk-js.linux-arm64-gnu.node +0 -0
- package/native/frisk-js.linux-arm64-musl.node +0 -0
- package/native/frisk-js.linux-x64-gnu.node +0 -0
- package/native/frisk-js.linux-x64-musl.node +0 -0
- package/native/frisk-js.win32-arm64-msvc.node +0 -0
- package/native/frisk-js.win32-x64-msvc.node +0 -0
- package/native/index.cjs +0 -580
- package/native/index.d.ts +0 -73
|
@@ -25,7 +25,9 @@ export declare const ATTRIBUTE_NAME_DECISION_OUTCOME = "frisk.decision.outcome";
|
|
|
25
25
|
export declare const ATTRIBUTE_NAME_DECISION_REASON = "frisk.decision.reason";
|
|
26
26
|
export declare const ATTRIBUTE_NAME_ERROR_TYPE = "error.type";
|
|
27
27
|
export declare const ATTRIBUTE_NAME_ERROR_MESSAGE = "error.message";
|
|
28
|
-
export declare const ATTRIBUTE_NAME_LATENCY_NS = "latency_ns";
|
|
29
28
|
export declare const ATTRIBUTE_NAME_TOOL_CALL_IS_SUCCESS = "frisk.tool_call.is_success";
|
|
30
29
|
export declare const ATTRIBUTE_NAME_TOOL_CALL_IS_ERROR = "frisk.tool_call.is_error";
|
|
30
|
+
export declare const ATTRIBUTE_NAME_TOOL_CALL_COUNT = "frisk.tool_calls.count";
|
|
31
|
+
export declare const ATTRIBUTE_NAME_TOOL_CALL_ERROR_COUNT = "frisk.tool_calls.error_count";
|
|
32
|
+
export declare const ATTRIBUTE_NAME_TOOL_CALL_SEQUENCE_NUMBER = "frisk.tool_call.sequence_number";
|
|
31
33
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/telemetry/constants.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,eAAO,MAAM,WAAW,iBAAiB,CAAA;AACzC,mCAAmC;AACnC,eAAO,MAAM,cAAc,UAAU,CAAA;AACrC,sEAAsE;AACtE,eAAO,MAAM,0BAA0B,2BAA2B,CAAA;AAElE,eAAO,MAAM,2BAA2B,gCAAgC,CAAA;AAExE,kEAAkE;AAClE,eAAO,MAAM,uBAAuB,kBAAkB,CAAA;AAEtD,eAAO,MAAM,6BAA6B,yBAAyB,CAAA;AACnE,eAAO,MAAM,yBAAyB,qBAAqB,CAAA;AAC3D,eAAO,MAAM,gCAAgC,4BAA4B,CAAA;AAEzE,8DAA8D;AAC9D,eAAO,MAAM,4BAA4B,wBAAwB,CAAA;AACjE,eAAO,MAAM,wBAAwB,oBAAoB,CAAA;AACzD,eAAO,MAAM,4BAA4B,kBAAkB,CAAA;AAC3D,eAAO,MAAM,oCAAoC,0BAA0B,CAAA;AAC3E,eAAO,MAAM,2BAA2B,uBAAuB,CAAA;AAC/D,eAAO,MAAM,6BAA6B,yBAAyB,CAAA;AACnE,eAAO,MAAM,4CAA4C,wCAClB,CAAA;AACvC,eAAO,MAAM,+BAA+B,2BAA2B,CAAA;AACvE,eAAO,MAAM,8CAA8C,0CAClB,CAAA;AACzC,eAAO,MAAM,0CAA0C,sCAClB,CAAA;AACrC,eAAO,MAAM,+BAA+B,2BAA2B,CAAA;AACvE,eAAO,MAAM,8BAA8B,0BAA0B,CAAA;AACrE,eAAO,MAAM,yBAAyB,eAAe,CAAA;AACrD,eAAO,MAAM,4BAA4B,kBAAkB,CAAA;AAC3D,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/telemetry/constants.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,eAAO,MAAM,WAAW,iBAAiB,CAAA;AACzC,mCAAmC;AACnC,eAAO,MAAM,cAAc,UAAU,CAAA;AACrC,sEAAsE;AACtE,eAAO,MAAM,0BAA0B,2BAA2B,CAAA;AAElE,eAAO,MAAM,2BAA2B,gCAAgC,CAAA;AAExE,kEAAkE;AAClE,eAAO,MAAM,uBAAuB,kBAAkB,CAAA;AAEtD,eAAO,MAAM,6BAA6B,yBAAyB,CAAA;AACnE,eAAO,MAAM,yBAAyB,qBAAqB,CAAA;AAC3D,eAAO,MAAM,gCAAgC,4BAA4B,CAAA;AAEzE,8DAA8D;AAC9D,eAAO,MAAM,4BAA4B,wBAAwB,CAAA;AACjE,eAAO,MAAM,wBAAwB,oBAAoB,CAAA;AACzD,eAAO,MAAM,4BAA4B,kBAAkB,CAAA;AAC3D,eAAO,MAAM,oCAAoC,0BAA0B,CAAA;AAC3E,eAAO,MAAM,2BAA2B,uBAAuB,CAAA;AAC/D,eAAO,MAAM,6BAA6B,yBAAyB,CAAA;AACnE,eAAO,MAAM,4CAA4C,wCAClB,CAAA;AACvC,eAAO,MAAM,+BAA+B,2BAA2B,CAAA;AACvE,eAAO,MAAM,8CAA8C,0CAClB,CAAA;AACzC,eAAO,MAAM,0CAA0C,sCAClB,CAAA;AACrC,eAAO,MAAM,+BAA+B,2BAA2B,CAAA;AACvE,eAAO,MAAM,8BAA8B,0BAA0B,CAAA;AACrE,eAAO,MAAM,yBAAyB,eAAe,CAAA;AACrD,eAAO,MAAM,4BAA4B,kBAAkB,CAAA;AAC3D,eAAO,MAAM,mCAAmC,+BAA+B,CAAA;AAC/E,eAAO,MAAM,iCAAiC,6BAA6B,CAAA;AAC3E,eAAO,MAAM,8BAA8B,2BAA2B,CAAA;AACtE,eAAO,MAAM,oCAAoC,iCACjB,CAAA;AAChC,eAAO,MAAM,wCAAwC,oCAClB,CAAA"}
|
package/dist/utils/redact.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export type RedactOption = boolean | string[];
|
|
|
13
13
|
/**
|
|
14
14
|
* Result of a dictionary redaction operation
|
|
15
15
|
*/
|
|
16
|
-
export interface
|
|
16
|
+
export interface RedactedObject {
|
|
17
17
|
/**
|
|
18
18
|
* The redacted dictionary value
|
|
19
19
|
*/
|
|
@@ -44,14 +44,14 @@ export interface RedactedSerializedObject {
|
|
|
44
44
|
*/
|
|
45
45
|
export declare function combineRedactOptions(...options: (RedactOption | null | undefined)[]): RedactOption;
|
|
46
46
|
/**
|
|
47
|
-
* Redact fields from a dictionary based on the redact option
|
|
47
|
+
* Redact fields from a dictionary based on the redact option.
|
|
48
48
|
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
49
|
+
* Supports dot-separated paths for nested field removal (e.g. "user.email").
|
|
50
|
+
* Only object traversal is supported — array indices are not interpreted.
|
|
51
51
|
*
|
|
52
52
|
* @param data - The dictionary to redact
|
|
53
53
|
* @param redactOption - The redaction configuration
|
|
54
54
|
* @returns The redacted dictionary with paths that were redacted
|
|
55
55
|
*/
|
|
56
|
-
export declare function
|
|
56
|
+
export declare function redactObject(data: Record<string, unknown>, redactOption?: RedactOption): RedactedObject;
|
|
57
57
|
//# sourceMappingURL=redact.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redact.d.ts","sourceRoot":"","sources":["../../src/utils/redact.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,MAAM,EAAE,CAAA;AAE7C;;GAEG;AACH,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"redact.d.ts","sourceRoot":"","sources":["../../src/utils/redact.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,MAAM,EAAE,CAAA;AAE7C;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAE9B;;OAEG;IACH,aAAa,EAAE,MAAM,EAAE,CAAA;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IAEpB;;OAEG;IACH,aAAa,EAAE,MAAM,EAAE,CAAA;CACxB;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,GAAG,OAAO,EAAE,CAAC,YAAY,GAAG,IAAI,GAAG,SAAS,CAAC,EAAE,GAC9C,YAAY,CAuBd;AA0BD;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,YAAY,CAAC,EAAE,YAAY,GAC1B,cAAc,CA2BhB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@friskai/frisk-js",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "FriskAI TypeScript SDK",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -22,27 +22,15 @@
|
|
|
22
22
|
"import": "./dist/adapters/langchain/index.js",
|
|
23
23
|
"default": "./dist/adapters/langchain/index.js"
|
|
24
24
|
},
|
|
25
|
-
"./adapters/claude": {
|
|
26
|
-
"types": "./dist/adapters/claude/index.d.ts",
|
|
27
|
-
"import": "./dist/adapters/claude/index.js",
|
|
28
|
-
"default": "./dist/adapters/claude/index.js"
|
|
29
|
-
},
|
|
30
|
-
"./claude": {
|
|
31
|
-
"types": "./dist/adapters/claude/index.d.ts",
|
|
32
|
-
"import": "./dist/adapters/claude/index.js",
|
|
33
|
-
"default": "./dist/adapters/claude/index.js"
|
|
34
|
-
},
|
|
35
25
|
"./package.json": "./package.json"
|
|
36
26
|
},
|
|
37
27
|
"files": [
|
|
38
|
-
"dist"
|
|
39
|
-
"native"
|
|
28
|
+
"dist"
|
|
40
29
|
],
|
|
41
30
|
"scripts": {
|
|
42
31
|
"build": "bash ./build.sh",
|
|
43
32
|
"build:ts": "bash ./build-ts.sh",
|
|
44
33
|
"dev": "bun build ./src/index.ts --outdir ./dist --target node --format esm --sourcemap=linked --watch --external @langchain/core --external @langchain/langgraph --external langchain",
|
|
45
|
-
"build:rust": "bash ./build-rust.sh",
|
|
46
34
|
"clean": "rm -rf dist",
|
|
47
35
|
"clean:all": "rm -rf dist native/*.node",
|
|
48
36
|
"prepublishOnly": "bun run build",
|
|
@@ -52,12 +40,6 @@
|
|
|
52
40
|
"test": "vitest run --coverage --coverage.thresholds.lines",
|
|
53
41
|
"test:watch": "vitest"
|
|
54
42
|
},
|
|
55
|
-
"napi": {
|
|
56
|
-
"name": "frisk-js",
|
|
57
|
-
"triples": {
|
|
58
|
-
"defaults": true
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
43
|
"keywords": [
|
|
62
44
|
"policy",
|
|
63
45
|
"authorization",
|
|
@@ -91,8 +73,7 @@
|
|
|
91
73
|
"@opentelemetry/api": ">=1.0.0",
|
|
92
74
|
"langchain": "^1.2.19",
|
|
93
75
|
"@langchain/core": ">=1.0.0",
|
|
94
|
-
"@langchain/langgraph": ">=1.0.0"
|
|
95
|
-
"@anthropic-ai/claude-agent-sdk": "^0.2.0"
|
|
76
|
+
"@langchain/langgraph": ">=1.0.0"
|
|
96
77
|
},
|
|
97
78
|
"peerDependenciesMeta": {
|
|
98
79
|
"langchain": {
|
|
@@ -103,18 +84,13 @@
|
|
|
103
84
|
},
|
|
104
85
|
"@langchain/langgraph": {
|
|
105
86
|
"optional": true
|
|
106
|
-
},
|
|
107
|
-
"@anthropic-ai/claude-agent-sdk": {
|
|
108
|
-
"optional": true
|
|
109
87
|
}
|
|
110
88
|
},
|
|
111
89
|
"devDependencies": {
|
|
112
90
|
"@biomejs/biome": "^2.3.14",
|
|
113
91
|
"@langchain/core": "^1.1.21",
|
|
114
92
|
"@langchain/langgraph": "^1.1.4",
|
|
115
|
-
"@anthropic-ai/claude-agent-sdk": "0.2.0",
|
|
116
93
|
"langchain": "^1.2.20",
|
|
117
|
-
"@napi-rs/cli": "^3.5.1",
|
|
118
94
|
"@opentelemetry/api": "^1.9.0",
|
|
119
95
|
"@types/node": "^22.0.0",
|
|
120
96
|
"@types/uuid": "^10.0.0",
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @friskai/frisk-js Claude Framework Adapter
|
|
3
|
-
*
|
|
4
|
-
* Framework adapter for Claude integration.
|
|
5
|
-
* Handles Claude-specific tool calls, serialization, and tool wrapping.
|
|
6
|
-
*/
|
|
7
|
-
import { SdkMcpToolDefinition } from '@anthropic-ai/claude-agent-sdk';
|
|
8
|
-
import { ZodRawShape } from 'zod';
|
|
9
|
-
import type { RegisterToolProperties } from '../../../core/tool-registry';
|
|
10
|
-
import { FrameworkAdapter, ToolCallInfo, WrapToolOptions } from '../../../framework-adapter/framework-adapter';
|
|
11
|
-
import type { RedactedDictionary, RedactedSerializedObject, RedactOption } from '../../../utils/redact';
|
|
12
|
-
/**
|
|
13
|
-
* Claude ToolCall type
|
|
14
|
-
* Represents a tool call from Claude messages
|
|
15
|
-
*/
|
|
16
|
-
export interface ClaudeToolCall {
|
|
17
|
-
id?: string;
|
|
18
|
-
name: string;
|
|
19
|
-
args: Record<string, unknown>;
|
|
20
|
-
type?: string;
|
|
21
|
-
}
|
|
22
|
-
/** Placeholder type for Claude tool objects accepted by this adapter. */
|
|
23
|
-
export interface ClaudeTool {
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Claude framework adapter
|
|
27
|
-
*
|
|
28
|
-
* Provides Claude-specific implementation of the FrameworkAdapter interface.
|
|
29
|
-
* Handles ToolCall objects, message serialization, and tool wrapping.
|
|
30
|
-
*
|
|
31
|
-
*/
|
|
32
|
-
export declare class ClaudeFrameworkAdapter implements FrameworkAdapter<ClaudeToolCall, ClaudeTool> {
|
|
33
|
-
readonly agentFramework = "@anthropic-ai/claude-agent-sdk";
|
|
34
|
-
readonly agentFrameworkVersion: string | null;
|
|
35
|
-
/**
|
|
36
|
-
* Serialize tool arguments to JSON with optional redaction
|
|
37
|
-
*/
|
|
38
|
-
serializeToolArgs(toolArgs: Record<string, unknown> | null | undefined, options?: {
|
|
39
|
-
redact?: RedactOption;
|
|
40
|
-
}): RedactedSerializedObject;
|
|
41
|
-
/**
|
|
42
|
-
* Serialize agent state to JSON with optional redaction.
|
|
43
|
-
*
|
|
44
|
-
* This implementation delegates to {@link agentStateToDict} to apply any
|
|
45
|
-
* provided redaction options before serializing the result.
|
|
46
|
-
*/
|
|
47
|
-
serializeAgentState(agentState: Record<string, unknown> | null | undefined, options?: {
|
|
48
|
-
redact?: RedactOption;
|
|
49
|
-
}): RedactedSerializedObject;
|
|
50
|
-
/**
|
|
51
|
-
* Convert tool arguments to dictionary with optional redaction
|
|
52
|
-
*/
|
|
53
|
-
toolArgsToDict(toolArgs: Record<string, unknown>, options?: {
|
|
54
|
-
redact?: RedactOption;
|
|
55
|
-
}): RedactedDictionary;
|
|
56
|
-
/**
|
|
57
|
-
* Convert agent state to dictionary with optional redaction.
|
|
58
|
-
*
|
|
59
|
-
* Applies the provided redact option directly to the agent state object.
|
|
60
|
-
*/
|
|
61
|
-
agentStateToDict(agentState: Record<string, unknown>, options?: {
|
|
62
|
-
redact?: RedactOption;
|
|
63
|
-
}): RedactedDictionary;
|
|
64
|
-
/**
|
|
65
|
-
* Extract tool call information from a Claude ToolCall
|
|
66
|
-
*/
|
|
67
|
-
normalizeToolCall(toolCall: ClaudeToolCall): ToolCallInfo;
|
|
68
|
-
/**
|
|
69
|
-
* Get the tool call ID or generate one if not present
|
|
70
|
-
*/
|
|
71
|
-
private getOrCreateToolCallId;
|
|
72
|
-
/**
|
|
73
|
-
* Get the tool name from a ToolCall
|
|
74
|
-
*/
|
|
75
|
-
private getToolName;
|
|
76
|
-
/**
|
|
77
|
-
* Extract the user query from agent state
|
|
78
|
-
*
|
|
79
|
-
* Looks for the last human message in the messages array
|
|
80
|
-
*/
|
|
81
|
-
extractPrompt(input: {
|
|
82
|
-
prompt: string;
|
|
83
|
-
}): string | null;
|
|
84
|
-
/**
|
|
85
|
-
* Wrap tools with additional functionality
|
|
86
|
-
*
|
|
87
|
-
* Note: For Frisk policy enforcement, use session.hooks instead.
|
|
88
|
-
* This method provides basic tool wrapping without policy checks.
|
|
89
|
-
*/
|
|
90
|
-
wrapTools(tools: Iterable<SdkMcpToolDefinition<ZodRawShape>>, options?: WrapToolOptions): SdkMcpToolDefinition<ZodRawShape>[];
|
|
91
|
-
/**
|
|
92
|
-
* Wrap tools with additional functionality.
|
|
93
|
-
*
|
|
94
|
-
* This is a passthrough by default. Override in subclasses for custom wrapping.
|
|
95
|
-
*/
|
|
96
|
-
wrapTool(tool: SdkMcpToolDefinition<ZodRawShape>, options?: WrapToolOptions): SdkMcpToolDefinition<ZodRawShape>;
|
|
97
|
-
extractRegisterToolProperties(_tool: SdkMcpToolDefinition<ZodRawShape>): RegisterToolProperties | null;
|
|
98
|
-
}
|
|
99
|
-
//# sourceMappingURL=claude-framework-adapter.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"claude-framework-adapter.d.ts","sourceRoot":"","sources":["../../../../src/adapters/claude/claude-framework-adapter/claude-framework-adapter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAA;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,KAAK,CAAA;AACjC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AACzE,OAAO,EAEL,gBAAgB,EAChB,YAAY,EACZ,eAAe,EAChB,MAAM,8CAA8C,CAAA;AAErD,OAAO,KAAK,EACV,kBAAkB,EAClB,wBAAwB,EACxB,YAAY,EACb,MAAM,uBAAuB,CAAA;AAK9B;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,yEAAyE;AACzE,MAAM,WAAW,UAAU;CAE1B;AAED;;;;;;GAMG;AACH,qBAAa,sBACX,YAAW,gBAAgB,CAAC,cAAc,EAAE,UAAU,CAAC;IAEvD,SAAgB,cAAc,oCAAmC;IACjE,SAAgB,qBAAqB,gBAA6B;IAElE;;OAEG;IACH,iBAAiB,CACf,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GAAG,SAAS,EACpD,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,YAAY,CAAA;KAAE,GAClC,wBAAwB;IAY3B;;;;;OAKG;IACH,mBAAmB,CACjB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GAAG,SAAS,EACtD,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,YAAY,CAAA;KAAE,GAClC,wBAAwB;IAY3B;;OAEG;IACH,cAAc,CACZ,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjC,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,YAAY,CAAA;KAAE,GAClC,kBAAkB;IAIrB;;;;OAIG;IACH,gBAAgB,CACd,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACnC,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,YAAY,CAAA;KAAE,GAClC,kBAAkB;IAIrB;;OAEG;IACH,iBAAiB,CAAC,QAAQ,EAAE,cAAc,GAAG,YAAY;IAQzD;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAQ7B;;OAEG;IACH,OAAO,CAAC,WAAW;IAQnB;;;;OAIG;IACH,aAAa,CAAC,KAAK,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM,GAAG,IAAI;IAIvD;;;;;OAKG;IACH,SAAS,CACP,KAAK,EAAE,QAAQ,CAAC,oBAAoB,CAAC,WAAW,CAAC,CAAC,EAClD,OAAO,GAAE,eAAwC,GAChD,oBAAoB,CAAC,WAAW,CAAC,EAAE;IAItC;;;;OAIG;IACI,QAAQ,CACb,IAAI,EAAE,oBAAoB,CAAC,WAAW,CAAC,EACvC,OAAO,GAAE,eAAwC,GAChD,oBAAoB,CAAC,WAAW,CAAC;IAQpC,6BAA6B,CAC3B,KAAK,EAAE,oBAAoB,CAAC,WAAW,CAAC,GACvC,sBAAsB,GAAG,IAAI;CAGjC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-claude-agent-sdk-version.d.ts","sourceRoot":"","sources":["../../../../src/adapters/claude/claude-framework-adapter/get-claude-agent-sdk-version.ts"],"names":[],"mappings":"AAMA,wBAAgB,wBAAwB,IAAI,MAAM,GAAG,IAAI,CAWxD"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { SdkMcpToolDefinition } from '@anthropic-ai/claude-agent-sdk';
|
|
2
|
-
import { ZodRawShape } from 'zod';
|
|
3
|
-
export declare function wrapToolWithLlmReasoning(originalTool: SdkMcpToolDefinition<ZodRawShape>): SdkMcpToolDefinition<ZodRawShape>;
|
|
4
|
-
//# sourceMappingURL=wrap-tool-with-llm-reasoning.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"wrap-tool-with-llm-reasoning.d.ts","sourceRoot":"","sources":["../../../../src/adapters/claude/claude-framework-adapter/wrap-tool-with-llm-reasoning.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAQ,MAAM,gCAAgC,CAAA;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,KAAK,CAAA;AAMjC,wBAAgB,wBAAwB,CACtC,YAAY,EAAE,oBAAoB,CAAC,WAAW,CAAC,GAC9C,oBAAoB,CAAC,WAAW,CAAC,CAyBnC"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { type HookCallback, type HookCallbackMatcher, type HookEvent } from '@anthropic-ai/claude-agent-sdk';
|
|
2
|
-
import type { Tracer } from '@opentelemetry/api';
|
|
3
|
-
import { FriskSession, type FriskSessionOptions } from '../../core/frisk-session';
|
|
4
|
-
import type { ResolvedRedactionOptions } from '../../core/redaction-options';
|
|
5
|
-
import { type FriskSDKLoggingOptions } from '../../logging';
|
|
6
|
-
import { FriskClaude, type FriskClaudeAgentState } from './frisk-claude';
|
|
7
|
-
export interface FriskClaudeSessionOptions extends FriskSessionOptions<FriskClaude> {
|
|
8
|
-
frisk: FriskClaude;
|
|
9
|
-
agentState: FriskClaudeAgentState;
|
|
10
|
-
redact: ResolvedRedactionOptions;
|
|
11
|
-
tracer: Tracer;
|
|
12
|
-
logging?: FriskSDKLoggingOptions;
|
|
13
|
-
}
|
|
14
|
-
export interface FriskClaudeHooksOptions {
|
|
15
|
-
controls?: {
|
|
16
|
-
toolPolicies?: boolean;
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
export type ClaudeAgentHooks = Partial<Record<HookEvent, HookCallbackMatcher[]>>;
|
|
20
|
-
/** Claude-specific session object exposing context and callback helpers. */
|
|
21
|
-
export declare class FriskClaudeSession extends FriskSession<FriskClaude> {
|
|
22
|
-
private agentState;
|
|
23
|
-
constructor(options: FriskClaudeSessionOptions);
|
|
24
|
-
hooks(options?: FriskClaudeHooksOptions): ClaudeAgentHooks;
|
|
25
|
-
sessionStopHook(): HookCallback;
|
|
26
|
-
userPromptSubmitHook(): HookCallback;
|
|
27
|
-
preToolUseHook(): HookCallback;
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=frisk-claude-session.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"frisk-claude-session.d.ts","sourceRoot":"","sources":["../../../src/adapters/claude/frisk-claude-session.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,SAAS,EAIf,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAChD,OAAO,EACL,YAAY,EACZ,KAAK,mBAAmB,EACzB,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAA;AAE5E,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,eAAe,CAAA;AAC3D,OAAO,EAAE,WAAW,EAAE,KAAK,qBAAqB,EAAE,MAAM,gBAAgB,CAAA;AAGxE,MAAM,WAAW,yBACf,SAAQ,mBAAmB,CAAC,WAAW,CAAC;IACxC,KAAK,EAAE,WAAW,CAAA;IAClB,UAAU,EAAE,qBAAqB,CAAA;IACjC,MAAM,EAAE,wBAAwB,CAAA;IAChC,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,sBAAsB,CAAA;CACjC;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,EAAE;QACT,YAAY,CAAC,EAAE,OAAO,CAAA;KACvB,CAAA;CACF;AAED,MAAM,MAAM,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,mBAAmB,EAAE,CAAC,CAAC,CAAA;AAEhF,4EAA4E;AAC5E,qBAAa,kBAAmB,SAAQ,YAAY,CAAC,WAAW,CAAC;IAC/D,OAAO,CAAC,UAAU,CAAuB;gBAEtB,OAAO,EAAE,yBAAyB;IAU9C,KAAK,CAAC,OAAO,CAAC,EAAE,uBAAuB,GAAG,gBAAgB;IAa1D,eAAe,IAAI,YAAY;IAQ/B,oBAAoB,IAAI,YAAY;IAYpC,cAAc,IAAI,YAAY;CA6BtC"}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @friskai/frisk-js Claude Integration
|
|
3
|
-
*
|
|
4
|
-
* FriskClaude class that extends Frisk with Claude-specific functionality.
|
|
5
|
-
*/
|
|
6
|
-
import { SdkMcpToolDefinition } from '@anthropic-ai/claude-agent-sdk';
|
|
7
|
-
import { ZodRawShape } from 'zod';
|
|
8
|
-
import { Frisk } from '../../core/frisk';
|
|
9
|
-
import type { FriskOptions } from '../../core/types';
|
|
10
|
-
import { WrapToolOptions } from '../../framework-adapter/framework-adapter';
|
|
11
|
-
import { ClaudeFrameworkAdapter, type ClaudeTool, type ClaudeToolCall } from './claude-framework-adapter/claude-framework-adapter';
|
|
12
|
-
import { FriskClaudeSession } from './frisk-claude-session';
|
|
13
|
-
/**
|
|
14
|
-
* Claude-specific Frisk init params (without frameworkAdapter since it's preset)
|
|
15
|
-
*/
|
|
16
|
-
export type FriskClaudeOptions = Omit<FriskOptions<ClaudeToolCall, ClaudeTool>, 'adapter'>;
|
|
17
|
-
export type FriskClaudeAgentState = Record<string, unknown>;
|
|
18
|
-
/**
|
|
19
|
-
* FriskClaude - Frisk SDK configured for Claude integration
|
|
20
|
-
*
|
|
21
|
-
* Extends the base Frisk class with Claude-specific functionality.
|
|
22
|
-
* Automatically configures the ClaudeFrameworkAdapter.
|
|
23
|
-
*
|
|
24
|
-
* @example
|
|
25
|
-
* ```typescript
|
|
26
|
-
* import { Frisk } from '@friskai/frisk-js/claude';
|
|
27
|
-
*
|
|
28
|
-
* const frisk = await Frisk.connect({
|
|
29
|
-
* apiKey: process.env.FRISK_API_KEY,
|
|
30
|
-
* redact: {
|
|
31
|
-
* redactToolArgs: ['password'],
|
|
32
|
-
* },
|
|
33
|
-
* });
|
|
34
|
-
*
|
|
35
|
-
* // Collect LLM reasoning from tools
|
|
36
|
-
* const wrappedTools = frisk.wrapTools(myTools);
|
|
37
|
-
*
|
|
38
|
-
* // Evaluate a tool call against Frisk policies
|
|
39
|
-
* const result = frisk.decideToolCall({
|
|
40
|
-
* toolCall: { name: 'send_email', id: 'tool-call-1', args: { recipient: 'user@example.com' } },
|
|
41
|
-
* agentState: { userId: 123 }
|
|
42
|
-
* })
|
|
43
|
-
* ```
|
|
44
|
-
*/
|
|
45
|
-
export declare class FriskClaude extends Frisk<ClaudeToolCall, ClaudeTool, ClaudeFrameworkAdapter, FriskClaudeAgentState> {
|
|
46
|
-
constructor(params?: FriskClaudeOptions);
|
|
47
|
-
session(agentState?: FriskClaudeAgentState): FriskClaudeSession;
|
|
48
|
-
/**
|
|
49
|
-
* Wrap many Claude tools with Frisk policy enforcement.
|
|
50
|
-
*
|
|
51
|
-
* This wrapper requires the LLM to provide a **reasoning / justification** before calling a tool.
|
|
52
|
-
* Frisk captures that reasoning and makes it available for review in the Frisk dashboard.
|
|
53
|
-
*
|
|
54
|
-
* ## Accepted tool types
|
|
55
|
-
* Accepts an instance of Claude's SdkMcpToolDefinition.
|
|
56
|
-
* This includes tools created via the `tool()` function, whose arguments are object-shaped.
|
|
57
|
-
*/
|
|
58
|
-
wrapTools(tools: Iterable<SdkMcpToolDefinition<ZodRawShape>>, options?: WrapToolOptions): SdkMcpToolDefinition<ZodRawShape>[];
|
|
59
|
-
/**
|
|
60
|
-
* Wrap a single Claude tool with Frisk policy enforcement.
|
|
61
|
-
*
|
|
62
|
-
* This wrapper requires the LLM to provide a **reasoning / justification** before calling a tool.
|
|
63
|
-
* Frisk captures that reasoning and makes it available for review in the Frisk dashboard.
|
|
64
|
-
*
|
|
65
|
-
* ## Accepted tool types
|
|
66
|
-
* Accepts an instance of Claude's SdkMcpToolDefinition.
|
|
67
|
-
* This includes tools created via the `tool()` function, whose arguments are object-shaped.
|
|
68
|
-
*/
|
|
69
|
-
wrapTool(tool: SdkMcpToolDefinition<ZodRawShape>, options?: WrapToolOptions): SdkMcpToolDefinition<ZodRawShape>;
|
|
70
|
-
}
|
|
71
|
-
//# sourceMappingURL=frisk-claude.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"frisk-claude.d.ts","sourceRoot":"","sources":["../../../src/adapters/claude/frisk-claude.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAA;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,KAAK,CAAA;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAExC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AACpD,OAAO,EAEL,eAAe,EAChB,MAAM,2CAA2C,CAAA;AAClD,OAAO,EACL,sBAAsB,EACtB,KAAK,UAAU,EACf,KAAK,cAAc,EACpB,MAAM,qDAAqD,CAAA;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAE3D;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,IAAI,CACnC,YAAY,CAAC,cAAc,EAAE,UAAU,CAAC,EACxC,SAAS,CACV,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAE3D;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,qBAAa,WAAY,SAAQ,KAAK,CACpC,cAAc,EACd,UAAU,EACV,sBAAsB,EACtB,qBAAqB,CACtB;gBACa,MAAM,CAAC,EAAE,kBAAkB;IAOhC,OAAO,CAAC,UAAU,CAAC,EAAE,qBAAqB,GAAG,kBAAkB;IAkBtE;;;;;;;;;OASG;IACI,SAAS,CACd,KAAK,EAAE,QAAQ,CAAC,oBAAoB,CAAC,WAAW,CAAC,CAAC,EAClD,OAAO,GAAE,eAAwC,GAChD,oBAAoB,CAAC,WAAW,CAAC,EAAE;IAOtC;;;;;;;;;OASG;IACI,QAAQ,CACb,IAAI,EAAE,oBAAoB,CAAC,WAAW,CAAC,EACvC,OAAO,GAAE,eAAwC,GAChD,oBAAoB,CAAC,WAAW,CAAC;CAGrC"}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export { FriskClaude, FriskClaude as Frisk, type FriskClaudeOptions, type FriskClaudeOptions as FriskOptions, } from './frisk-claude';
|
|
2
|
-
export { type FriskClaudeHooksOptions, FriskClaudeSession, FriskClaudeSession as FriskSession, type FriskClaudeSessionOptions as FriskSessionOptions, } from './frisk-claude-session';
|
|
3
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/adapters/claude/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,WAAW,IAAI,KAAK,EACpB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,IAAI,YAAY,GACxC,MAAM,gBAAgB,CAAA;AAEvB,OAAO,EACL,KAAK,uBAAuB,EAC5B,kBAAkB,EAClB,kBAAkB,IAAI,YAAY,EAClC,KAAK,yBAAyB,IAAI,mBAAmB,GACtD,MAAM,wBAAwB,CAAA"}
|