@moldea.ai/adapter-openai-agents-sdk 1.0.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.
Files changed (51) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +90 -0
  3. package/cover.png +0 -0
  4. package/dist/adapter/index.d.ts +3 -0
  5. package/dist/adapter/index.d.ts.map +1 -0
  6. package/dist/constants/index.d.ts +7 -0
  7. package/dist/constants/index.d.ts.map +1 -0
  8. package/dist/contracts/index.d.ts +164 -0
  9. package/dist/contracts/index.d.ts.map +1 -0
  10. package/dist/diagnostics/index.d.ts +32 -0
  11. package/dist/diagnostics/index.d.ts.map +1 -0
  12. package/dist/index.d.ts +2 -0
  13. package/dist/index.d.ts.map +1 -0
  14. package/dist/index.js +1993 -0
  15. package/dist/inspection/common.d.ts +36 -0
  16. package/dist/inspection/common.d.ts.map +1 -0
  17. package/dist/inspection/handoffs.d.ts +6 -0
  18. package/dist/inspection/handoffs.d.ts.map +1 -0
  19. package/dist/inspection/index.d.ts +2 -0
  20. package/dist/inspection/index.d.ts.map +1 -0
  21. package/dist/inspection/inspection.d.ts +18 -0
  22. package/dist/inspection/inspection.d.ts.map +1 -0
  23. package/dist/inspection/package-inspection.d.ts +7 -0
  24. package/dist/inspection/package-inspection.d.ts.map +1 -0
  25. package/dist/inspection/relationships.d.ts +6 -0
  26. package/dist/inspection/relationships.d.ts.map +1 -0
  27. package/dist/inspection/session.d.ts +5 -0
  28. package/dist/inspection/session.d.ts.map +1 -0
  29. package/dist/package-discovery/index.d.ts +27 -0
  30. package/dist/package-discovery/index.d.ts.map +1 -0
  31. package/dist/source-analysis/agent-definitions.d.ts +20 -0
  32. package/dist/source-analysis/agent-definitions.d.ts.map +1 -0
  33. package/dist/source-analysis/bindings.d.ts +11 -0
  34. package/dist/source-analysis/bindings.d.ts.map +1 -0
  35. package/dist/source-analysis/function-tools.d.ts +9 -0
  36. package/dist/source-analysis/function-tools.d.ts.map +1 -0
  37. package/dist/source-analysis/handoffs.d.ts +27 -0
  38. package/dist/source-analysis/handoffs.d.ts.map +1 -0
  39. package/dist/source-analysis/index.d.ts +11 -0
  40. package/dist/source-analysis/index.d.ts.map +1 -0
  41. package/dist/source-analysis/instruction-loaders.d.ts +11 -0
  42. package/dist/source-analysis/instruction-loaders.d.ts.map +1 -0
  43. package/dist/source-analysis/mutations.d.ts +15 -0
  44. package/dist/source-analysis/mutations.d.ts.map +1 -0
  45. package/dist/source-analysis/source-analysis.d.ts +11 -0
  46. package/dist/source-analysis/source-analysis.d.ts.map +1 -0
  47. package/dist/source-analysis/static-strings.d.ts +11 -0
  48. package/dist/source-analysis/static-strings.d.ts.map +1 -0
  49. package/dist/source-analysis/tool-collections.d.ts +27 -0
  50. package/dist/source-analysis/tool-collections.d.ts.map +1 -0
  51. package/package.json +60 -0
