@armoriq/sdk-dev 0.2.13 → 0.2.14

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.
Files changed (63) hide show
  1. package/README.md +3 -3
  2. package/dist/_build_env.d.ts +33 -0
  3. package/dist/_build_env.d.ts.map +1 -0
  4. package/dist/_build_env.js +47 -0
  5. package/dist/_build_env.js.map +1 -0
  6. package/dist/client.d.ts.map +1 -1
  7. package/dist/client.js +34 -12
  8. package/dist/client.js.map +1 -1
  9. package/dist/credentials.d.ts.map +1 -0
  10. package/dist/credentials.js.map +1 -0
  11. package/package.json +2 -7
  12. package/dist/cli/commands/login.d.ts +0 -4
  13. package/dist/cli/commands/login.d.ts.map +0 -1
  14. package/dist/cli/commands/login.js +0 -221
  15. package/dist/cli/commands/login.js.map +0 -1
  16. package/dist/cli/commands/logout.d.ts +0 -2
  17. package/dist/cli/commands/logout.d.ts.map +0 -1
  18. package/dist/cli/commands/logout.js +0 -14
  19. package/dist/cli/commands/logout.js.map +0 -1
  20. package/dist/cli/commands/whoami.d.ts +0 -2
  21. package/dist/cli/commands/whoami.d.ts.map +0 -1
  22. package/dist/cli/commands/whoami.js +0 -22
  23. package/dist/cli/commands/whoami.js.map +0 -1
  24. package/dist/cli/credentials.d.ts.map +0 -1
  25. package/dist/cli/credentials.js.map +0 -1
  26. package/dist/cli/index.d.ts +0 -3
  27. package/dist/cli/index.d.ts.map +0 -1
  28. package/dist/cli/index.js +0 -33
  29. package/dist/cli/index.js.map +0 -1
  30. package/dist/integrations/anthropic.d.ts +0 -18
  31. package/dist/integrations/anthropic.d.ts.map +0 -1
  32. package/dist/integrations/anthropic.js +0 -27
  33. package/dist/integrations/anthropic.js.map +0 -1
  34. package/dist/integrations/crewai.d.ts +0 -68
  35. package/dist/integrations/crewai.d.ts.map +0 -1
  36. package/dist/integrations/crewai.js +0 -178
  37. package/dist/integrations/crewai.js.map +0 -1
  38. package/dist/integrations/google-adk.d.ts +0 -72
  39. package/dist/integrations/google-adk.d.ts.map +0 -1
  40. package/dist/integrations/google-adk.js +0 -260
  41. package/dist/integrations/google-adk.js.map +0 -1
  42. package/dist/integrations/index.d.ts +0 -29
  43. package/dist/integrations/index.d.ts.map +0 -1
  44. package/dist/integrations/index.js +0 -37
  45. package/dist/integrations/index.js.map +0 -1
  46. package/dist/integrations/langchain.d.ts +0 -20
  47. package/dist/integrations/langchain.d.ts.map +0 -1
  48. package/dist/integrations/langchain.js +0 -28
  49. package/dist/integrations/langchain.js.map +0 -1
  50. package/dist/integrations/openai.d.ts +0 -19
  51. package/dist/integrations/openai.d.ts.map +0 -1
  52. package/dist/integrations/openai.js +0 -28
  53. package/dist/integrations/openai.js.map +0 -1
  54. package/dist/plan-builder.d.ts +0 -36
  55. package/dist/plan-builder.d.ts.map +0 -1
  56. package/dist/plan-builder.js +0 -98
  57. package/dist/plan-builder.js.map +0 -1
  58. package/dist/session.d.ts +0 -152
  59. package/dist/session.d.ts.map +0 -1
  60. package/dist/session.js +0 -547
  61. package/dist/session.js.map +0 -1
  62. /package/dist/{cli/credentials.d.ts → credentials.d.ts} +0 -0
  63. /package/dist/{cli/credentials.js → credentials.js} +0 -0
