@armoriq/sdk-dev 0.0.1 → 0.2.12
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/client.d.ts +30 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +108 -1
- package/dist/client.js.map +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -3
- package/dist/index.js.map +1 -1
- package/dist/integrations/anthropic.d.ts +18 -0
- package/dist/integrations/anthropic.d.ts.map +1 -0
- package/dist/integrations/anthropic.js +27 -0
- package/dist/integrations/anthropic.js.map +1 -0
- package/dist/integrations/crewai.d.ts +68 -0
- package/dist/integrations/crewai.d.ts.map +1 -0
- package/dist/integrations/crewai.js +178 -0
- package/dist/integrations/crewai.js.map +1 -0
- package/dist/integrations/google-adk.d.ts +64 -0
- package/dist/integrations/google-adk.d.ts.map +1 -0
- package/dist/integrations/google-adk.js +170 -0
- package/dist/integrations/google-adk.js.map +1 -0
- package/dist/integrations/index.d.ts +29 -0
- package/dist/integrations/index.d.ts.map +1 -0
- package/dist/integrations/index.js +37 -0
- package/dist/integrations/index.js.map +1 -0
- package/dist/integrations/langchain.d.ts +20 -0
- package/dist/integrations/langchain.d.ts.map +1 -0
- package/dist/integrations/langchain.js +28 -0
- package/dist/integrations/langchain.js.map +1 -0
- package/dist/integrations/openai.d.ts +19 -0
- package/dist/integrations/openai.d.ts.map +1 -0
- package/dist/integrations/openai.js +28 -0
- package/dist/integrations/openai.js.map +1 -0
- package/dist/models.d.ts +36 -0
- package/dist/models.d.ts.map +1 -1
- package/dist/plan-builder.d.ts +36 -0
- package/dist/plan-builder.d.ts.map +1 -0
- package/dist/plan-builder.js +98 -0
- package/dist/plan-builder.js.map +1 -0
- package/dist/session.d.ts +50 -0
- package/dist/session.d.ts.map +1 -0
- package/dist/session.js +93 -0
- package/dist/session.js.map +1 -0
- package/package.json +45 -1
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* ArmorIQ — CrewAI integration.
|
|
4
|
+
*
|
|
5
|
+
* Port of armoriq_sdk.integrations.crewai (Python). CrewAI is
|
|
6
|
+
* primarily a Python framework; this TS integration works against the
|
|
7
|
+
* experimental `@crewaijs/crewai` npm port.
|
|
8
|
+
*
|
|
9
|
+
* Pattern (same as Python):
|
|
10
|
+
* 1. Collect every tool from the crew's agents that exposes `.mcp`
|
|
11
|
+
* and `.action` properties (these are the Armoriq-bound tools).
|
|
12
|
+
* 2. Build a plan and mint an intent token via ArmorIQSession.
|
|
13
|
+
* 3. Patch each tool's `_run` (or `invoke`) to route through the
|
|
14
|
+
* Armoriq proxy via `session.dispatch`.
|
|
15
|
+
* 4. Restore the originals after kickoff.
|
|
16
|
+
*
|
|
17
|
+
* Usage:
|
|
18
|
+
*
|
|
19
|
+
* import { ArmorIQCrew } from '@armoriq/sdk-dev/integrations/crewai';
|
|
20
|
+
*
|
|
21
|
+
* const crew = new ArmorIQCrew({
|
|
22
|
+
* agents: [...], tasks: [...],
|
|
23
|
+
* armoriqClient: client,
|
|
24
|
+
* llm: 'gpt-4o',
|
|
25
|
+
* });
|
|
26
|
+
* const result = await crew.kickoff();
|
|
27
|
+
*
|
|
28
|
+
* If `crewai` (the JS port) is not installed, instantiation throws
|
|
29
|
+
* with install instructions — matching the Python behavior.
|
|
30
|
+
*/
|
|
31
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
+
exports.ArmorIQCrew = void 0;
|
|
33
|
+
function tryRequireCrewai() {
|
|
34
|
+
try {
|
|
35
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
36
|
+
return require('crewai');
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
try {
|
|
40
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
41
|
+
return require('@crewaijs/crewai');
|
|
42
|
+
}
|
|
43
|
+
catch (err) {
|
|
44
|
+
throw new Error('crewai is not installed.\n' +
|
|
45
|
+
'Install a CrewAI JS port: npm install crewai (or @crewaijs/crewai).\n' +
|
|
46
|
+
`Underlying error: ${err?.message ?? err}`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
function collectArmoriqTools(agents) {
|
|
51
|
+
const seen = new Set();
|
|
52
|
+
const tools = [];
|
|
53
|
+
for (const agent of agents) {
|
|
54
|
+
for (const tool of agent?.tools ?? []) {
|
|
55
|
+
if (tool && typeof tool.mcp === 'string' && typeof tool.action === 'string') {
|
|
56
|
+
if (!seen.has(tool)) {
|
|
57
|
+
seen.add(tool);
|
|
58
|
+
tools.push(tool);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return tools;
|
|
64
|
+
}
|
|
65
|
+
function buildToolCalls(tools) {
|
|
66
|
+
const seen = new Set();
|
|
67
|
+
const out = [];
|
|
68
|
+
for (const t of tools) {
|
|
69
|
+
const key = `${t.mcp}__${t.action}`;
|
|
70
|
+
if (!seen.has(key)) {
|
|
71
|
+
seen.add(key);
|
|
72
|
+
out.push({ name: key, args: {} });
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return out;
|
|
76
|
+
}
|
|
77
|
+
function deriveGoal(tasks) {
|
|
78
|
+
const parts = [];
|
|
79
|
+
for (const t of tasks) {
|
|
80
|
+
const d = t.description ?? t.expected_output;
|
|
81
|
+
if (d)
|
|
82
|
+
parts.push(d);
|
|
83
|
+
}
|
|
84
|
+
return parts.length ? parts.join(' ') : 'Execute crew tasks';
|
|
85
|
+
}
|
|
86
|
+
class ArmorIQCrew {
|
|
87
|
+
crew;
|
|
88
|
+
armoriqClient;
|
|
89
|
+
llm;
|
|
90
|
+
validitySeconds;
|
|
91
|
+
agents;
|
|
92
|
+
tasks;
|
|
93
|
+
session = null;
|
|
94
|
+
constructor(options) {
|
|
95
|
+
const crewai = tryRequireCrewai();
|
|
96
|
+
const Crew = crewai.Crew ?? crewai.default?.Crew;
|
|
97
|
+
if (!Crew) {
|
|
98
|
+
throw new Error('The installed crewai package does not export a Crew class.');
|
|
99
|
+
}
|
|
100
|
+
const { armoriqClient, llm, tokenValiditySeconds, agents, tasks, ...rest } = options;
|
|
101
|
+
this.armoriqClient = armoriqClient;
|
|
102
|
+
this.llm = llm ?? 'agent';
|
|
103
|
+
this.validitySeconds = tokenValiditySeconds ?? 3600;
|
|
104
|
+
this.agents = agents;
|
|
105
|
+
this.tasks = tasks;
|
|
106
|
+
this.crew = new Crew({ agents, tasks, ...rest });
|
|
107
|
+
}
|
|
108
|
+
async issueToken() {
|
|
109
|
+
const tools = collectArmoriqTools(this.agents);
|
|
110
|
+
if (tools.length === 0) {
|
|
111
|
+
// eslint-disable-next-line no-console
|
|
112
|
+
console.warn('[ArmorIQCrew] No ArmorIQ tools found; crew runs without ArmorIQ verification.');
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
115
|
+
const toolCalls = buildToolCalls(tools);
|
|
116
|
+
const session = this.armoriqClient.startSession({
|
|
117
|
+
llm: this.llm,
|
|
118
|
+
validitySeconds: this.validitySeconds,
|
|
119
|
+
});
|
|
120
|
+
await session.startPlan(toolCalls, { goal: deriveGoal(this.tasks) });
|
|
121
|
+
return session;
|
|
122
|
+
}
|
|
123
|
+
patchTools(session) {
|
|
124
|
+
const restorers = [];
|
|
125
|
+
const patched = new Set();
|
|
126
|
+
for (const agent of this.agents) {
|
|
127
|
+
for (const tool of agent?.tools ?? []) {
|
|
128
|
+
if (!patched.has(tool) &&
|
|
129
|
+
typeof tool.mcp === 'string' &&
|
|
130
|
+
typeof tool.action === 'string') {
|
|
131
|
+
patched.add(tool);
|
|
132
|
+
const original = tool._run ?? tool.invoke;
|
|
133
|
+
const method = tool.invoke ? 'invoke' : '_run';
|
|
134
|
+
// Use a typed route through Armoriq.
|
|
135
|
+
const wrapped = async (...args) => {
|
|
136
|
+
const params = (args[0] && typeof args[0] === 'object') ? args[0] : {};
|
|
137
|
+
const result = await session.dispatch(`${tool.mcp}__${tool.action}`, params);
|
|
138
|
+
return typeof result === 'string' ? result : JSON.stringify(result);
|
|
139
|
+
};
|
|
140
|
+
try {
|
|
141
|
+
tool[method] = wrapped;
|
|
142
|
+
}
|
|
143
|
+
catch {
|
|
144
|
+
Object.defineProperty(tool, method, { value: wrapped, writable: true });
|
|
145
|
+
}
|
|
146
|
+
restorers.push(() => {
|
|
147
|
+
try {
|
|
148
|
+
tool[method] = original;
|
|
149
|
+
}
|
|
150
|
+
catch {
|
|
151
|
+
Object.defineProperty(tool, method, { value: original, writable: true });
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
return restorers;
|
|
158
|
+
}
|
|
159
|
+
async kickoff(inputs) {
|
|
160
|
+
this.session = await this.issueToken();
|
|
161
|
+
const restorers = this.session ? this.patchTools(this.session) : [];
|
|
162
|
+
try {
|
|
163
|
+
if (typeof this.crew.kickoff === 'function') {
|
|
164
|
+
return await this.crew.kickoff(inputs);
|
|
165
|
+
}
|
|
166
|
+
throw new Error('The installed crewai Crew has no kickoff() method.');
|
|
167
|
+
}
|
|
168
|
+
finally {
|
|
169
|
+
for (const r of restorers)
|
|
170
|
+
r();
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
get crewaiCrew() {
|
|
174
|
+
return this.crew;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
exports.ArmorIQCrew = ArmorIQCrew;
|
|
178
|
+
//# sourceMappingURL=crewai.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crewai.js","sourceRoot":"","sources":["../../src/integrations/crewai.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;;;AAkCH,SAAS,gBAAgB;IACvB,IAAI,CAAC;QACH,8DAA8D;QAC9D,OAAO,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC3B,CAAC;IAA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,EAAE,CAAC,CAAC;wBAC3E,CAAC;oBACH,CAAC,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;QACH,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,MAA4B;QACxC,IAAI,CAAC,OAAO,GAAG,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;QACvC,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACpE,IAAI,CAAC;YACH,IAAI,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,KAAK,UAAU,EAAE,CAAC;gBAC5C,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;YACzC,CAAC;YACD,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;QACxE,CAAC;gBAAS,CAAC;YACT,KAAK,MAAM,CAAC,IAAI,SAAS;gBAAE,CAAC,EAAE,CAAC;QACjC,CAAC;IACH,CAAC;IAED,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;CACF;AAxGD,kCAwGC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ArmorIQ — Google ADK integration.
|
|
3
|
+
*
|
|
4
|
+
* Wraps the SDK as an ADK `BasePlugin`. Plugin instance is passed to
|
|
5
|
+
* `Runner` (or `InMemoryRunner`) via `plugins: [...]`. End-user agent
|
|
6
|
+
* code is unchanged from a plain ADK setup except for:
|
|
7
|
+
* 1. one extra import
|
|
8
|
+
* 2. one `new ArmorIQADK({ ... })` line
|
|
9
|
+
* 3. passing it into the runner's `plugins` array
|
|
10
|
+
* 4. pointing MCPToolset at the Armoriq proxy URL instead of stdio
|
|
11
|
+
*
|
|
12
|
+
* Usage:
|
|
13
|
+
*
|
|
14
|
+
* import { LlmAgent, MCPToolset, InMemoryRunner } from '@google/adk';
|
|
15
|
+
* import { ArmorIQADK } from '@armoriq/sdk-dev/integrations/google-adk';
|
|
16
|
+
*
|
|
17
|
+
* const armoriq = new ArmorIQADK({ apiKey: API_KEY, proxyUrl: PROXY_URL });
|
|
18
|
+
*
|
|
19
|
+
* const agent = new LlmAgent({
|
|
20
|
+
* model: 'gemini-2.5-flash',
|
|
21
|
+
* name: 'stripe_agent',
|
|
22
|
+
* instruction: 'You are a Stripe assistant.',
|
|
23
|
+
* tools: [new MCPToolset({ ... `${PROXY_URL}/mcp/Stripe` ... })],
|
|
24
|
+
* });
|
|
25
|
+
*
|
|
26
|
+
* const runner = new InMemoryRunner({ agent, plugins: [armoriq] });
|
|
27
|
+
*
|
|
28
|
+
* Requires: `npm install @google/adk` alongside `@armoriq/sdk`.
|
|
29
|
+
* `@google/adk` is declared as an optional peer dep so users who don't
|
|
30
|
+
* use ADK don't pay for it.
|
|
31
|
+
*/
|
|
32
|
+
import { ArmorIQClient } from '../client';
|
|
33
|
+
import { McpCredentialMap } from '../models';
|
|
34
|
+
import { ToolNameParser } from '../plan-builder';
|
|
35
|
+
export interface ArmorIQADKOptions {
|
|
36
|
+
/** Pass an existing ArmorIQClient, OR provide apiKey to construct one. */
|
|
37
|
+
client?: ArmorIQClient;
|
|
38
|
+
apiKey?: string;
|
|
39
|
+
proxyUrl?: string;
|
|
40
|
+
userId?: string;
|
|
41
|
+
agentId?: string;
|
|
42
|
+
/** Per-MCP runtime credentials; usually loaded from env automatically. */
|
|
43
|
+
mcpCredentials?: McpCredentialMap;
|
|
44
|
+
/** Used when ADK tool names aren't namespaced as `<MCP>__<action>`. */
|
|
45
|
+
defaultMcpName?: string;
|
|
46
|
+
/** Override the default `<MCP>__<action>` parser. */
|
|
47
|
+
toolNameParser?: ToolNameParser;
|
|
48
|
+
/** LLM identifier recorded on the captured plan (audit only). */
|
|
49
|
+
llm?: string;
|
|
50
|
+
/** Token validity in seconds (default 3600). */
|
|
51
|
+
validitySeconds?: number;
|
|
52
|
+
/** Plugin name for ADK's plugin registry (default 'armoriq'). */
|
|
53
|
+
pluginName?: string;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Public class. Constructed lazily so importing this module doesn't
|
|
57
|
+
* trigger the @google/adk lookup until the user actually instantiates.
|
|
58
|
+
*
|
|
59
|
+
* Use:
|
|
60
|
+
* const armoriq = new ArmorIQADK({ apiKey, proxyUrl });
|
|
61
|
+
* const runner = new InMemoryRunner({ agent, plugins: [armoriq] });
|
|
62
|
+
*/
|
|
63
|
+
export declare const ArmorIQADK: new (opts: ArmorIQADKOptions) => any;
|
|
64
|
+
//# sourceMappingURL=google-adk.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"google-adk.d.ts","sourceRoot":"","sources":["../../src/integrations/google-adk.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EAAE,gBAAgB,EAAY,MAAM,WAAW,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAgCjD,MAAM,WAAW,iBAAiB;IAChC,0EAA0E;IAC1E,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,0EAA0E;IAC1E,cAAc,CAAC,EAAE,gBAAgB,CAAC;IAClC,uEAAuE;IACvE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,qDAAqD;IACrD,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,iEAAiE;IACjE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,gDAAgD;IAChD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,iEAAiE;IACjE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAkHD;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU,EAAE,KAAK,IAAI,EAAE,iBAAiB,KAAK,GAQlD,CAAC"}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* ArmorIQ — Google ADK integration.
|
|
4
|
+
*
|
|
5
|
+
* Wraps the SDK as an ADK `BasePlugin`. Plugin instance is passed to
|
|
6
|
+
* `Runner` (or `InMemoryRunner`) via `plugins: [...]`. End-user agent
|
|
7
|
+
* code is unchanged from a plain ADK setup except for:
|
|
8
|
+
* 1. one extra import
|
|
9
|
+
* 2. one `new ArmorIQADK({ ... })` line
|
|
10
|
+
* 3. passing it into the runner's `plugins` array
|
|
11
|
+
* 4. pointing MCPToolset at the Armoriq proxy URL instead of stdio
|
|
12
|
+
*
|
|
13
|
+
* Usage:
|
|
14
|
+
*
|
|
15
|
+
* import { LlmAgent, MCPToolset, InMemoryRunner } from '@google/adk';
|
|
16
|
+
* import { ArmorIQADK } from '@armoriq/sdk-dev/integrations/google-adk';
|
|
17
|
+
*
|
|
18
|
+
* const armoriq = new ArmorIQADK({ apiKey: API_KEY, proxyUrl: PROXY_URL });
|
|
19
|
+
*
|
|
20
|
+
* const agent = new LlmAgent({
|
|
21
|
+
* model: 'gemini-2.5-flash',
|
|
22
|
+
* name: 'stripe_agent',
|
|
23
|
+
* instruction: 'You are a Stripe assistant.',
|
|
24
|
+
* tools: [new MCPToolset({ ... `${PROXY_URL}/mcp/Stripe` ... })],
|
|
25
|
+
* });
|
|
26
|
+
*
|
|
27
|
+
* const runner = new InMemoryRunner({ agent, plugins: [armoriq] });
|
|
28
|
+
*
|
|
29
|
+
* Requires: `npm install @google/adk` alongside `@armoriq/sdk`.
|
|
30
|
+
* `@google/adk` is declared as an optional peer dep so users who don't
|
|
31
|
+
* use ADK don't pay for it.
|
|
32
|
+
*/
|
|
33
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
34
|
+
exports.ArmorIQADK = void 0;
|
|
35
|
+
const client_1 = require("../client");
|
|
36
|
+
let _BasePluginCache = null;
|
|
37
|
+
function loadBasePlugin() {
|
|
38
|
+
if (_BasePluginCache)
|
|
39
|
+
return _BasePluginCache;
|
|
40
|
+
try {
|
|
41
|
+
// Try multiple resolution strategies. The SDK is a dependency of
|
|
42
|
+
// the consumer, so `require('@google/adk')` from here resolves in
|
|
43
|
+
// the SDK's own node_modules (where the package isn't installed).
|
|
44
|
+
// We use createRequire from the consumer's working directory so the
|
|
45
|
+
// lookup walks the consumer's node_modules tree instead.
|
|
46
|
+
const { createRequire } = require('module');
|
|
47
|
+
const consumerRequire = createRequire(process.cwd() + '/package.json');
|
|
48
|
+
const adk = consumerRequire('@google/adk');
|
|
49
|
+
_BasePluginCache = adk.BasePlugin;
|
|
50
|
+
if (!_BasePluginCache) {
|
|
51
|
+
throw new Error('@google/adk is installed but does not export BasePlugin.');
|
|
52
|
+
}
|
|
53
|
+
return _BasePluginCache;
|
|
54
|
+
}
|
|
55
|
+
catch (err) {
|
|
56
|
+
throw new Error('ArmorIQADK requires @google/adk to be installed. ' +
|
|
57
|
+
'Install it: npm install @google/adk\n' +
|
|
58
|
+
`Underlying error: ${err?.message ?? err}`);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Returns a class that extends ADK's `BasePlugin` at runtime, so the
|
|
63
|
+
* SDK doesn't have to import @google/adk at module load.
|
|
64
|
+
*/
|
|
65
|
+
function buildArmorIQADKClass() {
|
|
66
|
+
const BasePlugin = loadBasePlugin();
|
|
67
|
+
return class ArmorIQADKImpl extends BasePlugin {
|
|
68
|
+
armoriqClient;
|
|
69
|
+
// Keyed by invocationId (stable string) rather than object identity,
|
|
70
|
+
// because ADK's afterModelCallback and beforeToolCallback receive
|
|
71
|
+
// different Context object instances for the same invocation.
|
|
72
|
+
sessions = new Map();
|
|
73
|
+
opts;
|
|
74
|
+
constructor(opts) {
|
|
75
|
+
super(opts.pluginName ?? 'armoriq');
|
|
76
|
+
this.opts = opts;
|
|
77
|
+
this.armoriqClient =
|
|
78
|
+
opts.client ??
|
|
79
|
+
new client_1.ArmorIQClient({
|
|
80
|
+
apiKey: opts.apiKey,
|
|
81
|
+
proxyEndpoint: opts.proxyUrl,
|
|
82
|
+
userId: opts.userId,
|
|
83
|
+
agentId: opts.agentId,
|
|
84
|
+
mcpCredentials: opts.mcpCredentials,
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* After the model returns: extract function calls, mint an intent
|
|
89
|
+
* token, stash a session keyed off the callbackContext for the
|
|
90
|
+
* matching beforeToolCallback to consume.
|
|
91
|
+
*/
|
|
92
|
+
async afterModelCallback(params) {
|
|
93
|
+
const { callbackContext, llmResponse } = params;
|
|
94
|
+
const parts = llmResponse?.content?.parts ?? [];
|
|
95
|
+
const toolCalls = parts
|
|
96
|
+
.filter((p) => p && p.functionCall && p.functionCall.name)
|
|
97
|
+
.map((p) => ({
|
|
98
|
+
name: p.functionCall.name,
|
|
99
|
+
args: p.functionCall.args ?? {},
|
|
100
|
+
}));
|
|
101
|
+
if (toolCalls.length === 0)
|
|
102
|
+
return undefined;
|
|
103
|
+
const session = this.armoriqClient.startSession({
|
|
104
|
+
defaultMcpName: this.opts.defaultMcpName,
|
|
105
|
+
toolNameParser: this.opts.toolNameParser,
|
|
106
|
+
llm: this.opts.llm,
|
|
107
|
+
validitySeconds: this.opts.validitySeconds,
|
|
108
|
+
});
|
|
109
|
+
// ADK's userContent is a Content object ({role, parts}), not a string.
|
|
110
|
+
const rawContent = callbackContext?.userContent ??
|
|
111
|
+
callbackContext?.invocationContext?.userContent;
|
|
112
|
+
let goal = 'agent task';
|
|
113
|
+
if (typeof rawContent === 'string') {
|
|
114
|
+
goal = rawContent;
|
|
115
|
+
}
|
|
116
|
+
else if (rawContent?.parts) {
|
|
117
|
+
const texts = rawContent.parts
|
|
118
|
+
.filter((p) => typeof p?.text === 'string')
|
|
119
|
+
.map((p) => p.text);
|
|
120
|
+
if (texts.length > 0)
|
|
121
|
+
goal = texts.join(' ');
|
|
122
|
+
}
|
|
123
|
+
await session.startPlan(toolCalls, { goal });
|
|
124
|
+
const invocationId = callbackContext?.invocationContext?.invocationId ??
|
|
125
|
+
callbackContext?.invocationId ??
|
|
126
|
+
'default';
|
|
127
|
+
this.sessions.set(invocationId, session);
|
|
128
|
+
return undefined; // do not modify the LLM response
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Before each tool call: route through the Armoriq proxy and
|
|
132
|
+
* return the result so ADK skips its native dispatch.
|
|
133
|
+
*/
|
|
134
|
+
async beforeToolCallback(params) {
|
|
135
|
+
const { tool, toolArgs, toolContext } = params;
|
|
136
|
+
const invocationId = toolContext?.invocationContext?.invocationId ??
|
|
137
|
+
toolContext?.invocationId ??
|
|
138
|
+
'default';
|
|
139
|
+
const session = this.sessions.get(invocationId);
|
|
140
|
+
if (!session)
|
|
141
|
+
return undefined; // no plan captured this turn
|
|
142
|
+
const result = await session.dispatch(tool?.name ?? String(tool), toolArgs ?? {});
|
|
143
|
+
// ADK expects an object; wrap primitives.
|
|
144
|
+
if (result && typeof result === 'object' && !Array.isArray(result)) {
|
|
145
|
+
return result;
|
|
146
|
+
}
|
|
147
|
+
return { result };
|
|
148
|
+
}
|
|
149
|
+
get armoriqSdk() {
|
|
150
|
+
return this.armoriqClient;
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
let _CachedClass = null;
|
|
155
|
+
/**
|
|
156
|
+
* Public class. Constructed lazily so importing this module doesn't
|
|
157
|
+
* trigger the @google/adk lookup until the user actually instantiates.
|
|
158
|
+
*
|
|
159
|
+
* Use:
|
|
160
|
+
* const armoriq = new ArmorIQADK({ apiKey, proxyUrl });
|
|
161
|
+
* const runner = new InMemoryRunner({ agent, plugins: [armoriq] });
|
|
162
|
+
*/
|
|
163
|
+
exports.ArmorIQADK = new Proxy(function () { }, {
|
|
164
|
+
construct(_target, args) {
|
|
165
|
+
if (!_CachedClass)
|
|
166
|
+
_CachedClass = buildArmorIQADKClass();
|
|
167
|
+
return new _CachedClass(...args);
|
|
168
|
+
},
|
|
169
|
+
});
|
|
170
|
+
//# sourceMappingURL=google-adk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"google-adk.js","sourceRoot":"","sources":["../../src/integrations/google-adk.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;;;AAEH,sCAA0C;AAS1C,IAAI,gBAAgB,GAAmB,IAAI,CAAC;AAC5C,SAAS,cAAc;IACrB,IAAI,gBAAgB;QAAE,OAAO,gBAAgB,CAAC;IAC9C,IAAI,CAAC;QACH,iEAAiE;QACjE,kEAAkE;QAClE,kEAAkE;QAClE,oEAAoE;QACpE,yDAAyD;QACzD,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,QAAQ,CAA4B,CAAC;QACvE,MAAM,eAAe,GAAG,aAAa,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,eAAe,CAAC,CAAC;QACvE,MAAM,GAAG,GAAG,eAAe,CAAC,aAAa,CAAC,CAAC;QAC3C,gBAAgB,GAAG,GAAG,CAAC,UAAqB,CAAC;QAC7C,IAAI,CAAC,gBAAgB,EAAE,CAAC;YACtB,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAC;QAC9E,CAAC;QACD,OAAO,gBAAgB,CAAC;IAC1B,CAAC;IAAC,OAAO,GAAQ,EAAE,CAAC;QAClB,MAAM,IAAI,KAAK,CACb,mDAAmD;YACjD,uCAAuC;YACvC,qBAAqB,GAAG,EAAE,OAAO,IAAI,GAAG,EAAE,CAC7C,CAAC;IACJ,CAAC;AACH,CAAC;AAuBD;;;GAGG;AACH,SAAS,oBAAoB;IAC3B,MAAM,UAAU,GAAG,cAAc,EAAE,CAAC;IAEpC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EAAE,GAAG,MAAM,CAAC;YAC/C,MAAM,YAAY,GAChB,WAAW,EAAE,iBAAiB,EAAE,YAAY;gBAC5C,WAAW,EAAE,YAAY;gBACzB,SAAS,CAAC;YACZ,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;YAChD,IAAI,CAAC,OAAO;gBAAE,OAAO,SAAS,CAAC,CAAC,6BAA6B;YAE7D,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,EAAE,QAAQ,IAAI,EAAE,CAAC,CAAC;YAClF,0CAA0C;YAC1C,IAAI,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;gBACnE,OAAO,MAAiC,CAAC;YAC3C,CAAC;YACD,OAAO,EAAE,MAAM,EAAE,CAAC;QACpB,CAAC;QAED,IAAI,UAAU;YACZ,OAAO,IAAI,CAAC,aAAa,CAAC;QAC5B,CAAC;KACF,CAAC;AACJ,CAAC;AAED,IAAI,YAAY,GAAmB,IAAI,CAAC;AAExC;;;;;;;GAOG;AACU,QAAA,UAAU,GAAyC,IAAI,KAAK,CACvE,cAAa,CAAQ,EACrB;IACE,SAAS,CAAC,OAAO,EAAE,IAAI;QACrB,IAAI,CAAC,YAAY;YAAE,YAAY,GAAG,oBAAoB,EAAE,CAAC;QACzD,OAAO,IAAI,YAAY,CAAC,GAAG,IAAI,CAAC,CAAC;IACnC,CAAC;CACF,CACK,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ArmorIQ SDK — Framework integrations.
|
|
3
|
+
*
|
|
4
|
+
* Mirrors the shape of armoriq_sdk.integrations in the Python SDK.
|
|
5
|
+
* Each integration is importable on its own subpath so consumers only
|
|
6
|
+
* pay for the peer dep they actually use, e.g.:
|
|
7
|
+
*
|
|
8
|
+
* import { ArmorIQADK } from '@armoriq/sdk-dev/integrations/google-adk';
|
|
9
|
+
* import { ArmorIQCrew } from '@armoriq/sdk-dev/integrations/crewai';
|
|
10
|
+
* import { ArmorIQLangChain } from '@armoriq/sdk-dev/integrations/langchain';
|
|
11
|
+
* import { ArmorIQOpenAI } from '@armoriq/sdk-dev/integrations/openai';
|
|
12
|
+
* import { ArmorIQAnthropic } from '@armoriq/sdk-dev/integrations/anthropic';
|
|
13
|
+
*
|
|
14
|
+
* Availability:
|
|
15
|
+
* google-adk → real (wraps ADK's BasePlugin)
|
|
16
|
+
* crewai → real (port) (wraps CrewAI Crew.kickoff)
|
|
17
|
+
* langchain → Coming Soon
|
|
18
|
+
* openai → Coming Soon
|
|
19
|
+
* anthropic → Coming Soon
|
|
20
|
+
*
|
|
21
|
+
* Vertex AI: no separate file — Vertex agents run under Google ADK, so
|
|
22
|
+
* ArmorIQADK covers Vertex too.
|
|
23
|
+
*/
|
|
24
|
+
export { ArmorIQADK, ArmorIQADKOptions } from './google-adk';
|
|
25
|
+
export { ArmorIQCrew, ArmorIQCrewOptions } from './crewai';
|
|
26
|
+
export { ArmorIQLangChain, ArmorIQLangChainOptions } from './langchain';
|
|
27
|
+
export { ArmorIQOpenAI, ArmorIQOpenAIOptions } from './openai';
|
|
28
|
+
export { ArmorIQAnthropic, ArmorIQAnthropicOptions } from './anthropic';
|
|
29
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/integrations/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* ArmorIQ SDK — Framework integrations.
|
|
4
|
+
*
|
|
5
|
+
* Mirrors the shape of armoriq_sdk.integrations in the Python SDK.
|
|
6
|
+
* Each integration is importable on its own subpath so consumers only
|
|
7
|
+
* pay for the peer dep they actually use, e.g.:
|
|
8
|
+
*
|
|
9
|
+
* import { ArmorIQADK } from '@armoriq/sdk-dev/integrations/google-adk';
|
|
10
|
+
* import { ArmorIQCrew } from '@armoriq/sdk-dev/integrations/crewai';
|
|
11
|
+
* import { ArmorIQLangChain } from '@armoriq/sdk-dev/integrations/langchain';
|
|
12
|
+
* import { ArmorIQOpenAI } from '@armoriq/sdk-dev/integrations/openai';
|
|
13
|
+
* import { ArmorIQAnthropic } from '@armoriq/sdk-dev/integrations/anthropic';
|
|
14
|
+
*
|
|
15
|
+
* Availability:
|
|
16
|
+
* google-adk → real (wraps ADK's BasePlugin)
|
|
17
|
+
* crewai → real (port) (wraps CrewAI Crew.kickoff)
|
|
18
|
+
* langchain → Coming Soon
|
|
19
|
+
* openai → Coming Soon
|
|
20
|
+
* anthropic → Coming Soon
|
|
21
|
+
*
|
|
22
|
+
* Vertex AI: no separate file — Vertex agents run under Google ADK, so
|
|
23
|
+
* ArmorIQADK covers Vertex too.
|
|
24
|
+
*/
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.ArmorIQAnthropic = exports.ArmorIQOpenAI = exports.ArmorIQLangChain = exports.ArmorIQCrew = exports.ArmorIQADK = void 0;
|
|
27
|
+
var google_adk_1 = require("./google-adk");
|
|
28
|
+
Object.defineProperty(exports, "ArmorIQADK", { enumerable: true, get: function () { return google_adk_1.ArmorIQADK; } });
|
|
29
|
+
var crewai_1 = require("./crewai");
|
|
30
|
+
Object.defineProperty(exports, "ArmorIQCrew", { enumerable: true, get: function () { return crewai_1.ArmorIQCrew; } });
|
|
31
|
+
var langchain_1 = require("./langchain");
|
|
32
|
+
Object.defineProperty(exports, "ArmorIQLangChain", { enumerable: true, get: function () { return langchain_1.ArmorIQLangChain; } });
|
|
33
|
+
var openai_1 = require("./openai");
|
|
34
|
+
Object.defineProperty(exports, "ArmorIQOpenAI", { enumerable: true, get: function () { return openai_1.ArmorIQOpenAI; } });
|
|
35
|
+
var anthropic_1 = require("./anthropic");
|
|
36
|
+
Object.defineProperty(exports, "ArmorIQAnthropic", { enumerable: true, get: function () { return anthropic_1.ArmorIQAnthropic; } });
|
|
37
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/integrations/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;;AAEH,2CAA6D;AAApD,wGAAA,UAAU,OAAA;AACnB,mCAA2D;AAAlD,qGAAA,WAAW,OAAA;AACpB,yCAAwE;AAA/D,6GAAA,gBAAgB,OAAA;AACzB,mCAA+D;AAAtD,uGAAA,aAAa,OAAA;AACtB,yCAAwE;AAA/D,6GAAA,gBAAgB,OAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ArmorIQ — LangChain integration. (Coming Soon)
|
|
3
|
+
*
|
|
4
|
+
* Planned surface mirrors the Python SDK's ArmorIQLangChain (currently
|
|
5
|
+
* stubbed in Python too). When implemented, this will wrap LangChain.js
|
|
6
|
+
* `StructuredTool` / `Tool` instances so their `invoke()` routes through
|
|
7
|
+
* the Armoriq proxy via ArmorIQSession.
|
|
8
|
+
*
|
|
9
|
+
* Requires: `npm install @langchain/core langchain`
|
|
10
|
+
*/
|
|
11
|
+
import { ArmorIQClient } from '../client';
|
|
12
|
+
export interface ArmorIQLangChainOptions {
|
|
13
|
+
armoriqClient: ArmorIQClient;
|
|
14
|
+
llm?: string;
|
|
15
|
+
[key: string]: any;
|
|
16
|
+
}
|
|
17
|
+
export declare class ArmorIQLangChain {
|
|
18
|
+
constructor(_options: ArmorIQLangChainOptions);
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=langchain.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"langchain.d.ts","sourceRoot":"","sources":["../../src/integrations/langchain.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,MAAM,WAAW,uBAAuB;IACtC,aAAa,EAAE,aAAa,CAAC;IAC7B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED,qBAAa,gBAAgB;gBACf,QAAQ,EAAE,uBAAuB;CAY9C"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* ArmorIQ — LangChain integration. (Coming Soon)
|
|
4
|
+
*
|
|
5
|
+
* Planned surface mirrors the Python SDK's ArmorIQLangChain (currently
|
|
6
|
+
* stubbed in Python too). When implemented, this will wrap LangChain.js
|
|
7
|
+
* `StructuredTool` / `Tool` instances so their `invoke()` routes through
|
|
8
|
+
* the Armoriq proxy via ArmorIQSession.
|
|
9
|
+
*
|
|
10
|
+
* Requires: `npm install @langchain/core langchain`
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.ArmorIQLangChain = void 0;
|
|
14
|
+
class ArmorIQLangChain {
|
|
15
|
+
constructor(_options) {
|
|
16
|
+
try {
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
18
|
+
require('@langchain/core');
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
throw new Error('@langchain/core is not installed.\n' +
|
|
22
|
+
'Install it with: npm install @langchain/core langchain');
|
|
23
|
+
}
|
|
24
|
+
throw new Error('ArmorIQ LangChain integration is not yet implemented.');
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.ArmorIQLangChain = ArmorIQLangChain;
|
|
28
|
+
//# sourceMappingURL=langchain.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"langchain.js","sourceRoot":"","sources":["../../src/integrations/langchain.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;AAUH,MAAa,gBAAgB;IAC3B,YAAY,QAAiC;QAC3C,IAAI,CAAC;YACH,8DAA8D;YAC9D,OAAO,CAAC,iBAAiB,CAAC,CAAC;QAC7B,CAAC;QAAC,MAAM,CAAC;YACP,MAAM,IAAI,KAAK,CACb,qCAAqC;gBACnC,wDAAwD,CAC3D,CAAC;QACJ,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAC;IAC3E,CAAC;CACF;AAbD,4CAaC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ArmorIQ — OpenAI integration. (Coming Soon)
|
|
3
|
+
*
|
|
4
|
+
* Mirrors the Python SDK's ArmorIQOpenAI stub. When implemented, this
|
|
5
|
+
* will wrap the OpenAI SDK's tool-call dispatch (and/or the OpenAI
|
|
6
|
+
* Agents runtime) so tool calls route through the Armoriq proxy via
|
|
7
|
+
* ArmorIQSession.
|
|
8
|
+
*
|
|
9
|
+
* Requires: `npm install openai`
|
|
10
|
+
*/
|
|
11
|
+
import { ArmorIQClient } from '../client';
|
|
12
|
+
export interface ArmorIQOpenAIOptions {
|
|
13
|
+
armoriqClient: ArmorIQClient;
|
|
14
|
+
[key: string]: any;
|
|
15
|
+
}
|
|
16
|
+
export declare class ArmorIQOpenAI {
|
|
17
|
+
constructor(_options: ArmorIQOpenAIOptions);
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=openai.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openai.d.ts","sourceRoot":"","sources":["../../src/integrations/openai.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,MAAM,WAAW,oBAAoB;IACnC,aAAa,EAAE,aAAa,CAAC;IAC7B,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED,qBAAa,aAAa;gBACZ,QAAQ,EAAE,oBAAoB;CAY3C"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* ArmorIQ — OpenAI integration. (Coming Soon)
|
|
4
|
+
*
|
|
5
|
+
* Mirrors the Python SDK's ArmorIQOpenAI stub. When implemented, this
|
|
6
|
+
* will wrap the OpenAI SDK's tool-call dispatch (and/or the OpenAI
|
|
7
|
+
* Agents runtime) so tool calls route through the Armoriq proxy via
|
|
8
|
+
* ArmorIQSession.
|
|
9
|
+
*
|
|
10
|
+
* Requires: `npm install openai`
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.ArmorIQOpenAI = void 0;
|
|
14
|
+
class ArmorIQOpenAI {
|
|
15
|
+
constructor(_options) {
|
|
16
|
+
try {
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
18
|
+
require('openai');
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
throw new Error('openai is not installed.\n' +
|
|
22
|
+
'Install it with: npm install openai');
|
|
23
|
+
}
|
|
24
|
+
throw new Error('ArmorIQ OpenAI integration is not yet implemented.');
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.ArmorIQOpenAI = ArmorIQOpenAI;
|
|
28
|
+
//# sourceMappingURL=openai.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openai.js","sourceRoot":"","sources":["../../src/integrations/openai.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;AASH,MAAa,aAAa;IACxB,YAAY,QAA8B;QACxC,IAAI,CAAC;YACH,8DAA8D;YAC9D,OAAO,CAAC,QAAQ,CAAC,CAAC;QACpB,CAAC;QAAC,MAAM,CAAC;YACP,MAAM,IAAI,KAAK,CACb,4BAA4B;gBAC1B,qCAAqC,CACxC,CAAC;QACJ,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;IACxE,CAAC;CACF;AAbD,sCAaC"}
|