@jrkropp/codex-js 0.1.1 → 0.1.3
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/CHANGELOG.md +8 -0
- package/dist/ClientNotification-B6-FhXQf.d.ts +5 -0
- package/dist/{DynamicToolCallResponse-D2OVpa4p.d.ts → DynamicToolCallResponse-82DFjES2.d.ts} +1 -1
- package/dist/DynamicToolSpec-CfnhqAYK.d.ts +29 -0
- package/dist/PermissionsRequestApprovalResponse-DxzPPDRb.d.ts +55 -0
- package/dist/ProviderStatusBanner-BlP6lzwE.d.ts +441 -0
- package/dist/ServerRequest-B5cKVJjr.d.ts +2181 -0
- package/dist/{session-BO6EZNK7.d.ts → ThreadResumeResponse-DvmE1juU.d.ts} +3 -290
- package/dist/ToolRequestUserInputQuestion-CeZa5X1J.d.ts +23 -0
- package/dist/{ToolRequestUserInputResponse-Bxjlpgho.d.ts → ToolRequestUserInputResponse-zcPLwbiK.d.ts} +1 -1
- package/dist/TurnSteerResponse-0kBCfplh.d.ts +209 -0
- package/dist/WebSearchToolConfig-D3ep0625.d.ts +18 -0
- package/dist/chat-runtime-B6azJyKo.d.ts +381 -0
- package/dist/chunk-2DZRMCI2.js +1258 -0
- package/dist/chunk-2DZRMCI2.js.map +1 -0
- package/dist/chunk-4DPLJPB5.js +396 -0
- package/dist/chunk-4DPLJPB5.js.map +1 -0
- package/dist/chunk-5JMJ6OI5.js +3 -0
- package/dist/chunk-5JMJ6OI5.js.map +1 -0
- package/dist/chunk-6ZMJ34KE.js +1153 -0
- package/dist/chunk-6ZMJ34KE.js.map +1 -0
- package/dist/chunk-CGBS37IU.js +128 -0
- package/dist/chunk-CGBS37IU.js.map +1 -0
- package/dist/chunk-DCMKA2A6.js +18 -0
- package/dist/chunk-DCMKA2A6.js.map +1 -0
- package/dist/chunk-DYLHN3HG.js +937 -0
- package/dist/chunk-DYLHN3HG.js.map +1 -0
- package/dist/chunk-ILXA6HLX.js +1973 -0
- package/dist/chunk-ILXA6HLX.js.map +1 -0
- package/dist/{chunk-TZBLUZ2X.js → chunk-LWQNX4LI.js} +7811 -12696
- package/dist/chunk-LWQNX4LI.js.map +1 -0
- package/dist/{chunk-FFASNDXU.js → chunk-NCI4MAWZ.js} +317 -1967
- package/dist/chunk-NCI4MAWZ.js.map +1 -0
- package/dist/chunk-O44XP7LH.js +214 -0
- package/dist/chunk-O44XP7LH.js.map +1 -0
- package/dist/chunk-PST3ZWX2.js +555 -0
- package/dist/chunk-PST3ZWX2.js.map +1 -0
- package/dist/chunk-SYPHCDRD.js +1133 -0
- package/dist/chunk-SYPHCDRD.js.map +1 -0
- package/dist/chunk-V4BMZWBM.js +2401 -0
- package/dist/chunk-V4BMZWBM.js.map +1 -0
- package/dist/chunk-YHVCFD2D.js +117 -0
- package/dist/chunk-YHVCFD2D.js.map +1 -0
- package/dist/chunk-Z63UPBS3.js +152 -0
- package/dist/chunk-Z63UPBS3.js.map +1 -0
- package/dist/client/index.d.ts +16 -111
- package/dist/client/index.js +13 -1
- package/dist/codex-rs/app-server/index.d.ts +161 -0
- package/dist/codex-rs/app-server/index.js +13 -0
- package/dist/codex-rs/app-server/index.js.map +1 -0
- package/dist/codex-rs/app-server-protocol/index.d.ts +1722 -0
- package/dist/codex-rs/app-server-protocol/index.js +6 -0
- package/dist/codex-rs/app-server-protocol/index.js.map +1 -0
- package/dist/codex-rs/app-server-protocol/protocol.d.ts +19 -0
- package/dist/codex-rs/app-server-protocol/protocol.js +4 -0
- package/dist/codex-rs/app-server-protocol/protocol.js.map +1 -0
- package/dist/codex-rs/codex-api/index.d.ts +104 -0
- package/dist/codex-rs/codex-api/index.js +11 -0
- package/dist/codex-rs/codex-api/index.js.map +1 -0
- package/dist/codex-rs/config/index.d.ts +88 -0
- package/dist/codex-rs/config/index.js +4 -0
- package/dist/codex-rs/config/index.js.map +1 -0
- package/dist/codex-rs/core/config/index.d.ts +61 -0
- package/dist/codex-rs/core/config/index.js +5 -0
- package/dist/codex-rs/core/config/index.js.map +1 -0
- package/dist/codex-rs/core/index.d.ts +1393 -0
- package/dist/codex-rs/core/index.js +11 -0
- package/dist/codex-rs/core/index.js.map +1 -0
- package/dist/codex-rs/model-provider/index.d.ts +2 -0
- package/dist/codex-rs/model-provider/index.js +4 -0
- package/dist/codex-rs/model-provider/index.js.map +1 -0
- package/dist/codex-rs/models-manager/index.d.ts +2 -0
- package/dist/codex-rs/models-manager/index.js +4 -0
- package/dist/codex-rs/models-manager/index.js.map +1 -0
- package/dist/codex-rs/parity.d.ts +26 -0
- package/dist/codex-rs/parity.js +3 -0
- package/dist/codex-rs/parity.js.map +1 -0
- package/dist/codex-rs/thread-store/index.d.ts +5 -0
- package/dist/codex-rs/thread-store/index.js +4 -0
- package/dist/codex-rs/thread-store/index.js.map +1 -0
- package/dist/codex-rs/unsupported.d.ts +15 -0
- package/dist/codex-rs/unsupported.js +22 -0
- package/dist/codex-rs/unsupported.js.map +1 -0
- package/dist/codex-rs/utils/output-truncation.d.ts +21 -0
- package/dist/codex-rs/utils/output-truncation.js +4 -0
- package/dist/codex-rs/utils/output-truncation.js.map +1 -0
- package/dist/codex-rs/utils/string.d.ts +7 -0
- package/dist/codex-rs/utils/string.js +3 -0
- package/dist/codex-rs/utils/string.js.map +1 -0
- package/dist/common-CTyph5x8.d.ts +40 -0
- package/dist/event-mapping-CbISdQ1D.d.ts +43 -0
- package/dist/history-CfM-4V7b.d.ts +1654 -0
- package/dist/index-77U_Oc-a.d.ts +63 -0
- package/dist/index-CoDZosq0.d.ts +261 -0
- package/dist/index.d.ts +18 -8
- package/dist/index.js +16 -2
- package/dist/lib-nXlaKiS-.d.ts +48 -0
- package/dist/live-thread-BMvlflzM.d.ts +30 -0
- package/dist/merge-B_AWVmnI.d.ts +24 -0
- package/dist/mod-DYVLSWO4.d.ts +91 -0
- package/dist/plan-mode-Cv6KWb_S.d.ts +14 -0
- package/dist/proposed-plan-DpN1ma0Y.d.ts +53 -0
- package/dist/protocol-mpBcYHrm.d.ts +1655 -0
- package/dist/react/index.d.ts +20 -53
- package/dist/react/index.js +16 -2
- package/dist/{remote-DMPfepa9.d.ts → remote-ClZbq9KN.d.ts} +3 -1
- package/dist/rendered-thread-AOxw3V5b.d.ts +29 -0
- package/dist/responses_websocket-BhxSgCzK.d.ts +183 -0
- package/dist/runtime-Cm6ml53h.d.ts +528 -0
- package/dist/server/index.d.ts +29 -1999
- package/dist/server/index.js +13 -1
- package/dist/session-BRYzi8OT.d.ts +46 -0
- package/dist/shadcn/index.d.ts +1 -1
- package/dist/{sidebar-DT2XoitN.d.ts → sidebar-DMMij22z.d.ts} +1 -1
- package/dist/spec_plan_types-CmsJ-Tfn.d.ts +260 -0
- package/dist/{store-H2cQxdpe.d.ts → store-AGRxhgQ3.d.ts} +2 -1
- package/dist/t3code/apps/web/components/chat.d.ts +508 -0
- package/dist/t3code/apps/web/components/chat.js +12 -0
- package/dist/t3code/apps/web/components/chat.js.map +1 -0
- package/dist/t3code/apps/web/index.d.ts +12 -0
- package/dist/t3code/apps/web/index.js +13 -0
- package/dist/t3code/apps/web/index.js.map +1 -0
- package/dist/testing/index.d.ts +9 -91
- package/dist/testing/index.js +13 -1
- package/dist/thread-history-builder-zW0zeqcS.d.ts +58 -0
- package/dist/thread_event_store-C0zYzukG.d.ts +77 -0
- package/dist/types-BTeabLYr.d.ts +126 -0
- package/package.json +152 -88
- package/dist/chat-runtime-CMli5dzJ.d.ts +0 -748
- package/dist/chunk-FFASNDXU.js.map +0 -1
- package/dist/chunk-TZBLUZ2X.js.map +0 -1
- package/dist/thread_event_store-BIS0qzhi.d.ts +0 -3843
package/dist/testing/index.d.ts
CHANGED
|
@@ -1,91 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
flushThread: number;
|
|
11
|
-
listThreads: number;
|
|
12
|
-
loadHistory: number;
|
|
13
|
-
persistThread: number;
|
|
14
|
-
readThread: number;
|
|
15
|
-
readThreadByRolloutPath: number;
|
|
16
|
-
resumeThread: number;
|
|
17
|
-
shutdownThread: number;
|
|
18
|
-
unarchiveThread: number;
|
|
19
|
-
updateThreadMetadata: number;
|
|
20
|
-
};
|
|
21
|
-
type InMemoryThreadStoreState = {
|
|
22
|
-
calls: InMemoryThreadStoreCalls;
|
|
23
|
-
createdThreads: Map<ThreadId, CreateThreadParams>;
|
|
24
|
-
histories: Map<ThreadId, RolloutItem[]>;
|
|
25
|
-
rolloutPaths: Map<string, ThreadId>;
|
|
26
|
-
threads: Map<ThreadId, StoredThread>;
|
|
27
|
-
};
|
|
28
|
-
type InMemoryThreadStoreSnapshot = {
|
|
29
|
-
createdThreads: Array<[ThreadId, CreateThreadParams]>;
|
|
30
|
-
histories: Array<[ThreadId, RolloutItem[]]>;
|
|
31
|
-
rolloutPaths: Array<[string, ThreadId]>;
|
|
32
|
-
threads: Array<[ThreadId, StoredThread]>;
|
|
33
|
-
};
|
|
34
|
-
declare class InMemoryThreadStore implements ThreadStore {
|
|
35
|
-
protected readonly state: InMemoryThreadStoreState;
|
|
36
|
-
static forId(id: string): InMemoryThreadStore;
|
|
37
|
-
static removeId(id: string): InMemoryThreadStore | null;
|
|
38
|
-
calls(): InMemoryThreadStoreCalls;
|
|
39
|
-
snapshot(): InMemoryThreadStoreSnapshot;
|
|
40
|
-
restoreSnapshot(snapshot: InMemoryThreadStoreSnapshot): void;
|
|
41
|
-
createThread(params: CreateThreadParams): Promise<void>;
|
|
42
|
-
resumeThread(params: ResumeThreadParams): Promise<void>;
|
|
43
|
-
appendItems(params: AppendThreadItemsParams): Promise<void>;
|
|
44
|
-
persistThread(threadId: ThreadId): Promise<void>;
|
|
45
|
-
flushThread(threadId: ThreadId): Promise<void>;
|
|
46
|
-
shutdownThread(threadId: ThreadId): Promise<void>;
|
|
47
|
-
discardThread(threadId: ThreadId): Promise<void>;
|
|
48
|
-
loadHistory(params: LoadThreadHistoryParams): Promise<StoredThreadHistory>;
|
|
49
|
-
readThread(params: ReadThreadParams): Promise<StoredThread>;
|
|
50
|
-
readThreadByRolloutPath(params: ReadThreadByRolloutPathParams): Promise<StoredThread>;
|
|
51
|
-
listThreads(params: ListThreadsParams): Promise<ThreadPage>;
|
|
52
|
-
updateThreadMetadata(params: UpdateThreadMetadataParams): Promise<StoredThread>;
|
|
53
|
-
archiveThread(params: ArchiveThreadParams): Promise<void>;
|
|
54
|
-
unarchiveThread(params: ArchiveThreadParams): Promise<StoredThread>;
|
|
55
|
-
private history;
|
|
56
|
-
private storedThread;
|
|
57
|
-
private touch;
|
|
58
|
-
private updateThreadTokenUsage;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
type LocalThreadStoreConfig = {
|
|
62
|
-
codex_home: string;
|
|
63
|
-
default_model_provider_id: string;
|
|
64
|
-
};
|
|
65
|
-
declare class LocalThreadStore extends InMemoryThreadStore {
|
|
66
|
-
readonly config: LocalThreadStoreConfig;
|
|
67
|
-
constructor(config: LocalThreadStoreConfig);
|
|
68
|
-
stateDb(): null;
|
|
69
|
-
createThread(params: CreateThreadParams): Promise<void>;
|
|
70
|
-
resumeThread(params: ResumeThreadParams): Promise<void>;
|
|
71
|
-
appendItems(params: AppendThreadItemsParams): Promise<void>;
|
|
72
|
-
persistThread(threadId: ThreadId): Promise<void>;
|
|
73
|
-
flushThread(threadId: ThreadId): Promise<void>;
|
|
74
|
-
shutdownThread(threadId: ThreadId): Promise<void>;
|
|
75
|
-
discardThread(threadId: ThreadId): Promise<void>;
|
|
76
|
-
loadHistory(params: LoadThreadHistoryParams): Promise<StoredThreadHistory>;
|
|
77
|
-
readThread(params: ReadThreadParams): Promise<StoredThread>;
|
|
78
|
-
readThreadByRolloutPath(params: ReadThreadByRolloutPathParams): Promise<StoredThread>;
|
|
79
|
-
listThreads(params: ListThreadsParams): Promise<ThreadPage>;
|
|
80
|
-
updateThreadMetadata(params: UpdateThreadMetadataParams): Promise<StoredThread>;
|
|
81
|
-
archiveThread(params: ArchiveThreadParams): Promise<void>;
|
|
82
|
-
unarchiveThread(params: ArchiveThreadParams): Promise<StoredThread>;
|
|
83
|
-
liveRolloutPath(threadId: ThreadId): string;
|
|
84
|
-
private attachRolloutPath;
|
|
85
|
-
private load;
|
|
86
|
-
private save;
|
|
87
|
-
private rolloutPath;
|
|
88
|
-
private storePath;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
export { InMemoryThreadStore, type InMemoryThreadStoreCalls, LocalThreadStore, type LocalThreadStoreConfig, ThreadStore };
|
|
1
|
+
export { a as ThreadEventSnapshot, b as ThreadEventStore } from '../thread_event_store-C0zYzukG.js';
|
|
2
|
+
export { a as RenderedThreadState, c as createRenderedThreadState, r as renderThreadFromHistory } from '../rendered-thread-AOxw3V5b.js';
|
|
3
|
+
export { T as ThreadStore } from '../store-AGRxhgQ3.js';
|
|
4
|
+
export { I as InMemoryThreadStore, a as InMemoryThreadStoreCalls, L as LocalThreadStore, b as LocalThreadStoreConfig } from '../mod-DYVLSWO4.js';
|
|
5
|
+
import '../ToolRequestUserInputQuestion-CeZa5X1J.js';
|
|
6
|
+
import '../ServerRequest-B5cKVJjr.js';
|
|
7
|
+
import '../protocol-mpBcYHrm.js';
|
|
8
|
+
import '../types-BTeabLYr.js';
|
|
9
|
+
import '../thread-history-builder-zW0zeqcS.js';
|
package/dist/testing/index.js
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { ThreadEventStore } from '../chunk-6ZMJ34KE.js';
|
|
2
|
+
export { InMemoryThreadStore, LocalThreadStore } from '../chunk-4DPLJPB5.js';
|
|
3
|
+
import '../chunk-V4BMZWBM.js';
|
|
4
|
+
import '../chunk-LWQNX4LI.js';
|
|
5
|
+
import '../chunk-PST3ZWX2.js';
|
|
6
|
+
import '../chunk-Z63UPBS3.js';
|
|
7
|
+
import '../chunk-YHVCFD2D.js';
|
|
8
|
+
import '../chunk-DCMKA2A6.js';
|
|
9
|
+
import '../chunk-CGBS37IU.js';
|
|
10
|
+
import '../chunk-2DZRMCI2.js';
|
|
11
|
+
export { createRenderedThreadState, renderThreadFromHistory } from '../chunk-DYLHN3HG.js';
|
|
12
|
+
import '../chunk-SYPHCDRD.js';
|
|
13
|
+
import '../chunk-O44XP7LH.js';
|
|
2
14
|
//# sourceMappingURL=index.js.map
|
|
3
15
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { t as TurnItem, j as RolloutItem, E as EventMsg, A as ResponseItem } from './protocol-mpBcYHrm.js';
|
|
2
|
+
|
|
3
|
+
type TurnStatus = "completed" | "interrupted" | "failed" | "in_progress";
|
|
4
|
+
type TurnItemsView = "not_loaded" | "summary" | "full";
|
|
5
|
+
type TurnError = {
|
|
6
|
+
message: string;
|
|
7
|
+
codex_error_info?: unknown | null;
|
|
8
|
+
additional_details?: string | null;
|
|
9
|
+
};
|
|
10
|
+
type Turn = {
|
|
11
|
+
id: string;
|
|
12
|
+
items: TurnItem[];
|
|
13
|
+
items_view: TurnItemsView;
|
|
14
|
+
status: TurnStatus;
|
|
15
|
+
error: TurnError | null;
|
|
16
|
+
started_at: number | null;
|
|
17
|
+
completed_at: number | null;
|
|
18
|
+
duration_ms: number | null;
|
|
19
|
+
};
|
|
20
|
+
type PendingTurn = Turn & {
|
|
21
|
+
opened_explicitly: boolean;
|
|
22
|
+
};
|
|
23
|
+
declare class ThreadHistoryBuilder {
|
|
24
|
+
private turns;
|
|
25
|
+
private next_item_index;
|
|
26
|
+
static fromTurns(turns: readonly Turn[]): ThreadHistoryBuilder;
|
|
27
|
+
handle_rollout_item(item: RolloutItem, index?: number): void;
|
|
28
|
+
handle_event(event: EventMsg, eventId?: string): void;
|
|
29
|
+
handle_response_item(item: ResponseItem, id: string): void;
|
|
30
|
+
active_turn_snapshot(): Turn | null;
|
|
31
|
+
active_turn_position(): number | null;
|
|
32
|
+
finish(): Turn[];
|
|
33
|
+
has_active_turn(): boolean;
|
|
34
|
+
reset(): void;
|
|
35
|
+
private open_explicit_turn;
|
|
36
|
+
private complete_turn;
|
|
37
|
+
private append_user_message;
|
|
38
|
+
private upsert_agent_message;
|
|
39
|
+
private upsert_item_in_turn;
|
|
40
|
+
private upsert_item_in_current_or_existing_turn;
|
|
41
|
+
private append_to_current_turn;
|
|
42
|
+
private apply_agent_message_delta;
|
|
43
|
+
private apply_plan_delta;
|
|
44
|
+
private apply_exec_command_output_delta;
|
|
45
|
+
private apply_exec_command_end;
|
|
46
|
+
private ensure_turn;
|
|
47
|
+
private active_turn;
|
|
48
|
+
private turn_by_id;
|
|
49
|
+
private find_item;
|
|
50
|
+
}
|
|
51
|
+
declare function buildTurnsFromRolloutItems(items: readonly RolloutItem[]): Turn[];
|
|
52
|
+
declare function applyEventToThreadHistoryBuilder(builder: ThreadHistoryBuilder, event: EventMsg, eventId?: string): ThreadHistoryBuilder;
|
|
53
|
+
declare function flattenTurnsToTurnItems(turns: readonly Turn[]): TurnItem[];
|
|
54
|
+
declare function applyEventToTurns(turns: readonly Turn[], event: EventMsg, eventId?: string): Turn[];
|
|
55
|
+
declare function applyResponseItemToTurns(turns: readonly Turn[], item: ResponseItem, id: string): Turn[];
|
|
56
|
+
declare function appendCompactionTurnToTurns(turns: readonly Turn[], id: string): Turn[];
|
|
57
|
+
|
|
58
|
+
export { type PendingTurn as P, ThreadHistoryBuilder as T, type Turn as a, type TurnError as b, type TurnItemsView as c, type TurnStatus as d, appendCompactionTurnToTurns as e, applyEventToThreadHistoryBuilder as f, applyEventToTurns as g, applyResponseItemToTurns as h, buildTurnsFromRolloutItems as i, flattenTurnsToTurnItems as j };
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { R as RequestId } from './ToolRequestUserInputQuestion-CeZa5X1J.js';
|
|
2
|
+
import { R as RateLimitSnapshot, S as ServerNotification, a as ServerRequest, T as Thread, d as ThreadTokenUsage, c as Turn } from './ServerRequest-B5cKVJjr.js';
|
|
3
|
+
import { R as RenderedThreadConnectionStatus } from './rendered-thread-AOxw3V5b.js';
|
|
4
|
+
|
|
5
|
+
type ThreadBufferedEvent = {
|
|
6
|
+
notification: ServerNotification;
|
|
7
|
+
type: "notification";
|
|
8
|
+
} | {
|
|
9
|
+
request: ServerRequest;
|
|
10
|
+
type: "request";
|
|
11
|
+
};
|
|
12
|
+
type ServerNotificationThreadTarget = {
|
|
13
|
+
threadId: string;
|
|
14
|
+
type: "thread";
|
|
15
|
+
} | {
|
|
16
|
+
threadId: string;
|
|
17
|
+
type: "invalid_thread_id";
|
|
18
|
+
} | {
|
|
19
|
+
type: "global";
|
|
20
|
+
};
|
|
21
|
+
type ThreadEventSnapshot = {
|
|
22
|
+
activeTurnIds: string[];
|
|
23
|
+
accountRateLimits: RateLimitSnapshot | null;
|
|
24
|
+
bufferedEvents: ThreadBufferedEvent[];
|
|
25
|
+
connectionStatus: RenderedThreadConnectionStatus;
|
|
26
|
+
errors: string[];
|
|
27
|
+
pendingRequests: ServerRequest[];
|
|
28
|
+
resolvedRequestIds: RequestId[];
|
|
29
|
+
thread: Thread | null;
|
|
30
|
+
tokenUsage: ThreadTokenUsageSnapshot | null;
|
|
31
|
+
turns: Turn[];
|
|
32
|
+
warnings: string[];
|
|
33
|
+
};
|
|
34
|
+
type ThreadTokenUsageSnapshot = {
|
|
35
|
+
threadId: string;
|
|
36
|
+
tokenUsage: ThreadTokenUsage;
|
|
37
|
+
turnId: string;
|
|
38
|
+
updatedAt: string;
|
|
39
|
+
};
|
|
40
|
+
declare class ThreadEventStore {
|
|
41
|
+
private accountRateLimits;
|
|
42
|
+
private activeTurnIds;
|
|
43
|
+
private bufferedEvents;
|
|
44
|
+
private connectionStatus;
|
|
45
|
+
private errors;
|
|
46
|
+
private pendingRequests;
|
|
47
|
+
private resolvedRequestIds;
|
|
48
|
+
private thread;
|
|
49
|
+
private tokenUsage;
|
|
50
|
+
private turns;
|
|
51
|
+
private warnings;
|
|
52
|
+
static fromThread(thread: Thread): ThreadEventStore;
|
|
53
|
+
applyNotification(notification: ServerNotification): ThreadEventSnapshot;
|
|
54
|
+
applyRequest(request: ServerRequest): ThreadEventSnapshot;
|
|
55
|
+
setConnectionStatus(status: RenderedThreadConnectionStatus): ThreadEventSnapshot;
|
|
56
|
+
setThread(thread: Thread): ThreadEventSnapshot;
|
|
57
|
+
snapshot(): ThreadEventSnapshot;
|
|
58
|
+
noteNotification(notification: ServerNotification): void;
|
|
59
|
+
noteRequest(request: ServerRequest): void;
|
|
60
|
+
private upsertTurn;
|
|
61
|
+
private upsertItem;
|
|
62
|
+
private applyAgentMessageDelta;
|
|
63
|
+
private applyPlanDelta;
|
|
64
|
+
private applyReasoningSummaryPartAdded;
|
|
65
|
+
private applyReasoningSummaryTextDelta;
|
|
66
|
+
private applyReasoningTextDelta;
|
|
67
|
+
private applyCommandOutputDelta;
|
|
68
|
+
private applyFileChangePatchUpdated;
|
|
69
|
+
private reasoningItem;
|
|
70
|
+
private ensureTurn;
|
|
71
|
+
private replaceTurn;
|
|
72
|
+
}
|
|
73
|
+
declare function serverRequestThreadId(request: ServerRequest): string | null;
|
|
74
|
+
declare function serverNotificationThreadTarget(notification: ServerNotification): ServerNotificationThreadTarget;
|
|
75
|
+
declare function threadEventSnapshotHasStarted(snapshot: ThreadEventSnapshot | null): boolean;
|
|
76
|
+
|
|
77
|
+
export { type ServerNotificationThreadTarget as S, type ThreadBufferedEvent as T, type ThreadEventSnapshot as a, ThreadEventStore as b, type ThreadTokenUsageSnapshot as c, serverRequestThreadId as d, serverNotificationThreadTarget as s, threadEventSnapshotHasStarted as t };
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { l as ThreadId, j as RolloutItem, B as BaseInstructions, D as DynamicToolSpec, m as ThreadMemoryMode } from './protocol-mpBcYHrm.js';
|
|
2
|
+
|
|
3
|
+
declare const ThreadEventPersistenceMode: {
|
|
4
|
+
readonly Limited: "Limited";
|
|
5
|
+
readonly Extended: "Extended";
|
|
6
|
+
};
|
|
7
|
+
type ThreadEventPersistenceMode = (typeof ThreadEventPersistenceMode)[keyof typeof ThreadEventPersistenceMode];
|
|
8
|
+
declare const ThreadSortKey: {
|
|
9
|
+
readonly CreatedAt: "CreatedAt";
|
|
10
|
+
readonly UpdatedAt: "UpdatedAt";
|
|
11
|
+
};
|
|
12
|
+
type ThreadSortKey = (typeof ThreadSortKey)[keyof typeof ThreadSortKey];
|
|
13
|
+
declare const SortDirection: {
|
|
14
|
+
readonly Asc: "Asc";
|
|
15
|
+
readonly Desc: "Desc";
|
|
16
|
+
};
|
|
17
|
+
type SortDirection = (typeof SortDirection)[keyof typeof SortDirection];
|
|
18
|
+
type ThreadPersistenceMetadata = {
|
|
19
|
+
cwd?: string | null;
|
|
20
|
+
model_provider: string;
|
|
21
|
+
memory_mode: ThreadMemoryMode;
|
|
22
|
+
[key: string]: unknown;
|
|
23
|
+
};
|
|
24
|
+
type CreateThreadParams = {
|
|
25
|
+
thread_id: ThreadId;
|
|
26
|
+
forked_from_id?: ThreadId | null;
|
|
27
|
+
source: string;
|
|
28
|
+
thread_source?: string | null;
|
|
29
|
+
base_instructions: BaseInstructions;
|
|
30
|
+
dynamic_tools: DynamicToolSpec[];
|
|
31
|
+
metadata: ThreadPersistenceMetadata;
|
|
32
|
+
event_persistence_mode: ThreadEventPersistenceMode;
|
|
33
|
+
};
|
|
34
|
+
type ResumeThreadParams = {
|
|
35
|
+
thread_id: ThreadId;
|
|
36
|
+
rollout_path?: string | null;
|
|
37
|
+
history?: RolloutItem[] | null;
|
|
38
|
+
include_archived: boolean;
|
|
39
|
+
metadata: ThreadPersistenceMetadata;
|
|
40
|
+
event_persistence_mode: ThreadEventPersistenceMode;
|
|
41
|
+
};
|
|
42
|
+
type AppendThreadItemsParams = {
|
|
43
|
+
thread_id: ThreadId;
|
|
44
|
+
items: RolloutItem[];
|
|
45
|
+
};
|
|
46
|
+
type LoadThreadHistoryParams = {
|
|
47
|
+
thread_id: ThreadId;
|
|
48
|
+
include_archived: boolean;
|
|
49
|
+
};
|
|
50
|
+
type StoredThreadHistory = {
|
|
51
|
+
thread_id: ThreadId;
|
|
52
|
+
items: RolloutItem[];
|
|
53
|
+
};
|
|
54
|
+
type ReadThreadParams = {
|
|
55
|
+
thread_id: ThreadId;
|
|
56
|
+
include_archived: boolean;
|
|
57
|
+
include_history: boolean;
|
|
58
|
+
};
|
|
59
|
+
type ReadThreadByRolloutPathParams = {
|
|
60
|
+
rollout_path: string;
|
|
61
|
+
include_archived: boolean;
|
|
62
|
+
include_history: boolean;
|
|
63
|
+
};
|
|
64
|
+
type ListThreadsParams = {
|
|
65
|
+
page_size: number;
|
|
66
|
+
cursor?: string | null;
|
|
67
|
+
sort_key: ThreadSortKey;
|
|
68
|
+
sort_direction: SortDirection;
|
|
69
|
+
allowed_sources: string[];
|
|
70
|
+
model_providers?: string[] | null;
|
|
71
|
+
cwd_filters?: string[] | null;
|
|
72
|
+
archived: boolean;
|
|
73
|
+
search_term?: string | null;
|
|
74
|
+
use_state_db_only: boolean;
|
|
75
|
+
};
|
|
76
|
+
type ThreadPage = {
|
|
77
|
+
items: StoredThread[];
|
|
78
|
+
next_cursor?: string | null;
|
|
79
|
+
};
|
|
80
|
+
type StoredThread = {
|
|
81
|
+
thread_id: ThreadId;
|
|
82
|
+
rollout_path?: string | null;
|
|
83
|
+
forked_from_id?: ThreadId | null;
|
|
84
|
+
preview: string;
|
|
85
|
+
name?: string | null;
|
|
86
|
+
model_provider: string;
|
|
87
|
+
model?: string | null;
|
|
88
|
+
reasoning_effort?: string | null;
|
|
89
|
+
created_at: string;
|
|
90
|
+
updated_at: string;
|
|
91
|
+
archived_at?: string | null;
|
|
92
|
+
cwd: string;
|
|
93
|
+
cli_version?: string;
|
|
94
|
+
source: string;
|
|
95
|
+
thread_source?: string | null;
|
|
96
|
+
agent_nickname?: string | null;
|
|
97
|
+
agent_role?: string | null;
|
|
98
|
+
agent_path?: string | null;
|
|
99
|
+
git_info?: unknown;
|
|
100
|
+
approval_mode?: string;
|
|
101
|
+
sandbox_policy?: unknown;
|
|
102
|
+
token_usage?: unknown;
|
|
103
|
+
first_user_message?: string | null;
|
|
104
|
+
history?: StoredThreadHistory | null;
|
|
105
|
+
};
|
|
106
|
+
type OptionalStringPatch = string | null | undefined;
|
|
107
|
+
type GitInfoPatch = {
|
|
108
|
+
sha?: OptionalStringPatch;
|
|
109
|
+
branch?: OptionalStringPatch;
|
|
110
|
+
origin_url?: OptionalStringPatch;
|
|
111
|
+
};
|
|
112
|
+
type ThreadMetadataPatch = {
|
|
113
|
+
name?: string;
|
|
114
|
+
memory_mode?: ThreadMemoryMode;
|
|
115
|
+
git_info?: GitInfoPatch;
|
|
116
|
+
};
|
|
117
|
+
type UpdateThreadMetadataParams = {
|
|
118
|
+
thread_id: ThreadId;
|
|
119
|
+
patch: ThreadMetadataPatch;
|
|
120
|
+
include_archived: boolean;
|
|
121
|
+
};
|
|
122
|
+
type ArchiveThreadParams = {
|
|
123
|
+
thread_id: ThreadId;
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
export { type AppendThreadItemsParams as A, type CreateThreadParams as C, type GitInfoPatch as G, type ListThreadsParams as L, type OptionalStringPatch as O, type ReadThreadByRolloutPathParams as R, SortDirection as S, ThreadEventPersistenceMode as T, type UpdateThreadMetadataParams as U, type ArchiveThreadParams as a, type LoadThreadHistoryParams as b, type ReadThreadParams as c, type ResumeThreadParams as d, type StoredThread as e, type StoredThreadHistory as f, type ThreadMetadataPatch as g, type ThreadPage as h, type ThreadPersistenceMetadata as i, ThreadSortKey as j };
|
package/package.json
CHANGED
|
@@ -1,89 +1,153 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}
|
|
2
|
+
"name": "@jrkropp/codex-js",
|
|
3
|
+
"version": "0.1.3",
|
|
4
|
+
"description": "Unofficial TypeScript Codex runtime for building Codex-backed web apps.",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"sideEffects": [
|
|
8
|
+
"**/*.css"
|
|
9
|
+
],
|
|
10
|
+
"files": [
|
|
11
|
+
"dist",
|
|
12
|
+
"README.md",
|
|
13
|
+
"CHANGELOG.md",
|
|
14
|
+
"LICENSE",
|
|
15
|
+
"NOTICE"
|
|
16
|
+
],
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"import": "./dist/index.js"
|
|
21
|
+
},
|
|
22
|
+
"./client": {
|
|
23
|
+
"types": "./dist/client/index.d.ts",
|
|
24
|
+
"import": "./dist/client/index.js"
|
|
25
|
+
},
|
|
26
|
+
"./server": {
|
|
27
|
+
"types": "./dist/server/index.d.ts",
|
|
28
|
+
"import": "./dist/server/index.js"
|
|
29
|
+
},
|
|
30
|
+
"./react": {
|
|
31
|
+
"types": "./dist/react/index.d.ts",
|
|
32
|
+
"import": "./dist/react/index.js"
|
|
33
|
+
},
|
|
34
|
+
"./shadcn": {
|
|
35
|
+
"types": "./dist/shadcn/index.d.ts",
|
|
36
|
+
"import": "./dist/shadcn/index.js"
|
|
37
|
+
},
|
|
38
|
+
"./testing": {
|
|
39
|
+
"types": "./dist/testing/index.d.ts",
|
|
40
|
+
"import": "./dist/testing/index.js"
|
|
41
|
+
},
|
|
42
|
+
"./codex-rs/config": {
|
|
43
|
+
"types": "./dist/codex-rs/config/index.d.ts",
|
|
44
|
+
"import": "./dist/codex-rs/config/index.js"
|
|
45
|
+
},
|
|
46
|
+
"./codex-rs/parity": {
|
|
47
|
+
"types": "./dist/codex-rs/parity.d.ts",
|
|
48
|
+
"import": "./dist/codex-rs/parity.js"
|
|
49
|
+
},
|
|
50
|
+
"./codex-rs/unsupported": {
|
|
51
|
+
"types": "./dist/codex-rs/unsupported.d.ts",
|
|
52
|
+
"import": "./dist/codex-rs/unsupported.js"
|
|
53
|
+
},
|
|
54
|
+
"./codex-rs/core": {
|
|
55
|
+
"types": "./dist/codex-rs/core/index.d.ts",
|
|
56
|
+
"import": "./dist/codex-rs/core/index.js"
|
|
57
|
+
},
|
|
58
|
+
"./codex-rs/core/config": {
|
|
59
|
+
"types": "./dist/codex-rs/core/config/index.d.ts",
|
|
60
|
+
"import": "./dist/codex-rs/core/config/index.js"
|
|
61
|
+
},
|
|
62
|
+
"./codex-rs/thread-store": {
|
|
63
|
+
"types": "./dist/codex-rs/thread-store/index.d.ts",
|
|
64
|
+
"import": "./dist/codex-rs/thread-store/index.js"
|
|
65
|
+
},
|
|
66
|
+
"./codex-rs/codex-api": {
|
|
67
|
+
"types": "./dist/codex-rs/codex-api/index.d.ts",
|
|
68
|
+
"import": "./dist/codex-rs/codex-api/index.js"
|
|
69
|
+
},
|
|
70
|
+
"./codex-rs/app-server": {
|
|
71
|
+
"types": "./dist/codex-rs/app-server/index.d.ts",
|
|
72
|
+
"import": "./dist/codex-rs/app-server/index.js"
|
|
73
|
+
},
|
|
74
|
+
"./codex-rs/app-server-protocol": {
|
|
75
|
+
"types": "./dist/codex-rs/app-server-protocol/index.d.ts",
|
|
76
|
+
"import": "./dist/codex-rs/app-server-protocol/index.js"
|
|
77
|
+
},
|
|
78
|
+
"./codex-rs/app-server-protocol/protocol": {
|
|
79
|
+
"types": "./dist/codex-rs/app-server-protocol/protocol.d.ts",
|
|
80
|
+
"import": "./dist/codex-rs/app-server-protocol/protocol.js"
|
|
81
|
+
},
|
|
82
|
+
"./codex-rs/model-provider": {
|
|
83
|
+
"types": "./dist/codex-rs/model-provider/index.d.ts",
|
|
84
|
+
"import": "./dist/codex-rs/model-provider/index.js"
|
|
85
|
+
},
|
|
86
|
+
"./codex-rs/models-manager": {
|
|
87
|
+
"types": "./dist/codex-rs/models-manager/index.d.ts",
|
|
88
|
+
"import": "./dist/codex-rs/models-manager/index.js"
|
|
89
|
+
},
|
|
90
|
+
"./codex-rs/utils/output-truncation": {
|
|
91
|
+
"types": "./dist/codex-rs/utils/output-truncation.d.ts",
|
|
92
|
+
"import": "./dist/codex-rs/utils/output-truncation.js"
|
|
93
|
+
},
|
|
94
|
+
"./codex-rs/utils/string": {
|
|
95
|
+
"types": "./dist/codex-rs/utils/string.d.ts",
|
|
96
|
+
"import": "./dist/codex-rs/utils/string.js"
|
|
97
|
+
},
|
|
98
|
+
"./t3code/apps/web": {
|
|
99
|
+
"types": "./dist/t3code/apps/web/index.d.ts",
|
|
100
|
+
"import": "./dist/t3code/apps/web/index.js"
|
|
101
|
+
},
|
|
102
|
+
"./t3code/apps/web/components/chat": {
|
|
103
|
+
"types": "./dist/t3code/apps/web/components/chat.d.ts",
|
|
104
|
+
"import": "./dist/t3code/apps/web/components/chat.js"
|
|
105
|
+
},
|
|
106
|
+
"./styles.css": "./dist/styles.css"
|
|
107
|
+
},
|
|
108
|
+
"dependencies": {
|
|
109
|
+
"@legendapp/list": "^3.0.0-beta.44",
|
|
110
|
+
"@lexical/react": "^0.44.0",
|
|
111
|
+
"class-variance-authority": "^0.7.1",
|
|
112
|
+
"clsx": "^2.1.1",
|
|
113
|
+
"cmdk": "^1.1.1",
|
|
114
|
+
"lexical": "^0.44.0",
|
|
115
|
+
"lucide-react": "^1.11.0",
|
|
116
|
+
"radix-ui": "^1.4.3",
|
|
117
|
+
"react-markdown": "^10.1.0",
|
|
118
|
+
"remark-gfm": "^4.0.1",
|
|
119
|
+
"smol-toml": "^1.6.1",
|
|
120
|
+
"tailwind-merge": "^3.5.0",
|
|
121
|
+
"zustand": "^5.0.13"
|
|
122
|
+
},
|
|
123
|
+
"peerDependencies": {
|
|
124
|
+
"react": "^18.3.0 || ^19.0.0",
|
|
125
|
+
"react-dom": "^18.3.0 || ^19.0.0"
|
|
126
|
+
},
|
|
127
|
+
"devDependencies": {
|
|
128
|
+
"@types/react": "19.2.7",
|
|
129
|
+
"@types/react-dom": "19.2.3",
|
|
130
|
+
"typescript": "5.8.3"
|
|
131
|
+
},
|
|
132
|
+
"publishConfig": {
|
|
133
|
+
"access": "public",
|
|
134
|
+
"provenance": true
|
|
135
|
+
},
|
|
136
|
+
"repository": {
|
|
137
|
+
"type": "git",
|
|
138
|
+
"url": "git+https://github.com/jrkropp/codex-js.git",
|
|
139
|
+
"directory": "packages/codex-js"
|
|
140
|
+
},
|
|
141
|
+
"bugs": {
|
|
142
|
+
"url": "https://github.com/jrkropp/codex-js/issues"
|
|
143
|
+
},
|
|
144
|
+
"homepage": "https://github.com/jrkropp/codex-js#readme",
|
|
145
|
+
"scripts": {
|
|
146
|
+
"build": "tsup && node scripts/copy-assets.mjs",
|
|
147
|
+
"clean": "rm -rf dist",
|
|
148
|
+
"codex:mirror": "node scripts/generate-codex-mirror.mjs",
|
|
149
|
+
"pack:dry-run": "npm pack --dry-run",
|
|
150
|
+
"publint": "publint",
|
|
151
|
+
"typecheck": "tsc -p tsconfig.json --pretty false"
|
|
152
|
+
}
|
|
153
|
+
}
|