@openai/agents-core 0.2.1 → 0.3.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.
Files changed (87) hide show
  1. package/dist/editor.d.ts +38 -0
  2. package/dist/editor.js +3 -0
  3. package/dist/editor.js.map +1 -0
  4. package/dist/editor.mjs +2 -0
  5. package/dist/editor.mjs.map +1 -0
  6. package/dist/extensions/handoffFilters.js +4 -0
  7. package/dist/extensions/handoffFilters.js.map +1 -1
  8. package/dist/extensions/handoffFilters.mjs +4 -0
  9. package/dist/extensions/handoffFilters.mjs.map +1 -1
  10. package/dist/index.d.ts +8 -2
  11. package/dist/index.js +8 -2
  12. package/dist/index.js.map +1 -1
  13. package/dist/index.mjs +3 -1
  14. package/dist/index.mjs.map +1 -1
  15. package/dist/items.d.ts +518 -4
  16. package/dist/items.js +22 -1
  17. package/dist/items.js.map +1 -1
  18. package/dist/items.mjs +22 -1
  19. package/dist/items.mjs.map +1 -1
  20. package/dist/memory/memorySession.d.ts +22 -0
  21. package/dist/memory/memorySession.js +64 -0
  22. package/dist/memory/memorySession.js.map +1 -0
  23. package/dist/memory/memorySession.mjs +60 -0
  24. package/dist/memory/memorySession.mjs.map +1 -0
  25. package/dist/memory/session.d.ts +36 -0
  26. package/dist/memory/session.js +3 -0
  27. package/dist/memory/session.js.map +1 -0
  28. package/dist/memory/session.mjs +2 -0
  29. package/dist/memory/session.mjs.map +1 -0
  30. package/dist/metadata.js +2 -2
  31. package/dist/metadata.mjs +2 -2
  32. package/dist/model.d.ts +10 -2
  33. package/dist/run.d.ts +88 -8
  34. package/dist/run.js +859 -347
  35. package/dist/run.js.map +1 -1
  36. package/dist/run.mjs +859 -347
  37. package/dist/run.mjs.map +1 -1
  38. package/dist/runContext.js +2 -2
  39. package/dist/runContext.js.map +1 -1
  40. package/dist/runContext.mjs +2 -2
  41. package/dist/runContext.mjs.map +1 -1
  42. package/dist/runImplementation.d.ts +37 -3
  43. package/dist/runImplementation.js +1116 -319
  44. package/dist/runImplementation.js.map +1 -1
  45. package/dist/runImplementation.mjs +1106 -317
  46. package/dist/runImplementation.mjs.map +1 -1
  47. package/dist/runState.d.ts +4453 -785
  48. package/dist/runState.js +62 -3
  49. package/dist/runState.js.map +1 -1
  50. package/dist/runState.mjs +62 -3
  51. package/dist/runState.mjs.map +1 -1
  52. package/dist/shell.d.ts +36 -0
  53. package/dist/shell.js +3 -0
  54. package/dist/shell.js.map +1 -0
  55. package/dist/shell.mjs +2 -0
  56. package/dist/shell.mjs.map +1 -0
  57. package/dist/tool.d.ts +62 -1
  58. package/dist/tool.js +30 -0
  59. package/dist/tool.js.map +1 -1
  60. package/dist/tool.mjs +28 -0
  61. package/dist/tool.mjs.map +1 -1
  62. package/dist/types/aliases.d.ts +3 -3
  63. package/dist/types/protocol.d.ts +5470 -1519
  64. package/dist/types/protocol.js +74 -1
  65. package/dist/types/protocol.js.map +1 -1
  66. package/dist/types/protocol.mjs +73 -0
  67. package/dist/types/protocol.mjs.map +1 -1
  68. package/dist/utils/applyDiff.d.ts +9 -0
  69. package/dist/utils/applyDiff.js +275 -0
  70. package/dist/utils/applyDiff.js.map +1 -0
  71. package/dist/utils/applyDiff.mjs +272 -0
  72. package/dist/utils/applyDiff.mjs.map +1 -0
  73. package/dist/utils/index.d.ts +1 -0
  74. package/dist/utils/index.js +3 -1
  75. package/dist/utils/index.js.map +1 -1
  76. package/dist/utils/index.mjs +1 -0
  77. package/dist/utils/index.mjs.map +1 -1
  78. package/dist/utils/serialize.js +12 -0
  79. package/dist/utils/serialize.js.map +1 -1
  80. package/dist/utils/serialize.mjs +12 -0
  81. package/dist/utils/serialize.mjs.map +1 -1
  82. package/dist/utils/smartString.d.ts +9 -0
  83. package/dist/utils/smartString.js +15 -0
  84. package/dist/utils/smartString.js.map +1 -1
  85. package/dist/utils/smartString.mjs +14 -3
  86. package/dist/utils/smartString.mjs.map +1 -1
  87. package/package.json +3 -3
