@armoriq/sdk-dev 0.6.8 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +168 -1
- package/dist/_version.d.ts +1 -1
- package/dist/_version.js +1 -1
- package/dist/cli/commands/auth.d.ts +12 -0
- package/dist/cli/commands/auth.d.ts.map +1 -1
- package/dist/cli/commands/auth.js +460 -42
- package/dist/cli/commands/auth.js.map +1 -1
- package/dist/cli/index.js +0 -0
- package/dist/client.d.ts +8 -15
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +20 -18
- package/dist/client.js.map +1 -1
- package/dist/config.d.ts +0 -17
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -19
- package/dist/config.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -14
- package/dist/index.js.map +1 -1
- package/dist/integrations/google_adk.d.ts +168 -6
- package/dist/integrations/google_adk.d.ts.map +1 -1
- package/dist/integrations/google_adk.js +797 -103
- package/dist/integrations/google_adk.js.map +1 -1
- package/dist/integrations/langchain.d.ts +51 -1
- package/dist/integrations/langchain.d.ts.map +1 -1
- package/dist/integrations/langchain.js +563 -30
- package/dist/integrations/langchain.js.map +1 -1
- package/dist/integrations/strands.d.ts +48 -0
- package/dist/integrations/strands.d.ts.map +1 -1
- package/dist/integrations/strands.js +441 -27
- package/dist/integrations/strands.js.map +1 -1
- package/dist/models.d.ts +2 -2
- package/dist/models.d.ts.map +1 -1
- package/dist/observability/content-capture.d.ts +75 -0
- package/dist/observability/content-capture.d.ts.map +1 -0
- package/dist/observability/content-capture.js +339 -0
- package/dist/observability/content-capture.js.map +1 -0
- package/dist/observability/index.d.ts +6 -7
- package/dist/observability/index.d.ts.map +1 -1
- package/dist/observability/index.js +18 -27
- package/dist/observability/index.js.map +1 -1
- package/dist/observability/otel-config.d.ts +47 -0
- package/dist/observability/otel-config.d.ts.map +1 -0
- package/dist/observability/otel-config.js +268 -0
- package/dist/observability/otel-config.js.map +1 -0
- package/dist/observability/otel-export-ceiling.d.ts +96 -0
- package/dist/observability/otel-export-ceiling.d.ts.map +1 -0
- package/dist/observability/otel-export-ceiling.js +264 -0
- package/dist/observability/otel-export-ceiling.js.map +1 -0
- package/dist/observability/otel-runtime.d.ts +103 -0
- package/dist/observability/otel-runtime.d.ts.map +1 -0
- package/dist/observability/otel-runtime.js +668 -0
- package/dist/observability/otel-runtime.js.map +1 -0
- package/dist/observability/otel-session.d.ts +168 -0
- package/dist/observability/otel-session.d.ts.map +1 -0
- package/dist/observability/otel-session.js +621 -0
- package/dist/observability/otel-session.js.map +1 -0
- package/dist/observability/otel-shutdown.d.ts +17 -0
- package/dist/observability/otel-shutdown.d.ts.map +1 -0
- package/dist/observability/otel-shutdown.js +54 -0
- package/dist/observability/otel-shutdown.js.map +1 -0
- package/dist/observability/policy-lease.d.ts +22 -0
- package/dist/observability/policy-lease.d.ts.map +1 -0
- package/dist/observability/policy-lease.js +102 -0
- package/dist/observability/policy-lease.js.map +1 -0
- package/dist/plan_builder.d.ts +5 -4
- package/dist/plan_builder.d.ts.map +1 -1
- package/dist/plan_builder.js +14 -15
- package/dist/plan_builder.js.map +1 -1
- package/dist/session.d.ts +61 -93
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +388 -812
- package/dist/session.js.map +1 -1
- package/dist/token_usage.d.ts +11 -18
- package/dist/token_usage.d.ts.map +1 -1
- package/dist/token_usage.js +29 -94
- package/dist/token_usage.js.map +1 -1
- package/dist/tool_name.d.ts +18 -0
- package/dist/tool_name.d.ts.map +1 -0
- package/dist/tool_name.js +29 -0
- package/dist/tool_name.js.map +1 -0
- package/dist/tool_push.d.ts +28 -0
- package/dist/tool_push.d.ts.map +1 -0
- package/dist/tool_push.js +151 -0
- package/dist/tool_push.js.map +1 -0
- package/dist/tool_registry.d.ts +100 -0
- package/dist/tool_registry.d.ts.map +1 -0
- package/dist/tool_registry.js +440 -0
- package/dist/tool_registry.js.map +1 -0
- package/dist/tool_schema.d.ts +22 -0
- package/dist/tool_schema.d.ts.map +1 -0
- package/dist/tool_schema.js +163 -0
- package/dist/tool_schema.js.map +1 -0
- package/package.json +13 -7
- package/dist/integrations/microsoft_copilot.d.ts +0 -84
- package/dist/integrations/microsoft_copilot.d.ts.map +0 -1
- package/dist/integrations/microsoft_copilot.js +0 -126
- package/dist/integrations/microsoft_copilot.js.map +0 -1
package/README.md
CHANGED
|
@@ -88,7 +88,7 @@ USER_ID=your-user-id
|
|
|
88
88
|
AGENT_ID=your-agent-id
|
|
89
89
|
|
|
90
90
|
# Optional
|
|
91
|
-
ARMORIQ_ENV=production # or '
|
|
91
|
+
ARMORIQ_ENV=production # or 'local' for local development
|
|
92
92
|
CONTEXT_ID=default
|
|
93
93
|
IAP_ENDPOINT=https://iap.armoriq.ai
|
|
94
94
|
PROXY_ENDPOINT=https://proxy.armoriq.ai
|
|
@@ -97,6 +97,167 @@ BACKEND_ENDPOINT=https://api.armoriq.ai
|
|
|
97
97
|
|
|
98
98
|
---
|
|
99
99
|
|
|
100
|
+
## Native OpenTelemetry observability
|
|
101
|
+
|
|
102
|
+
Version 0.7.0 has one native OpenTelemetry span tree per session. It supports
|
|
103
|
+
exactly three exporter choices. Organization policy still governs every choice;
|
|
104
|
+
when observability is off or policy authority is unavailable, the SDK does not
|
|
105
|
+
export telemetry and agent execution continues.
|
|
106
|
+
|
|
107
|
+
### 1. ArmorIQ OTLP
|
|
108
|
+
|
|
109
|
+
ArmorIQ OTLP is the default. No endpoint configuration is needed.
|
|
110
|
+
|
|
111
|
+
```typescript
|
|
112
|
+
const session = client.startSession({ mode: 'sdk' });
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### 2. Generic external OTLP endpoint
|
|
116
|
+
|
|
117
|
+
Use a standards-compatible HTTP/protobuf endpoint through options or standard
|
|
118
|
+
OpenTelemetry environment variables.
|
|
119
|
+
|
|
120
|
+
```typescript
|
|
121
|
+
const client = new ArmorIQClient({
|
|
122
|
+
apiKey: 'ak_your_key_here',
|
|
123
|
+
observability: {
|
|
124
|
+
exporter: 'external',
|
|
125
|
+
endpoint: 'https://collector.example.com/v1/traces',
|
|
126
|
+
headers: { Authorization: 'Bearer token' },
|
|
127
|
+
},
|
|
128
|
+
});
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
OTEL_SERVICE_NAME=my-agent
|
|
133
|
+
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=https://observability.example.com/v1/traces
|
|
134
|
+
OTEL_EXPORTER_OTLP_TRACES_HEADERS=Authorization=Bearer%20token,x-tenant-id=my-tenant
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
You can instead supply a base endpoint. The SDK appends `/v1/traces` only for
|
|
138
|
+
this base form:
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
OTEL_EXPORTER_OTLP_ENDPOINT=https://collector.example.com
|
|
142
|
+
OTEL_EXPORTER_OTLP_HEADERS=Authorization=Bearer%20token
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Trace-specific settings take precedence over general settings:
|
|
146
|
+
|
|
147
|
+
```text
|
|
148
|
+
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT > OTEL_EXPORTER_OTLP_ENDPOINT
|
|
149
|
+
OTEL_EXPORTER_OTLP_TRACES_HEADERS > OTEL_EXPORTER_OTLP_HEADERS
|
|
150
|
+
OTEL_EXPORTER_OTLP_TRACES_PROTOCOL > OTEL_EXPORTER_OTLP_PROTOCOL
|
|
151
|
+
OTEL_EXPORTER_OTLP_TRACES_TIMEOUT > OTEL_EXPORTER_OTLP_TIMEOUT
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### 3. Caller-owned tracer provider
|
|
155
|
+
|
|
156
|
+
Pass your own OpenTelemetry tracer provider when your application owns provider
|
|
157
|
+
lifecycle and exporter setup.
|
|
158
|
+
|
|
159
|
+
```typescript
|
|
160
|
+
import { NodeTracerProvider } from '@opentelemetry/sdk-trace-node';
|
|
161
|
+
|
|
162
|
+
const provider = new NodeTracerProvider();
|
|
163
|
+
const session = client.startSession({
|
|
164
|
+
observability: { exporter: 'provider', tracerProvider: provider },
|
|
165
|
+
});
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
Only `http/protobuf` is supported for the SDK-managed external exporter. gRPC,
|
|
169
|
+
OTLP/JSON, compression, HTTP proxy configuration, and mTLS configuration are
|
|
170
|
+
not supported by that exporter.
|
|
171
|
+
Set those features on an OpenTelemetry Collector when they are required. The
|
|
172
|
+
exporter is fail-open: a remote outage, bad response, or timeout never changes
|
|
173
|
+
the result of an agent request. `content-type` headers are ignored because the
|
|
174
|
+
SDK always sends `application/x-protobuf`.
|
|
175
|
+
|
|
176
|
+
Before the first external trace, the SDK waits up to 1.4 seconds for the
|
|
177
|
+
organization policy authority. This one-time bound prevents unauthorized data
|
|
178
|
+
from reaching a third party. If authority is not available within the bound,
|
|
179
|
+
external telemetry stays disabled for that session and the agent continues.
|
|
180
|
+
|
|
181
|
+
One SDK runtime has one exporter choice. For fan-out to ArmorIQ and external
|
|
182
|
+
tools, use an OpenTelemetry Collector to route permitted traces.
|
|
183
|
+
|
|
184
|
+
### Langfuse example
|
|
185
|
+
|
|
186
|
+
Langfuse is one OTLP-compatible destination. Configure its OTLP endpoint and
|
|
187
|
+
standard headers in the environment; do not add Langfuse-specific runtime code
|
|
188
|
+
to your agent:
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
OTEL_SERVICE_NAME=my-agent
|
|
192
|
+
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=https://cloud.langfuse.com/api/public/otel/v1/traces
|
|
193
|
+
OTEL_EXPORTER_OTLP_TRACES_HEADERS=Authorization=Basic%20BASE64_PUBLIC_KEY_COLON_SECRET_KEY,x-langfuse-ingestion-version=4
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
For another vendor, use that vendor's documented OTLP trace endpoint and
|
|
197
|
+
headers. The SDK does not infer vendor URLs, credentials, or private fields.
|
|
198
|
+
|
|
199
|
+
### What is exported externally
|
|
200
|
+
|
|
201
|
+
External OTLP export always includes the trace hierarchy, stable span names,
|
|
202
|
+
service identity, supported GenAI model and token-use attributes, and safe
|
|
203
|
+
resource attributes. API keys, policy payloads, private ArmorIQ IDs, and
|
|
204
|
+
arbitrary user metadata are never exported to an external destination.
|
|
205
|
+
|
|
206
|
+
Prompt content, outputs, and tool arguments/results are withheld by default.
|
|
207
|
+
They are exported to an external destination only when the organization's
|
|
208
|
+
policy lease grants both content capture and external content capture, and
|
|
209
|
+
the effective capture mode is `enhanced` or `debug` — every other combination
|
|
210
|
+
(including a policy fetch that is not currently authoritative) withholds
|
|
211
|
+
them. Do not rely on external export being content-free by default if your
|
|
212
|
+
organization runs with those grants and capture modes enabled; check your
|
|
213
|
+
organization's observability policy if that guarantee matters to you.
|
|
214
|
+
|
|
215
|
+
Supported safe resource attributes are:
|
|
216
|
+
|
|
217
|
+
```bash
|
|
218
|
+
OTEL_SERVICE_NAME=my-agent
|
|
219
|
+
OTEL_RESOURCE_ATTRIBUTES=service.namespace=education,deployment.environment.name=staging
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
Do not put secrets or user content in resource attributes. Unsupported resource
|
|
223
|
+
attributes, malformed attributes, and values that look like a phone number,
|
|
224
|
+
SSN, or payment-card number are ignored before export.
|
|
225
|
+
|
|
226
|
+
### Capture modes and per-session opt-out
|
|
227
|
+
|
|
228
|
+
The capture modes are exactly `off`, `metadata`, `enhanced`, and `debug`.
|
|
229
|
+
Select an upper bound with `ARMORIQ_OTEL_CAPTURE_MODE` or
|
|
230
|
+
`observability.captureMode`; the organization policy can only narrow it.
|
|
231
|
+
|
|
232
|
+
```typescript
|
|
233
|
+
const noTelemetrySession = client.startSession({
|
|
234
|
+
observability: { enabled: false },
|
|
235
|
+
});
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
### Transcript token usage
|
|
239
|
+
|
|
240
|
+
Pass the session's native OTel bridge when you record transcript usage so model
|
|
241
|
+
tokens and cost become `gen_ai.chat` spans on the same trace.
|
|
242
|
+
|
|
243
|
+
```typescript
|
|
244
|
+
await client.captureTranscriptTokens({
|
|
245
|
+
transcriptPath: '/tmp/transcript.jsonl',
|
|
246
|
+
product: 'armorclaude',
|
|
247
|
+
sessionId: session.sessionId,
|
|
248
|
+
otel: session.otelSession,
|
|
249
|
+
});
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
### 0.7.0 breaking changes
|
|
253
|
+
|
|
254
|
+
The prior pipeline selector, JSON recorder and shipper APIs, recorder handles,
|
|
255
|
+
schema and trace-summary exports, and `defaultObservabilityConfig` are removed.
|
|
256
|
+
Use `session.otelSession` for native spans. See the 0.7.0 breaking-change notes
|
|
257
|
+
in [CHANGELOG.md](CHANGELOG.md) for the complete removed public surface.
|
|
258
|
+
|
|
259
|
+
---
|
|
260
|
+
|
|
100
261
|
## Advanced Usage
|
|
101
262
|
|
|
102
263
|
### Delegation
|
|
@@ -189,6 +350,12 @@ interface SDKConfig {
|
|
|
189
350
|
|
|
190
351
|
For complete documentation, visit [docs.armoriq.ai](https://docs.armoriq.ai)
|
|
191
352
|
|
|
353
|
+
For native framework adapter versions, lifecycle hooks, callback chaining, and
|
|
354
|
+
known limits, see the [framework compatibility matrix](docs/integrations/compatibility-matrix.md).
|
|
355
|
+
|
|
356
|
+
For the OTLP-only 0.7.0 release sequence, see the
|
|
357
|
+
[release runbook](docs/release-0.7.0-otlp-only.md).
|
|
358
|
+
|
|
192
359
|
---
|
|
193
360
|
|
|
194
361
|
## Links
|
package/dist/_version.d.ts
CHANGED
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
* Must match `version` in package.json and the locked version in
|
|
9
9
|
* package-lock.json. tests/package_metadata.test.ts enforces they agree.
|
|
10
10
|
*/
|
|
11
|
-
export declare const VERSION = "0.
|
|
11
|
+
export declare const VERSION = "0.7.0";
|
|
12
12
|
//# sourceMappingURL=_version.d.ts.map
|
package/dist/_version.js
CHANGED
|
@@ -6,6 +6,17 @@
|
|
|
6
6
|
* local callback with the key, or — if the callback can't be reached —
|
|
7
7
|
* we fall back to polling /auth/device/token.
|
|
8
8
|
*/
|
|
9
|
+
import * as fs from 'fs';
|
|
10
|
+
type DeviceIdentityFs = Pick<typeof fs, 'readFileSync' | 'mkdirSync' | 'writeFileSync' | 'unlinkSync' | 'linkSync' | 'statSync' | 'openSync' | 'writeSync' | 'fsyncSync' | 'closeSync'>;
|
|
11
|
+
/**
|
|
12
|
+
* The installation's stable, opaque device id, or null when it could not be
|
|
13
|
+
* persisted.
|
|
14
|
+
*
|
|
15
|
+
* Null rather than an unpersisted UUID: a value that is not on disk differs on
|
|
16
|
+
* every login, and the backend keys per-device key rotation on it, so returning
|
|
17
|
+
* one would provision a new key each time for what is one installation.
|
|
18
|
+
*/
|
|
19
|
+
export declare function loadOrCreateDeviceId(identityFs?: DeviceIdentityFs): string | null;
|
|
9
20
|
export declare function cmdLogin(args: {
|
|
10
21
|
backend?: string;
|
|
11
22
|
org?: string;
|
|
@@ -14,4 +25,5 @@ export declare function cmdLogin(args: {
|
|
|
14
25
|
}): Promise<number>;
|
|
15
26
|
export declare function cmdLogout(): number;
|
|
16
27
|
export declare function cmdWhoami(): number;
|
|
28
|
+
export {};
|
|
17
29
|
//# sourceMappingURL=auth.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/auth.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/auth.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAkCzB,KAAK,gBAAgB,GAAG,IAAI,CAC1B,OAAO,EAAE,EACP,cAAc,GACd,WAAW,GACX,eAAe,GACf,YAAY,GACZ,UAAU,GACV,UAAU,GACV,UAAU,GACV,WAAW,GACX,WAAW,GACX,WAAW,CACd,CAAC;AAqHF;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,GAAE,gBAAqB,GAAG,MAAM,GAAG,IAAI,CAkCrF;AA2bD,wBAAsB,QAAQ,CAAC,IAAI,EAAE;IACnC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,GAAG,OAAO,CAAC,MAAM,CAAC,CAoNlB;AAED,wBAAgB,SAAS,IAAI,MAAM,CAOlC;AAED,wBAAgB,SAAS,IAAI,MAAM,CAkBlC"}
|