@@ -0,0 +1,36 @@
1
+ import type ts from 'typescript';
2
+ import type { IRuntimeAdapterEvidence, ISourceRange } from '@moldea.ai/core';
3
+ import type { IAdapterDiagnostic } from '@moldea.ai/core/adapter';
4
+ import type { IRepositoryReference } from '@moldea.ai/core/format';
5
+ import type { IRepositoryPath } from '@moldea.ai/repository';
6
+ import type { IOpenAiAgentsSdkAdapterDiagnosticCode, IOpenAiAgentsSdkInspectionSession, IOpenAiAgentsSdkSourceAnalysis } from '../contracts/index.js';
7
+ /** Compares exact strings without locale-dependent behavior. */
8
+ export declare const compareOpenAiAgentsSdkStrings: (left: string, right: string) => number;
9
+ /** Determines whether a runtime-visible value satisfies Core's machine-string contract. */
10
+ export declare const isOpenAiAgentsSdkMachineString: (value: string) => boolean;
11
+ /** Creates one deeply immutable OpenAI Agents SDK evidence record. */
12
+ export declare const createOpenAiAgentsSdkEvidence: (evidence: IRuntimeAdapterEvidence) => IRuntimeAdapterEvidence;
13
+ /**
14
+ * Appends one stable package-owned diagnostic.
15
+ * @param diagnostics The operation result collection.
16
+ * @param code The stable diagnostic code.
17
+ * @param path The exact affected path.
18
+ * @param agentId The owning source-agent identifier.
19
+ * @param range The optional scalar source range.
20
+ * @param capabilityId The optional owning tool capability.
21
+ * @param details Safe scalar diagnostic details.
22
+ */
23
+ export declare const addOpenAiAgentsSdkDiagnostic: (diagnostics: IAdapterDiagnostic[], code: IOpenAiAgentsSdkAdapterDiagnosticCode, path: IRepositoryPath | null, agentId: string, range?: ISourceRange | null, capabilityId?: string, details?: IAdapterDiagnostic["details"]) => void;
24
+ /** Returns the Core scalar range for one node in its analyzed source. */
25
+ export declare const locateOpenAiAgentsSdkNode: (analysis: IOpenAiAgentsSdkSourceAnalysis, node: ts.Node) => ISourceRange;
26
+ /**
27
+ * Loads and validates one supported bound TypeScript source.
28
+ * @param session The operation-local inspection session.
29
+ * @param reference The exact manifest reference.
30
+ * @param diagnostics The operation result collection.
31
+ * @param agentId The owning agent identifier.
32
+ * @param capabilityId The optional owning tool capability.
33
+ * @returns The indexed source or `null` after unsupported or invalid input.
34
+ */
35
+ export declare const analyzeOpenAiAgentsSdkBoundReference: (session: IOpenAiAgentsSdkInspectionSession, reference: IRepositoryReference, diagnostics: IAdapterDiagnostic[], agentId: string, capabilityId?: string) => Promise<IOpenAiAgentsSdkSourceAnalysis | null>;
36
+ //# sourceMappingURL=common.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/inspection/common.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAGjC,OAAO,KAAK,EAAE,uBAAuB,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC7E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAG7D,OAAO,KAAK,EACV,qCAAqC,EACrC,iCAAiC,EACjC,8BAA8B,EAC/B,MAAM,uBAAuB,CAAC;AAiB/B,gEAAgE;AAChE,eAAO,MAAM,6BAA6B,GAAI,MAAM,MAAM,EAAE,OAAO,MAAM,KAAG,MAClC,CAAC;AAE3C,2FAA2F;AAC3F,eAAO,MAAM,8BAA8B,GAAI,OAAO,MAAM,KAAG,OAW9D,CAAC;AAQF,sEAAsE;AACtE,eAAO,MAAM,6BAA6B,GACxC,UAAU,uBAAuB,KAChC,uBAKC,CAAC;AASL;;;;;;;;;GASG;AACH,eAAO,MAAM,4BAA4B,GACvC,aAAa,kBAAkB,EAAE,EACjC,MAAM,qCAAqC,EAC3C,MAAM,eAAe,GAAG,IAAI,EAC5B,SAAS,MAAM,EACf,QAAO,YAAY,GAAG,IAAW,EACjC,eAAe,MAAM,EACrB,UAAS,kBAAkB,CAAC,SAAS,CAAM,KAC1C,IAWF,CAAC;AAEF,yEAAyE;AACzE,eAAO,MAAM,yBAAyB,GACpC,UAAU,8BAA8B,EACxC,MAAM,EAAE,CAAC,IAAI,KACZ,YACmF,CAAC;AAEvF;;;;;;;;GAQG;AACH,eAAO,MAAM,oCAAoC,GAC/C,SAAS,iCAAiC,EAC1C,WAAW,oBAAoB,EAC/B,aAAa,kBAAkB,EAAE,EACjC,SAAS,MAAM,EACf,eAAe,MAAM,KACpB,OAAO,CAAC,8BAA8B,GAAG,IAAI,CAgC/C,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { IIndexedAgent, IRuntimeAdapterEvidence } from '@moldea.ai/core';
2
+ import type { IAdapterDiagnostic, IRuntimeAdapterContext } from '@moldea.ai/core/adapter';
3
+ import type { IOpenAiAgentsSdkAgentDefinition, IOpenAiAgentsSdkInspectionSession, IOpenAiAgentsSdkSourceAnalysis } from '../contracts/index.js';
4
+ /** Inspects runtime-native handoff registrations and routing-description wiring. */
5
+ export declare const inspectOpenAiAgentsSdkHandoffs: (context: IRuntimeAdapterContext, session: IOpenAiAgentsSdkInspectionSession, agent: IIndexedAgent, analysis: IOpenAiAgentsSdkSourceAnalysis, definition: IOpenAiAgentsSdkAgentDefinition, evidence: IRuntimeAdapterEvidence[], diagnostics: IAdapterDiagnostic[]) => Promise<void>;
6
+ //# sourceMappingURL=handoffs.d.ts.map
@@ -0,0 +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,iBAAiB,CAAC;AAC9E,OAAO,KAAK,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAI1F,OAAO,KAAK,EACV,+BAA+B,EAE/B,iCAAiC,EAEjC,8BAA8B,EAC/B,MAAM,uBAAuB,CAAC;AAoP/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,CAiFd,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { inspectOpenAiAgentsSdk } from './inspection.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/inspection/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,18 @@
1
+ import type { IRuntimeAdapterContext, IRuntimeAdapterResult } from '@moldea.ai/core/adapter';
2
+ /**
3
+ * Inspects all scoped OpenAI Agents SDK agents through one deterministic session.
4
+ * @param context The Core-provided immutable adapter context.
5
+ * @returns A promise resolving to source-grounded evidence and diagnostics.
6
+ * @throws
7
+ * - INVALID_REPOSITORY_PATH: The repository path is invalid.
8
+ * - ENTRY_NOT_FOUND: The requested repository entry was not found.
9
+ * - ENTRY_NOT_FILE: The requested repository entry is not a file.
10
+ * - ACCESS_DENIED: Access to the repository source was denied.
11
+ * - SOURCE_UNAVAILABLE: The repository source is unavailable.
12
+ * - SNAPSHOT_CHANGED: The repository snapshot changed during the operation.
13
+ * - INVALID_SOURCE_DATA: The repository source returned invalid data.
14
+ * - RESOURCE_LIMIT_EXCEEDED: A repository reading resource limit was exceeded.
15
+ * - ABORTED: The repository operation or inspection signal was aborted.
16
+ */
17
+ export declare const inspectOpenAiAgentsSdk: (context: IRuntimeAdapterContext) => Promise<IRuntimeAdapterResult>;
18
+ //# sourceMappingURL=inspection.d.ts.map
@@ -0,0 +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;AAsIjC;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,sBAAsB,GACjC,SAAS,sBAAsB,KAC9B,OAAO,CAAC,qBAAqB,CAmB/B,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { IRuntimeAdapterEvidence } from '@moldea.ai/core';
2
+ import type { IAdapterDiagnostic } from '@moldea.ai/core/adapter';
3
+ import type { IRepositoryPath } from '@moldea.ai/repository';
4
+ import type { IOpenAiAgentsSdkInspectionSession } from '../contracts/index.js';
5
+ /** Inspects the nearest owning package manifest for one runtime source. */
6
+ export declare const inspectOpenAiAgentsSdkPackage: (session: IOpenAiAgentsSdkInspectionSession, sourcePath: IRepositoryPath, evidence: IRuntimeAdapterEvidence[], diagnostics: IAdapterDiagnostic[], agentId: string) => Promise<void>;
7
+ //# sourceMappingURL=package-inspection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"package-inspection.d.ts","sourceRoot":"","sources":["../../src/inspection/package-inspection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAM7D,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,uBAAuB,CAAC;AAG/E,2EAA2E;AAC3E,eAAO,MAAM,6BAA6B,GACxC,SAAS,iCAAiC,EAC1C,YAAY,eAAe,EAC3B,UAAU,uBAAuB,EAAE,EACnC,aAAa,kBAAkB,EAAE,EACjC,SAAS,MAAM,KACd,OAAO,CAAC,IAAI,CA+Cd,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { IIndexedAgent, IRuntimeAdapterEvidence } from '@moldea.ai/core';
2
+ import type { IAdapterDiagnostic } from '@moldea.ai/core/adapter';
3
+ import type { IOpenAiAgentsSdkAgentDefinition, IOpenAiAgentsSdkInspectionSession, IOpenAiAgentsSdkSourceAnalysis } from '../contracts/index.js';
4
+ /** Inspects instruction, agent-schema, function-tool, and tool-schema relationships. */
5
+ export declare const inspectOpenAiAgentsSdkRelationships: (session: IOpenAiAgentsSdkInspectionSession, agent: IIndexedAgent, analysis: IOpenAiAgentsSdkSourceAnalysis, definition: IOpenAiAgentsSdkAgentDefinition, evidence: IRuntimeAdapterEvidence[], diagnostics: IAdapterDiagnostic[]) => Promise<void>;
6
+ //# sourceMappingURL=relationships.d.ts.map
@@ -0,0 +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,iBAAiB,CAAC;AAC9E,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"}
@@ -0,0 +1,5 @@
1
+ import type { IRuntimeAdapterContext } from '@moldea.ai/core/adapter';
2
+ import type { IOpenAiAgentsSdkInspectionSession } from '../contracts/index.js';
3
+ /** Creates one operation-local OpenAI Agents SDK inspection session. */
4
+ export declare const createOpenAiAgentsSdkInspectionSession: (context: IRuntimeAdapterContext) => IOpenAiAgentsSdkInspectionSession;
5
+ //# sourceMappingURL=session.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/inspection/session.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAEtE,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,uBAAuB,CAAC;AAI/E,wEAAwE;AACxE,eAAO,MAAM,sCAAsC,GACjD,SAAS,sBAAsB,KAC9B,iCAUC,CAAC"}
@@ -0,0 +1,27 @@
1
+ import type { IRepositoryPath, IRepositoryReader } from '@moldea.ai/repository';
2
+ import type { IOpenAiAgentsSdkPackageDiscoveryResult } from '../contracts/index.js';
3
+ /**
4
+ * Creates nearest-to-root package-manifest candidates for one source path.
5
+ * @param sourcePath The bound repository source path.
6
+ * @returns Deterministically ordered logical package-manifest paths.
7
+ */
8
+ export declare const createPackageManifestCandidatePaths: (sourcePath: IRepositoryPath) => readonly IRepositoryPath[];
9
+ /**
10
+ * Discovers the nearest relevant OpenAI Agents SDK package declaration.
11
+ * @param repository The Core-owned budget-aware repository reader.
12
+ * @param sourcePath The bound source whose package scope is inspected.
13
+ * @param signal The active inspection signal.
14
+ * @returns The first observed declaration, invalid manifest, or absence result.
15
+ * @throws
16
+ * - INVALID_REPOSITORY_PATH: The repository path is invalid.
17
+ * - ENTRY_NOT_FOUND: The requested repository entry was not found.
18
+ * - ENTRY_NOT_FILE: The requested repository entry is not a file.
19
+ * - ACCESS_DENIED: Access to the repository source was denied.
20
+ * - SOURCE_UNAVAILABLE: The repository source is unavailable.
21
+ * - SNAPSHOT_CHANGED: The repository snapshot changed during the operation.
22
+ * - INVALID_SOURCE_DATA: The repository source returned invalid data.
23
+ * - RESOURCE_LIMIT_EXCEEDED: A repository reading resource limit was exceeded.
24
+ * - ABORTED: The repository operation was aborted.
25
+ */
26
+ export declare const discoverOpenAiAgentsSdkPackage: (repository: IRepositoryReader, sourcePath: IRepositoryPath, signal?: AbortSignal) => Promise<IOpenAiAgentsSdkPackageDiscoveryResult>;
27
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/package-discovery/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAOhF,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,iBAAiB,EAC7B,YAAY,eAAe,EAC3B,SAAS,WAAW,KACnB,OAAO,CAAC,sCAAsC,CA4BhD,CAAC"}
@@ -0,0 +1,20 @@
1
+ import ts from 'typescript';
2
+ import type { IOpenAiAgentsSdkAgentDefinition, IOpenAiAgentsSdkExportState, IOpenAiAgentsSdkSourceAnalysis } from '../contracts/index.js';
3
+ /**
4
+ * Classifies one directly exported Agent binding and its relationship-specific configuration.
5
+ * @param analysis The indexed source module.
6
+ * @param symbol The exact exported Agent symbol.
7
+ * @returns The absent, unsupported, or supported definition state.
8
+ */
9
+ export declare const getOpenAiAgentsSdkAgentDefinition: (analysis: IOpenAiAgentsSdkSourceAnalysis, symbol: string) => IOpenAiAgentsSdkExportState & {
10
+ readonly definition?: IOpenAiAgentsSdkAgentDefinition;
11
+ };
12
+ /**
13
+ * Applies relationship-specific post-construction Agent mutation uncertainty.
14
+ * @param analysis The Agent source analysis.
15
+ * @param definition The supported initial Agent definition.
16
+ * @param allowedTargetReferences Direct uses as supported handoff targets.
17
+ * @returns The definition with only affected relationships marked unresolved.
18
+ */
19
+ export declare const applyOpenAiAgentsSdkAgentMutations: (analysis: IOpenAiAgentsSdkSourceAnalysis, definition: IOpenAiAgentsSdkAgentDefinition, allowedTargetReferences: ReadonlySet<ts.Identifier>) => IOpenAiAgentsSdkAgentDefinition;
20
+ //# sourceMappingURL=agent-definitions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-definitions.d.ts","sourceRoot":"","sources":["../../src/source-analysis/agent-definitions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAI5B,OAAO,KAAK,EACV,+BAA+B,EAC/B,2BAA2B,EAE3B,8BAA8B,EAC/B,MAAM,uBAAuB,CAAC;AA8H/B;;;;;GAKG;AACH,eAAO,MAAM,iCAAiC,GAC5C,UAAU,8BAA8B,EACxC,QAAQ,MAAM,KACb,2BAA2B,GAAG;IAAE,QAAQ,CAAC,UAAU,CAAC,EAAE,+BAA+B,CAAA;CAkCvF,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,kCAAkC,GAC7C,UAAU,8BAA8B,EACxC,YAAY,+BAA+B,EAC3C,yBAAyB,WAAW,CAAC,EAAE,CAAC,UAAU,CAAC,KAClD,+BAyBF,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { IRepositoryReference } from '@moldea.ai/core/format';
2
+ import type { IOpenAiAgentsSdkRelationship, IOpenAiAgentsSdkSourceAnalysis } from '../contracts/index.js';
3
+ /**
4
+ * Classifies a direct relationship to one explicitly bound runtime symbol.
5
+ * @param relationship The supported configuration relationship.
6
+ * @param analysis The source containing the relationship.
7
+ * @param reference The exact manifest binding.
8
+ * @returns `true` for a match, `false` for proved absence, or `null` when unresolved.
9
+ */
10
+ export declare const classifyOpenAiAgentsSdkDirectBinding: (relationship: IOpenAiAgentsSdkRelationship, analysis: IOpenAiAgentsSdkSourceAnalysis, reference: IRepositoryReference) => boolean | null;
11
+ //# sourceMappingURL=bindings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bindings.d.ts","sourceRoot":"","sources":["../../src/source-analysis/bindings.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAEnE,OAAO,KAAK,EACV,4BAA4B,EAC5B,8BAA8B,EAC/B,MAAM,uBAAuB,CAAC;AAE/B;;;;;;GAMG;AACH,eAAO,MAAM,oCAAoC,GAC/C,cAAc,4BAA4B,EAC1C,UAAU,8BAA8B,EACxC,WAAW,oBAAoB,KAC9B,OAAO,GAAG,IAgCZ,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { IOpenAiAgentsSdkFunctionToolResult, IOpenAiAgentsSdkSourceAnalysis } from '../contracts/index.js';
2
+ /**
3
+ * Classifies one directly exported root tool(...) declaration.
4
+ * @param analysis The indexed tool source.
5
+ * @param symbol The exact exported tool registration symbol.
6
+ * @returns The absent, unsupported, or structurally supported function-tool state.
7
+ */
8
+ export declare const getOpenAiAgentsSdkFunctionTool: (analysis: IOpenAiAgentsSdkSourceAnalysis, symbol: string) => IOpenAiAgentsSdkFunctionToolResult;
9
+ //# sourceMappingURL=function-tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"function-tools.d.ts","sourceRoot":"","sources":["../../src/source-analysis/function-tools.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAEV,kCAAkC,EAElC,8BAA8B,EAC/B,MAAM,uBAAuB,CAAC;AA4D/B;;;;;GAKG;AACH,eAAO,MAAM,8BAA8B,GACzC,UAAU,8BAA8B,EACxC,QAAQ,MAAM,KACb,kCAqDF,CAAC"}
@@ -0,0 +1,27 @@
1
+ import ts from 'typescript';
2
+ import type { IOpenAiAgentsSdkHandoffRegistration, IOpenAiAgentsSdkRelationship, IOpenAiAgentsSdkSourceAnalysis } from '../contracts/index.js';
3
+ /** Collects direct module-array references from supported Agent handoff relationships. */
4
+ export declare const collectOpenAiAgentsSdkHandoffCollectionReferences: (relationships: readonly IOpenAiAgentsSdkRelationship[]) => ReadonlySet<ts.Identifier>;
5
+ /**
6
+ * Returns every supported expression in one closed Agent handoff collection.
7
+ * @param relationship The Agent handoffs relationship.
8
+ * @param analysis The source containing the collection.
9
+ * @param allowedCollectionReferences All supported references to shared module arrays.
10
+ * @returns Closed collection elements or `null` when the collection is unresolved.
11
+ */
12
+ export declare const getOpenAiAgentsSdkHandoffElements: (relationship: IOpenAiAgentsSdkRelationship, analysis: IOpenAiAgentsSdkSourceAnalysis, allowedCollectionReferences: ReadonlySet<ts.Identifier>) => readonly ts.Expression[] | null;
13
+ /**
14
+ * Classifies one direct Agent or handoff(...) registration element.
15
+ * @param element The closed collection element.
16
+ * @param analysis The source containing the element.
17
+ * @param allowedWrapperReferences All direct supported collection uses of module wrappers.
18
+ * @returns The supported registration or `null` for an unresolved target form.
19
+ */
20
+ export declare const analyzeOpenAiAgentsSdkHandoffElement: (element: ts.Expression, analysis: IOpenAiAgentsSdkSourceAnalysis, allowedWrapperReferences: ReadonlySet<ts.Identifier>) => IOpenAiAgentsSdkHandoffRegistration | null;
21
+ /**
22
+ * Collects Agent identifier uses that are mechanically supported handoff targets.
23
+ * @param analysis The source containing Agent definitions and handoff collections.
24
+ * @returns Exact target identifiers allowed by Agent mutation analysis.
25
+ */
26
+ export declare const collectOpenAiAgentsSdkHandoffTargetReferences: (analysis: IOpenAiAgentsSdkSourceAnalysis) => ReadonlySet<ts.Identifier>;
27
+ //# sourceMappingURL=handoffs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handoffs.d.ts","sourceRoot":"","sources":["../../src/source-analysis/handoffs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAQ5B,OAAO,KAAK,EACV,mCAAmC,EACnC,4BAA4B,EAC5B,8BAA8B,EAC/B,MAAM,uBAAuB,CAAC;AA2I/B,0FAA0F;AAC1F,eAAO,MAAM,iDAAiD,GAC5D,eAAe,SAAS,4BAA4B,EAAE,KACrD,WAAW,CAAC,EAAE,CAAC,UAAU,CAUzB,CAAC;AAEJ;;;;;;GAMG;AACH,eAAO,MAAM,iCAAiC,GAC5C,cAAc,4BAA4B,EAC1C,UAAU,8BAA8B,EACxC,6BAA6B,WAAW,CAAC,EAAE,CAAC,UAAU,CAAC,KACtD,SAAS,EAAE,CAAC,UAAU,EAAE,GAAG,IAC8C,CAAC;AAE7E;;;;;;GAMG;AACH,eAAO,MAAM,oCAAoC,GAC/C,SAAS,EAAE,CAAC,UAAU,EACtB,UAAU,8BAA8B,EACxC,0BAA0B,WAAW,CAAC,EAAE,CAAC,UAAU,CAAC,KACnD,mCAAmC,GAAG,IA4DxC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,6CAA6C,GACxD,UAAU,8BAA8B,KACvC,WAAW,CAAC,EAAE,CAAC,UAAU,CA+B3B,CAAC"}
@@ -0,0 +1,11 @@
1
+ export { applyOpenAiAgentsSdkAgentMutations, getOpenAiAgentsSdkAgentDefinition, } from './agent-definitions.js';
2
+ export { classifyOpenAiAgentsSdkDirectBinding } from './bindings.js';
3
+ export { getOpenAiAgentsSdkFunctionTool } from './function-tools.js';
4
+ export { analyzeOpenAiAgentsSdkHandoffElement, collectOpenAiAgentsSdkHandoffCollectionReferences, collectOpenAiAgentsSdkHandoffTargetReferences, getOpenAiAgentsSdkHandoffElements, } from './handoffs.js';
5
+ export { classifyOpenAiAgentsSdkInstructionLoader } from './instruction-loaders.js';
6
+ export { analyzeOpenAiAgentsSdkMutations } from './mutations.js';
7
+ export type { IOpenAiAgentsSdkMutationAnalysis } from './mutations.js';
8
+ export { analyzeOpenAiAgentsSdkSource } from './source-analysis.js';
9
+ export { resolveOpenAiAgentsSdkStaticString } from './static-strings.js';
10
+ export { classifyOpenAiAgentsSdkToolRegistration, collectOpenAiAgentsSdkToolCollectionReferences, getOpenAiAgentsSdkToolElements, } from './tool-collections.js';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/source-analysis/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,kCAAkC,EAClC,iCAAiC,GAClC,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAAE,oCAAoC,EAAE,MAAM,eAAe,CAAC;AAGrE,OAAO,EAAE,8BAA8B,EAAE,MAAM,qBAAqB,CAAC;AAGrE,OAAO,EACL,oCAAoC,EACpC,iDAAiD,EACjD,6CAA6C,EAC7C,iCAAiC,GAClC,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAE,wCAAwC,EAAE,MAAM,0BAA0B,CAAC;AAGpF,OAAO,EAAE,+BAA+B,EAAE,MAAM,gBAAgB,CAAC;AACjE,YAAY,EAAE,gCAAgC,EAAE,MAAM,gBAAgB,CAAC;AAGvE,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAGpE,OAAO,EAAE,kCAAkC,EAAE,MAAM,qBAAqB,CAAC;AAGzE,OAAO,EACL,uCAAuC,EACvC,8CAA8C,EAC9C,8BAA8B,GAC/B,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { IRepositoryReference } from '@moldea.ai/core/format';
2
+ import type { IOpenAiAgentsSdkRelationship, IOpenAiAgentsSdkSourceAnalysis } from '../contracts/index.js';
3
+ /**
4
+ * Classifies the supported direct, called, or single-return instruction-loader relationship.
5
+ * @param relationship The Agent instructions relationship.
6
+ * @param analysis The source containing the Agent definition.
7
+ * @param reference The exact declared instruction-loader binding.
8
+ * @returns `true` for wired, `false` for provably unwired, or `null` when unresolved.
9
+ */
10
+ export declare const classifyOpenAiAgentsSdkInstructionLoader: (relationship: IOpenAiAgentsSdkRelationship, analysis: IOpenAiAgentsSdkSourceAnalysis, reference: IRepositoryReference) => boolean | null;
11
+ //# sourceMappingURL=instruction-loaders.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"instruction-loaders.d.ts","sourceRoot":"","sources":["../../src/source-analysis/instruction-loaders.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAEnE,OAAO,KAAK,EACV,4BAA4B,EAC5B,8BAA8B,EAC/B,MAAM,uBAAuB,CAAC;AAiD/B;;;;;;GAMG;AACH,eAAO,MAAM,wCAAwC,GACnD,cAAc,4BAA4B,EAC1C,UAAU,8BAA8B,EACxC,WAAW,oBAAoB,KAC9B,OAAO,GAAG,IAuCZ,CAAC"}
@@ -0,0 +1,15 @@
1
+ import ts from 'typescript';
2
+ import type { IOpenAiAgentsSdkSourceAnalysis } from '../contracts/index.js';
3
+ export interface IOpenAiAgentsSdkMutationAnalysis {
4
+ readonly hasUnknownMutation: boolean;
5
+ readonly mutatedMembers: ReadonlySet<string>;
6
+ }
7
+ /**
8
+ * Classifies module-local mutations and escapes for one returned SDK object.
9
+ * @param analysis The indexed source containing the binding.
10
+ * @param declaration The module-local constant declaration.
11
+ * @param allowedReferences Bare identifier uses proven to be supported registrations or targets.
12
+ * @returns Member-specific mutations and whether an unknown use can affect every relationship.
13
+ */
14
+ export declare const analyzeOpenAiAgentsSdkMutations: (analysis: IOpenAiAgentsSdkSourceAnalysis, declaration: ts.VariableDeclaration, allowedReferences: ReadonlySet<ts.Identifier>) => IOpenAiAgentsSdkMutationAnalysis;
15
+ //# sourceMappingURL=mutations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mutations.d.ts","sourceRoot":"","sources":["../../src/source-analysis/mutations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAI5B,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAC;AAE5E,MAAM,WAAW,gCAAgC;IAC/C,QAAQ,CAAC,kBAAkB,EAAE,OAAO,CAAC;IACrC,QAAQ,CAAC,cAAc,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAC9C;AAiJD;;;;;;GAMG;AACH,eAAO,MAAM,+BAA+B,GAC1C,UAAU,8BAA8B,EACxC,aAAa,EAAE,CAAC,mBAAmB,EACnC,mBAAmB,WAAW,CAAC,EAAE,CAAC,UAAU,CAAC,KAC5C,gCAmEF,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { IRepositoryPath } from '@moldea.ai/repository';
2
+ import type { IOpenAiAgentsSdkSourceAnalysisResult } from '../contracts/index.js';
3
+ /**
4
+ * Parses and indexes one OpenAI Agents SDK TypeScript module without executing it.
5
+ * @param path The normalized repository source path.
6
+ * @param bytes The exact repository bytes.
7
+ * @param signal The active inspection signal.
8
+ * @returns The source analysis or a stable invalid source result.
9
+ */
10
+ export declare const analyzeOpenAiAgentsSdkSource: (path: IRepositoryPath, bytes: Uint8Array, signal?: AbortSignal) => IOpenAiAgentsSdkSourceAnalysisResult;
11
+ //# sourceMappingURL=source-analysis.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source-analysis.d.ts","sourceRoot":"","sources":["../../src/source-analysis/source-analysis.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAG7D,OAAO,KAAK,EAGV,oCAAoC,EACrC,MAAM,uBAAuB,CAAC;AA6C/B;;;;;;GAMG;AACH,eAAO,MAAM,4BAA4B,GACvC,MAAM,eAAe,EACrB,OAAO,UAAU,EACjB,SAAS,WAAW,KACnB,oCAcF,CAAC"}
@@ -0,0 +1,11 @@
1
+ import ts from 'typescript';
2
+ import type { IOpenAiAgentsSdkInspectionSession, IOpenAiAgentsSdkSourceAnalysis, IOpenAiAgentsSdkStaticStringResult } from '../contracts/index.js';
3
+ /**
4
+ * Resolves one exact supported static string without normalization or execution.
5
+ * @param session The operation-local source session.
6
+ * @param analysis The source containing the expression.
7
+ * @param expression The candidate static string expression.
8
+ * @returns The exact compiler-parsed string or an unsupported state.
9
+ */
10
+ export declare const resolveOpenAiAgentsSdkStaticString: (session: IOpenAiAgentsSdkInspectionSession, analysis: IOpenAiAgentsSdkSourceAnalysis, expression: ts.Expression) => Promise<IOpenAiAgentsSdkStaticStringResult>;
11
+ //# sourceMappingURL=static-strings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"static-strings.d.ts","sourceRoot":"","sources":["../../src/source-analysis/static-strings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAW5B,OAAO,KAAK,EACV,iCAAiC,EACjC,8BAA8B,EAC9B,kCAAkC,EACnC,MAAM,uBAAuB,CAAC;AA4G/B;;;;;;GAMG;AACH,eAAO,MAAM,kCAAkC,GAC7C,SAAS,iCAAiC,EAC1C,UAAU,8BAA8B,EACxC,YAAY,EAAE,CAAC,UAAU,KACxB,OAAO,CAAC,kCAAkC,CAC0B,CAAC"}
@@ -0,0 +1,27 @@
1
+ import ts from 'typescript';
2
+ import type { IRepositoryReference } from '@moldea.ai/core/format';
3
+ import type { IOpenAiAgentsSdkRelationship, IOpenAiAgentsSdkSourceAnalysis } from '../contracts/index.js';
4
+ /**
5
+ * Collects module-array references that are direct supported Agent tool relationships.
6
+ * @param relationships Agent tool relationships in one source module.
7
+ * @returns Bare collection identifiers allowed to share one immutable module array.
8
+ */
9
+ export declare const collectOpenAiAgentsSdkToolCollectionReferences: (relationships: readonly IOpenAiAgentsSdkRelationship[]) => ReadonlySet<ts.Identifier>;
10
+ /**
11
+ * Classifies whether one declared function tool appears in a closed Agent tools collection.
12
+ * @param relationship The Agent tools relationship.
13
+ * @param analysis The Agent source analysis.
14
+ * @param reference The exact declared tool registration binding.
15
+ * @param allowedCollectionReferences All supported references to shared module arrays.
16
+ * @returns `true` for registered, `false` for proved absence, or `null` when unresolved.
17
+ */
18
+ export declare const classifyOpenAiAgentsSdkToolRegistration: (relationship: IOpenAiAgentsSdkRelationship, analysis: IOpenAiAgentsSdkSourceAnalysis, reference: IRepositoryReference, allowedCollectionReferences: ReadonlySet<ts.Identifier>) => boolean | null;
19
+ /**
20
+ * Returns identifier elements from one supported tools collection.
21
+ * @param relationship The Agent tools relationship.
22
+ * @param analysis The source containing the collection.
23
+ * @param allowedCollectionReferences All supported references to shared module arrays.
24
+ * @returns Direct identifier elements or an empty collection for unsupported forms.
25
+ */
26
+ export declare const getOpenAiAgentsSdkToolElements: (relationship: IOpenAiAgentsSdkRelationship, analysis: IOpenAiAgentsSdkSourceAnalysis, allowedCollectionReferences: ReadonlySet<ts.Identifier>) => readonly ts.Identifier[];
27
+ //# sourceMappingURL=tool-collections.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-collections.d.ts","sourceRoot":"","sources":["../../src/source-analysis/tool-collections.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAS5B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAEnE,OAAO,KAAK,EACV,4BAA4B,EAC5B,8BAA8B,EAC/B,MAAM,uBAAuB,CAAC;AA2B/B;;;;GAIG;AACH,eAAO,MAAM,8CAA8C,GACzD,eAAe,SAAS,4BAA4B,EAAE,KACrD,WAAW,CAAC,EAAE,CAAC,UAAU,CAUzB,CAAC;AAEJ;;;;;;;GAOG;AACH,eAAO,MAAM,uCAAuC,GAClD,cAAc,4BAA4B,EAC1C,UAAU,8BAA8B,EACxC,WAAW,oBAAoB,EAC/B,6BAA6B,WAAW,CAAC,EAAE,CAAC,UAAU,CAAC,KACtD,OAAO,GAAG,IAiCZ,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,8BAA8B,GACzC,cAAc,4BAA4B,EAC1C,UAAU,8BAA8B,EACxC,6BAA6B,WAAW,CAAC,EAAE,CAAC,UAAU,CAAC,KACtD,SAAS,EAAE,CAAC,UAAU,EAGtB,CAAC"}
package/package.json ADDED
@@ -0,0 +1,60 @@
1
+ {
2
+ "name": "@moldea.ai/adapter-openai-agents-sdk",
3
+ "version": "1.0.0",
4
+ "description": "Deterministic runtime evidence and diagnostics for direct OpenAI Agents SDK integrations.",
5
+ "homepage": "https://github.com/moldea-ai/packages/tree/main/projects/adapter-openai-agents-sdk#readme",
6
+ "bugs": {
7
+ "url": "https://github.com/moldea-ai/packages/issues"
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/moldea-ai/packages.git",
12
+ "directory": "projects/adapter-openai-agents-sdk"
13
+ },
14
+ "license": "MIT",
15
+ "author": "Jesus Graterol",
16
+ "type": "module",
17
+ "sideEffects": false,
18
+ "files": [
19
+ "cover.png",
20
+ "dist",
21
+ "LICENSE",
22
+ "README.md"
23
+ ],
24
+ "exports": {
25
+ ".": {
26
+ "types": "./dist/index.d.ts",
27
+ "import": "./dist/index.js"
28
+ }
29
+ },
30
+ "main": "./dist/index.js",
31
+ "types": "./dist/index.d.ts",
32
+ "engines": {
33
+ "node": "^22.11.0 || ^24.11.0"
34
+ },
35
+ "dependencies": {
36
+ "@moldea.ai/core": "^2.0.0",
37
+ "@moldea.ai/repository": "^1.0.0",
38
+ "semver": "7.8.5",
39
+ "typescript": "6.0.3"
40
+ },
41
+ "devDependencies": {
42
+ "@types/node": "22.20.1",
43
+ "@types/semver": "7.8.0",
44
+ "vite": "8.2.1",
45
+ "vitest": "4.1.10",
46
+ "@moldea.ai/adapter-static-analysis": "0.0.0"
47
+ },
48
+ "publishConfig": {
49
+ "access": "public"
50
+ },
51
+ "scripts": {
52
+ "build": "vite build --emptyOutDir && tsc -p tsconfig.build.json",
53
+ "dev": "vite build --watch",
54
+ "lint": "eslint .",
55
+ "test": "pnpm run test:unit && pnpm run test:integration",
56
+ "test:integration": "pnpm run build && vitest run --config vitest/test-integration.config.ts",
57
+ "test:unit": "vitest run --config vitest/test-unit.config.ts",
58
+ "typecheck": "tsc -p tsconfig.src.json --noEmit && tsc -p tsconfig.json --noEmit"
59
+ }
60
+ }