@@ -0,0 +1,38 @@
1
+ import type { ApplyPatchOperation } from './types/protocol';
2
+ export type { ApplyPatchOperation } from './types/protocol';
3
+ /**
4
+ * Result returned by an Editor operation.
5
+ */
6
+ export type ApplyPatchResult = {
7
+ /**
8
+ * Whether the operation completed successfully. Defaults to `completed`.
9
+ */
10
+ status?: 'completed' | 'failed';
11
+ /**
12
+ * Optional textual output to forward to the model.
13
+ */
14
+ output?: string;
15
+ };
16
+ /**
17
+ * Host interface responsible for applying diffs on disk.
18
+ */
19
+ export interface Editor {
20
+ /**
21
+ * Creates a new file from a V4A diff.
22
+ */
23
+ createFile(operation: Extract<ApplyPatchOperation, {
24
+ type: 'create_file';
25
+ }>): Promise<ApplyPatchResult | void>;
26
+ /**
27
+ * Updates an existing file based on a V4A diff.
28
+ */
29
+ updateFile(operation: Extract<ApplyPatchOperation, {
30
+ type: 'update_file';
31
+ }>): Promise<ApplyPatchResult | void>;
32
+ /**
33
+ * Deletes an existing file.
34
+ */
35
+ deleteFile(operation: Extract<ApplyPatchOperation, {
36
+ type: 'delete_file';
37
+ }>): Promise<ApplyPatchResult | void>;
38
+ }
package/dist/editor.js ADDED
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=editor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor.js","sourceRoot":"","sources":["../src/editor.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=editor.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor.mjs","sourceRoot":"","sources":["../src/editor.ts"],"names":[],"mappings":""}
@@ -7,6 +7,10 @@ const TOOL_TYPES = new Set([
7
7
  'function_call_result',
8
8
  'computer_call',
9
9
  'computer_call_result',
10
+ 'shell_call',
11
+ 'shell_call_output',
12
+ 'apply_patch_call',
13
+ 'apply_patch_call_output',
10
14
  'hosted_tool_call',
11
15
  ]);
12
16
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"handoffFilters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,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC;AAClE,CAAC"}
@@ -4,6 +4,10 @@ const TOOL_TYPES = new Set([
4
4
  'function_call_result',
5
5
  'computer_call',
6
6
  'computer_call_result',
7
+ 'shell_call',
8
+ 'shell_call_output',
9
+ 'apply_patch_call',
10
+ 'apply_patch_call_output',
7
11
  'hosted_tool_call',
8
12
  ]);
