@armoriq/sdk-dev 0.2.12 → 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.
- package/README.md +3 -3
- package/dist/_build_env.d.ts +33 -0
- package/dist/_build_env.d.ts.map +1 -0
- package/dist/_build_env.js +47 -0
- package/dist/_build_env.js.map +1 -0
- package/dist/client.d.ts +0 -30
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +52 -123
- package/dist/client.js.map +1 -1
- package/dist/credentials.d.ts +12 -0
- package/dist/credentials.d.ts.map +1 -0
- package/dist/credentials.js +81 -0
- package/dist/credentials.js.map +1 -0
- package/dist/index.d.ts +3 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -9
- package/dist/index.js.map +1 -1
- package/dist/models.d.ts +0 -36
- package/dist/models.d.ts.map +1 -1
- package/package.json +1 -45
- package/dist/integrations/anthropic.d.ts +0 -18
- package/dist/integrations/anthropic.d.ts.map +0 -1
- package/dist/integrations/anthropic.js +0 -27
- package/dist/integrations/anthropic.js.map +0 -1
- package/dist/integrations/crewai.d.ts +0 -68
- package/dist/integrations/crewai.d.ts.map +0 -1
- package/dist/integrations/crewai.js +0 -178
- package/dist/integrations/crewai.js.map +0 -1
- package/dist/integrations/google-adk.d.ts +0 -64
- package/dist/integrations/google-adk.d.ts.map +0 -1
- package/dist/integrations/google-adk.js +0 -170
- package/dist/integrations/google-adk.js.map +0 -1
- package/dist/integrations/index.d.ts +0 -29
- package/dist/integrations/index.d.ts.map +0 -1
- package/dist/integrations/index.js +0 -37
- package/dist/integrations/index.js.map +0 -1
- package/dist/integrations/langchain.d.ts +0 -20
- package/dist/integrations/langchain.d.ts.map +0 -1
- package/dist/integrations/langchain.js +0 -28
- package/dist/integrations/langchain.js.map +0 -1
- package/dist/integrations/openai.d.ts +0 -19
- package/dist/integrations/openai.d.ts.map +0 -1
- package/dist/integrations/openai.js +0 -28
- package/dist/integrations/openai.js.map +0 -1
- package/dist/plan-builder.d.ts +0 -36
- package/dist/plan-builder.d.ts.map +0 -1
- package/dist/plan-builder.js +0 -98
- package/dist/plan-builder.js.map +0 -1
- package/dist/session.d.ts +0 -50
- package/dist/session.d.ts.map +0 -1
- package/dist/session.js +0 -93
- package/dist/session.js.map +0 -1
|
@@ -1,64 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,170 +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
|
-
});
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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,EAA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C;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"}
|
|
@@ -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"}
|
package/dist/plan-builder.d.ts
DELETED
|
@@ -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"}
|
package/dist/plan-builder.js
DELETED
|
@@ -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
|
package/dist/plan-builder.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plan-builder.js","sourceRoot":"","sources":["../src/plan-builder.ts"],"names":[],"mappings":";AAAA;;;;;;GAM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;YACZ,GAAG;YACH,MAAM,EAAE,EAAE,CAAC,IAAI,IAAI,EAAE;YACrB,WAAW,EAAE,QAAQ,MAAM,OAAO,GAAG,EAAE;SACxC,CAAC;IACJ,CAAC,CAAC,CAAC;IACH,OAAO;QACL,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,YAAY;QAC/B,KAAK;KACN,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,SAAgB,aAAa,CAAC,SAAqB;IACjD,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAC9B,SAAS,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,EAAE,EAAE,CAAC,CAAC,CAChE,CAAC;IACF,OAAO,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC7E,CAAC"}
|
package/dist/session.d.ts
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ArmorIQSession — collapses the four-step framework-integration
|
|
3
|
-
* pattern into two calls.
|
|
4
|
-
*
|
|
5
|
-
* await session.startPlan(toolCalls) // capture plan + mint token
|
|
6
|
-
* return session.dispatch(toolName, args) // route through proxy
|
|
7
|
-
*
|
|
8
|
-
* Each framework adapter (ADK, LangChain, OpenAI Agents, Vercel AI
|
|
9
|
-
* SDK, etc.) wires its own hooks into these two methods and never has
|
|
10
|
-
* to think about plan shape, token threading, or cred-mode handling.
|
|
11
|
-
*/
|
|
12
|
-
import { ArmorIQClient } from './client';
|
|
13
|
-
import { IntentToken, ToolCall } from './models';
|
|
14
|
-
import { ToolNameParser } from './plan-builder';
|
|
15
|
-
export interface SessionOptions {
|
|
16
|
-
toolNameParser?: ToolNameParser;
|
|
17
|
-
defaultMcpName?: string;
|
|
18
|
-
validitySeconds?: number;
|
|
19
|
-
llm?: string;
|
|
20
|
-
}
|
|
21
|
-
export declare class ArmorIQSession {
|
|
22
|
-
private client;
|
|
23
|
-
private toolNameParser;
|
|
24
|
-
private defaultMcpName?;
|
|
25
|
-
private validitySeconds;
|
|
26
|
-
private llm;
|
|
27
|
-
private currentPlanHash;
|
|
28
|
-
private currentTokenValue;
|
|
29
|
-
private mcpByAction;
|
|
30
|
-
constructor(client: ArmorIQClient, opts?: SessionOptions);
|
|
31
|
-
/**
|
|
32
|
-
* Capture a plan from the LLM's tool calls and mint an intent token.
|
|
33
|
-
* Idempotent: if called again with the same tool-calls list (by SHA),
|
|
34
|
-
* skips the mint and returns the cached token.
|
|
35
|
-
*/
|
|
36
|
-
startPlan(toolCalls: ToolCall[], opts?: {
|
|
37
|
-
goal?: string;
|
|
38
|
-
}): Promise<IntentToken>;
|
|
39
|
-
/**
|
|
40
|
-
* Route a tool call through the Armoriq proxy.
|
|
41
|
-
* Returns the raw `result` field so the framework can short-circuit
|
|
42
|
-
* its native dispatch by returning this value directly.
|
|
43
|
-
*/
|
|
44
|
-
dispatch(toolName: string, toolArgs: Record<string, unknown>): Promise<unknown>;
|
|
45
|
-
/** Drop cached plan + token so the next startPlan() always mints fresh. */
|
|
46
|
-
reset(): void;
|
|
47
|
-
/** Inspect the currently held intent token (for debugging / audit). */
|
|
48
|
-
get currentToken(): IntentToken | null;
|
|
49
|
-
}
|
|
50
|
-
//# sourceMappingURL=session.d.ts.map
|
package/dist/session.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../src/session.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,WAAW,EAAuB,QAAQ,EAAE,MAAM,UAAU,CAAC;AACtE,OAAO,EACL,cAAc,EAIf,MAAM,gBAAgB,CAAC;AAExB,MAAM,WAAW,cAAc;IAC7B,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,qBAAa,cAAc;IACzB,OAAO,CAAC,MAAM,CAAgB;IAC9B,OAAO,CAAC,cAAc,CAAiB;IACvC,OAAO,CAAC,cAAc,CAAC,CAAS;IAChC,OAAO,CAAC,eAAe,CAAS;IAChC,OAAO,CAAC,GAAG,CAAS;IAEpB,OAAO,CAAC,eAAe,CAAuB;IAC9C,OAAO,CAAC,iBAAiB,CAA4B;IACrD,OAAO,CAAC,WAAW,CAAkC;gBAEzC,MAAM,EAAE,aAAa,EAAE,IAAI,GAAE,cAAmB;IAS5D;;;;OAIG;IACG,SAAS,CACb,SAAS,EAAE,QAAQ,EAAE,EACrB,IAAI,GAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAO,GAC3B,OAAO,CAAC,WAAW,CAAC;IAmCvB;;;;OAIG;IACG,QAAQ,CACZ,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAChC,OAAO,CAAC,OAAO,CAAC;IAuBnB,2EAA2E;IAC3E,KAAK,IAAI,IAAI;IAMb,uEAAuE;IACvE,IAAI,YAAY,IAAI,WAAW,GAAG,IAAI,CAErC;CACF"}
|