@traceai/codex-sdk 0.0.0-stage → 0.1.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 +172 -2
- package/dist/esm/attributes.d.ts +101 -0
- package/dist/esm/attributes.d.ts.map +1 -0
- package/dist/esm/attributes.js +104 -0
- package/dist/esm/attributes.js.map +1 -0
- package/dist/esm/codexWrapper.d.ts +5 -0
- package/dist/esm/codexWrapper.d.ts.map +1 -0
- package/dist/esm/codexWrapper.js +63 -0
- package/dist/esm/codexWrapper.js.map +1 -0
- package/dist/esm/index.d.ts +8 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +5 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/instrumentation.d.ts +85 -0
- package/dist/esm/instrumentation.d.ts.map +1 -0
- package/dist/esm/instrumentation.js +195 -0
- package/dist/esm/instrumentation.js.map +1 -0
- package/dist/esm/package.json +1 -0
- package/dist/esm/spans.d.ts +152 -0
- package/dist/esm/spans.d.ts.map +1 -0
- package/dist/esm/spans.js +678 -0
- package/dist/esm/spans.js.map +1 -0
- package/dist/esm/threadWrapper.d.ts +35 -0
- package/dist/esm/threadWrapper.d.ts.map +1 -0
- package/dist/esm/threadWrapper.js +208 -0
- package/dist/esm/threadWrapper.js.map +1 -0
- package/dist/esm/types.d.ts +123 -0
- package/dist/esm/types.d.ts.map +1 -0
- package/dist/esm/types.js +10 -0
- package/dist/esm/types.js.map +1 -0
- package/dist/esm/version.d.ts +2 -0
- package/dist/esm/version.d.ts.map +1 -0
- package/dist/esm/version.js +2 -0
- package/dist/esm/version.js.map +1 -0
- package/dist/esnext/attributes.d.ts +101 -0
- package/dist/esnext/attributes.d.ts.map +1 -0
- package/dist/esnext/attributes.js +104 -0
- package/dist/esnext/attributes.js.map +1 -0
- package/dist/esnext/codexWrapper.d.ts +5 -0
- package/dist/esnext/codexWrapper.d.ts.map +1 -0
- package/dist/esnext/codexWrapper.js +65 -0
- package/dist/esnext/codexWrapper.js.map +1 -0
- package/dist/esnext/index.d.ts +8 -0
- package/dist/esnext/index.d.ts.map +1 -0
- package/dist/esnext/index.js +5 -0
- package/dist/esnext/index.js.map +1 -0
- package/dist/esnext/instrumentation.d.ts +85 -0
- package/dist/esnext/instrumentation.d.ts.map +1 -0
- package/dist/esnext/instrumentation.js +200 -0
- package/dist/esnext/instrumentation.js.map +1 -0
- package/dist/esnext/spans.d.ts +152 -0
- package/dist/esnext/spans.d.ts.map +1 -0
- package/dist/esnext/spans.js +688 -0
- package/dist/esnext/spans.js.map +1 -0
- package/dist/esnext/threadWrapper.d.ts +35 -0
- package/dist/esnext/threadWrapper.d.ts.map +1 -0
- package/dist/esnext/threadWrapper.js +206 -0
- package/dist/esnext/threadWrapper.js.map +1 -0
- package/dist/esnext/types.d.ts +123 -0
- package/dist/esnext/types.d.ts.map +1 -0
- package/dist/esnext/types.js +10 -0
- package/dist/esnext/types.js.map +1 -0
- package/dist/esnext/version.d.ts +2 -0
- package/dist/esnext/version.d.ts.map +1 -0
- package/dist/esnext/version.js +2 -0
- package/dist/esnext/version.js.map +1 -0
- package/dist/src/attributes.d.ts +101 -0
- package/dist/src/attributes.d.ts.map +1 -0
- package/dist/src/attributes.js +107 -0
- package/dist/src/attributes.js.map +1 -0
- package/dist/src/codexWrapper.d.ts +5 -0
- package/dist/src/codexWrapper.d.ts.map +1 -0
- package/dist/src/codexWrapper.js +68 -0
- package/dist/src/codexWrapper.js.map +1 -0
- package/dist/src/index.d.ts +8 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +21 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/instrumentation.d.ts +85 -0
- package/dist/src/instrumentation.d.ts.map +1 -0
- package/dist/src/instrumentation.js +222 -0
- package/dist/src/instrumentation.js.map +1 -0
- package/dist/src/spans.d.ts +152 -0
- package/dist/src/spans.d.ts.map +1 -0
- package/dist/src/spans.js +698 -0
- package/dist/src/spans.js.map +1 -0
- package/dist/src/threadWrapper.d.ts +35 -0
- package/dist/src/threadWrapper.d.ts.map +1 -0
- package/dist/src/threadWrapper.js +229 -0
- package/dist/src/threadWrapper.js.map +1 -0
- package/dist/src/types.d.ts +123 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/types.js +11 -0
- package/dist/src/types.js.map +1 -0
- package/dist/src/version.d.ts +2 -0
- package/dist/src/version.d.ts.map +1 -0
- package/dist/src/version.js +5 -0
- package/dist/src/version.js.map +1 -0
- package/package.json +76 -3
- package/src/attributes.ts +113 -0
- package/src/codexWrapper.ts +71 -0
- package/src/index.ts +27 -0
- package/src/instrumentation.ts +227 -0
- package/src/spans.ts +729 -0
- package/src/threadWrapper.ts +221 -0
- package/src/types.ts +113 -0
- package/src/version.ts +1 -0
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Patch `Thread` so every turn is traced.
|
|
3
|
+
*
|
|
4
|
+
* `Thread.run()` and `Thread.runStreamed()` both drive the private async
|
|
5
|
+
* generator `runStreamedInternal(input, turnOptions)` (every stable SDK
|
|
6
|
+
* release from 0.44.0 to 0.162.1), so wrapping that one method traces both
|
|
7
|
+
* entry points with real per-event timing. The wrapper yields the SDK's own
|
|
8
|
+
* event objects unchanged and forwards `return()` / `throw()`, so `run()`
|
|
9
|
+
* keeps its exact behaviour (including `break` on `turn.failed`).
|
|
10
|
+
*
|
|
11
|
+
* If a future SDK drops that method, the wrapper falls back to the public
|
|
12
|
+
* `runStreamed()` and logs once that `run()` may be untraced.
|
|
13
|
+
*/
|
|
14
|
+
import { Tracer, context as otelContext, diag } from "@opentelemetry/api";
|
|
15
|
+
import { ContentPolicy, TurnTracer, clockMs } from "./spans";
|
|
16
|
+
import { InputLike, ThreadEventLike, ThreadLike, TurnOptionsLike } from "./types";
|
|
17
|
+
|
|
18
|
+
const PATCHED = Symbol.for("@traceai/codex-sdk/patched");
|
|
19
|
+
const PATCH_RECORD = Symbol.for("@traceai/codex-sdk/patch-record");
|
|
20
|
+
const LOG = "@traceai/codex-sdk";
|
|
21
|
+
|
|
22
|
+
export interface TurnTracingContext {
|
|
23
|
+
tracer: Tracer;
|
|
24
|
+
policy: ContentPolicy;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
type GetContext = () => TurnTracingContext | undefined;
|
|
28
|
+
|
|
29
|
+
interface PatchRecord {
|
|
30
|
+
method: "runStreamedInternal" | "runStreamed";
|
|
31
|
+
originalDescriptor: PropertyDescriptor | undefined;
|
|
32
|
+
wrapper: unknown;
|
|
33
|
+
owner: symbol;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function isPatched(target: unknown): boolean {
|
|
37
|
+
return !!target && (target as Record<symbol, unknown>)[PATCHED] === true;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** The undo closure retains neither the target nor its possibly bound original method. */
|
|
41
|
+
function weakUndo(ref: WeakRef<ThreadLike>, owner: symbol): () => void {
|
|
42
|
+
return () => {
|
|
43
|
+
const target = ref.deref();
|
|
44
|
+
if (!target) return;
|
|
45
|
+
const record = Object.getOwnPropertyDescriptor(target, PATCH_RECORD)?.value as PatchRecord | undefined;
|
|
46
|
+
if (record?.owner !== owner) return;
|
|
47
|
+
try {
|
|
48
|
+
// Do not clobber a method that the application replaced after our patch.
|
|
49
|
+
if (Object.getOwnPropertyDescriptor(target, record.method)?.value === record.wrapper) {
|
|
50
|
+
if (record.originalDescriptor) Object.defineProperty(target, record.method, record.originalDescriptor);
|
|
51
|
+
else delete (target as Record<string, unknown>)[record.method];
|
|
52
|
+
}
|
|
53
|
+
delete (target as Record<symbol, unknown>)[PATCHED];
|
|
54
|
+
delete (target as Record<symbol, unknown>)[PATCH_RECORD];
|
|
55
|
+
} catch (error) {
|
|
56
|
+
diag.debug(`${LOG}: unpatch failed: ${error}`);
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Patch a Thread prototype or a single Thread instance. Returns an undo
|
|
63
|
+
* function, or `undefined` when the target was already patched or has no
|
|
64
|
+
* method to wrap.
|
|
65
|
+
*/
|
|
66
|
+
export function patchThread(target: ThreadLike, getContext: GetContext): (() => void) | undefined {
|
|
67
|
+
if (!target || typeof target !== "object" || isPatched(target)) return undefined;
|
|
68
|
+
|
|
69
|
+
const owner = Symbol();
|
|
70
|
+
let record: PatchRecord;
|
|
71
|
+
if (typeof target.runStreamedInternal === "function") {
|
|
72
|
+
const original = target.runStreamedInternal;
|
|
73
|
+
const originalDescriptor = Object.getOwnPropertyDescriptor(target, "runStreamedInternal");
|
|
74
|
+
const traced = function tracedRunStreamedInternal(this: ThreadLike, input: InputLike, turnOptions?: TurnOptionsLike) {
|
|
75
|
+
const startTimeMs = clockMs();
|
|
76
|
+
const parentContext = otelContext.active();
|
|
77
|
+
// eslint-disable-next-line prefer-rest-params
|
|
78
|
+
const generator = original.apply(this, arguments as unknown as [InputLike, TurnOptionsLike?]);
|
|
79
|
+
return traceEvents(generator, this, input, turnOptions, parentContext, startTimeMs, getContext);
|
|
80
|
+
};
|
|
81
|
+
record = { method: "runStreamedInternal", originalDescriptor, wrapper: traced, owner };
|
|
82
|
+
defineMethod(target, "runStreamedInternal", traced);
|
|
83
|
+
} else if (typeof target.runStreamed === "function") {
|
|
84
|
+
const original = target.runStreamed;
|
|
85
|
+
const originalDescriptor = Object.getOwnPropertyDescriptor(target, "runStreamed");
|
|
86
|
+
diag.warn(`${LOG}: Thread.runStreamedInternal not found; tracing runStreamed() only, run() may be untraced`);
|
|
87
|
+
const traced = async function tracedRunStreamed(this: ThreadLike, input: InputLike, turnOptions?: TurnOptionsLike) {
|
|
88
|
+
const startTimeMs = clockMs();
|
|
89
|
+
const parentContext = otelContext.active();
|
|
90
|
+
// eslint-disable-next-line prefer-rest-params
|
|
91
|
+
const result = await original.apply(this, arguments as unknown as [InputLike, TurnOptionsLike?]);
|
|
92
|
+
if (!result || typeof result !== "object" || !result.events) return result;
|
|
93
|
+
return {
|
|
94
|
+
...result,
|
|
95
|
+
events: traceEvents(result.events, this, input, turnOptions, parentContext, startTimeMs, getContext),
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
record = { method: "runStreamed", originalDescriptor, wrapper: traced, owner };
|
|
99
|
+
defineMethod(target, "runStreamed", traced);
|
|
100
|
+
} else {
|
|
101
|
+
return undefined;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// Keep the public marker boolean so older installed copies also recognize an
|
|
105
|
+
// active patch. Store ownership separately, only on the weakly tracked target.
|
|
106
|
+
Object.defineProperties(target, {
|
|
107
|
+
[PATCHED]: { value: true, configurable: true },
|
|
108
|
+
[PATCH_RECORD]: { value: record, configurable: true },
|
|
109
|
+
});
|
|
110
|
+
return weakUndo(new WeakRef(target), owner);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function defineMethod(target: object, name: string, value: unknown): void {
|
|
114
|
+
Object.defineProperty(target, name, { value, writable: true, configurable: true, enumerable: false });
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Return a generator that yields exactly what `source` yields and drives a
|
|
119
|
+
* `TurnTracer`. A tracing failure disables tracing for that turn only.
|
|
120
|
+
*/
|
|
121
|
+
export function traceEvents(
|
|
122
|
+
source: AsyncGenerator<ThreadEventLike>,
|
|
123
|
+
thread: ThreadLike,
|
|
124
|
+
input: InputLike,
|
|
125
|
+
turnOptions: TurnOptionsLike | undefined,
|
|
126
|
+
parentContext: ReturnType<typeof otelContext.active>,
|
|
127
|
+
startTimeMs: number,
|
|
128
|
+
getContext: GetContext,
|
|
129
|
+
): AsyncGenerator<ThreadEventLike> {
|
|
130
|
+
let turnTracer: TurnTracer | undefined;
|
|
131
|
+
try {
|
|
132
|
+
const ctx = getContext();
|
|
133
|
+
if (ctx) {
|
|
134
|
+
turnTracer = new TurnTracer({
|
|
135
|
+
tracer: ctx.tracer,
|
|
136
|
+
policy: ctx.policy,
|
|
137
|
+
parentContext,
|
|
138
|
+
input,
|
|
139
|
+
turnOptions,
|
|
140
|
+
threadOptions: readThreadOptions(thread),
|
|
141
|
+
threadId: readThreadId(thread),
|
|
142
|
+
startTimeMs,
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
} catch (error) {
|
|
146
|
+
diag.debug(`${LOG}: tracing disabled for this turn: ${error}`);
|
|
147
|
+
}
|
|
148
|
+
if (!turnTracer || !source || typeof source.next !== "function") return source;
|
|
149
|
+
const tracer = turnTracer;
|
|
150
|
+
|
|
151
|
+
const safe = (fn: () => void) => {
|
|
152
|
+
try {
|
|
153
|
+
fn();
|
|
154
|
+
} catch (error) {
|
|
155
|
+
diag.debug(`${LOG}: ${error}`);
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
const proxy: AsyncGenerator<ThreadEventLike> = {
|
|
160
|
+
async next(...args: [] | [unknown]) {
|
|
161
|
+
safe(() => tracer.start());
|
|
162
|
+
let result: IteratorResult<ThreadEventLike>;
|
|
163
|
+
try {
|
|
164
|
+
result = await source.next(...(args as []));
|
|
165
|
+
} catch (error) {
|
|
166
|
+
safe(() => tracer.finish({ kind: "error", error }));
|
|
167
|
+
throw error;
|
|
168
|
+
}
|
|
169
|
+
if (result.done) safe(() => tracer.finish({ kind: "completed" }));
|
|
170
|
+
else safe(() => tracer.onEvent(result.value));
|
|
171
|
+
return result;
|
|
172
|
+
},
|
|
173
|
+
async return(value?: unknown) {
|
|
174
|
+
try {
|
|
175
|
+
return await source.return(value as never);
|
|
176
|
+
} finally {
|
|
177
|
+
safe(() => tracer.finish({ kind: "returned" }));
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
async throw(error?: unknown) {
|
|
181
|
+
let result: IteratorResult<ThreadEventLike>;
|
|
182
|
+
try {
|
|
183
|
+
result = await source.throw(error);
|
|
184
|
+
} catch (thrown) {
|
|
185
|
+
safe(() => tracer.finish({ kind: "error", error: thrown }));
|
|
186
|
+
throw thrown;
|
|
187
|
+
}
|
|
188
|
+
if (result.done) safe(() => tracer.finish({ kind: "returned" }));
|
|
189
|
+
else safe(() => tracer.onEvent(result.value));
|
|
190
|
+
return result;
|
|
191
|
+
},
|
|
192
|
+
[Symbol.asyncIterator]() {
|
|
193
|
+
return proxy;
|
|
194
|
+
},
|
|
195
|
+
} as AsyncGenerator<ThreadEventLike>;
|
|
196
|
+
const asyncDispose = (Symbol as unknown as { asyncDispose?: symbol }).asyncDispose;
|
|
197
|
+
if (asyncDispose) {
|
|
198
|
+
(proxy as unknown as Record<symbol, unknown>)[asyncDispose] = async () => {
|
|
199
|
+
await proxy.return(undefined);
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
return proxy;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
function readThreadId(thread: ThreadLike): string | null {
|
|
206
|
+
try {
|
|
207
|
+
const id = thread?.id;
|
|
208
|
+
return typeof id === "string" && id ? id : null;
|
|
209
|
+
} catch {
|
|
210
|
+
return null;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
function readThreadOptions(thread: ThreadLike): ThreadLike["_threadOptions"] {
|
|
215
|
+
try {
|
|
216
|
+
const options = thread?._threadOptions;
|
|
217
|
+
return options && typeof options === "object" ? options : undefined;
|
|
218
|
+
} catch {
|
|
219
|
+
return undefined;
|
|
220
|
+
}
|
|
221
|
+
}
|
package/src/types.ts
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structural copies of the `@openai/codex-sdk` types this package reads
|
|
3
|
+
* (dist/index.d.ts of 0.162.1). The SDK is a peer dependency, so nothing here
|
|
4
|
+
* imports it: the package type-checks and runs whether or not it is installed.
|
|
5
|
+
*
|
|
6
|
+
* Every field is optional or `unknown` because the wrapper must never throw on
|
|
7
|
+
* an event shape a newer SDK adds.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/** `UserInput` / `Input` accepted by `Thread.run()` and `Thread.runStreamed()`. */
|
|
11
|
+
export type UserInputLike = { type?: string; text?: unknown; path?: unknown };
|
|
12
|
+
export type InputLike = string | UserInputLike[];
|
|
13
|
+
|
|
14
|
+
/** `TurnOptions`. Only `signal` is read (abort detection). */
|
|
15
|
+
export interface TurnOptionsLike {
|
|
16
|
+
signal?: AbortSignalLike;
|
|
17
|
+
outputSchema?: unknown;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface AbortSignalLike {
|
|
21
|
+
aborted?: boolean;
|
|
22
|
+
reason?: unknown;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** `ThreadOptions`, kept on the private `_threadOptions` field of a Thread. */
|
|
26
|
+
export interface ThreadOptionsLike {
|
|
27
|
+
model?: string;
|
|
28
|
+
sandboxMode?: string;
|
|
29
|
+
approvalPolicy?: string;
|
|
30
|
+
modelReasoningEffort?: string;
|
|
31
|
+
webSearchMode?: string;
|
|
32
|
+
webSearchEnabled?: boolean;
|
|
33
|
+
networkAccessEnabled?: boolean;
|
|
34
|
+
skipGitRepoCheck?: boolean;
|
|
35
|
+
workingDirectory?: string;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** `Usage` on `turn.completed`. */
|
|
39
|
+
export interface UsageLike {
|
|
40
|
+
input_tokens?: number;
|
|
41
|
+
cached_input_tokens?: number;
|
|
42
|
+
cache_write_input_tokens?: number;
|
|
43
|
+
output_tokens?: number;
|
|
44
|
+
reasoning_output_tokens?: number;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** Union of `ThreadItem` members, flattened. */
|
|
48
|
+
export interface ThreadItemLike {
|
|
49
|
+
id?: string;
|
|
50
|
+
type?: string;
|
|
51
|
+
/** agent_message, reasoning, todo item */
|
|
52
|
+
text?: string;
|
|
53
|
+
/** command_execution */
|
|
54
|
+
command?: string;
|
|
55
|
+
aggregated_output?: string;
|
|
56
|
+
/** `null` while the command runs (the binary sends unset optionals as `null`). */
|
|
57
|
+
exit_code?: number | null;
|
|
58
|
+
/** command_execution, file_change, mcp_tool_call */
|
|
59
|
+
status?: string;
|
|
60
|
+
/** file_change */
|
|
61
|
+
changes?: Array<{ path?: string; kind?: string }>;
|
|
62
|
+
/** mcp_tool_call */
|
|
63
|
+
server?: string;
|
|
64
|
+
tool?: string;
|
|
65
|
+
arguments?: unknown;
|
|
66
|
+
/**
|
|
67
|
+
* `null` (not missing) on `item.started` and on a failed call: codex-rs
|
|
68
|
+
* serializes these `Option`s as `null`, unlike the SDK's `result?:` typing.
|
|
69
|
+
*/
|
|
70
|
+
result?: { content?: unknown; structured_content?: unknown } | null;
|
|
71
|
+
error?: { message?: string } | null;
|
|
72
|
+
/** web_search */
|
|
73
|
+
query?: string;
|
|
74
|
+
/** todo_list */
|
|
75
|
+
items?: Array<{ text?: string; completed?: boolean }>;
|
|
76
|
+
/** error item */
|
|
77
|
+
message?: string;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/** `ThreadEvent`. */
|
|
81
|
+
export interface ThreadEventLike {
|
|
82
|
+
type?: string;
|
|
83
|
+
thread_id?: string;
|
|
84
|
+
usage?: UsageLike;
|
|
85
|
+
error?: { message?: string };
|
|
86
|
+
item?: ThreadItemLike;
|
|
87
|
+
message?: string;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* The parts of a `Thread` instance the wrapper touches. `runStreamedInternal`
|
|
92
|
+
* is private in the SDK but is the one method both `run()` and `runStreamed()`
|
|
93
|
+
* call (every stable release from 0.44.0 to 0.162.1); `id` and
|
|
94
|
+
* `_threadOptions` are read for the session id and model.
|
|
95
|
+
*/
|
|
96
|
+
export interface ThreadLike {
|
|
97
|
+
readonly id?: string | null;
|
|
98
|
+
_threadOptions?: ThreadOptionsLike;
|
|
99
|
+
runStreamedInternal?: (input: InputLike, turnOptions?: TurnOptionsLike) => AsyncGenerator<ThreadEventLike>;
|
|
100
|
+
runStreamed?: (input: InputLike, turnOptions?: TurnOptionsLike) => Promise<{ events: AsyncGenerator<ThreadEventLike> }>;
|
|
101
|
+
run?: (input: InputLike, turnOptions?: TurnOptionsLike) => Promise<unknown>;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* The SDK module namespace (`import * as CodexSDK from "@openai/codex-sdk"`)
|
|
106
|
+
* or any object exposing the `Thread` class. Typed loosely on purpose: the
|
|
107
|
+
* SDK's `Thread` declares its fields `private`, so it is not assignable to an
|
|
108
|
+
* interface that names them.
|
|
109
|
+
*/
|
|
110
|
+
export interface CodexModuleLike {
|
|
111
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
112
|
+
Thread?: Function;
|
|
113
|
+
}
|
package/src/version.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const VERSION = "0.1.1"; // x-release-please-version
|