9
13
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"handoffFilters.mjs","sourceRoot":"","sources":["../../src/extensions/handoffFilters.ts"],"names":[],"mappings":"OACO,EACL,kBAAkB,EAClB,oBAAoB,EAEpB,eAAe,EACf,qBAAqB,GACtB;AAGD,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC;IACzB,eAAe;IACf,sBAAsB;IACtB,eAAe;IACf,sBAAsB;IACtB,kBAAkB;CACnB,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAC5B,gBAAkC;IAElC,MAAM,EAAE,YAAY,EAAE,eAAe,EAAE,QAAQ,EAAE,UAAU,EAAE,GAC3D,gBAAgB,CAAC;IAEnB,MAAM,eAAe,GAAG,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC;QACjD,CAAC,CAAC,wBAAwB,CAAC,YAAY,CAAC;QACxC,CAAC,CAAC,YAAY,CAAC;IAEjB,MAAM,uBAAuB,GAAG,oBAAoB,CAAC,eAAe,CAAC,CAAC;IACtE,MAAM,gBAAgB,GAAG,oBAAoB,CAAC,QAAQ,CAAC,CAAC;IAExD,OAAO;QACL,YAAY,EAAE,eAAe;QAC7B,eAAe,EAAE,uBAAuB;QACxC,QAAQ,EAAE,gBAAgB;QAC1B,UAAU;KACX,CAAC;AACJ,CAAC;AAED,SAAS,oBAAoB,CAAC,KAAgB;IAC5C,OAAO,KAAK,CAAC,MAAM,CACjB,CAAC,IAAI,EAAE,EAAE,CACP,CAAC,CAAC,IAAI,YAAY,kBAAkB,CAAC;QACrC,CAAC,CAAC,IAAI,YAAY,o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,CACjB,CAAC,IAAI,EAAE,EAAE,CACP,CAAC,CAAC,IAAI,YAAY,kBAAkB,CAAC;QACrC,CAAC,CAAC,IAAI,YAAY,oBAAoB,CAAC;QACvC,CAAC,CAAC,IAAI,YAAY,eAAe,CAAC;QAClC,CAAC,CAAC,IAAI,YAAY,qBAAqB,CAAC,CAC3C,CAAC;AACJ,CAAC;AAED,SAAS,wBAAwB,CAAC,KAAuB;IACvD,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC;AAClE,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  export { RuntimeEventEmitter } from '@openai/agents-core/_shims';
2
2
  export { Agent, AgentConfiguration, AgentConfigWithHandoffs, AgentOptions, AgentOutputType, ToolsToFinalOutputResult, ToolToFinalOutputFunction, ToolUseBehavior, ToolUseBehaviorFlags, } from './agent';
3
3
  export { Computer } from './computer';
4
+ export { ShellAction, ShellResult, ShellOutputResult, Shell } from './shell';
5
+ export { ApplyPatchOperation, ApplyPatchResult, Editor } from './editor';
4
6
  export { AgentsError, GuardrailExecutionError, InputGuardrailTripwireTriggered, MaxTurnsExceededError, ModelBehaviorError, OutputGuardrailTripwireTriggered, ToolCallError, UserError, SystemError, } from './errors';
5
7
  export { RunAgentUpdatedStreamEvent, RunRawModelStreamEvent, RunItemStreamEvent, RunStreamEvent, } from './events';
6
8
  export { defineOutputGuardrail, GuardrailFunctionOutput, InputGuardrail, InputGuardrailFunction, InputGuardrailFunctionArgs, InputGuardrailMetadata, InputGuardrailResult, OutputGuardrail, OutputGuardrailDefinition, OutputGuardrailFunction, OutputGuardrailFunctionArgs, OutputGuardrailMetadata, OutputGuardrailResult, } from './guardrail';
@@ -9,6 +11,7 @@ export { assistant, system, user } from './helpers/message';
9
11
  export { extractAllTextOutput, RunHandoffCallItem, RunHandoffOutputItem, RunItem, RunMessageOutputItem, RunReasoningItem, RunToolApprovalItem, RunToolCallItem, RunToolCallOutputItem, } from './items';
10
12
  export { AgentHooks } from './lifecycle';
11
13
  export { getLogger } from './logger';
14
+ export { applyDiff } from './utils/applyDiff';
12
15
  export { getAllMcpTools, invalidateServerToolsCache, mcpToFunctionTool, MCPServer, MCPServerStdio, MCPServerStreamableHttp, MCPServerSSE, GetAllMcpToolsOptions, } from './mcp';
13
16
  export { MCPToolFilterCallable, MCPToolFilterContext, MCPToolFilterStatic, createMCPToolStaticFilter, } from './mcpUtil';
14
17
  export { Model, ModelProvider, ModelRequest, ModelResponse, ModelSettings, ModelSettingsToolChoice, SerializedHandoff, SerializedTool, SerializedOutputType, } from './model';