@@ -1,260 +0,0 @@
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
- mode: this.opts.mode ?? 'local',
109
- });
110
- // ADK's userContent is a Content object ({role, parts}), not a string.
111
- const rawContent = callbackContext?.userContent ??
112
- callbackContext?.invocationContext?.userContent;
113
- let goal = 'agent task';
114
- if (typeof rawContent === 'string') {
115
- goal = rawContent;
116
- }
117
- else if (rawContent?.parts) {
118
- const texts = rawContent.parts
119
- .filter((p) => typeof p?.text === 'string')
120
- .map((p) => p.text);
121
- if (texts.length > 0)
122
- goal = texts.join(' ');
123
- }
124
- await session.startPlan(toolCalls, { goal });
125
- const invocationId = callbackContext?.invocationContext?.invocationId ??
126
- callbackContext?.invocationId ??
127
- 'default';
128
- this.sessions.set(invocationId, session);
129
- return undefined; // do not modify the LLM response
130
- }
131
- /**
132
- * Before each tool call: enforce policy. If blocked, return an
133
- * error object (short-circuits the tool). If allowed, return
134
- * undefined so ADK calls the MCP directly — the agent's own
135
- * MCPToolset handles the connection with its own credentials.
136
- */
137
- async beforeToolCallback(params) {
138
- const { tool, toolArgs, toolContext } = params;
139
- const invocationId = toolContext?.invocationContext?.invocationId ??
140
- toolContext?.invocationId ??
141
- 'default';
142
- const session = this.sessions.get(invocationId);
143
- if (!session)
144
- return undefined;
145
- const toolName = tool?.name ?? String(tool);
146
- // Pull user email if present (set by ADK runner for the request).
147
- const userEmail = toolContext?.userEmail ??
148
- toolContext?.invocationContext?.userEmail ??
149
- toolContext?.invocationContext?.userId;
150
- // session.check() picks local vs proxy based on session.mode and
151
- // handles the delegation flow on a 'hold' decision.
152
- const decision = await session.check(toolName, toolArgs ?? {}, { userEmail });
153
- if (!decision.allowed) {
154
- // Mark this tool call as blocked so afterToolCallback skips
155
- // its success-path audit and writes a 'failed' record instead.
156
- toolContext.__armoriq_blocked = decision;
157
- // Report the block to the audit log NOW (before short-circuit)
158
- // so AIGraph reflects the correct status.
159
- try {
160
- await session.report(toolName, toolArgs ?? {}, {
161
- blocked: true,
162
- reason: decision.reason,
163
- action: decision.action,
164
- delegationId: decision.delegationId,
165
- }, {
166
- status: 'failed',
167
- errorMessage: decision.reason || `Blocked by policy (${decision.action})`,
168
- });
169
- }
170
- catch {
171
- // never fail the request because audit failed
172
- }
173
- // Return a clear, structured message that the LLM can interpret
174
- // and surface to the user verbatim.
175
- const policy = decision.matchedPolicy ? ` (policy: ${decision.matchedPolicy})` : '';
176
- let userMessage;
177
- if (decision.action === 'hold' && decision.delegationId) {
178
- userMessage =
179
- `This action requires approval${policy}. ` +
180
- `An approval request has been sent (id: ${decision.delegationId}). ` +
181
- `Once approved, please re-run this request to proceed. ` +
182
- `Reason: ${decision.reason ?? 'policy-hold'}.`;
183
- }
184
- else if (decision.action === 'hold') {
185
- userMessage =
186
- `This action requires approval before it can run${policy}. ` +
187
- `Reason: ${decision.reason ?? 'policy-hold'}.`;
188
- }
189
- else {
190
- userMessage =
191
- `This action is not permitted by your organization's policy${policy}. ` +
192
- `Reason: ${decision.reason ?? 'policy-blocked'}.`;
193
- }
194
- return {
195
- error: userMessage,
196
- armoriq_enforcement: {
197
- blocked: true,
198
- action: decision.action,
199
- reason: decision.reason,
200
- matchedPolicy: decision.matchedPolicy,
201
- tool: toolName,
202
- delegationId: decision.delegationId,
203
- },
204
- };
205
- }
206
- // Store start time for duration tracking in afterToolCallback
207
- toolContext.__armoriq_start = Date.now();
208
- return undefined; // let ADK call the MCP directly
209
- }
210
- /**
211
- * After each tool call: report execution to audit log.
212
- * This fires AFTER the MCP returns its result — the agent called
213
- * the MCP directly, and now we record what happened.
214
- */
215
- async afterToolCallback(params) {
216
- const { tool, toolArgs, toolContext, result } = params;
217
- const invocationId = toolContext?.invocationContext?.invocationId ??
218
- toolContext?.invocationId ??
219
- 'default';
220
- const session = this.sessions.get(invocationId);
221
- if (!session)
222
- return undefined;
223
- // If beforeToolCallback already blocked this call, the audit was
224
- // written there. Don't double-audit.
225
- if (toolContext.__armoriq_blocked) {
226
- return undefined;
227
- }
228
- const toolName = tool?.name ?? String(tool);
229
- const startTime = toolContext.__armoriq_start;
230
- const durationMs = startTime ? Date.now() - startTime : undefined;
231
- const hasError = result?.error || result?.isError;
232
- await session.report(toolName, toolArgs ?? {}, result, {
233
- status: hasError ? 'failed' : 'success',
234
- errorMessage: hasError ? String(result.error || result.isError) : undefined,
235
- durationMs,
236
- });
237
- return undefined;
238
- }
239
- get armoriqSdk() {
240
- return this.armoriqClient;
241
- }
242
- };
243
- }
244
- let _CachedClass = null;
245
- /**
246
- * Public class. Constructed lazily so importing this module doesn't
247
- * trigger the @google/adk lookup until the user actually instantiates.
248
- *
249
- * Use:
250
- * const armoriq = new ArmorIQADK({ apiKey, proxyUrl });
251
- * const runner = new InMemoryRunner({ agent, plugins: [armoriq] });
252
- */
253
- exports.ArmorIQADK = new Proxy(function () { }, {
254
- construct(_target, args) {
255
- if (!_CachedClass)
256
- _CachedClass = buildArmorIQADKClass();
257
- return new _CachedClass(...args);
258
- },
259
- });
260
- //# sourceMappingURL=google-adk.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"google-adk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CACK,CAAC"}
@@ -1,29 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,37 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,20 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,28 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,19 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,28 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,36 +0,0 @@
1
- /**
2
- * Plan-shape helpers used by ArmorIQSession and framework integrations.
3
- *
4
- * Most LLM frameworks surface tool calls as a flat list of
5
- * `{ name, args }`. The SDK accepts that shape directly so plugin code
6
- * doesn't have to hand-construct `{ goal, steps: [...] }` every time.
7
- */
8
- import { ToolCall } from './models';
9
- export interface ToolNameParser {
10
- (toolName: string): {
11
- mcp: string;
12
- action: string;
13
- };
14
- }
15
- export interface BuildPlanOptions {
16
- goal?: string;
17
- toolNameParser?: ToolNameParser;
18
- defaultMcpName?: string;
19
- }
20
- /**
21
- * Default tool-name convention: `<MCP>__<action>`. Matches the proxy's
22
- * MCP gateway and the convention used by sdk-admin-agent.
23
- * "Stripe__create_payment" -> { mcp: "Stripe", action: "create_payment" }
24
- * "create_payment" -> uses defaultMcpName, else throws.
25
- */
26
- export declare function defaultToolNameParser(defaultMcpName?: string): ToolNameParser;
27
- /**
28
- * Build a SDK-shaped plan dict from a flat list of tool calls.
29
- */
30
- export declare function buildPlanFromToolCalls(toolCalls: ToolCall[], opts?: BuildPlanOptions): Record<string, any>;
31
- /**
32
- * Stable hash over a tool-calls list — used by the session to skip
33
- * re-minting when the LLM re-emits the same plan in the same turn.
34
- */
35
- export declare function hashToolCalls(toolCalls: ToolCall[]): string;
36
- //# sourceMappingURL=plan-builder.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plan-builder.d.ts","sourceRoot":"","sources":["../src/plan-builder.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEpC,MAAM,WAAW,cAAc;IAC7B,CAAC,QAAQ,EAAE,MAAM,GAAG;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CACrD;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,cAAc,CAkB7E;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,QAAQ,EAAE,EACrB,IAAI,GAAE,gBAAqB,GAC1B,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAgBrB;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,QAAQ,EAAE,GAAG,MAAM,CAK3D"}
@@ -1,98 +0,0 @@
1
- "use strict";
2
- /**
3
- * Plan-shape helpers used by ArmorIQSession and framework integrations.
4
- *
5
- * Most LLM frameworks surface tool calls as a flat list of
6
- * `{ name, args }`. The SDK accepts that shape directly so plugin code
7
- * doesn't have to hand-construct `{ goal, steps: [...] }` every time.
8
- */
9
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- var desc = Object.getOwnPropertyDescriptor(m, k);
12
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
13
- desc = { enumerable: true, get: function() { return m[k]; } };
14
- }
15
- Object.defineProperty(o, k2, desc);
16
- }) : (function(o, m, k, k2) {
17
- if (k2 === undefined) k2 = k;
18
- o[k2] = m[k];
19
- }));
20
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
21
- Object.defineProperty(o, "default", { enumerable: true, value: v });
22
- }) : function(o, v) {
23
- o["default"] = v;
24
- });
25
- var __importStar = (this && this.__importStar) || (function () {
26
- var ownKeys = function(o) {
27
- ownKeys = Object.getOwnPropertyNames || function (o) {
28
- var ar = [];
29
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
30
- return ar;
31
- };
32
- return ownKeys(o);
33
- };
34
- return function (mod) {
35
- if (mod && mod.__esModule) return mod;
36
- var result = {};
37
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
38
- __setModuleDefault(result, mod);
39
- return result;
40
- };
41
- })();
42
- Object.defineProperty(exports, "__esModule", { value: true });
43
- exports.defaultToolNameParser = defaultToolNameParser;
44
- exports.buildPlanFromToolCalls = buildPlanFromToolCalls;
45
- exports.hashToolCalls = hashToolCalls;
46
- const crypto = __importStar(require("crypto"));
47
- /**
48
- * Default tool-name convention: `<MCP>__<action>`. Matches the proxy's
49
- * MCP gateway and the convention used by sdk-admin-agent.
50
- * "Stripe__create_payment" -> { mcp: "Stripe", action: "create_payment" }
51
- * "create_payment" -> uses defaultMcpName, else throws.
52
- */
53
- function defaultToolNameParser(defaultMcpName) {
54
- return (toolName) => {
55
- const idx = toolName.indexOf('__');
56
- if (idx === -1) {
57
- if (!defaultMcpName) {
58
- throw new Error(`Tool "${toolName}" is not namespaced as <MCP>__<action> and no defaultMcpName was set on the session.`);
59
- }
60
- return { mcp: defaultMcpName, action: toolName };
61
- }
62
- const mcp = toolName.slice(0, idx);
63
- const action = toolName.slice(idx + 2);
64
- if (!mcp || !action) {
65
- throw new Error(`Tool "${toolName}" has a malformed MCP prefix.`);
66
- }
67
- return { mcp, action };
68
- };
69
- }
70
- /**
71
- * Build a SDK-shaped plan dict from a flat list of tool calls.
72
- */
73
- function buildPlanFromToolCalls(toolCalls, opts = {}) {
74
- const parser = opts.toolNameParser ?? defaultToolNameParser(opts.defaultMcpName);
75
- const steps = toolCalls.map((tc) => {
76
- const { mcp, action } = parser(tc.name);
77
- return {
78
- action,
79
- tool: action,
80
- mcp,
81
- params: tc.args ?? {},
82
- description: `Call ${action} on ${mcp}`,
83
- };
84
- });
85
- return {
86
- goal: opts.goal ?? 'agent task',
87
- steps,
88
- };
89
- }
90
- /**
91
- * Stable hash over a tool-calls list — used by the session to skip
92
- * re-minting when the LLM re-emits the same plan in the same turn.
93
- */
94
- function hashToolCalls(toolCalls) {
95
- const canonical = JSON.stringify(toolCalls.map((tc) => ({ name: tc.name, args: tc.args ?? {} })));
96
- return crypto.createHash('sha256').update(canonical, 'utf8').digest('hex');
97
- }
98
- //# sourceMappingURL=plan-builder.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plan-builder.js","sourceRoot":"","sources":["../src/plan-builder.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBH,sDAkBC;AAKD,wDAmBC;AAMD,sCAKC;AAxED,+CAAiC;AAajC;;;;;GAKG;AACH,SAAgB,qBAAqB,CAAC,cAAuB;IAC3D,OAAO,CAAC,QAAgB,EAAE,EAAE;QAC1B,MAAM,GAAG,GAAG,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACnC,IAAI,GAAG,KAAK,CAAC,CAAC,EAAE,CAAC;YACf,IAAI,CAAC,cAAc,EAAE,CAAC;gBACpB,MAAM,IAAI,KAAK,CACb,SAAS,QAAQ,sFAAsF,CACxG,CAAC;YACJ,CAAC;YACD,OAAO,EAAE,GAAG,EAAE,cAAc,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;QACnD,CAAC;QACD,MAAM,GAAG,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;QACnC,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;QACvC,IAAI,CAAC,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