@armoriq/sdk-dev 0.6.10 → 0.8.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 +168 -1
- package/dist/_version.d.ts +1 -1
- package/dist/_version.d.ts.map +1 -1
- package/dist/_version.js +1 -1
- package/dist/_version.js.map +1 -1
- package/dist/cli/commands/auth.d.ts +12 -0
- package/dist/cli/commands/auth.d.ts.map +1 -1
- package/dist/cli/commands/auth.js +522 -49
- package/dist/cli/commands/auth.js.map +1 -1
- package/dist/client.d.ts +8 -15
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +20 -18
- package/dist/client.js.map +1 -1
- package/dist/config.d.ts +0 -17
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -19
- package/dist/config.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -14
- package/dist/index.js.map +1 -1
- package/dist/integrations/google_adk.d.ts +155 -7
- package/dist/integrations/google_adk.d.ts.map +1 -1
- package/dist/integrations/google_adk.js +727 -46
- package/dist/integrations/google_adk.js.map +1 -1
- package/dist/integrations/langchain.d.ts +48 -2
- package/dist/integrations/langchain.d.ts.map +1 -1
- package/dist/integrations/langchain.js +528 -33
- package/dist/integrations/langchain.js.map +1 -1
- package/dist/integrations/strands.d.ts +65 -1
- package/dist/integrations/strands.d.ts.map +1 -1
- package/dist/integrations/strands.js +456 -36
- package/dist/integrations/strands.js.map +1 -1
- package/dist/models.d.ts +2 -2
- package/dist/models.d.ts.map +1 -1
- package/dist/observability/content-capture.d.ts +103 -0
- package/dist/observability/content-capture.d.ts.map +1 -0
- package/dist/observability/content-capture.js +423 -0
- package/dist/observability/content-capture.js.map +1 -0
- package/dist/observability/index.d.ts +6 -7
- package/dist/observability/index.d.ts.map +1 -1
- package/dist/observability/index.js +18 -27
- package/dist/observability/index.js.map +1 -1
- package/dist/observability/otel-config.d.ts +47 -0
- package/dist/observability/otel-config.d.ts.map +1 -0
- package/dist/observability/otel-config.js +268 -0
- package/dist/observability/otel-config.js.map +1 -0
- package/dist/observability/otel-export-ceiling.d.ts +96 -0
- package/dist/observability/otel-export-ceiling.d.ts.map +1 -0
- package/dist/observability/otel-export-ceiling.js +271 -0
- package/dist/observability/otel-export-ceiling.js.map +1 -0
- package/dist/observability/otel-runtime.d.ts +103 -0
- package/dist/observability/otel-runtime.d.ts.map +1 -0
- package/dist/observability/otel-runtime.js +680 -0
- package/dist/observability/otel-runtime.js.map +1 -0
- package/dist/observability/otel-session.d.ts +168 -0
- package/dist/observability/otel-session.d.ts.map +1 -0
- package/dist/observability/otel-session.js +630 -0
- package/dist/observability/otel-session.js.map +1 -0
- package/dist/observability/otel-shutdown.d.ts +17 -0
- package/dist/observability/otel-shutdown.d.ts.map +1 -0
- package/dist/observability/otel-shutdown.js +54 -0
- package/dist/observability/otel-shutdown.js.map +1 -0
- package/dist/observability/policy-lease.d.ts +22 -0
- package/dist/observability/policy-lease.d.ts.map +1 -0
- package/dist/observability/policy-lease.js +102 -0
- package/dist/observability/policy-lease.js.map +1 -0
- package/dist/plan_builder.d.ts +5 -4
- package/dist/plan_builder.d.ts.map +1 -1
- package/dist/plan_builder.js +14 -15
- package/dist/plan_builder.js.map +1 -1
- package/dist/session.d.ts +61 -93
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +388 -804
- package/dist/session.js.map +1 -1
- package/dist/token_usage.d.ts +11 -18
- package/dist/token_usage.d.ts.map +1 -1
- package/dist/token_usage.js +29 -94
- package/dist/token_usage.js.map +1 -1
- package/dist/tool_name.d.ts +18 -0
- package/dist/tool_name.d.ts.map +1 -0
- package/dist/tool_name.js +29 -0
- package/dist/tool_name.js.map +1 -0
- package/dist/tool_push.d.ts +28 -0
- package/dist/tool_push.d.ts.map +1 -0
- package/dist/tool_push.js +151 -0
- package/dist/tool_push.js.map +1 -0
- package/dist/tool_registry.d.ts +100 -0
- package/dist/tool_registry.d.ts.map +1 -0
- package/dist/tool_registry.js +440 -0
- package/dist/tool_registry.js.map +1 -0
- package/dist/tool_schema.d.ts +22 -0
- package/dist/tool_schema.d.ts.map +1 -0
- package/dist/tool_schema.js +163 -0
- package/dist/tool_schema.js.map +1 -0
- package/package.json +12 -7
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC3D,OAAO,EACL,wBAAwB,EACxB,KAAK,eAAe,EACpB,KAAK,uBAAuB,GAC7B,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,cAAc,EACd,cAAc,EACd,WAAW,EACX,aAAa,EACb,aAAa,GACd,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,uBAAuB,EACvB,sBAAsB,EACtB,qBAAqB,EACrB,mBAAmB,EACnB,iBAAiB,EACjB,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,GACpB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,WAAW,EACX,WAAW,EACX,aAAa,EACb,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,SAAS,EACT,mBAAmB,EACnB,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,QAAQ,EACR,uBAAuB,EACvB,uBAAuB,EACvB,kBAAkB,EAClB,QAAQ,EACR,aAAa,EACb,gBAAgB,GACjB,MAAM,UAAU,CAAC;AAElB,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,aAAa,EACb,cAAc,EACd,QAAQ,EACR,SAAS,GACV,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,cAAc,EACd,WAAW,EACX,aAAa,EACb,WAAW,EACX,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC3D,OAAO,EACL,wBAAwB,EACxB,KAAK,eAAe,EACpB,KAAK,uBAAuB,GAC7B,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,cAAc,EACd,cAAc,EACd,WAAW,EACX,aAAa,EACb,aAAa,GACd,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,uBAAuB,EACvB,sBAAsB,EACtB,qBAAqB,EACrB,mBAAmB,EACnB,iBAAiB,EACjB,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,GACpB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,WAAW,EACX,WAAW,EACX,aAAa,EACb,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,SAAS,EACT,mBAAmB,EACnB,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,QAAQ,EACR,uBAAuB,EACvB,uBAAuB,EACvB,kBAAkB,EAClB,QAAQ,EACR,aAAa,EACb,gBAAgB,GACjB,MAAM,UAAU,CAAC;AAElB,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,aAAa,EACb,cAAc,EACd,QAAQ,EACR,SAAS,GACV,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,cAAc,EACd,WAAW,EACX,aAAa,EACb,WAAW,EACX,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,UAAU,CAAC;AAElB,OAAO,EACL,cAAc,EACd,YAAY,EACZ,uBAAuB,EACvB,WAAW,EACX,iBAAiB,EACjB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,EAC5B,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,uBAAuB,EAC5B,KAAK,gBAAgB,EACrB,KAAK,yBAAyB,EAC9B,uBAAuB,EACvB,4BAA4B,GAC7B,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,eAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,eAAO,MAAM,KAAK,uBAAuB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* against package.json, so it only drifts.
|
|
14
14
|
*/
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
exports.EMAIL = exports.AUTHOR = exports.VERSION = exports.
|
|
16
|
+
exports.EMAIL = exports.AUTHOR = exports.VERSION = exports.splitPrefixedToolName = exports.METADATA_CONTENT_PLACEHOLDER = exports.projectTelemetryContent = exports.resolveOtelConfig = exports.OtelSession = exports.ArmorIQTelemetryRuntime = exports.MODEL_PRICES = exports.computeCostUsd = exports.DEFAULT_PROXY_URL = exports.saveArmorIQConfig = exports.resolveEnvReferences = exports.resolveEnvReference = exports.parseArmorIQConfig = exports.loadArmorIQConfig = exports.ArmorIQConfigError = exports.hashToolCalls = exports.buildPlanFromToolCalls = exports.defaultToolNameParser = exports.IntentToken = exports.PolicyHoldException = exports.PolicyBlockedException = exports.ConfigurationException = exports.RevokedTokenError = exports.DelegationException = exports.TokenExpiredException = exports.MCPInvocationException = exports.IntentMismatchException = exports.InvalidTokenException = exports.ArmorIQException = exports.ArmorIQSession = exports.summarizeTranscriptUsage = exports.ArmorIQUserScope = exports.ArmorIQClient = void 0;
|
|
17
17
|
var client_1 = require("./client");
|
|
18
18
|
Object.defineProperty(exports, "ArmorIQClient", { enumerable: true, get: function () { return client_1.ArmorIQClient; } });
|
|
19
19
|
Object.defineProperty(exports, "ArmorIQUserScope", { enumerable: true, get: function () { return client_1.ArmorIQUserScope; } });
|
|
@@ -46,22 +46,16 @@ Object.defineProperty(exports, "resolveEnvReference", { enumerable: true, get: f
|
|
|
46
46
|
Object.defineProperty(exports, "resolveEnvReferences", { enumerable: true, get: function () { return config_1.resolveEnvReferences; } });
|
|
47
47
|
Object.defineProperty(exports, "saveArmorIQConfig", { enumerable: true, get: function () { return config_1.saveArmorIQConfig; } });
|
|
48
48
|
Object.defineProperty(exports, "DEFAULT_PROXY_URL", { enumerable: true, get: function () { return config_1.DEFAULT_PROXY_URL; } });
|
|
49
|
-
Object.defineProperty(exports, "defaultObservabilityConfig", { enumerable: true, get: function () { return config_1.defaultObservabilityConfig; } });
|
|
50
49
|
var observability_1 = require("./observability");
|
|
51
|
-
Object.defineProperty(exports, "ObservabilityRecorder", { enumerable: true, get: function () { return observability_1.ObservabilityRecorder; } });
|
|
52
|
-
Object.defineProperty(exports, "startTrace", { enumerable: true, get: function () { return observability_1.startTrace; } });
|
|
53
|
-
Object.defineProperty(exports, "endTrace", { enumerable: true, get: function () { return observability_1.endTrace; } });
|
|
54
|
-
Object.defineProperty(exports, "openSpan", { enumerable: true, get: function () { return observability_1.openSpan; } });
|
|
55
|
-
Object.defineProperty(exports, "closeSpan", { enumerable: true, get: function () { return observability_1.closeSpan; } });
|
|
56
|
-
Object.defineProperty(exports, "recordSpan", { enumerable: true, get: function () { return observability_1.recordSpan; } });
|
|
57
|
-
Object.defineProperty(exports, "recordEvent", { enumerable: true, get: function () { return observability_1.recordEvent; } });
|
|
58
|
-
Object.defineProperty(exports, "recordPolicyCall", { enumerable: true, get: function () { return observability_1.recordPolicyCall; } });
|
|
59
|
-
Object.defineProperty(exports, "recordGeneration", { enumerable: true, get: function () { return observability_1.recordGeneration; } });
|
|
60
|
-
Object.defineProperty(exports, "flushObservability", { enumerable: true, get: function () { return observability_1.flushObservability; } });
|
|
61
50
|
Object.defineProperty(exports, "computeCostUsd", { enumerable: true, get: function () { return observability_1.computeCostUsd; } });
|
|
62
|
-
Object.defineProperty(exports, "isValidUuid", { enumerable: true, get: function () { return observability_1.isValidUuid; } });
|
|
63
51
|
Object.defineProperty(exports, "MODEL_PRICES", { enumerable: true, get: function () { return observability_1.MODEL_PRICES; } });
|
|
64
|
-
Object.defineProperty(exports, "
|
|
52
|
+
Object.defineProperty(exports, "ArmorIQTelemetryRuntime", { enumerable: true, get: function () { return observability_1.ArmorIQTelemetryRuntime; } });
|
|
53
|
+
Object.defineProperty(exports, "OtelSession", { enumerable: true, get: function () { return observability_1.OtelSession; } });
|
|
54
|
+
Object.defineProperty(exports, "resolveOtelConfig", { enumerable: true, get: function () { return observability_1.resolveOtelConfig; } });
|
|
55
|
+
Object.defineProperty(exports, "projectTelemetryContent", { enumerable: true, get: function () { return observability_1.projectTelemetryContent; } });
|
|
56
|
+
Object.defineProperty(exports, "METADATA_CONTENT_PLACEHOLDER", { enumerable: true, get: function () { return observability_1.METADATA_CONTENT_PLACEHOLDER; } });
|
|
57
|
+
var tool_name_1 = require("./tool_name");
|
|
58
|
+
Object.defineProperty(exports, "splitPrefixedToolName", { enumerable: true, get: function () { return tool_name_1.splitPrefixedToolName; } });
|
|
65
59
|
var _version_1 = require("./_version");
|
|
66
60
|
Object.defineProperty(exports, "VERSION", { enumerable: true, get: function () { return _version_1.VERSION; } });
|
|
67
61
|
exports.AUTHOR = 'ArmorIQ Team';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;;AAEH,mCAA2D;AAAlD,uGAAA,aAAa,OAAA;AAAE,0GAAA,gBAAgB,OAAA;AACxC,6CAIuB;AAHrB,uHAAA,wBAAwB,OAAA;AAI1B,qCAMmB;AALjB,yGAAA,cAAc,OAAA;AAMhB,2CAWsB;AAVpB,8GAAA,gBAAgB,OAAA;AAChB,mHAAA,qBAAqB,OAAA;AACrB,qHAAA,uBAAuB,OAAA;AACvB,oHAAA,sBAAsB,OAAA;AACtB,mHAAA,qBAAqB,OAAA;AACrB,iHAAA,mBAAmB,OAAA;AACnB,+GAAA,iBAAiB,OAAA;AACjB,oHAAA,sBAAsB,OAAA;AACtB,oHAAA,sBAAsB,OAAA;AACtB,iHAAA,mBAAmB,OAAA;AAErB,mCAmBkB;AAlBhB,qGAAA,WAAW,OAAA;AAoBb,+CAOwB;AANtB,qHAAA,qBAAqB,OAAA;AACrB,sHAAA,sBAAsB,OAAA;AACtB,6GAAA,aAAa,OAAA;AAMf,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;;AAEH,mCAA2D;AAAlD,uGAAA,aAAa,OAAA;AAAE,0GAAA,gBAAgB,OAAA;AACxC,6CAIuB;AAHrB,uHAAA,wBAAwB,OAAA;AAI1B,qCAMmB;AALjB,yGAAA,cAAc,OAAA;AAMhB,2CAWsB;AAVpB,8GAAA,gBAAgB,OAAA;AAChB,mHAAA,qBAAqB,OAAA;AACrB,qHAAA,uBAAuB,OAAA;AACvB,oHAAA,sBAAsB,OAAA;AACtB,mHAAA,qBAAqB,OAAA;AACrB,iHAAA,mBAAmB,OAAA;AACnB,+GAAA,iBAAiB,OAAA;AACjB,oHAAA,sBAAsB,OAAA;AACtB,oHAAA,sBAAsB,OAAA;AACtB,iHAAA,mBAAmB,OAAA;AAErB,mCAmBkB;AAlBhB,qGAAA,WAAW,OAAA;AAoBb,+CAOwB;AANtB,qHAAA,qBAAqB,OAAA;AACrB,sHAAA,sBAAsB,OAAA;AACtB,6GAAA,aAAa,OAAA;AAMf,mCAiBkB;AAfhB,4GAAA,kBAAkB,OAAA;AASlB,2GAAA,iBAAiB,OAAA;AACjB,4GAAA,kBAAkB,OAAA;AAClB,6GAAA,mBAAmB,OAAA;AACnB,8GAAA,oBAAoB,OAAA;AACpB,2GAAA,iBAAiB,OAAA;AACjB,2GAAA,iBAAiB,OAAA;AAGnB,iDAgCyB;AA/BvB,+GAAA,cAAc,OAAA;AACd,6GAAA,YAAY,OAAA;AACZ,wHAAA,uBAAuB,OAAA;AACvB,4GAAA,WAAW,OAAA;AACX,kHAAA,iBAAiB,OAAA;AAyBjB,wHAAA,uBAAuB,OAAA;AACvB,6HAAA,4BAA4B,OAAA;AAG9B,yCAAoD;AAA3C,kHAAA,qBAAqB,OAAA;AAC9B,uCAAqC;AAA5B,mGAAA,OAAO,OAAA;AACH,QAAA,MAAM,GAAG,cAAc,CAAC;AACxB,QAAA,KAAK,GAAG,oBAAoB,CAAC"}
|
|
@@ -32,6 +32,7 @@ import { ArmorIQClient, ArmorIQUserScope } from '../client';
|
|
|
32
32
|
import { ArmorIQSession, SessionMode } from '../session';
|
|
33
33
|
import { ToolNameParser } from '../plan_builder';
|
|
34
34
|
import { OnEvent } from './strands';
|
|
35
|
+
import type { OtelTerminalStatus } from '../observability';
|
|
35
36
|
export interface ArmorIQADKOptions {
|
|
36
37
|
apiKey: string;
|
|
37
38
|
backendEndpoint?: string;
|
|
@@ -71,9 +72,17 @@ export type AdkCallback = (...args: any[]) => any;
|
|
|
71
72
|
* compiler from catching the next ADK contract drift.
|
|
72
73
|
*/
|
|
73
74
|
export interface AdkLikeAgent {
|
|
75
|
+
beforeModelCallback?: AdkCallback | AdkCallback[];
|
|
74
76
|
afterModelCallback?: AdkCallback | AdkCallback[];
|
|
75
77
|
beforeToolCallback?: AdkCallback | AdkCallback[];
|
|
76
78
|
afterToolCallback?: AdkCallback | AdkCallback[];
|
|
79
|
+
runAsync?: (...args: any[]) => AsyncIterable<unknown>;
|
|
80
|
+
/**
|
|
81
|
+
* ADK's BaseAgent sets this when the agent is added as a subAgent of a
|
|
82
|
+
* composed workflow (SequentialAgent, ParallelAgent, ...). Optional so any
|
|
83
|
+
* duck-typed caller that never composes agents installs exactly as before.
|
|
84
|
+
*/
|
|
85
|
+
parentAgent?: AdkLikeAgent;
|
|
77
86
|
}
|
|
78
87
|
/**
|
|
79
88
|
* Process-wide ArmorIQ factory for ADK-style agents.
|
|
@@ -113,11 +122,51 @@ export declare class ArmorIQADKBundle {
|
|
|
113
122
|
private parser;
|
|
114
123
|
private planMinted;
|
|
115
124
|
private pendingPlanCapture?;
|
|
116
|
-
|
|
117
|
-
private
|
|
125
|
+
/** Terminal enforcement state keyed by ADK's native functionCallId. */
|
|
126
|
+
private blockedCalls;
|
|
127
|
+
/**
|
|
128
|
+
* Legacy duck-typed callers may omit functionCallId. Keep a FIFO fallback
|
|
129
|
+
* for those callers; real ADK 0.6.1 always supplies the native id.
|
|
130
|
+
*/
|
|
131
|
+
private anonymousBlockedCalls;
|
|
132
|
+
private nextAnonymousCallOrdinal;
|
|
133
|
+
private modelSpans;
|
|
134
|
+
private toolSpans;
|
|
135
|
+
/** Model output is scoped by ADK's native invocation key. A scalar leaks a
|
|
136
|
+
* concurrent invocation's result into another span/root. */
|
|
137
|
+
private readonly modelOutputs;
|
|
138
|
+
/**
|
|
139
|
+
* Root/session output per invocation. Defaults to the raw model output
|
|
140
|
+
* (mirrors modelOutputs) but the PAP rejection branch overwrites the entry
|
|
141
|
+
* — never modelOutputs — with the safe response ADK actually returns, so
|
|
142
|
+
* root/session telemetry exports what the caller really got back instead
|
|
143
|
+
* of the blocked content.
|
|
144
|
+
*/
|
|
145
|
+
private readonly rootOutputs;
|
|
146
|
+
private toolOrdinals;
|
|
147
|
+
private nextToolOrdinal;
|
|
148
|
+
private nextInvocationOrdinal;
|
|
149
|
+
private closed;
|
|
150
|
+
private closePromise?;
|
|
118
151
|
private onEvent?;
|
|
119
152
|
private agent?;
|
|
120
|
-
|
|
153
|
+
/**
|
|
154
|
+
* The agent whose runAsync actually got the close-on-completion wrapper.
|
|
155
|
+
* Usually the installed agent itself; when the installed agent is a child
|
|
156
|
+
* of a composed workflow (see install()) this is the outermost ancestor,
|
|
157
|
+
* so uninstall() must restore runAsync on THIS object, not on the
|
|
158
|
+
* installed agent.
|
|
159
|
+
*/
|
|
160
|
+
private runAsyncOwner?;
|
|
161
|
+
/**
|
|
162
|
+
* Set while `runAsyncOwner` is only a provisional owner (the installed
|
|
163
|
+
* agent had no `parentAgent` yet at install() time). Holds the agent whose
|
|
164
|
+
* `parentAgent` property we replaced with an accessor so we notice if ADK
|
|
165
|
+
* composes it into a parent *after* install() — see watchForLateParent().
|
|
166
|
+
*/
|
|
167
|
+
private parentWatchTarget?;
|
|
168
|
+
/** The agent whose callback slots this bundle last wrote. */
|
|
169
|
+
private callbackAgent?;
|
|
121
170
|
constructor(args: {
|
|
122
171
|
factory: ArmorIQADK;
|
|
123
172
|
scope: ArmorIQUserScope;
|
|
@@ -135,15 +184,114 @@ export declare class ArmorIQADKBundle {
|
|
|
135
184
|
private ensureSession;
|
|
136
185
|
private capturePlan;
|
|
137
186
|
/** End and ship the request-owned plan session without closing the shared client. */
|
|
138
|
-
close(status?:
|
|
187
|
+
close(status?: OtelTerminalStatus): Promise<void>;
|
|
188
|
+
private closeInternal;
|
|
139
189
|
private afterModel;
|
|
190
|
+
/** ADK resolves toolsets on every model step, so a changed tool set is visible here. */
|
|
191
|
+
private refreshDeclarations;
|
|
192
|
+
private beforeModel;
|
|
193
|
+
private modelKey;
|
|
194
|
+
private toolOrdinal;
|
|
195
|
+
private frameworkMcpOperation;
|
|
196
|
+
private anonymousCallFingerprint;
|
|
197
|
+
/**
|
|
198
|
+
* The fallback is only for legacy duck-typed callers. Keep the diagnostic
|
|
199
|
+
* fixed and once per process so it cannot leak tool data or flood host logs.
|
|
200
|
+
*/
|
|
201
|
+
private warnFunctionCallIdFallback;
|
|
202
|
+
private callKeyForBefore;
|
|
203
|
+
private callKeyForAfter;
|
|
204
|
+
private rememberBlockedCall;
|
|
140
205
|
private beforeTool;
|
|
141
206
|
private afterTool;
|
|
207
|
+
/** Attach this bundle to an ADK-style agent. */
|
|
208
|
+
install(agent: AdkLikeAgent): this;
|
|
142
209
|
/**
|
|
143
|
-
*
|
|
144
|
-
*
|
|
210
|
+
* Chained in front of the agent's pre-ArmorIQ callbacks, not in front of
|
|
211
|
+
* whatever is in the slot now. See `callbackRegistrations`. runAsync is
|
|
212
|
+
* wrapped separately, on the invocation owner rather than on the agent.
|
|
145
213
|
*/
|
|
146
|
-
|
|
214
|
+
private installCallbacks;
|
|
215
|
+
/**
|
|
216
|
+
* Subscribe this bundle to the close-on-completion wrapper for `owner`,
|
|
217
|
+
* installing that wrapper if this is the first bundle to claim the owner.
|
|
218
|
+
*
|
|
219
|
+
* There is exactly one wrapper per owner (see `runAsyncRegistrations`), so
|
|
220
|
+
* a second bundle resolving the same owner joins the existing wrapper's
|
|
221
|
+
* subscriber set rather than layering a second wrapper on top of the first.
|
|
222
|
+
* That keeps the true pre-wrap `runAsync` recoverable regardless of the
|
|
223
|
+
* order bundles later unsubscribe in, and means no inert wrapper can be
|
|
224
|
+
* left behind to retain a torn-down bundle.
|
|
225
|
+
*/
|
|
226
|
+
private bindFinalizer;
|
|
227
|
+
/**
|
|
228
|
+
* Drop this bundle from its owner's wrapper subscriber set. The shared
|
|
229
|
+
* wrapper stays in place while any sibling bundle still needs it; only when
|
|
230
|
+
* the set drains does the owner get its TRUE pre-wrap `runAsync` back — the
|
|
231
|
+
* one recorded at registration time, never a snapshot of whatever happened
|
|
232
|
+
* to be installed when this particular bundle bound. Uninstall order is
|
|
233
|
+
* therefore irrelevant, and no wrapper survives an owner's last subscriber.
|
|
234
|
+
*/
|
|
235
|
+
private unsubscribeRunAsync;
|
|
236
|
+
/**
|
|
237
|
+
* Release this bundle from both owner-keyed structures, so neither can be
|
|
238
|
+
* left holding it because only the other was released.
|
|
239
|
+
*
|
|
240
|
+
* The agent-keyed callback registry is deliberately NOT released here: it
|
|
241
|
+
* must survive close so a late tool call still meets `beforeTool`'s
|
|
242
|
+
* fail-closed refusal. Only uninstall() releases it.
|
|
243
|
+
*/
|
|
244
|
+
private releaseFromOwners;
|
|
245
|
+
/**
|
|
246
|
+
* Put the agent's four callback slots back the way they were before ArmorIQ
|
|
247
|
+
* touched them, but only while this bundle still occupies them.
|
|
248
|
+
*
|
|
249
|
+
* A later bundle that installed over this one owns the slots now, so
|
|
250
|
+
* unwinding here would tear out live enforcement; that bundle's own release
|
|
251
|
+
* restores the same recorded originals when its turn comes, which is why
|
|
252
|
+
* uninstall order cannot matter. Each slot is compared against exactly what
|
|
253
|
+
* we wrote, so a callback the application replaced afterwards is left alone
|
|
254
|
+
* (the same guard `unsubscribeRunAsync()` applies to `runAsync`).
|
|
255
|
+
*
|
|
256
|
+
* Deliberately NOT called from closeInternal(). A closed bundle's callbacks
|
|
257
|
+
* stay installed so a tool call arriving after the request ended still meets
|
|
258
|
+
* `beforeTool`'s fail-closed refusal instead of reaching the application's
|
|
259
|
+
* unguarded callbacks. That leaves at most the one current bundle reachable
|
|
260
|
+
* from the agent, which the next install() replaces.
|
|
261
|
+
*/
|
|
262
|
+
private releaseCallbacks;
|
|
263
|
+
/**
|
|
264
|
+
* Replace `agent.parentAgent` with an accessor so we notice the moment ADK
|
|
265
|
+
* (or application code) assigns a real parent to it — which happens
|
|
266
|
+
* strictly before that parent's own runAsync can be invoked, since ADK
|
|
267
|
+
* always finishes composing a tree before running it. When that happens,
|
|
268
|
+
* re-bind the finalizer to the *new* outermost owner instead, so an
|
|
269
|
+
* install()-before-composition call ends up wrapping the same object
|
|
270
|
+
* install()-after-composition would have.
|
|
271
|
+
*
|
|
272
|
+
* Static, and keyed by `owner` (via `lateParentSubscribers`) rather than by
|
|
273
|
+
* `bundle`, because more than one bundle can resolve the same owner (see
|
|
274
|
+
* the registry doc comment above) — at most one accessor is ever installed
|
|
275
|
+
* per owner, and its setter fans out to every subscribed bundle.
|
|
276
|
+
*/
|
|
277
|
+
private static watchForLateParent;
|
|
278
|
+
private handleLateParent;
|
|
279
|
+
/**
|
|
280
|
+
* Stop watching `agent` for a late parent assignment on this bundle's
|
|
281
|
+
* behalf — used by uninstall() when the late parent never arrived. Removes
|
|
282
|
+
* only this bundle from the shared subscriber set; the accessor is only
|
|
283
|
+
* torn down (restored to a plain property) once no bundle is left
|
|
284
|
+
* watching it, so unwinding one bundle never disturbs another bundle still
|
|
285
|
+
* watching the same owner.
|
|
286
|
+
*/
|
|
287
|
+
private restoreParentWatcher;
|
|
288
|
+
/**
|
|
289
|
+
* Walk ADK's public `parentAgent` link to the outermost agent that owns
|
|
290
|
+
* this invocation. An agent installed directly on a root (the common case,
|
|
291
|
+
* and every existing call site) resolves to itself, so behavior there is
|
|
292
|
+
* unchanged.
|
|
293
|
+
*/
|
|
294
|
+
private static invocationOwner;
|
|
147
295
|
uninstall(agent?: AdkLikeAgent): void;
|
|
148
296
|
}
|
|
149
297
|
//# sourceMappingURL=google_adk.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"google_adk.d.ts","sourceRoot":"","sources":["../../src/integrations/google_adk.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;
|
|
1
|
+
{"version":3,"file":"google_adk.d.ts","sourceRoot":"","sources":["../../src/integrations/google_adk.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAIH,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE5D,OAAO,EAAE,cAAc,EAAiB,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