@@ -16,14 +19,17 @@ export { OPENAI_DEFAULT_MODEL_ENV_VARIABLE_NAME, gpt5ReasoningSettingsRequired,
16
19
  export { setDefaultModelProvider } from './providers';
17
20
  export { RunResult, StreamedRunResult } from './result';
18
21
  export { IndividualRunOptions, NonStreamRunOptions, run, RunConfig, Runner, StreamRunOptions, } from './run';
22
+ export type { ModelInputData, CallModelInputFilter, CallModelInputFilterArgs, } from './run';
19
23
  export { RunContext } from './runContext';
20
24
  export { RunState } from './runState';
21
- export { HostedTool, ComputerTool, computerTool, HostedMCPTool, hostedMcpTool, FunctionTool, FunctionToolResult, Tool, tool, ToolExecuteArgument, ToolEnabledFunction, } from './tool';
25
+ export { HostedTool, ComputerTool, computerTool, ShellTool, shellTool, ApplyPatchTool, applyPatchTool, HostedMCPTool, hostedMcpTool, FunctionTool, FunctionToolResult, Tool, tool, ToolExecuteArgument, ToolEnabledFunction, } from './tool';
22
26
  export type { ToolOutputText, ToolOutputImage, ToolOutputFileContent, ToolCallStructuredOutput, ToolCallOutputContent, } from './types/protocol';
23
27
  export * from './tracing';
24
28
  export { getGlobalTraceProvider, TraceProvider } from './tracing/provider';
25
- export type { AgentInputItem, AgentOutputItem, AssistantMessageItem, HostedToolCallItem, ComputerCallResultItem, ComputerUseCallItem, FunctionCallItem, FunctionCallResultItem, JsonSchemaDefinition, ReasoningItem, ResponseStreamEvent, SystemMessageItem, TextOutput, UnknownContext, UnknownItem, UserMessageItem, StreamEvent, StreamEventTextStream, StreamEventResponseCompleted, StreamEventResponseStarted, StreamEventGenericItem, } from './types';
29
+ export type { AgentInputItem, AgentOutputItem, AssistantMessageItem, HostedToolCallItem, ComputerCallResultItem, ComputerUseCallItem, ShellCallItem, ShellCallResultItem, ApplyPatchCallItem, ApplyPatchCallResultItem, FunctionCallItem, FunctionCallResultItem, JsonSchemaDefinition, ReasoningItem, ResponseStreamEvent, SystemMessageItem, TextOutput, UnknownContext, UnknownItem, UserMessageItem, StreamEvent, StreamEventTextStream, StreamEventResponseCompleted, StreamEventResponseStarted, StreamEventGenericItem, } from './types';
26
30
  export { Usage } from './usage';
31
+ export type { Session, SessionInputCallback } from './memory/session';
32
+ export { MemorySession } from './memory/memorySession';
27
33
  /**
28
34
  * Exporting the whole protocol as an object here. This contains both the types
29
35
  * and the zod schemas for parsing the protocol.
package/dist/index.js CHANGED
@@ -36,8 +36,8 @@ var __importStar = (this && this.__importStar) || (function () {
36
36
  };
37
37
  })();
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.RunContext = exports.Runner = exports.run = exports.StreamedRunResult = exports.RunResult = exports.setDefaultModelProvider = exports.isGpt5Default = exports.getDefaultModelSettings = exports.getDefaultModel = exports.gpt5ReasoningSettingsRequired = exports.OPENAI_DEFAULT_MODEL_ENV_VARIABLE_NAME = exports.createMCPToolStaticFilter = exports.MCPServerSSE = exports.MCPServerStreamableHttp = exports.MCPServerStdio = exports.mcpToFunctionTool = exports.invalidateServerToolsCache = exports.getAllMcpTools = exports.getLogger = exports.AgentHooks = exports.RunToolCallOutputItem = exports.RunToolCallItem = exports.RunToolApprovalItem = exports.RunReasoningItem = exports.RunMessageOutputItem = exports.RunHandoffOutputItem = exports.RunHandoffCallItem = exports.extractAllTextOutput = exports.user = exports.system = exports.assistant = exports.handoff = exports.Handoff = exports.getTransferMessage = exports.getHandoff = exports.defineOutputGuardrail = exports.RunItemStreamEvent = exports.RunRawModelStreamEvent = exports.RunAgentUpdatedStreamEvent = exports.SystemError = exports.UserError = exports.ToolCallError = exports.OutputGuardrailTripwireTriggered = exports.ModelBehaviorError = exports.MaxTurnsExceededError = exports.InputGuardrailTripwireTriggered = exports.GuardrailExecutionError = exports.AgentsError = exports.Agent = exports.RuntimeEventEmitter = void 0;
40
- exports.protocol = exports.Usage = exports.TraceProvider = exports.getGlobalTraceProvider = exports.tool = exports.hostedMcpTool = exports.computerTool = exports.RunState = void 0;
39
+ exports.Runner = exports.run = exports.StreamedRunResult = exports.RunResult = exports.setDefaultModelProvider = exports.isGpt5Default = exports.getDefaultModelSettings = exports.getDefaultModel = exports.gpt5ReasoningSettingsRequired = exports.OPENAI_DEFAULT_MODEL_ENV_VARIABLE_NAME = exports.createMCPToolStaticFilter = exports.MCPServerSSE = exports.MCPServerStreamableHttp = exports.MCPServerStdio = exports.mcpToFunctionTool = exports.invalidateServerToolsCache = exports.getAllMcpTools = exports.applyDiff = exports.getLogger = exports.AgentHooks = exports.RunToolCallOutputItem = exports.RunToolCallItem = exports.RunToolApprovalItem = exports.RunReasoningItem = exports.RunMessageOutputItem = exports.RunHandoffOutputItem = exports.RunHandoffCallItem = exports.extractAllTextOutput = exports.user = exports.system = exports.assistant = exports.handoff = exports.Handoff = exports.getTransferMessage = exports.getHandoff = exports.defineOutputGuardrail = exports.RunItemStreamEvent = exports.RunRawModelStreamEvent = exports.RunAgentUpdatedStreamEvent = exports.SystemError = exports.UserError = exports.ToolCallError = exports.OutputGuardrailTripwireTriggered = exports.ModelBehaviorError = exports.MaxTurnsExceededError = exports.InputGuardrailTripwireTriggered = exports.GuardrailExecutionError = exports.AgentsError = exports.Agent = exports.RuntimeEventEmitter = void 0;
40
+ exports.protocol = exports.MemorySession = exports.Usage = exports.TraceProvider = exports.getGlobalTraceProvider = exports.tool = exports.hostedMcpTool = exports.applyPatchTool = exports.shellTool = exports.computerTool = exports.RunState = exports.RunContext = void 0;
41
41
  const tracing_1 = require("./tracing/index.js");
42
42
  const processor_1 = require("./tracing/processor.js");
43
43
  var _shims_1 = require("@openai/agents-core/_shims");
@@ -82,6 +82,8 @@ var lifecycle_1 = require("./lifecycle.js");
82
82
  Object.defineProperty(exports, "AgentHooks", { enumerable: true, get: function () { return lifecycle_1.AgentHooks; } });
83
83
  var logger_1 = require("./logger.js");
84
84
  Object.defineProperty(exports, "getLogger", { enumerable: true, get: function () { return logger_1.getLogger; } });
85
+ var applyDiff_1 = require("./utils/applyDiff.js");
86
+ Object.defineProperty(exports, "applyDiff", { enumerable: true, get: function () { return applyDiff_1.applyDiff; } });
85
87
  var mcp_1 = require("./mcp.js");
86
88
  Object.defineProperty(exports, "getAllMcpTools", { enumerable: true, get: function () { return mcp_1.getAllMcpTools; } });
87
89
  Object.defineProperty(exports, "invalidateServerToolsCache", { enumerable: true, get: function () { return mcp_1.invalidateServerToolsCache; } });
@@ -111,6 +113,8 @@ var runState_1 = require("./runState.js");
111
113
  Object.defineProperty(exports, "RunState", { enumerable: true, get: function () { return runState_1.RunState; } });
112
114
  var tool_1 = require("./tool.js");
113
115
  Object.defineProperty(exports, "computerTool", { enumerable: true, get: function () { return tool_1.computerTool; } });
116
+ Object.defineProperty(exports, "shellTool", { enumerable: true, get: function () { return tool_1.shellTool; } });
117
+ Object.defineProperty(exports, "applyPatchTool", { enumerable: true, get: function () { return tool_1.applyPatchTool; } });
114
118
  Object.defineProperty(exports, "hostedMcpTool", { enumerable: true, get: function () { return tool_1.hostedMcpTool; } });
115
119
  Object.defineProperty(exports, "tool", { enumerable: true, get: function () { return tool_1.tool; } });
116
120
  __exportStar(require("./tracing/index.js"), exports);
@@ -119,6 +123,8 @@ Object.defineProperty(exports, "getGlobalTraceProvider", { enumerable: true, get
119
123
  Object.defineProperty(exports, "TraceProvider", { enumerable: true, get: function () { return provider_1.TraceProvider; } });
120
124
  var usage_1 = require("./usage.js");
121
125
  Object.defineProperty(exports, "Usage", { enumerable: true, get: function () { return usage_1.Usage; } });
126
+ var memorySession_1 = require("./memory/memorySession.js");
127
+ Object.defineProperty(exports, "MemorySession", { enumerable: true, get: function () { return memorySession_1.MemorySession; } });
122
128
  /**
123
129
  * Exporting the whole protocol as an object here. This contains both the types
124
130
  * and the zod schemas for parsing the protocol.
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA8C;AAC9C,sDAAuD;AAEvD,qDAAiE;AAAxD,6GAAA,mBAAmB,OAAA;AAC5B,oCAUiB;AATf,8FAAA,KAAK,OAAA;AAWP,sCAUkB;AAThB,qGAAA,WAAW,OAAA;AACX,iHAAA,uBAAuB,OAAA;AACvB,yHAAA,+BAA+B,OAAA;AAC/B,+GAAA,qBAAqB,OAAA;AACrB,4GAAA,kBAAkB,OAAA;AAClB,0HAAA,gCAAgC,OAAA;AAChC,uGAAA,aAAa,OAAA;AACb,mGAAA,SAAS,OAAA;AACT,qGAAA,WAAW,OAAA;AAEb,sCAKkB;AAJhB,oHAAA,0BAA0B,OAAA;AAC1B,gHAAA,sBAAsB,OAAA;AACtB,4GAAA,kBAAkB,OAAA;AAGpB,4CAcqB;AAbnB,kHAAA,qBAAqB,OAAA;AAcvB,wCAOmB;AANjB,qGAAA,UAAU,OAAA;AACV,6GAAA,kBAAkB,OAAA;AAClB,kGAAA,OAAO,OAAA;AACP,kGAAA,OAAO,OAAA;AAIT,gDAA4D;AAAnD,oGAAA,SAAS,OAAA;AAAE,iGAAA,MAAM,OAAA;AAAE,+FAAA,IAAI,OAAA;AAChC,oCAUiB;AATf,6GAAA,oBAAoB,OAAA;AACpB,2GAAA,kBAAkB,OAAA;AAClB,6GAAA,oBAAoB,OAAA;AAEpB,6GAAA,oBAAoB,OAAA;AACpB,yGAA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AY,OAAA;AAGd,wCAKmB;AADjB,oHAAA,yBAAyB,OAAA;AAa3B,kDAMwB;AALtB,sIAAA,sCAAsC,OAAA;AACtC,6HAAA,6BAA6B,OAAA;AAC7B,+GAAA,eAAe,OAAA;AACf,uHAAA,uBAAuB,OAAA;AACvB,6GAAA,aAAa,OAAA;AAEf,4CAAsD;AAA7C,oHAAA,uBAAuB,OAAA;AAChC,sCAAwD;AAA/C,mGAAA,SAAS,OAAA;AAAE,2GAAA,iBAAiB,OAAA;AACrC,gCAOe;AAJb,0FAAA,GAAG,OAAA;AAEH,6FAAA,MAAM,OAAA;AAQR,8CAA0C;AAAjC,wGAAA,UAAU,OAAA;AACnB,0CAAsC;AAA7B,oGAAA,QAAQ,OAAA;AACjB,kCAgBgB;AAbd,oGAAA,YAAY,OAAA;AAEZ,iGAAA,SAAS,OAAA;AAET,sGAAA,cAAc,OAAA;AAEd,qGAAA,aAAa,OAAA;AAIb,4FAAA,IAAI,OAAA;AAWN,qDAA0B;AAC1B,kDAA2E;AAAlE,kHAAA,sBAAsB,OAAA;AAAE,yGAAA,aAAa,OAAA;AA6B9C,oCAAgC;AAAvB,8FAAA,KAAK,OAAA;AAEd,2DAAuD;AAA9C,8GAAA,aAAa,OAAA;AAEtB;;;GAGG;AACH,gEAA6C;AAE7C;;;;;GAKG;AACH,IAAA,2BAAiB,EAAC,IAAA,4BAAgB,GAAE,CAAC,CAAC"}
package/dist/index.mjs CHANGED
@@ -10,6 +10,7 @@ export { assistant, system, user } from "./helpers/message.mjs";
10
10
  export { extractAllTextOutput, RunHandoffCallItem, RunHandoffOutputItem, RunMessageOutputItem, RunReasoningItem, RunToolApprovalItem, RunToolCallItem, RunToolCallOutputItem, } from "./items.mjs";
11
11
  export { AgentHooks } from "./lifecycle.mjs";
12
12
  export { getLogger } from "./logger.mjs";
13
+ export { applyDiff } from "./utils/applyDiff.mjs";
13
14
  export { getAllMcpTools, invalidateServerToolsCache, mcpToFunctionTool, MCPServerStdio, MCPServerStreamableHttp, MCPServerSSE, } from "./mcp.mjs";
14
15
  export { createMCPToolStaticFilter, } from "./mcpUtil.mjs";
15
16
  export { OPENAI_DEFAULT_MODEL_ENV_VARIABLE_NAME, gpt5ReasoningSettingsRequired, getDefaultModel, getDefaultModelSettings, isGpt5Default, } from "./defaultModel.mjs";
@@ -18,10 +19,11 @@ export { RunResult, StreamedRunResult } from "./result.mjs";
18
19
  export { run, Runner, } from "./run.mjs";
19
20
  export { RunContext } from "./runContext.mjs";
20
21
  export { RunState } from "./runState.mjs";
21
- export { computerTool, hostedMcpTool, tool, } from "./tool.mjs";
22
+ export { computerTool, shellTool, applyPatchTool, hostedMcpTool, tool, } from "./tool.mjs";
22
23
  export * from "./tracing/index.mjs";
23
24
  export { getGlobalTraceProvider, TraceProvider } from "./tracing/provider.mjs";
24
25
  export { Usage } from "./usage.mjs";
26
+ export { MemorySession } from "./memory/memorySession.mjs";
25
27
  export * as protocol from "./types/protocol.mjs";
26
28
  /**
27
29
  * Add the default processor, which exports traces and spans to the backend in batches. You can
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"OAAO,EAAE,iBAAiB,EAAE;OACrB,EAAE,gBAAgB,EAAE;OAEpB,EAAE,mBAAmB,EAAE,MAAM,4BAA4B;OACzD,EACL,KAAK,GASN;OAEM,EACL,WAAW,EACX,uBAAuB,EACvB,+BAA+B,EAC/B,qBAAqB,EACrB,kBAAkB,EAClB,gCAAgC,EAChC,aAAa,EACb,SAAS,EACT,WAAW,GACZ;OACM,EACL,0BAA0B,EAC1B,sBAAsB,EACtB,kBAAkB,GAEnB;OACM,EACL,qBAAqB,GAatB;OACM,EACL,UAAU,EACV,kBAAkB,EAClB,OAAO,EACP,OAAO,GAGR;OACM,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE;OAC3B,EACL,oBAAoB,EACpB,kBAAkB,EAClB,oBAAoB,EAEpB,oBAAoB,EACpB,gBAAgB,EAChB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