@friskai/frisk-js 0.2.6 → 0.2.10
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/dist/adapters/claude/claude-framework-adapter/claude-framework-adapter.d.ts +2 -0
- package/dist/adapters/claude/claude-framework-adapter/claude-framework-adapter.d.ts.map +1 -1
- package/dist/adapters/claude/claude-framework-adapter/get-claude-agent-sdk-version.d.ts +2 -0
- package/dist/adapters/claude/claude-framework-adapter/get-claude-agent-sdk-version.d.ts.map +1 -0
- package/dist/adapters/claude/index.js +304 -53
- package/dist/adapters/claude/index.js.map +16 -11
- package/dist/adapters/langchain/frisk-callback-handler.d.ts +20 -16
- package/dist/adapters/langchain/frisk-callback-handler.d.ts.map +1 -1
- package/dist/adapters/langchain/frisk-langchain-session.d.ts.map +1 -1
- package/dist/adapters/langchain/index.js +23791 -23455
- package/dist/adapters/langchain/index.js.map +77 -72
- package/dist/adapters/langchain/langchain-framework-adapter/get-langchain-version.d.ts +2 -0
- package/dist/adapters/langchain/langchain-framework-adapter/get-langchain-version.d.ts.map +1 -0
- package/dist/adapters/langchain/langchain-framework-adapter/langchain-framework-adapter.d.ts +2 -0
- package/dist/adapters/langchain/langchain-framework-adapter/langchain-framework-adapter.d.ts.map +1 -1
- package/dist/core/frisk-session.d.ts +27 -2
- package/dist/core/frisk-session.d.ts.map +1 -1
- package/dist/core/frisk.d.ts +6 -2
- package/dist/core/frisk.d.ts.map +1 -1
- package/dist/core/sdk-attributes/detect-runtime.d.ts +5 -0
- package/dist/core/sdk-attributes/detect-runtime.d.ts.map +1 -0
- package/dist/core/sdk-attributes/get-core-sdk-attributes.d.ts +12 -0
- package/dist/core/sdk-attributes/get-core-sdk-attributes.d.ts.map +1 -0
- package/dist/core/sdk-attributes/read-sdk-meta.d.ts +7 -0
- package/dist/core/sdk-attributes/read-sdk-meta.d.ts.map +1 -0
- package/dist/core/tool-call-span.d.ts +1 -2
- package/dist/core/tool-call-span.d.ts.map +1 -1
- package/dist/core/tool-registry.d.ts +5 -1
- package/dist/core/tool-registry.d.ts.map +1 -1
- package/dist/framework-adapter/base-framework-adapter.d.ts +2 -0
- package/dist/framework-adapter/base-framework-adapter.d.ts.map +1 -1
- package/dist/framework-adapter/framework-adapter.d.ts +2 -0
- package/dist/framework-adapter/framework-adapter.d.ts.map +1 -1
- package/dist/generated/sdk-meta.d.ts +3 -0
- package/dist/generated/sdk-meta.d.ts.map +1 -0
- package/dist/index.js +263 -32
- package/dist/index.js.map +14 -10
- package/dist/telemetry/constants.d.ts +6 -1
- package/dist/telemetry/constants.d.ts.map +1 -1
- 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 +52 -52
- package/package.json +1 -1
|
@@ -30,6 +30,8 @@ export interface ClaudeTool {
|
|
|
30
30
|
*
|
|
31
31
|
*/
|
|
32
32
|
export declare class ClaudeFrameworkAdapter implements FrameworkAdapter<ClaudeToolCall, ClaudeTool> {
|
|
33
|
+
readonly agentFramework = "@anthropic-ai/claude-agent-sdk";
|
|
34
|
+
readonly agentFrameworkVersion: string | null;
|
|
33
35
|
/**
|
|
34
36
|
* Serialize tool arguments to JSON with optional redaction
|
|
35
37
|
*/
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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"}
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -43678,6 +43678,8 @@ function redactDictionarySimple(data, redactOption) {
|
|
|
43678
43678
|
}
|
|
43679
43679
|
// src/framework-adapter/base-framework-adapter.ts
|
|
43680
43680
|
class BaseFrameworkAdapter {
|
|
43681
|
+
agentFramework = "none";
|
|
43682
|
+
agentFrameworkVersion = null;
|
|
43681
43683
|
serializeToolArgs(toolArgs, options) {
|
|
43682
43684
|
if (toolArgs == null) {
|
|
43683
43685
|
return { value: null, redactedPaths: [] };
|
|
@@ -43846,6 +43848,7 @@ var redactDictionary = nativeBindings.redactDictionary;
|
|
|
43846
43848
|
var TRACER_NAME = "frisk_js_sdk";
|
|
43847
43849
|
var TRACER_VERSION = "0.1.0";
|
|
43848
43850
|
var SPAN_NAME_DECIDE_TOOL_CALL = "frisk.tool_call.decide";
|
|
43851
|
+
var SPAN_NAME_OBSERVE_TOOL_CALL = "frisk.tool_call.observation";
|
|
43849
43852
|
var SPAN_NAME_FRISK_SESSION = "frisk.session";
|
|
43850
43853
|
var ATTRIBUTE_NAME_SESSION_PROMPT = "frisk.session.prompt";
|
|
43851
43854
|
var ATTRIBUTE_NAME_SESSION_ID = "frisk.session.id";
|
|
@@ -43864,7 +43867,11 @@ var ATTRIBUTE_NAME_DECISION_OUTCOME = "frisk.decision.outcome";
|
|
|
43864
43867
|
var ATTRIBUTE_NAME_DECISION_REASON = "frisk.decision.reason";
|
|
43865
43868
|
var ATTRIBUTE_NAME_ERROR_TYPE = "error.type";
|
|
43866
43869
|
var ATTRIBUTE_NAME_ERROR_MESSAGE = "error.message";
|
|
43867
|
-
var
|
|
43870
|
+
var ATTRIBUTE_NAME_TOOL_CALL_IS_SUCCESS = "frisk.tool_call.is_success";
|
|
43871
|
+
var ATTRIBUTE_NAME_TOOL_CALL_IS_ERROR = "frisk.tool_call.is_error";
|
|
43872
|
+
var ATTRIBUTE_NAME_TOOL_CALL_COUNT = "frisk.tool_calls.count";
|
|
43873
|
+
var ATTRIBUTE_NAME_TOOL_CALL_ERROR_COUNT = "frisk.tool_calls.error_count";
|
|
43874
|
+
var ATTRIBUTE_NAME_TOOL_CALL_SEQUENCE_NUMBER = "frisk.tool_call.sequence_number";
|
|
43868
43875
|
// src/telemetry/tracing-manager.ts
|
|
43869
43876
|
var import_grpc_js = __toESM(require_src3(), 1);
|
|
43870
43877
|
var import_exporter_trace_otlp_grpc = __toESM(require_src12(), 1);
|
|
@@ -44157,6 +44164,9 @@ class AccessTokenProvider {
|
|
|
44157
44164
|
}
|
|
44158
44165
|
}
|
|
44159
44166
|
|
|
44167
|
+
// src/core/frisk-session.ts
|
|
44168
|
+
var import_api2 = __toESM(require_src4(), 1);
|
|
44169
|
+
|
|
44160
44170
|
// ../../node_modules/zod/v4/core/core.js
|
|
44161
44171
|
var NEVER = Object.freeze({
|
|
44162
44172
|
status: "aborted"
|
|
@@ -48506,7 +48516,6 @@ class ToolCallSpan {
|
|
|
48506
48516
|
tracer;
|
|
48507
48517
|
redaction;
|
|
48508
48518
|
_span = null;
|
|
48509
|
-
_startTimeNs = null;
|
|
48510
48519
|
_traceContextCarrier = null;
|
|
48511
48520
|
sessionId;
|
|
48512
48521
|
friskToolVersionId;
|
|
@@ -48587,7 +48596,6 @@ class ToolCallSpan {
|
|
|
48587
48596
|
}
|
|
48588
48597
|
enter() {
|
|
48589
48598
|
const parentContext = this.parent ? import_api.trace.setSpan(import_api.context.active(), this.parent) : import_api.context.active();
|
|
48590
|
-
this._startTimeNs = process.hrtime.bigint();
|
|
48591
48599
|
const redactedToolArgsResult = this.adapter.serializeToolArgs(removeLlmReasoningArg(this.toolCall.args), { redact: this.redaction.redactToolArgs });
|
|
48592
48600
|
const redactedAgentStateResult = this.adapter.serializeAgentState(this.agentState, { redact: this.redaction.redactAgentState });
|
|
48593
48601
|
this._span = this.tracer.startSpan(SPAN_NAME_DECIDE_TOOL_CALL, {
|
|
@@ -48613,11 +48621,6 @@ class ToolCallSpan {
|
|
|
48613
48621
|
if (!this.span) {
|
|
48614
48622
|
return;
|
|
48615
48623
|
}
|
|
48616
|
-
if (this._startTimeNs !== null) {
|
|
48617
|
-
const endTimeNs = process.hrtime.bigint();
|
|
48618
|
-
const latencyNs = endTimeNs - this._startTimeNs;
|
|
48619
|
-
this.setAttribute(ATTRIBUTE_NAME_LATENCY_NS, Number(latencyNs));
|
|
48620
|
-
}
|
|
48621
48624
|
this.span.end();
|
|
48622
48625
|
}
|
|
48623
48626
|
}
|
|
@@ -48635,12 +48638,15 @@ var DecisionOutcome;
|
|
|
48635
48638
|
class FriskSession {
|
|
48636
48639
|
frisk;
|
|
48637
48640
|
id;
|
|
48638
|
-
|
|
48641
|
+
_rootSpan = null;
|
|
48639
48642
|
redaction;
|
|
48640
48643
|
tracer;
|
|
48641
48644
|
logger;
|
|
48642
48645
|
_rootRunId = null;
|
|
48643
48646
|
_isTracing = false;
|
|
48647
|
+
toolCallSequenceNumber = 0;
|
|
48648
|
+
toolCallSequenceGenerator = this.createToolCallSequenceGenerator();
|
|
48649
|
+
toolCallErrorCount = 0;
|
|
48644
48650
|
constructor({ frisk, redact, tracer, logging }) {
|
|
48645
48651
|
const sessionId = this.constructor.generateSessionId();
|
|
48646
48652
|
this.logger = deriveSdkLogger(logging, {
|
|
@@ -48651,12 +48657,75 @@ class FriskSession {
|
|
|
48651
48657
|
this.redaction = redact;
|
|
48652
48658
|
this.tracer = tracer;
|
|
48653
48659
|
}
|
|
48660
|
+
get rootSpan() {
|
|
48661
|
+
return this._rootSpan;
|
|
48662
|
+
}
|
|
48663
|
+
getTracer() {
|
|
48664
|
+
return this.tracer;
|
|
48665
|
+
}
|
|
48654
48666
|
get isTracing() {
|
|
48655
48667
|
return this._isTracing;
|
|
48656
48668
|
}
|
|
48657
48669
|
get rootRunId() {
|
|
48658
48670
|
return this._rootRunId;
|
|
48659
48671
|
}
|
|
48672
|
+
async createToolCallSpan({
|
|
48673
|
+
name,
|
|
48674
|
+
args: toolArgsInput
|
|
48675
|
+
}) {
|
|
48676
|
+
const toolArgs = this.validateToolArgs(toolArgsInput);
|
|
48677
|
+
const redactedToolArgsResult = this.frisk.adapter?.serializeToolArgs(removeLlmReasoningArg(toolArgs), { redact: this.redaction.redactToolArgs }) ?? {
|
|
48678
|
+
value: "{}",
|
|
48679
|
+
redactedPaths: []
|
|
48680
|
+
};
|
|
48681
|
+
const sessionSpan = this.rootSpan;
|
|
48682
|
+
const parentContext = sessionSpan ? import_api2.trace.setSpan(import_api2.context.active(), sessionSpan) : import_api2.context.active();
|
|
48683
|
+
const spanAttributes = {
|
|
48684
|
+
[ATTRIBUTE_NAME_SESSION_ID]: this.id,
|
|
48685
|
+
[ATTRIBUTE_NAME_TOOL_NAME]: name,
|
|
48686
|
+
[ATTRIBUTE_NAME_TOOL_ARGS_JSON]: redactedToolArgsResult.value,
|
|
48687
|
+
[ATTRIBUTE_NAME_TOOL_ARGS_REDACTED_PATHS_JSON]: JSON.stringify(redactedToolArgsResult.redactedPaths),
|
|
48688
|
+
[ATTRIBUTE_NAME_TOOL_CALL_SEQUENCE_NUMBER]: this.toolCallSequenceGenerator.next().value
|
|
48689
|
+
};
|
|
48690
|
+
await this.frisk.toolRegistrationComplete;
|
|
48691
|
+
const registeredTool = this.frisk.getRegisteredTool(name);
|
|
48692
|
+
if (registeredTool) {
|
|
48693
|
+
spanAttributes[ATTRIBUTE_NAME_FRISK_TOOL_ID] = registeredTool.id;
|
|
48694
|
+
spanAttributes[ATTRIBUTE_NAME_FRISK_TOOL_VERSION_ID] = registeredTool.versionId;
|
|
48695
|
+
}
|
|
48696
|
+
const span = this.getTracer().startSpan(SPAN_NAME_OBSERVE_TOOL_CALL, {
|
|
48697
|
+
attributes: spanAttributes
|
|
48698
|
+
}, parentContext);
|
|
48699
|
+
return span;
|
|
48700
|
+
}
|
|
48701
|
+
closeToolCallSpan({
|
|
48702
|
+
toolCallId,
|
|
48703
|
+
span,
|
|
48704
|
+
err,
|
|
48705
|
+
status
|
|
48706
|
+
}) {
|
|
48707
|
+
if (toolCallId) {
|
|
48708
|
+
span.setAttribute(ATTRIBUTE_NAME_TOOL_CALL_ID, toolCallId);
|
|
48709
|
+
}
|
|
48710
|
+
if (status === "error" /* Error */ || !!err) {
|
|
48711
|
+
this.incrementToolCallErrors();
|
|
48712
|
+
span.setAttribute(ATTRIBUTE_NAME_TOOL_CALL_IS_ERROR, true);
|
|
48713
|
+
span.setAttribute(ATTRIBUTE_NAME_TOOL_CALL_IS_SUCCESS, false);
|
|
48714
|
+
} else if (status === "success" /* Success */) {
|
|
48715
|
+
span.setAttribute(ATTRIBUTE_NAME_TOOL_CALL_IS_SUCCESS, true);
|
|
48716
|
+
span.setAttribute(ATTRIBUTE_NAME_TOOL_CALL_IS_ERROR, false);
|
|
48717
|
+
}
|
|
48718
|
+
if (err && err instanceof Error) {
|
|
48719
|
+
span.setAttribute(ATTRIBUTE_NAME_ERROR_MESSAGE, `${err}`);
|
|
48720
|
+
span.setAttribute(ATTRIBUTE_NAME_ERROR_TYPE, `${err.constructor.name}`);
|
|
48721
|
+
}
|
|
48722
|
+
span.end();
|
|
48723
|
+
}
|
|
48724
|
+
validateToolArgs(parsedToolArgs) {
|
|
48725
|
+
const isPlainObject2 = typeof parsedToolArgs === "object" && parsedToolArgs !== null && !Array.isArray(parsedToolArgs) && (Object.getPrototypeOf(parsedToolArgs) === Object.prototype || Object.getPrototypeOf(parsedToolArgs) === null);
|
|
48726
|
+
const toolArgs = isPlainObject2 ? parsedToolArgs : {};
|
|
48727
|
+
return toolArgs;
|
|
48728
|
+
}
|
|
48660
48729
|
decideToolCall({
|
|
48661
48730
|
toolCall,
|
|
48662
48731
|
agentState
|
|
@@ -48669,7 +48738,7 @@ class FriskSession {
|
|
|
48669
48738
|
friskToolId: registeredTool?.id ?? null,
|
|
48670
48739
|
friskToolVersionId: registeredTool?.versionId ?? null,
|
|
48671
48740
|
agentState,
|
|
48672
|
-
parent: this.
|
|
48741
|
+
parent: this._rootSpan,
|
|
48673
48742
|
tracer: this.tracer,
|
|
48674
48743
|
redact: this.redaction
|
|
48675
48744
|
});
|
|
@@ -48713,6 +48782,20 @@ class FriskSession {
|
|
|
48713
48782
|
}
|
|
48714
48783
|
});
|
|
48715
48784
|
}
|
|
48785
|
+
*createToolCallSequenceGenerator() {
|
|
48786
|
+
while (true) {
|
|
48787
|
+
yield this.toolCallSequenceNumber++;
|
|
48788
|
+
}
|
|
48789
|
+
}
|
|
48790
|
+
getToolCallCount() {
|
|
48791
|
+
return this.toolCallSequenceNumber;
|
|
48792
|
+
}
|
|
48793
|
+
incrementToolCallErrors() {
|
|
48794
|
+
this.toolCallErrorCount += 1;
|
|
48795
|
+
}
|
|
48796
|
+
getToolCallErrorCount() {
|
|
48797
|
+
return this.toolCallErrorCount;
|
|
48798
|
+
}
|
|
48716
48799
|
initTracing({ runId, inputs }) {
|
|
48717
48800
|
this._rootRunId = runId;
|
|
48718
48801
|
this._isTracing = true;
|
|
@@ -48727,21 +48810,141 @@ class FriskSession {
|
|
|
48727
48810
|
return span;
|
|
48728
48811
|
}
|
|
48729
48812
|
endTracing() {
|
|
48730
|
-
if (this.
|
|
48731
|
-
this.
|
|
48813
|
+
if (this._rootSpan) {
|
|
48814
|
+
this._rootSpan.setAttribute(ATTRIBUTE_NAME_TOOL_CALL_COUNT, this.getToolCallCount());
|
|
48815
|
+
this._rootSpan.setAttribute(ATTRIBUTE_NAME_TOOL_CALL_ERROR_COUNT, this.getToolCallErrorCount());
|
|
48816
|
+
this._rootSpan.end();
|
|
48732
48817
|
}
|
|
48733
48818
|
this._isTracing = false;
|
|
48734
48819
|
const registry2 = SessionRegistry.getInstance();
|
|
48735
48820
|
registry2.unregister(this.id);
|
|
48736
48821
|
}
|
|
48737
48822
|
setRootSpan(span) {
|
|
48738
|
-
this.
|
|
48823
|
+
this._rootSpan = span;
|
|
48739
48824
|
}
|
|
48740
48825
|
static generateSessionId() {
|
|
48741
48826
|
return v4();
|
|
48742
48827
|
}
|
|
48743
48828
|
}
|
|
48744
48829
|
|
|
48830
|
+
// src/core/sdk-attributes/detect-runtime.ts
|
|
48831
|
+
function detectRuntime() {
|
|
48832
|
+
const g = globalThis;
|
|
48833
|
+
if (g.Bun) {
|
|
48834
|
+
return {
|
|
48835
|
+
runtime: "bun",
|
|
48836
|
+
runtimeVersion: g.Bun.version
|
|
48837
|
+
};
|
|
48838
|
+
}
|
|
48839
|
+
if (g.Deno) {
|
|
48840
|
+
return {
|
|
48841
|
+
runtime: "deno",
|
|
48842
|
+
runtimeVersion: g.Deno.version.deno
|
|
48843
|
+
};
|
|
48844
|
+
}
|
|
48845
|
+
if (typeof process !== "undefined" && process.versions?.node) {
|
|
48846
|
+
return {
|
|
48847
|
+
runtime: "node",
|
|
48848
|
+
runtimeVersion: process.versions.node
|
|
48849
|
+
};
|
|
48850
|
+
}
|
|
48851
|
+
if (typeof navigator !== "undefined") {
|
|
48852
|
+
return {
|
|
48853
|
+
runtime: "browser",
|
|
48854
|
+
runtimeVersion: navigator.userAgent
|
|
48855
|
+
};
|
|
48856
|
+
}
|
|
48857
|
+
return {
|
|
48858
|
+
runtime: "unknown",
|
|
48859
|
+
runtimeVersion: "unknown"
|
|
48860
|
+
};
|
|
48861
|
+
}
|
|
48862
|
+
|
|
48863
|
+
// src/core/sdk-attributes/read-sdk-meta.ts
|
|
48864
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
48865
|
+
import { dirname as dirname2, join } from "node:path";
|
|
48866
|
+
import { fileURLToPath } from "node:url";
|
|
48867
|
+
|
|
48868
|
+
// src/generated/sdk-meta.ts
|
|
48869
|
+
var SDK_NAME = "@friskai/frisk-js";
|
|
48870
|
+
var SDK_VERSION = "0.2.10";
|
|
48871
|
+
|
|
48872
|
+
// src/core/sdk-attributes/read-sdk-meta.ts
|
|
48873
|
+
function getSdkMeta() {
|
|
48874
|
+
if (isNonEmptyString(SDK_NAME) && isNonEmptyString(SDK_VERSION)) {
|
|
48875
|
+
return {
|
|
48876
|
+
sdkName: SDK_NAME,
|
|
48877
|
+
sdkVersion: SDK_VERSION,
|
|
48878
|
+
source: "injected"
|
|
48879
|
+
};
|
|
48880
|
+
}
|
|
48881
|
+
const fromPkg = tryReadPackageJson();
|
|
48882
|
+
if (fromPkg) {
|
|
48883
|
+
return {
|
|
48884
|
+
...fromPkg,
|
|
48885
|
+
source: "package.json"
|
|
48886
|
+
};
|
|
48887
|
+
}
|
|
48888
|
+
return {
|
|
48889
|
+
sdkName: "unknown",
|
|
48890
|
+
sdkVersion: "unknown",
|
|
48891
|
+
source: "unknown"
|
|
48892
|
+
};
|
|
48893
|
+
}
|
|
48894
|
+
function isNonEmptyString(value) {
|
|
48895
|
+
return typeof value === "string" && value.length > 0;
|
|
48896
|
+
}
|
|
48897
|
+
function findNearestPackageJson(startDir) {
|
|
48898
|
+
let dir = startDir;
|
|
48899
|
+
while (true) {
|
|
48900
|
+
const candidate = join(dir, "package.json");
|
|
48901
|
+
if (existsSync(candidate)) {
|
|
48902
|
+
return candidate;
|
|
48903
|
+
}
|
|
48904
|
+
const parent = dirname2(dir);
|
|
48905
|
+
if (parent === dir) {
|
|
48906
|
+
return null;
|
|
48907
|
+
}
|
|
48908
|
+
dir = parent;
|
|
48909
|
+
}
|
|
48910
|
+
}
|
|
48911
|
+
function tryReadPackageJson() {
|
|
48912
|
+
try {
|
|
48913
|
+
const here = dirname2(fileURLToPath(import.meta.url));
|
|
48914
|
+
const pkgPath = findNearestPackageJson(here);
|
|
48915
|
+
if (!pkgPath)
|
|
48916
|
+
return null;
|
|
48917
|
+
const raw = readFileSync(pkgPath, "utf8");
|
|
48918
|
+
const pkg = JSON.parse(raw);
|
|
48919
|
+
if (!isNonEmptyString(pkg.name) || !isNonEmptyString(pkg.version)) {
|
|
48920
|
+
return null;
|
|
48921
|
+
}
|
|
48922
|
+
return {
|
|
48923
|
+
sdkName: pkg.name,
|
|
48924
|
+
sdkVersion: pkg.version
|
|
48925
|
+
};
|
|
48926
|
+
} catch {
|
|
48927
|
+
return null;
|
|
48928
|
+
}
|
|
48929
|
+
}
|
|
48930
|
+
|
|
48931
|
+
// src/core/sdk-attributes/get-core-sdk-attributes.ts
|
|
48932
|
+
var coreSdkAttributes = null;
|
|
48933
|
+
function getCoreSdkAttributes() {
|
|
48934
|
+
if (!coreSdkAttributes) {
|
|
48935
|
+
const { sdkName, sdkVersion } = getSdkMeta();
|
|
48936
|
+
const { runtime, runtimeVersion } = detectRuntime();
|
|
48937
|
+
coreSdkAttributes = {
|
|
48938
|
+
version: sdkVersion,
|
|
48939
|
+
language: "js",
|
|
48940
|
+
name: sdkName,
|
|
48941
|
+
runtime,
|
|
48942
|
+
runtimeVersion
|
|
48943
|
+
};
|
|
48944
|
+
}
|
|
48945
|
+
return coreSdkAttributes;
|
|
48946
|
+
}
|
|
48947
|
+
|
|
48745
48948
|
// src/core/tool-approval-request.ts
|
|
48746
48949
|
var REQUEST_TIMEOUT_MS = 1e4;
|
|
48747
48950
|
var logger = deriveSdkLogger(undefined, {
|
|
@@ -49019,16 +49222,25 @@ class ToolRegistry {
|
|
|
49019
49222
|
getRegisteredTool(toolName) {
|
|
49020
49223
|
return this.toolNameToId.get(toolName) ?? null;
|
|
49021
49224
|
}
|
|
49022
|
-
registerTools(
|
|
49023
|
-
|
|
49024
|
-
|
|
49225
|
+
registerTools({
|
|
49226
|
+
tools,
|
|
49227
|
+
sdkAttributes
|
|
49228
|
+
}) {
|
|
49229
|
+
const toolsList = [...tools];
|
|
49230
|
+
if (toolsList.length === 0 && !sdkAttributes) {
|
|
49025
49231
|
this.initialized = Promise.resolve(true);
|
|
49026
49232
|
return;
|
|
49027
49233
|
}
|
|
49028
|
-
this.initialized = this.executeRegisterTools(
|
|
49234
|
+
this.initialized = this.executeRegisterTools({
|
|
49235
|
+
tools: toolsList,
|
|
49236
|
+
sdkAttributes
|
|
49237
|
+
});
|
|
49029
49238
|
this.initialized;
|
|
49030
49239
|
}
|
|
49031
|
-
async executeRegisterTools(
|
|
49240
|
+
async executeRegisterTools({
|
|
49241
|
+
tools,
|
|
49242
|
+
sdkAttributes
|
|
49243
|
+
}) {
|
|
49032
49244
|
try {
|
|
49033
49245
|
const accessToken = await this.getAccessToken();
|
|
49034
49246
|
const response = await fetch(buildRegisterToolsEndpoint(this.apiBaseUrl), {
|
|
@@ -49038,13 +49250,14 @@ class ToolRegistry {
|
|
|
49038
49250
|
"Content-Type": "application/json"
|
|
49039
49251
|
},
|
|
49040
49252
|
body: JSON.stringify({
|
|
49041
|
-
properties:
|
|
49253
|
+
properties: tools.map((property) => ({
|
|
49042
49254
|
name: property.name,
|
|
49043
49255
|
description: property.description,
|
|
49044
49256
|
inputJsonSchema: property.inputJsonSchema,
|
|
49045
49257
|
outputJsonSchema: property.outputJsonSchema,
|
|
49046
49258
|
responseFormat: property.responseFormat
|
|
49047
|
-
}))
|
|
49259
|
+
})),
|
|
49260
|
+
sdk: sdkAttributes
|
|
49048
49261
|
})
|
|
49049
49262
|
});
|
|
49050
49263
|
if (!response.ok) {
|
|
@@ -49065,18 +49278,22 @@ class ToolRegistry {
|
|
|
49065
49278
|
|
|
49066
49279
|
// src/core/frisk.ts
|
|
49067
49280
|
class Frisk {
|
|
49068
|
-
redaction
|
|
49281
|
+
get redaction() {
|
|
49282
|
+
return this._redaction;
|
|
49283
|
+
}
|
|
49284
|
+
_redaction;
|
|
49069
49285
|
apiBaseUrl;
|
|
49070
49286
|
otlpEndpoint;
|
|
49071
49287
|
accessTokenProvider;
|
|
49072
49288
|
initialized = false;
|
|
49073
49289
|
rootLogger;
|
|
49074
49290
|
logger;
|
|
49075
|
-
|
|
49291
|
+
_logLevel;
|
|
49076
49292
|
_adapter;
|
|
49077
49293
|
_friskHandle = null;
|
|
49078
49294
|
_tracingManager = null;
|
|
49079
49295
|
_toolRegistry;
|
|
49296
|
+
sdkAttributes;
|
|
49080
49297
|
wrapToolsCalled = false;
|
|
49081
49298
|
get toolRegistrationComplete() {
|
|
49082
49299
|
if (!this.wrapToolsCalled) {
|
|
@@ -49084,6 +49301,9 @@ class Frisk {
|
|
|
49084
49301
|
}
|
|
49085
49302
|
return this._toolRegistry.initialized;
|
|
49086
49303
|
}
|
|
49304
|
+
get logLevel() {
|
|
49305
|
+
return this._logLevel;
|
|
49306
|
+
}
|
|
49087
49307
|
static async connect(options) {
|
|
49088
49308
|
const instance = new this(options);
|
|
49089
49309
|
await instance.connect();
|
|
@@ -49093,13 +49313,15 @@ class Frisk {
|
|
|
49093
49313
|
this.rootLogger = deriveSdkLogger(options?.logging, {
|
|
49094
49314
|
sdk: "frisk"
|
|
49095
49315
|
});
|
|
49096
|
-
this.
|
|
49316
|
+
this._logLevel = options?.logging?.logLevel;
|
|
49097
49317
|
this.logger = deriveSdkLogger({
|
|
49098
49318
|
logger: this.rootLogger,
|
|
49099
|
-
logLevel: this.
|
|
49319
|
+
logLevel: this._logLevel
|
|
49100
49320
|
}, {
|
|
49101
49321
|
component: "FriskCore"
|
|
49102
49322
|
});
|
|
49323
|
+
this._adapter = options?.adapter ?? new BaseFrameworkAdapter;
|
|
49324
|
+
this.sdkAttributes = this.getSdkAttributes();
|
|
49103
49325
|
const apiKey = options?.apiKey ?? getEnv(FRISK_API_KEY);
|
|
49104
49326
|
if (!apiKey) {
|
|
49105
49327
|
throw new MissingAPIKeyError;
|
|
@@ -49114,7 +49336,7 @@ class Frisk {
|
|
|
49114
49336
|
baseUrl,
|
|
49115
49337
|
logging: {
|
|
49116
49338
|
logger: this.rootLogger,
|
|
49117
|
-
logLevel: this.
|
|
49339
|
+
logLevel: this._logLevel
|
|
49118
49340
|
}
|
|
49119
49341
|
});
|
|
49120
49342
|
this._toolRegistry = new ToolRegistry({
|
|
@@ -49127,8 +49349,7 @@ class Frisk {
|
|
|
49127
49349
|
throw new MissingOtlpEndpointError;
|
|
49128
49350
|
}
|
|
49129
49351
|
this.otlpEndpoint = otlpEndpoint;
|
|
49130
|
-
this.
|
|
49131
|
-
this._adapter = options?.adapter ?? new BaseFrameworkAdapter;
|
|
49352
|
+
this._redaction = resolveRedactionOptions(options?.redact);
|
|
49132
49353
|
}
|
|
49133
49354
|
get friskHandle() {
|
|
49134
49355
|
if (!this._friskHandle) {
|
|
@@ -49166,11 +49387,11 @@ class Frisk {
|
|
|
49166
49387
|
session(metadata) {
|
|
49167
49388
|
const session = new FriskSession({
|
|
49168
49389
|
frisk: this,
|
|
49169
|
-
redact: this.
|
|
49390
|
+
redact: this._redaction,
|
|
49170
49391
|
tracer: this.tracingManager.getTracer(),
|
|
49171
49392
|
logging: {
|
|
49172
49393
|
logger: this.rootLogger,
|
|
49173
|
-
logLevel: this.
|
|
49394
|
+
logLevel: this._logLevel
|
|
49174
49395
|
}
|
|
49175
49396
|
});
|
|
49176
49397
|
const registry2 = SessionRegistry.getInstance();
|
|
@@ -49185,13 +49406,23 @@ class Frisk {
|
|
|
49185
49406
|
const toolList = [...tools];
|
|
49186
49407
|
const registerToolProperties = toolList.map((tool) => this._adapter.extractRegisterToolProperties?.(tool)).filter((properties) => properties !== null && properties !== undefined);
|
|
49187
49408
|
if (registerToolProperties.length > 0) {
|
|
49188
|
-
this._toolRegistry.registerTools(
|
|
49409
|
+
this._toolRegistry.registerTools({
|
|
49410
|
+
tools: registerToolProperties,
|
|
49411
|
+
sdkAttributes: this.sdkAttributes
|
|
49412
|
+
});
|
|
49189
49413
|
}
|
|
49190
49414
|
if (this._adapter.wrapTools) {
|
|
49191
49415
|
return this._adapter.wrapTools(toolList, options);
|
|
49192
49416
|
}
|
|
49193
49417
|
return toolList;
|
|
49194
49418
|
}
|
|
49419
|
+
getSdkAttributes() {
|
|
49420
|
+
return {
|
|
49421
|
+
...getCoreSdkAttributes(),
|
|
49422
|
+
agentFramework: this.adapter.agentFramework ?? null,
|
|
49423
|
+
agentFrameworkVersion: this.adapter.agentFrameworkVersion ?? null
|
|
49424
|
+
};
|
|
49425
|
+
}
|
|
49195
49426
|
wrapTool(tool, options = DefaultWrapToolOptions) {
|
|
49196
49427
|
if (this._adapter.wrapTool) {
|
|
49197
49428
|
return this._adapter.wrapTool(tool, options);
|
|
@@ -49218,7 +49449,7 @@ class Frisk {
|
|
|
49218
49449
|
const argsJson = toolCall.args ? JSON.stringify(removeLlmReasoningArg(toolCall.args)) : null;
|
|
49219
49450
|
const stateJson = agentState ? JSON.stringify(agentState) : null;
|
|
49220
49451
|
const registeredTool = this.getRegisteredTool(toolCall.name);
|
|
49221
|
-
const coreResult = this.friskHandle.process(toolCall.name, registeredTool?.id ?? null, registeredTool?.versionId ?? null, argsJson, stateJson, id, this.
|
|
49452
|
+
const coreResult = this.friskHandle.process(toolCall.name, registeredTool?.id ?? null, registeredTool?.versionId ?? null, argsJson, stateJson, id, this._redaction, traceContextCarrier);
|
|
49222
49453
|
const outcome = coreResult.decision === "allow" ? "allow" /* ALLOW */ : coreResult.decision === "deny" ? "deny" /* DENY */ : coreResult.decision === "escalate" ? "escalate" /* ESCALATE */ : "error" /* ERROR */;
|
|
49223
49454
|
return {
|
|
49224
49455
|
outcome,
|
|
@@ -49283,12 +49514,30 @@ function createFriskToolCallId() {
|
|
|
49283
49514
|
return v4();
|
|
49284
49515
|
}
|
|
49285
49516
|
|
|
49517
|
+
// src/adapters/claude/claude-framework-adapter/get-claude-agent-sdk-version.ts
|
|
49518
|
+
import { createRequire as createRequire3 } from "node:module";
|
|
49519
|
+
var require3 = createRequire3(import.meta.url);
|
|
49520
|
+
var versionSet = false;
|
|
49521
|
+
var version3 = null;
|
|
49522
|
+
function getClaudeAgentSdkVersion() {
|
|
49523
|
+
if (!versionSet) {
|
|
49524
|
+
try {
|
|
49525
|
+
const pkg = require3("@anthropic-ai/claude-agent-sdk/package.json");
|
|
49526
|
+
version3 = typeof pkg.version === "string" ? pkg.version : null;
|
|
49527
|
+
} catch {
|
|
49528
|
+
version3 = null;
|
|
49529
|
+
}
|
|
49530
|
+
versionSet = true;
|
|
49531
|
+
}
|
|
49532
|
+
return version3;
|
|
49533
|
+
}
|
|
49534
|
+
|
|
49286
49535
|
// ../../node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs
|
|
49287
49536
|
import * as fs from "fs";
|
|
49288
49537
|
import { stat as statPromise, open } from "fs/promises";
|
|
49289
|
-
import { join } from "path";
|
|
49538
|
+
import { join as join2 } from "path";
|
|
49290
49539
|
import { homedir } from "os";
|
|
49291
|
-
import { dirname as
|
|
49540
|
+
import { dirname as dirname3, join as join22 } from "path";
|
|
49292
49541
|
import { cwd } from "process";
|
|
49293
49542
|
import { realpathSync as realpathSync2 } from "fs";
|
|
49294
49543
|
import { randomUUID } from "crypto";
|
|
@@ -50978,7 +51227,7 @@ var require_code2 = __commonJS2((exports) => {
|
|
|
50978
51227
|
return allSchemaProperties(schemaMap).filter((p) => !(0, util_1.alwaysValidSchema)(it, schemaMap[p]));
|
|
50979
51228
|
}
|
|
50980
51229
|
exports.schemaProperties = schemaProperties;
|
|
50981
|
-
function callValidateCode({ schemaCode, data, it: { gen, topSchemaRef, schemaPath, errorPath }, it }, func,
|
|
51230
|
+
function callValidateCode({ schemaCode, data, it: { gen, topSchemaRef, schemaPath, errorPath }, it }, func, context3, passSchema) {
|
|
50982
51231
|
const dataAndSchema = passSchema ? (0, codegen_1._)`${schemaCode}, ${data}, ${topSchemaRef}${schemaPath}` : data;
|
|
50983
51232
|
const valCxt = [
|
|
50984
51233
|
[names_1.default.instancePath, (0, codegen_1.strConcat)(names_1.default.instancePath, errorPath)],
|
|
@@ -50989,7 +51238,7 @@ var require_code2 = __commonJS2((exports) => {
|
|
|
50989
51238
|
if (it.opts.dynamicRef)
|
|
50990
51239
|
valCxt.push([names_1.default.dynamicAnchors, names_1.default.dynamicAnchors]);
|
|
50991
51240
|
const args = (0, codegen_1._)`${dataAndSchema}, ${gen.object(...valCxt)}`;
|
|
50992
|
-
return
|
|
51241
|
+
return context3 !== codegen_1.nil ? (0, codegen_1._)`${func}.call(${context3}, ${args})` : (0, codegen_1._)`${func}(${args})`;
|
|
50993
51242
|
}
|
|
50994
51243
|
exports.callValidateCode = callValidateCode;
|
|
50995
51244
|
var newRegExp = (0, codegen_1._)`new RegExp`;
|
|
@@ -56007,7 +56256,7 @@ function shouldShowDebugMessage(message, filter) {
|
|
|
56007
56256
|
return shouldShowDebugCategories(categories, filter);
|
|
56008
56257
|
}
|
|
56009
56258
|
function getClaudeConfigHomeDir() {
|
|
56010
|
-
return process.env.CLAUDE_CONFIG_DIR ??
|
|
56259
|
+
return process.env.CLAUDE_CONFIG_DIR ?? join2(homedir(), ".claude");
|
|
56011
56260
|
}
|
|
56012
56261
|
function isEnvTruthy(envVar) {
|
|
56013
56262
|
if (!envVar)
|
|
@@ -56293,8 +56542,8 @@ function getDebugWriter() {
|
|
|
56293
56542
|
debugWriter = createBufferedWriter({
|
|
56294
56543
|
writeFn: (content) => {
|
|
56295
56544
|
const path = getDebugLogPath();
|
|
56296
|
-
if (!getFsImplementation().existsSync(
|
|
56297
|
-
getFsImplementation().mkdirSync(
|
|
56545
|
+
if (!getFsImplementation().existsSync(dirname3(path))) {
|
|
56546
|
+
getFsImplementation().mkdirSync(dirname3(path));
|
|
56298
56547
|
}
|
|
56299
56548
|
getFsImplementation().appendFileSync(path, content);
|
|
56300
56549
|
updateLatestDebugLogSymlink();
|
|
@@ -56327,7 +56576,7 @@ function logForDebugging(message, { level } = {
|
|
|
56327
56576
|
getDebugWriter().write(output);
|
|
56328
56577
|
}
|
|
56329
56578
|
function getDebugLogPath() {
|
|
56330
|
-
return process.env.CLAUDE_CODE_DEBUG_LOGS_DIR ??
|
|
56579
|
+
return process.env.CLAUDE_CODE_DEBUG_LOGS_DIR ?? join22(getClaudeConfigHomeDir(), "debug", `${getSessionId()}.txt`);
|
|
56331
56580
|
}
|
|
56332
56581
|
var updateLatestDebugLogSymlink = memoize_default(() => {
|
|
56333
56582
|
if (process.argv[2] === "--ripgrep") {
|
|
@@ -56335,8 +56584,8 @@ var updateLatestDebugLogSymlink = memoize_default(() => {
|
|
|
56335
56584
|
}
|
|
56336
56585
|
try {
|
|
56337
56586
|
const debugLogPath = getDebugLogPath();
|
|
56338
|
-
const debugLogsDir =
|
|
56339
|
-
const latestSymlinkPath =
|
|
56587
|
+
const debugLogsDir = dirname3(debugLogPath);
|
|
56588
|
+
const latestSymlinkPath = join22(debugLogsDir, "latest");
|
|
56340
56589
|
if (!getFsImplementation().existsSync(debugLogsDir)) {
|
|
56341
56590
|
getFsImplementation().mkdirSync(debugLogsDir);
|
|
56342
56591
|
}
|
|
@@ -57874,11 +58123,11 @@ function datetimeRegex(args) {
|
|
|
57874
58123
|
regex = `${regex}(${opts.join("|")})`;
|
|
57875
58124
|
return new RegExp(`^${regex}$`);
|
|
57876
58125
|
}
|
|
57877
|
-
function isValidIP(ip,
|
|
57878
|
-
if ((
|
|
58126
|
+
function isValidIP(ip, version4) {
|
|
58127
|
+
if ((version4 === "v4" || !version4) && ipv4Regex.test(ip)) {
|
|
57879
58128
|
return true;
|
|
57880
58129
|
}
|
|
57881
|
-
if ((
|
|
58130
|
+
if ((version4 === "v6" || !version4) && ipv6Regex.test(ip)) {
|
|
57882
58131
|
return true;
|
|
57883
58132
|
}
|
|
57884
58133
|
return false;
|
|
@@ -57905,11 +58154,11 @@ function isValidJWT2(jwt, alg) {
|
|
|
57905
58154
|
return false;
|
|
57906
58155
|
}
|
|
57907
58156
|
}
|
|
57908
|
-
function isValidCidr(ip,
|
|
57909
|
-
if ((
|
|
58157
|
+
function isValidCidr(ip, version4) {
|
|
58158
|
+
if ((version4 === "v4" || !version4) && ipv4CidrRegex.test(ip)) {
|
|
57910
58159
|
return true;
|
|
57911
58160
|
}
|
|
57912
|
-
if ((
|
|
58161
|
+
if ((version4 === "v6" || !version4) && ipv6CidrRegex.test(ip)) {
|
|
57913
58162
|
return true;
|
|
57914
58163
|
}
|
|
57915
58164
|
return false;
|
|
@@ -61527,10 +61776,10 @@ var ksuid2 = /^[A-Za-z0-9]{27}$/;
|
|
|
61527
61776
|
var nanoid2 = /^[a-zA-Z0-9_-]{21}$/;
|
|
61528
61777
|
var duration3 = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;
|
|
61529
61778
|
var guid2 = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/;
|
|
61530
|
-
var uuid3 = (
|
|
61531
|
-
if (!
|
|
61779
|
+
var uuid3 = (version4) => {
|
|
61780
|
+
if (!version4)
|
|
61532
61781
|
return /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/;
|
|
61533
|
-
return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${
|
|
61782
|
+
return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version4}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`);
|
|
61534
61783
|
};
|
|
61535
61784
|
var email2 = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;
|
|
61536
61785
|
var _emoji3 = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
|
|
@@ -61991,7 +62240,7 @@ class Doc2 {
|
|
|
61991
62240
|
`));
|
|
61992
62241
|
}
|
|
61993
62242
|
}
|
|
61994
|
-
var
|
|
62243
|
+
var version4 = {
|
|
61995
62244
|
major: 4,
|
|
61996
62245
|
minor: 0,
|
|
61997
62246
|
patch: 0
|
|
@@ -62001,7 +62250,7 @@ var $ZodType2 = /* @__PURE__ */ $constructor2("$ZodType", (inst, def) => {
|
|
|
62001
62250
|
inst ?? (inst = {});
|
|
62002
62251
|
inst._zod.def = def;
|
|
62003
62252
|
inst._zod.bag = inst._zod.bag || {};
|
|
62004
|
-
inst._zod.version =
|
|
62253
|
+
inst._zod.version = version4;
|
|
62005
62254
|
const checks2 = [...inst._zod.def.checks ?? []];
|
|
62006
62255
|
if (inst._zod.traits.has("$ZodCheck")) {
|
|
62007
62256
|
checks2.unshift(inst);
|
|
@@ -65306,6 +65555,8 @@ function wrapToolWithLlmReasoning(originalTool) {
|
|
|
65306
65555
|
|
|
65307
65556
|
// src/adapters/claude/claude-framework-adapter/claude-framework-adapter.ts
|
|
65308
65557
|
class ClaudeFrameworkAdapter {
|
|
65558
|
+
agentFramework = "@anthropic-ai/claude-agent-sdk";
|
|
65559
|
+
agentFrameworkVersion = getClaudeAgentSdkVersion();
|
|
65309
65560
|
serializeToolArgs(toolArgs, options) {
|
|
65310
65561
|
if (toolArgs == null) {
|
|
65311
65562
|
return { value: null, redactedPaths: [] };
|
|
@@ -65477,5 +65728,5 @@ export {
|
|
|
65477
65728
|
FriskClaude as Frisk
|
|
65478
65729
|
};
|
|
65479
65730
|
|
|
65480
|
-
//# debugId=
|
|
65731
|
+
//# debugId=5119FBBBF820D1B564756E2164756E21
|
|
65481
65732
|
//# sourceMappingURL=index.js.map
|