@datacules/agent-identity-otel 0.11.0 → 0.11.1
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/LICENSE +109 -0
- package/dist/esm/index.js +118 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/types/index.d.ts +61 -0
- package/dist/types/index.d.ts.map +1 -0
- package/package.json +22 -6
package/LICENSE
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
Datacules Agent Identity License — Version 1.0
|
|
2
|
+
Copyright (c) 2026 Datacules LLC. All rights reserved.
|
|
3
|
+
|
|
4
|
+
─────────────────────────────────────────────────────────────────────────────
|
|
5
|
+
PREAMBLE
|
|
6
|
+
─────────────────────────────────────────────────────────────────────────────
|
|
7
|
+
|
|
8
|
+
This software — Agent Identity & Auth Patterns — is developed and owned by
|
|
9
|
+
Datacules LLC. It is made available to the public as open-source software
|
|
10
|
+
under the permissive terms below.
|
|
11
|
+
|
|
12
|
+
Datacules LLC retains ownership and authorship of this software while
|
|
13
|
+
granting broad, royalty-free rights for anyone to use, copy, modify, and
|
|
14
|
+
distribute it — in commercial or non-commercial contexts — without requiring
|
|
15
|
+
that derivative works also become open source.
|
|
16
|
+
|
|
17
|
+
─────────────────────────────────────────────────────────────────────────────
|
|
18
|
+
TERMS AND CONDITIONS
|
|
19
|
+
─────────────────────────────────────────────────────────────────────────────
|
|
20
|
+
|
|
21
|
+
1. PERMISSION TO USE
|
|
22
|
+
|
|
23
|
+
Permission is hereby granted, free of charge, to any person or
|
|
24
|
+
organization obtaining a copy of this software and associated
|
|
25
|
+
documentation files (the "Software"), to use, copy, modify, merge,
|
|
26
|
+
publish, distribute, sublicense, and/or sell copies of the Software,
|
|
27
|
+
and to permit persons to whom the Software is furnished to do so,
|
|
28
|
+
subject to the conditions below.
|
|
29
|
+
|
|
30
|
+
2. ATTRIBUTION
|
|
31
|
+
|
|
32
|
+
a. Redistributions of source code must retain this copyright notice,
|
|
33
|
+
this list of conditions, and the disclaimer below.
|
|
34
|
+
|
|
35
|
+
b. Redistributions in binary form or as a product must reproduce this
|
|
36
|
+
copyright notice, this list of conditions, and the disclaimer in the
|
|
37
|
+
documentation and/or other materials provided with the distribution.
|
|
38
|
+
|
|
39
|
+
c. Neither the name "Datacules LLC" nor the names of its contributors
|
|
40
|
+
may be used to endorse or promote products derived from this Software
|
|
41
|
+
without prior written permission from Datacules LLC.
|
|
42
|
+
|
|
43
|
+
3. COMMERCIAL USE
|
|
44
|
+
|
|
45
|
+
Use of this Software in commercial products, SaaS platforms, internal
|
|
46
|
+
enterprise tools, or any revenue-generating context is explicitly
|
|
47
|
+
permitted without royalty, fee, or additional licensing agreement,
|
|
48
|
+
provided that the conditions in Section 2 (Attribution) are met.
|
|
49
|
+
|
|
50
|
+
4. NO COPYLEFT / NO VIRAL REQUIREMENT
|
|
51
|
+
|
|
52
|
+
This license does NOT require that derivative works, modifications,
|
|
53
|
+
or software that uses or embeds this Software be made open source.
|
|
54
|
+
You may incorporate this Software into proprietary or closed-source
|
|
55
|
+
products under your own license terms.
|
|
56
|
+
|
|
57
|
+
5. MODIFICATIONS
|
|
58
|
+
|
|
59
|
+
Modified versions of the Software may be distributed under the same
|
|
60
|
+
terms as this license or under any other permissive open-source
|
|
61
|
+
license (e.g. MIT, Apache 2.0, BSD), provided that:
|
|
62
|
+
|
|
63
|
+
a. The original copyright notice of Datacules LLC is preserved.
|
|
64
|
+
b. Modifications are clearly documented and distinguished from the
|
|
65
|
+
original work.
|
|
66
|
+
|
|
67
|
+
6. COMPATIBILITY
|
|
68
|
+
|
|
69
|
+
This license is compatible with other permissive open-source licenses
|
|
70
|
+
such as MIT, BSD 2-Clause, BSD 3-Clause, and Apache License 2.0. It
|
|
71
|
+
is also GPL-compatible — this Software may coexist with GPL-licensed
|
|
72
|
+
code, though this Software itself is not distributed under the GPL.
|
|
73
|
+
|
|
74
|
+
─────────────────────────────────────────────────────────────────────────────
|
|
75
|
+
DISCLAIMER
|
|
76
|
+
─────────────────────────────────────────────────────────────────────────────
|
|
77
|
+
|
|
78
|
+
THIS SOFTWARE IS PROVIDED BY DATACULES LLC AND CONTRIBUTORS "AS IS" AND
|
|
79
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
80
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
|
|
81
|
+
AND NON-INFRINGEMENT ARE DISCLAIMED.
|
|
82
|
+
|
|
83
|
+
IN NO EVENT SHALL DATACULES LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
|
84
|
+
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
85
|
+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
86
|
+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
87
|
+
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
88
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
89
|
+
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
90
|
+
|
|
91
|
+
─────────────────────────────────────────────────────────────────────────────
|
|
92
|
+
SUMMARY (non-binding)
|
|
93
|
+
─────────────────────────────────────────────────────────────────────────────
|
|
94
|
+
|
|
95
|
+
✔ Use freely — commercial, proprietary, or open-source projects
|
|
96
|
+
✔ Modify and distribute with or without changes
|
|
97
|
+
✔ Sell products built on this Software
|
|
98
|
+
✔ No royalties or fees
|
|
99
|
+
✔ No requirement to open-source your own code
|
|
100
|
+
✔ Attribution to Datacules LLC required in source and binary distributions
|
|
101
|
+
✗ Do not use "Datacules LLC" to endorse derived products without permission
|
|
102
|
+
|
|
103
|
+
─────────────────────────────────────────────────────────────────────────────
|
|
104
|
+
CONTACT
|
|
105
|
+
─────────────────────────────────────────────────────────────────────────────
|
|
106
|
+
|
|
107
|
+
Datacules LLC
|
|
108
|
+
For licensing enquiries: legal@datacules.com
|
|
109
|
+
Product: https://github.com/hvrcharon1/agent-identity
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wrap any CredentialRouter with automatic OTEL span instrumentation.
|
|
3
|
+
*
|
|
4
|
+
* Span schema:
|
|
5
|
+
* agent_identity.resolve — sync resolve
|
|
6
|
+
* agent_identity.resolve_async — async resolve (includes approval + budget)
|
|
7
|
+
* agent_identity.resolve_pair — migration pair resolve (sync)
|
|
8
|
+
* agent_identity.resolve_pair_async — migration pair resolve (async)
|
|
9
|
+
*
|
|
10
|
+
* Attributes on every span:
|
|
11
|
+
* agent.user_id, agent.provider, agent.model, agent.action,
|
|
12
|
+
* credential.resource_id, credential.resource_kind,
|
|
13
|
+
* routing.canary (boolean), routing.resolved (boolean)
|
|
14
|
+
*
|
|
15
|
+
* Migration spans also set:
|
|
16
|
+
* migration.id, migration.phase, migration.dry_run
|
|
17
|
+
*/
|
|
18
|
+
export function withOtel(router, options) {
|
|
19
|
+
const { tracer, serviceName = 'agent-identity', includeUserId = true } = options;
|
|
20
|
+
function startSpan(name, ctx) {
|
|
21
|
+
const span = tracer.startSpan(`${serviceName}.${name}`);
|
|
22
|
+
span.setAttribute('agent.provider', ctx.provider);
|
|
23
|
+
span.setAttribute('agent.model', ctx.model);
|
|
24
|
+
span.setAttribute('agent.action', ctx.action);
|
|
25
|
+
span.setAttribute('credential.resource_id', ctx.resourceId);
|
|
26
|
+
span.setAttribute('credential.resource_kind', ctx.resourceKind);
|
|
27
|
+
if (includeUserId)
|
|
28
|
+
span.setAttribute('agent.user_id', ctx.userId);
|
|
29
|
+
if (ctx.traceId)
|
|
30
|
+
span.setAttribute('trace.id', ctx.traceId);
|
|
31
|
+
if (ctx.parentTraceId)
|
|
32
|
+
span.setAttribute('trace.parent_id', ctx.parentTraceId);
|
|
33
|
+
return span;
|
|
34
|
+
}
|
|
35
|
+
function annotateResult(span, resolved) {
|
|
36
|
+
span.setAttribute('routing.resolved', resolved !== null);
|
|
37
|
+
if (resolved) {
|
|
38
|
+
span.setAttribute('credential.id', resolved.credentialId);
|
|
39
|
+
span.setAttribute('credential.kind', resolved.kind);
|
|
40
|
+
span.setAttribute('routing.canary', resolved.isCanary ?? false);
|
|
41
|
+
span.setAttribute('routing.resolved_for', resolved.resolvedFor);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
function annotateMigrationCtx(span, ctx) {
|
|
45
|
+
span.setAttribute('migration.id', ctx.migrationId);
|
|
46
|
+
span.setAttribute('migration.phase', ctx.phase);
|
|
47
|
+
span.setAttribute('migration.dry_run', ctx.dryRun);
|
|
48
|
+
}
|
|
49
|
+
return {
|
|
50
|
+
resolve(ctx) {
|
|
51
|
+
const span = startSpan('resolve', ctx);
|
|
52
|
+
try {
|
|
53
|
+
const result = router.resolve(ctx);
|
|
54
|
+
annotateResult(span, result);
|
|
55
|
+
return result;
|
|
56
|
+
}
|
|
57
|
+
catch (err) {
|
|
58
|
+
span.recordException(err);
|
|
59
|
+
span.setStatus({ code: 2 }); // ERROR
|
|
60
|
+
throw err;
|
|
61
|
+
}
|
|
62
|
+
finally {
|
|
63
|
+
span.end();
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
async resolveAsync(ctx) {
|
|
67
|
+
const span = startSpan('resolve_async', ctx);
|
|
68
|
+
try {
|
|
69
|
+
const result = await router.resolveAsync(ctx);
|
|
70
|
+
annotateResult(span, result);
|
|
71
|
+
return result;
|
|
72
|
+
}
|
|
73
|
+
catch (err) {
|
|
74
|
+
span.recordException(err);
|
|
75
|
+
span.setStatus({ code: 2 });
|
|
76
|
+
throw err;
|
|
77
|
+
}
|
|
78
|
+
finally {
|
|
79
|
+
span.end();
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
resolvePair(ctx) {
|
|
83
|
+
const span = startSpan('resolve_pair', ctx);
|
|
84
|
+
annotateMigrationCtx(span, ctx);
|
|
85
|
+
try {
|
|
86
|
+
const result = router.resolvePair(ctx);
|
|
87
|
+
span.setAttribute('routing.resolved', result !== null);
|
|
88
|
+
return result;
|
|
89
|
+
}
|
|
90
|
+
catch (err) {
|
|
91
|
+
span.recordException(err);
|
|
92
|
+
span.setStatus({ code: 2 });
|
|
93
|
+
throw err;
|
|
94
|
+
}
|
|
95
|
+
finally {
|
|
96
|
+
span.end();
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
async resolvePairAsync(ctx) {
|
|
100
|
+
const span = startSpan('resolve_pair_async', ctx);
|
|
101
|
+
annotateMigrationCtx(span, ctx);
|
|
102
|
+
try {
|
|
103
|
+
const result = await router.resolvePairAsync(ctx);
|
|
104
|
+
span.setAttribute('routing.resolved', result !== null);
|
|
105
|
+
return result;
|
|
106
|
+
}
|
|
107
|
+
catch (err) {
|
|
108
|
+
span.recordException(err);
|
|
109
|
+
span.setStatus({ code: 2 });
|
|
110
|
+
throw err;
|
|
111
|
+
}
|
|
112
|
+
finally {
|
|
113
|
+
span.end();
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AA4CA;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,QAAQ,CAAC,MAAoB,EAAE,OAA2B;IACxE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,gBAAgB,EAAE,aAAa,GAAG,IAAI,EAAE,GAAG,OAAO,CAAC;IAEjF,SAAS,SAAS,CAAC,IAAY,EAAE,GAAwB;QACvD,MAAM,IAAI,GAAG,MAAM,CAAC,SAAS,CAAC,GAAG,WAAW,IAAI,IAAI,EAAE,CAAC,CAAC;QACxD,IA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G,CAAC;YACZ,CAAC;oBAAS,CAAC;gBACT,IAAI,CAAC,GAAG,EAAE,CAAC;YACb,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @datacules/agent-identity-otel
|
|
3
|
+
*
|
|
4
|
+
* Zero-config OpenTelemetry wrapper for @datacules/agent-identity.
|
|
5
|
+
* Wraps CredentialRouter to emit spans on every resolve, store lookup,
|
|
6
|
+
* and audit emission — without touching your existing code.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* import { withOtel } from '@datacules/agent-identity-otel';
|
|
10
|
+
* import { trace } from '@opentelemetry/api';
|
|
11
|
+
*
|
|
12
|
+
* const router = withOtel(createRouter(credentials, rules, logger), {
|
|
13
|
+
* tracer: trace.getTracer('agent-identity'),
|
|
14
|
+
* });
|
|
15
|
+
*/
|
|
16
|
+
import type { Tracer } from '@opentelemetry/api';
|
|
17
|
+
import type { AgentRequestContext, ResolvedCredential, MigrationContext, ResolvedCredentialPair } from '@datacules/agent-identity';
|
|
18
|
+
export interface OtelWrapperOptions {
|
|
19
|
+
tracer: Tracer;
|
|
20
|
+
/** Service name prefix on every span (default: 'agent-identity') */
|
|
21
|
+
serviceName?: string;
|
|
22
|
+
/** If true, include userId in span attributes (default: true) */
|
|
23
|
+
includeUserId?: boolean;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Structural interface that CredentialRouter satisfies.
|
|
27
|
+
* withOtel() accepts any object that matches this shape — not just
|
|
28
|
+
* CredentialRouter — so it works with any custom router implementation.
|
|
29
|
+
*/
|
|
30
|
+
export interface TracedRouter {
|
|
31
|
+
resolve(ctx: AgentRequestContext): ResolvedCredential | null;
|
|
32
|
+
resolveAsync(ctx: AgentRequestContext): Promise<ResolvedCredential | null>;
|
|
33
|
+
resolvePair(ctx: MigrationContext): ResolvedCredentialPair | null;
|
|
34
|
+
/**
|
|
35
|
+
* Async counterpart of resolvePair() — benefits from budget enforcement,
|
|
36
|
+
* attestation, and approval gates on migration workflows.
|
|
37
|
+
* Added to TracedRouter to match the method added to CredentialRouter in
|
|
38
|
+
* the v0.3.0 hardening pass (PR #19).
|
|
39
|
+
*/
|
|
40
|
+
resolvePairAsync(ctx: MigrationContext): Promise<ResolvedCredentialPair | null>;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Wrap any CredentialRouter with automatic OTEL span instrumentation.
|
|
44
|
+
*
|
|
45
|
+
* Span schema:
|
|
46
|
+
* agent_identity.resolve — sync resolve
|
|
47
|
+
* agent_identity.resolve_async — async resolve (includes approval + budget)
|
|
48
|
+
* agent_identity.resolve_pair — migration pair resolve (sync)
|
|
49
|
+
* agent_identity.resolve_pair_async — migration pair resolve (async)
|
|
50
|
+
*
|
|
51
|
+
* Attributes on every span:
|
|
52
|
+
* agent.user_id, agent.provider, agent.model, agent.action,
|
|
53
|
+
* credential.resource_id, credential.resource_kind,
|
|
54
|
+
* routing.canary (boolean), routing.resolved (boolean)
|
|
55
|
+
*
|
|
56
|
+
* Migration spans also set:
|
|
57
|
+
* migration.id, migration.phase, migration.dry_run
|
|
58
|
+
*/
|
|
59
|
+
export declare function withOtel(router: TracedRouter, options: OtelWrapperOptions): TracedRouter;
|
|
60
|
+
export type { OtelWrapperOptions as WithOtelOptions };
|
|
61
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,EAAE,MAAM,EAAwB,MAAM,oBAAoB,CAAC;AACvE,OAAO,KAAK,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAEnI,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,oEAAoE;IACpE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iEAAiE;IACjE,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,OAAO,CAAC,GAAG,EAAE,mBAAmB,GAAG,kBAAkB,GAAG,IAAI,CAAC;IAC7D,YAAY,CAAC,GAAG,EAAE,mBAAmB,GAAG,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAAC;IAC3E,WAAW,CAAC,GAAG,EAAE,gBAAgB,GAAG,sBAAsB,GAAG,IAAI,CAAC;IAClE;;;;;OAKG;IACH,gBAAgB,CAAC,GAAG,EAAE,gBAAgB,GAAG,OAAO,CAAC,sBAAsB,GAAG,IAAI,CAAC,CAAC;CACjF;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,kBAAkB,GAAG,YAAY,CA+FxF;AAGD,YAAY,EAAE,kBAAkB,IAAI,eAAe,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,10 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datacules/agent-identity-otel",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Zero-config OpenTelemetry tracing wrapper for @datacules/agent-identity",
|
|
6
6
|
"author": "Datacules LLC",
|
|
7
|
-
"license": "
|
|
7
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/hvrcharon1/agent-identity.git",
|
|
11
|
+
"directory": "packages/integrations/otel"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [
|
|
14
|
+
"agent-identity",
|
|
15
|
+
"opentelemetry",
|
|
16
|
+
"otel",
|
|
17
|
+
"tracing",
|
|
18
|
+
"observability",
|
|
19
|
+
"ai-agents",
|
|
20
|
+
"datacules"
|
|
21
|
+
],
|
|
8
22
|
"module": "./dist/esm/index.js",
|
|
9
23
|
"types": "./dist/types/index.d.ts",
|
|
10
24
|
"exports": {
|
|
@@ -15,20 +29,22 @@
|
|
|
15
29
|
},
|
|
16
30
|
"files": [
|
|
17
31
|
"dist",
|
|
18
|
-
"README.md"
|
|
32
|
+
"README.md",
|
|
33
|
+
"LICENSE"
|
|
19
34
|
],
|
|
20
35
|
"scripts": {
|
|
21
36
|
"build": "tsc -p tsconfig.build.json",
|
|
22
37
|
"type-check": "tsc --noEmit",
|
|
23
38
|
"lint": "eslint src --ext .ts"
|
|
24
39
|
},
|
|
25
|
-
"dependencies": {
|
|
26
|
-
"@datacules/agent-identity": "^0.8.0"
|
|
27
|
-
},
|
|
28
40
|
"peerDependencies": {
|
|
41
|
+
"@datacules/agent-identity": "^0.11.1",
|
|
29
42
|
"@opentelemetry/api": ">=1.0.0"
|
|
30
43
|
},
|
|
31
44
|
"peerDependenciesMeta": {
|
|
45
|
+
"@datacules/agent-identity": {
|
|
46
|
+
"optional": false
|
|
47
|
+
},
|
|
32
48
|
"@opentelemetry/api": {
|
|
33
49
|
"optional": false
|
|
34
50
|
}
|