@moldea.ai/adapter-openai-agents-sdk 1.0.7 → 2.0.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/README.md +3 -3
- package/dist/constants/index.d.ts +1 -1
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/index.js +13 -12
- package/dist/inspection/handoffs.d.ts +1 -1
- package/dist/inspection/handoffs.d.ts.map +1 -1
- package/dist/inspection/inspection.d.ts.map +1 -1
- package/dist/inspection/relationships.d.ts +1 -1
- package/dist/inspection/relationships.d.ts.map +1 -1
- package/dist/inspection/session.d.ts +1 -1
- package/dist/inspection/session.d.ts.map +1 -1
- package/dist/package-discovery/index.d.ts +3 -2
- package/dist/package-discovery/index.d.ts.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -8,12 +8,12 @@ The package implements the official `openai-agents-sdk` runtime adapter for `@mo
|
|
|
8
8
|
|
|
9
9
|
## Supported target
|
|
10
10
|
|
|
11
|
-
Version `
|
|
11
|
+
Version `2.0.1` supports:
|
|
12
12
|
|
|
13
13
|
- Repository Format version `1`
|
|
14
|
-
- `@moldea.ai/core
|
|
14
|
+
- `@moldea.ai/core ^3.0.0`
|
|
15
15
|
- TypeScript ESM source
|
|
16
|
-
- npm `@openai/agents >=0.16.1
|
|
16
|
+
- npm `@openai/agents >=0.16.1`
|
|
17
17
|
- directly exported `const` agents constructed through `new Agent({ ... })` or `Agent.create({ ... })`
|
|
18
18
|
- direct, awaited, referenced, or single-return-wrapper instruction loaders
|
|
19
19
|
- direct agent output-schema relationships through `outputType`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const OPENAI_AGENTS_SDK_ADAPTER_ID = "openai-agents-sdk";
|
|
2
2
|
export declare const OPENAI_AGENTS_SDK_PACKAGE_NAME = "@openai/agents";
|
|
3
|
-
export declare const OPENAI_AGENTS_SDK_SUPPORTED_RANGE = ">=0.16.1
|
|
3
|
+
export declare const OPENAI_AGENTS_SDK_SUPPORTED_RANGE = ">=0.16.1";
|
|
4
4
|
export declare const OPENAI_AGENTS_SDK_TARGET_ID = "typescript-agent-handoffs-0-16";
|
|
5
5
|
export declare const OPENAI_AGENTS_SDK_SUPPORTED_REPOSITORY_FORMAT_VERSIONS: readonly 1[];
|
|
6
6
|
export declare const OPENAI_AGENTS_SDK_TOOL_NAME_PATTERN: RegExp;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,4BAA4B,sBAAsB,CAAC;AAChE,eAAO,MAAM,8BAA8B,mBAAmB,CAAC;AAC/D,eAAO,MAAM,iCAAiC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,4BAA4B,sBAAsB,CAAC;AAChE,eAAO,MAAM,8BAA8B,mBAAmB,CAAC;AAC/D,eAAO,MAAM,iCAAiC,aAAa,CAAC;AAC5D,eAAO,MAAM,2BAA2B,mCAAmC,CAAC;AAC5E,eAAO,MAAM,sDAAsD,cAEnB,CAAC;AAGjD,eAAO,MAAM,mCAAmC,QAAoB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -2,10 +2,11 @@ import { posix } from "node:path";
|
|
|
2
2
|
import { intersects, subset, validRange } from "semver";
|
|
3
3
|
import ts from "typescript";
|
|
4
4
|
import { parseRepositoryPath } from "@moldea.ai/repository";
|
|
5
|
+
import { readRuntimeAdapterFile } from "@moldea.ai/core/adapter";
|
|
5
6
|
//#region src/constants/index.ts
|
|
6
7
|
var OPENAI_AGENTS_SDK_ADAPTER_ID = "openai-agents-sdk";
|
|
7
8
|
var OPENAI_AGENTS_SDK_PACKAGE_NAME = "@openai/agents";
|
|
8
|
-
var OPENAI_AGENTS_SDK_SUPPORTED_RANGE = ">=0.16.1
|
|
9
|
+
var OPENAI_AGENTS_SDK_SUPPORTED_RANGE = ">=0.16.1";
|
|
9
10
|
var OPENAI_AGENTS_SDK_SUPPORTED_REPOSITORY_FORMAT_VERSIONS = Object.freeze([1]);
|
|
10
11
|
var OPENAI_AGENTS_SDK_TOOL_NAME_PATTERN = /^[A-Za-z0-9_]+$/;
|
|
11
12
|
//#endregion
|
|
@@ -1606,9 +1607,9 @@ var resolveTarget = async (session, sourceAnalysis, expression) => {
|
|
|
1606
1607
|
}
|
|
1607
1608
|
return resolvedTargets.length === 1 ? resolvedTargets[0] : null;
|
|
1608
1609
|
};
|
|
1609
|
-
var
|
|
1610
|
-
|
|
1611
|
-
|
|
1610
|
+
var resolveMappedAgent = (context, target) => context.resolveAgent({
|
|
1611
|
+
path: target.path,
|
|
1612
|
+
symbol: target.symbol
|
|
1612
1613
|
});
|
|
1613
1614
|
var getSafeDetails = (registration, routingDescriptionSource, target, targetAgentId) => ({
|
|
1614
1615
|
registrationKind: registration.kind,
|
|
@@ -1660,17 +1661,17 @@ var inspectOpenAiAgentsSdkHandoffs = async (context, session, agent, analysis, d
|
|
|
1660
1661
|
if (registration === null) continue;
|
|
1661
1662
|
const target = await resolveTarget(session, analysis, registration.target);
|
|
1662
1663
|
if (target === null) continue;
|
|
1663
|
-
const
|
|
1664
|
+
const resolution = resolveMappedAgent(context, target);
|
|
1665
|
+
const mappedAgent = resolution.kind === "matched" ? resolution.agent : void 0;
|
|
1664
1666
|
const runtimeName = await getRuntimeName(session, analysis, registration);
|
|
1665
1667
|
let routingDescriptionSource = "unresolved";
|
|
1666
|
-
if (
|
|
1667
|
-
else if (
|
|
1668
|
-
const targetAgent = mappedAgents.length === 1 ? mappedAgents[0] : void 0;
|
|
1668
|
+
if (resolution.kind === "ambiguous") addOpenAiAgentsSdkDiagnostic(diagnostics, "OPENAI_AGENTS_SDK_HANDOFF_TARGET_AMBIGUOUS", analysis.path, agent.id, locateOpenAiAgentsSdkNode(analysis, registration.target), void 0, getAmbiguousTargetDetails(registration, target));
|
|
1669
|
+
else if (mappedAgent !== void 0) routingDescriptionSource = await inspectRoutingDescription(session, agent, analysis, registration, target, mappedAgent, diagnostics);
|
|
1669
1670
|
evidence.push(createOpenAiAgentsSdkEvidence({
|
|
1670
1671
|
agentId: agent.id,
|
|
1671
1672
|
capabilityId: null,
|
|
1672
1673
|
capabilityKind: null,
|
|
1673
|
-
details: getSafeDetails(registration, routingDescriptionSource, target,
|
|
1674
|
+
details: getSafeDetails(registration, routingDescriptionSource, target, mappedAgent?.id),
|
|
1674
1675
|
kind: "handoff-registration",
|
|
1675
1676
|
references: [{ path: analysis.path }, {
|
|
1676
1677
|
path: target.path,
|
|
@@ -1921,7 +1922,7 @@ var discoverOpenAiAgentsSdkPackage = async (repository, sourcePath, signal) => {
|
|
|
1921
1922
|
packageName: OPENAI_AGENTS_SDK_PACKAGE_NAME,
|
|
1922
1923
|
reader: {
|
|
1923
1924
|
getEntry: (path) => repository.getEntry(parseRepositoryPath(path), repositoryOptions),
|
|
1924
|
-
readFile: (path) => repository
|
|
1925
|
+
readFile: (path) => readRuntimeAdapterFile(repository, parseRepositoryPath(path), repositoryOptions)
|
|
1925
1926
|
},
|
|
1926
1927
|
...signal === void 0 ? {} : { signal },
|
|
1927
1928
|
sourcePath,
|
|
@@ -1947,7 +1948,7 @@ var createOpenAiAgentsSdkInspectionSession = (context) => createInspectionSessio
|
|
|
1947
1948
|
analyzeSource: analyzeOpenAiAgentsSdkSource,
|
|
1948
1949
|
discoverPackage: (path, signal) => discoverOpenAiAgentsSdkPackage(context.repository, path, signal),
|
|
1949
1950
|
getEntry: (path, signal) => context.repository.getEntry(path, signal === void 0 ? void 0 : { signal }),
|
|
1950
|
-
readFile: (path, signal) => context.repository
|
|
1951
|
+
readFile: (path, signal) => readRuntimeAdapterFile(context.repository, path, signal === void 0 ? void 0 : { signal }),
|
|
1951
1952
|
...context.signal === void 0 ? {} : { signal: context.signal }
|
|
1952
1953
|
});
|
|
1953
1954
|
//#endregion
|
|
@@ -2017,7 +2018,7 @@ var inspectOpenAiAgentsSdk = async (context) => {
|
|
|
2017
2018
|
const session = createOpenAiAgentsSdkInspectionSession(context);
|
|
2018
2019
|
const evidence = [];
|
|
2019
2020
|
const diagnostics = [];
|
|
2020
|
-
const agents = [
|
|
2021
|
+
const agents = [context.agent];
|
|
2021
2022
|
for (const agent of agents) {
|
|
2022
2023
|
context.signal?.throwIfAborted();
|
|
2023
2024
|
await inspectAgent(context, session, agent, evidence, diagnostics);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IIndexedAgent, IRuntimeAdapterEvidence } from '@moldea.ai/core';
|
|
1
|
+
import type { IIndexedAgent, IRuntimeAdapterEvidence } from '@moldea.ai/core/adapter';
|
|
2
2
|
import type { IAdapterDiagnostic, IRuntimeAdapterContext } from '@moldea.ai/core/adapter';
|
|
3
3
|
import type { IOpenAiAgentsSdkAgentDefinition, IOpenAiAgentsSdkInspectionSession, IOpenAiAgentsSdkSourceAnalysis } from '../contracts/index.js';
|
|
4
4
|
/** Inspects runtime-native handoff registrations and routing-description wiring. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handoffs.d.ts","sourceRoot":"","sources":["../../src/inspection/handoffs.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,uBAAuB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"handoffs.d.ts","sourceRoot":"","sources":["../../src/inspection/handoffs.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AACtF,OAAO,KAAK,EACV,kBAAkB,EAClB,sBAAsB,EAEvB,MAAM,yBAAyB,CAAC;AAIjC,OAAO,KAAK,EACV,+BAA+B,EAE/B,iCAAiC,EAEjC,8BAA8B,EAC/B,MAAM,uBAAuB,CAAC;AAiP/B,oFAAoF;AACpF,eAAO,MAAM,8BAA8B,GACzC,SAAS,sBAAsB,EAC/B,SAAS,iCAAiC,EAC1C,OAAO,aAAa,EACpB,UAAU,8BAA8B,EACxC,YAAY,+BAA+B,EAC3C,UAAU,uBAAuB,EAAE,EACnC,aAAa,kBAAkB,EAAE,KAChC,OAAO,CAAC,IAAI,CAgFd,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inspection.d.ts","sourceRoot":"","sources":["../../src/inspection/inspection.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAEV,sBAAsB,EACtB,qBAAqB,EACtB,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"inspection.d.ts","sourceRoot":"","sources":["../../src/inspection/inspection.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAEV,sBAAsB,EACtB,qBAAqB,EACtB,MAAM,yBAAyB,CAAC;AAqIjC;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,sBAAsB,GACjC,SAAS,sBAAsB,KAC9B,OAAO,CAAC,qBAAqB,CAiB/B,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IIndexedAgent, IRuntimeAdapterEvidence } from '@moldea.ai/core';
|
|
1
|
+
import type { IIndexedAgent, IRuntimeAdapterEvidence } from '@moldea.ai/core/adapter';
|
|
2
2
|
import type { IAdapterDiagnostic } from '@moldea.ai/core/adapter';
|
|
3
3
|
import type { IOpenAiAgentsSdkAgentDefinition, IOpenAiAgentsSdkInspectionSession, IOpenAiAgentsSdkSourceAnalysis } from '../contracts/index.js';
|
|
4
4
|
/** Inspects instruction, agent-schema, function-tool, and tool-schema relationships. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"relationships.d.ts","sourceRoot":"","sources":["../../src/inspection/relationships.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,uBAAuB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"relationships.d.ts","sourceRoot":"","sources":["../../src/inspection/relationships.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AACtF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAOlE,OAAO,KAAK,EACV,+BAA+B,EAE/B,iCAAiC,EAEjC,8BAA8B,EAC/B,MAAM,uBAAuB,CAAC;AAikB/B,wFAAwF;AACxF,eAAO,MAAM,mCAAmC,GAC9C,SAAS,iCAAiC,EAC1C,OAAO,aAAa,EACpB,UAAU,8BAA8B,EACxC,YAAY,+BAA+B,EAC3C,UAAU,uBAAuB,EAAE,EACnC,aAAa,kBAAkB,EAAE,KAChC,OAAO,CAAC,IAAI,CAId,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type IRuntimeAdapterContext } from '@moldea.ai/core/adapter';
|
|
2
2
|
import type { IOpenAiAgentsSdkInspectionSession } from '../contracts/index.js';
|
|
3
3
|
/** Creates one operation-local OpenAI Agents SDK inspection session. */
|
|
4
4
|
export declare const createOpenAiAgentsSdkInspectionSession: (context: IRuntimeAdapterContext) => IOpenAiAgentsSdkInspectionSession;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/inspection/session.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/inspection/session.ts"],"names":[],"mappings":"AACA,OAAO,EAA0B,KAAK,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAE9F,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,uBAAuB,CAAC;AAI/E,wEAAwE;AACxE,eAAO,MAAM,sCAAsC,GACjD,SAAS,sBAAsB,KAC9B,iCAcC,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type IRuntimeAdapterRepository } from '@moldea.ai/core/adapter';
|
|
2
|
+
import type { IRepositoryPath } from '@moldea.ai/repository';
|
|
2
3
|
import type { IOpenAiAgentsSdkPackageDiscoveryResult } from '../contracts/index.js';
|
|
3
4
|
/**
|
|
4
5
|
* Creates nearest-to-root package-manifest candidates for one source path.
|
|
@@ -23,5 +24,5 @@ export declare const createPackageManifestCandidatePaths: (sourcePath: IReposito
|
|
|
23
24
|
* - RESOURCE_LIMIT_EXCEEDED: A repository reading resource limit was exceeded.
|
|
24
25
|
* - ABORTED: The repository operation was aborted.
|
|
25
26
|
*/
|
|
26
|
-
export declare const discoverOpenAiAgentsSdkPackage: (repository:
|
|
27
|
+
export declare const discoverOpenAiAgentsSdkPackage: (repository: IRuntimeAdapterRepository, sourcePath: IRepositoryPath, signal?: AbortSignal) => Promise<IOpenAiAgentsSdkPackageDiscoveryResult>;
|
|
27
28
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/package-discovery/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/package-discovery/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAA0B,KAAK,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AACjG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAO7D,OAAO,KAAK,EAAE,sCAAsC,EAAE,MAAM,uBAAuB,CAAC;AAEpF;;;;GAIG;AACH,eAAO,MAAM,mCAAmC,GAC9C,YAAY,eAAe,KAC1B,SAAS,eAAe,EACgD,CAAC;AAE5E;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,8BAA8B,GACzC,YAAY,yBAAyB,EACrC,YAAY,eAAe,EAC3B,SAAS,WAAW,KACnB,OAAO,CAAC,sCAAsC,CA6BhD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moldea.ai/adapter-openai-agents-sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "Deterministic runtime evidence and diagnostics for direct OpenAI Agents SDK integrations.",
|
|
5
5
|
"homepage": "https://github.com/moldea-ai/packages/tree/main/projects/adapter-openai-agents-sdk#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"node": ">=22.11.0"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@moldea.ai/core": "
|
|
37
|
-
"@moldea.ai/repository": "
|
|
36
|
+
"@moldea.ai/core": "^3.0.0",
|
|
37
|
+
"@moldea.ai/repository": "^2.0.0",
|
|
38
38
|
"semver": "7.8.5",
|
|
39
39
|
"typescript": "6.0.3"
|
|
40
40
|
},
|