t3code-cli 0.10.0 → 0.11.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.
- package/README.md +33 -1
- package/dist/application.js +2 -2
- package/dist/auth.js +1 -1
- package/dist/bin.js +1566 -351
- package/dist/cli.js +1 -1
- package/dist/config.js +1 -1
- package/dist/connection.js +1 -11
- package/dist/index.js +1 -1
- package/dist/layout.js +1 -1
- package/dist/node.js +2 -0
- package/dist/orchestration.js +2 -2
- package/dist/rpc.js +2 -2
- package/dist/runtime.js +1 -1
- package/dist/scope.js +1 -1
- package/dist/shared.js +1740 -767
- package/dist/src/application/index.d.ts +3 -2
- package/dist/src/application/layer.d.ts +82 -841
- package/dist/src/application/model-selection.d.ts +15 -0
- package/dist/src/application/models.d.ts +1 -87
- package/dist/src/application/project-commands.d.ts +9 -0
- package/dist/src/application/projects.d.ts +13 -135
- package/dist/src/application/service.d.ts +84 -5
- package/dist/src/application/shell-sequence.d.ts +2 -12
- package/dist/src/application/terminals.d.ts +66 -0
- package/dist/src/application/thread-commands.d.ts +47 -0
- package/dist/src/application/thread-update.d.ts +8 -0
- package/dist/src/application/thread-wait.d.ts +3 -14
- package/dist/src/application/threads.d.ts +21 -50
- package/dist/src/cli/flags.d.ts +3 -0
- package/dist/src/cli/output-format.d.ts +2 -0
- package/dist/src/domain/error.d.ts +14 -1
- package/dist/src/domain/helpers.d.ts +0 -9
- package/dist/src/domain/model-config.d.ts +29 -3
- package/dist/src/domain/thread-lifecycle.d.ts +2 -10
- package/dist/src/node/index.d.ts +2 -0
- package/dist/src/orchestration/index.d.ts +1 -0
- package/dist/src/orchestration/layer.d.ts +177 -1032
- package/dist/src/orchestration/service.d.ts +1 -0
- package/dist/src/rpc/error.d.ts +4 -2
- package/dist/src/rpc/index.d.ts +5 -0
- package/dist/src/rpc/layer.d.ts +1097 -499
- package/dist/src/rpc/operation.d.ts +5752 -0
- package/dist/src/rpc/ws-group.d.ts +327 -147
- package/dist/src/runtime/layer.d.ts +1 -1
- package/dist/t3tools.js +2 -2
- package/dist/upstream-t3code/packages/contracts/src/environmentHttp.d.ts +10 -33
- package/dist/upstream-t3code/packages/contracts/src/ipc.d.ts +0 -6
- package/dist/upstream-t3code/packages/contracts/src/orchestration.d.ts +1 -657
- package/dist/upstream-t3code/packages/contracts/src/provider.d.ts +0 -14
- package/dist/upstream-t3code/packages/contracts/src/providerRuntime.d.ts +1 -175
- package/dist/upstream-t3code/packages/contracts/src/rpc.d.ts +0 -492
- package/dist/upstream-t3code/packages/contracts/src/server.d.ts +0 -45
- package/dist/upstream-t3code/packages/contracts/src/settings.d.ts +0 -21
- package/dist/upstream-t3code/packages/contracts/src/terminal.d.ts +3 -6
- package/package.json +6 -2
- package/src/application/index.ts +28 -2
- package/src/application/layer.ts +34 -5
- package/src/application/model-selection.ts +68 -2
- package/src/application/models.ts +14 -14
- package/src/application/project-commands.ts +15 -0
- package/src/application/projects.ts +43 -13
- package/src/application/service.ts +196 -77
- package/src/application/shell-sequence.ts +5 -7
- package/src/application/terminals.ts +207 -0
- package/src/application/thread-commands.test.ts +43 -0
- package/src/application/thread-commands.ts +81 -0
- package/src/application/thread-update.ts +72 -0
- package/src/application/thread-wait.ts +46 -47
- package/src/application/threads.test.ts +166 -0
- package/src/application/threads.ts +123 -40
- package/src/bin.ts +2 -0
- package/src/cli/app.ts +2 -0
- package/src/cli/confirm.ts +31 -0
- package/src/cli/error.ts +26 -3
- package/src/cli/flags.ts +15 -0
- package/src/cli/input/layer.ts +20 -0
- package/src/cli/input/service.ts +1 -0
- package/src/cli/output-format.ts +6 -2
- package/src/cli/project-format.ts +7 -0
- package/src/cli/project.ts +2 -1
- package/src/cli/projects/delete.ts +50 -0
- package/src/cli/self-action.ts +34 -0
- package/src/cli/terminal/attach.ts +32 -0
- package/src/cli/terminal/commands.test.ts +101 -0
- package/src/cli/terminal/create.ts +54 -0
- package/src/cli/terminal/destroy.ts +60 -0
- package/src/cli/terminal/encoding.test.ts +63 -0
- package/src/cli/terminal/encoding.ts +23 -0
- package/src/cli/terminal/error.ts +14 -0
- package/src/cli/terminal/io-node-layer.ts +82 -0
- package/src/cli/terminal/io-service.ts +25 -0
- package/src/cli/terminal/list.ts +35 -0
- package/src/cli/terminal/read.ts +102 -0
- package/src/cli/terminal/scope.ts +30 -0
- package/src/cli/terminal/shared.ts +250 -0
- package/src/cli/terminal/stream.ts +64 -0
- package/src/cli/terminal/wait.test.ts +146 -0
- package/src/cli/terminal/wait.ts +222 -0
- package/src/cli/terminal/write.ts +132 -0
- package/src/cli/terminal-format.ts +167 -0
- package/src/cli/terminal.ts +26 -0
- package/src/cli/thread-format.test.ts +32 -0
- package/src/cli/thread-format.ts +8 -1
- package/src/cli/thread.ts +8 -0
- package/src/cli/threads/archive.ts +11 -18
- package/src/cli/threads/delete.ts +61 -0
- package/src/cli/threads/interrupt.ts +52 -0
- package/src/cli/threads/list.test.ts +69 -0
- package/src/cli/threads/list.ts +15 -3
- package/src/cli/threads/send.ts +22 -2
- package/src/cli/threads/unarchive.ts +44 -0
- package/src/cli/threads/update.ts +150 -0
- package/src/domain/error.ts +20 -1
- package/src/domain/model-config.ts +4 -0
- package/src/domain/thread-lifecycle.ts +14 -0
- package/src/node/index.ts +2 -0
- package/src/orchestration/index.ts +1 -0
- package/src/orchestration/layer.ts +33 -85
- package/src/orchestration/service.ts +4 -0
- package/src/rpc/error.ts +10 -0
- package/src/rpc/index.ts +5 -0
- package/src/rpc/operation.ts +83 -0
- package/src/rpc/ws-group.ts +24 -0
- package/src/runtime/layer.ts +7 -2
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import * as Crypto from "effect/Crypto";
|
|
2
2
|
import * as Effect from "effect/Effect";
|
|
3
3
|
import * as Path from "effect/Path";
|
|
4
|
+
import * as Stream from "effect/Stream";
|
|
4
5
|
import { Environment } from "../environment/service.ts";
|
|
5
6
|
import { T3Orchestration } from "../orchestration/service.ts";
|
|
6
|
-
import { ProjectLookupError, ThreadSessionError } from "../domain/error.ts";
|
|
7
|
-
import { type StartThreadInput } from "./service.ts";
|
|
8
|
-
import type {
|
|
7
|
+
import { ProjectLookupError, ThreadLookupError, ThreadSessionError } from "../domain/error.ts";
|
|
8
|
+
import { type ListThreadsInclude, type StartThreadInput } from "./service.ts";
|
|
9
|
+
import type { CallbackThreadInput, SendThreadInput } from "./service.ts";
|
|
9
10
|
import { derivePendingApprovals, derivePendingUserInputs } from "../domain/thread-activities.ts";
|
|
10
11
|
import { type ThreadLifecycleStatus } from "../domain/thread-lifecycle.ts";
|
|
11
12
|
import type { OrchestrationThread } from "#t3tools/contracts";
|
|
@@ -25,7 +26,22 @@ export declare const makeThreadApplication: () => Effect.Effect<{
|
|
|
25
26
|
archiveThread: (threadId: string) => Effect.Effect<{
|
|
26
27
|
readonly sequence: number;
|
|
27
28
|
}, import("../rpc/error.ts").RpcError, never>;
|
|
28
|
-
|
|
29
|
+
deleteThread: (threadId: string) => Effect.Effect<{
|
|
30
|
+
threadId: string;
|
|
31
|
+
dispatch: {
|
|
32
|
+
readonly sequence: number;
|
|
33
|
+
};
|
|
34
|
+
}, ThreadLookupError | import("../rpc/error.ts").RpcError, never>;
|
|
35
|
+
interruptThread: (threadId: string) => Effect.Effect<{
|
|
36
|
+
readonly sequence: number;
|
|
37
|
+
}, import("../rpc/error.ts").RpcError, never>;
|
|
38
|
+
updateThread: (input: import("./service.ts").UpdateThreadInput) => Effect.Effect<import("#t3tools/contracts").DispatchResult, import("./error.ts").ApplicationError>;
|
|
39
|
+
unarchiveThread: (threadId: string) => Effect.Effect<{
|
|
40
|
+
readonly sequence: number;
|
|
41
|
+
}, import("../rpc/error.ts").RpcError, never>;
|
|
42
|
+
listThreads: (projectRef: string, options?: {
|
|
43
|
+
readonly include?: ListThreadsInclude;
|
|
44
|
+
} | undefined) => Effect.Effect<{
|
|
29
45
|
project: {
|
|
30
46
|
readonly id: string & import("effect/Brand").Brand<"ProjectId">;
|
|
31
47
|
readonly title: string;
|
|
@@ -102,15 +118,6 @@ export declare const makeThreadApplication: () => Effect.Effect<{
|
|
|
102
118
|
readonly updatedAt: string;
|
|
103
119
|
readonly providerInstanceId?: (string & import("effect/Brand").Brand<"ProviderInstanceId">) | undefined;
|
|
104
120
|
} | null;
|
|
105
|
-
readonly goal: {
|
|
106
|
-
readonly objective: string;
|
|
107
|
-
readonly status: "active" | "paused" | "budgetLimited" | "complete";
|
|
108
|
-
readonly tokensUsed: number;
|
|
109
|
-
readonly tokenBudget: number | null;
|
|
110
|
-
readonly timeUsedSeconds: number;
|
|
111
|
-
readonly createdAt: string;
|
|
112
|
-
readonly updatedAt: string;
|
|
113
|
-
} | null;
|
|
114
121
|
readonly latestUserMessageAt: string | null;
|
|
115
122
|
readonly hasPendingApprovals: boolean;
|
|
116
123
|
readonly hasPendingUserInput: boolean;
|
|
@@ -149,15 +156,6 @@ export declare const makeThreadApplication: () => Effect.Effect<{
|
|
|
149
156
|
readonly updatedAt: string;
|
|
150
157
|
readonly archivedAt: string | null;
|
|
151
158
|
readonly deletedAt: string | null;
|
|
152
|
-
readonly goal: {
|
|
153
|
-
readonly objective: string;
|
|
154
|
-
readonly status: "active" | "paused" | "budgetLimited" | "complete";
|
|
155
|
-
readonly tokensUsed: number;
|
|
156
|
-
readonly tokenBudget: number | null;
|
|
157
|
-
readonly timeUsedSeconds: number;
|
|
158
|
-
readonly createdAt: string;
|
|
159
|
-
readonly updatedAt: string;
|
|
160
|
-
} | null;
|
|
161
159
|
readonly messages: readonly {
|
|
162
160
|
readonly id: string & import("effect/Brand").Brand<"MessageId">;
|
|
163
161
|
readonly role: "user" | "assistant" | "system";
|
|
@@ -274,15 +272,6 @@ export declare const makeThreadApplication: () => Effect.Effect<{
|
|
|
274
272
|
readonly updatedAt: string;
|
|
275
273
|
readonly archivedAt: string | null;
|
|
276
274
|
readonly deletedAt: string | null;
|
|
277
|
-
readonly goal: {
|
|
278
|
-
readonly objective: string;
|
|
279
|
-
readonly status: "active" | "paused" | "budgetLimited" | "complete";
|
|
280
|
-
readonly tokensUsed: number;
|
|
281
|
-
readonly tokenBudget: number | null;
|
|
282
|
-
readonly timeUsedSeconds: number;
|
|
283
|
-
readonly createdAt: string;
|
|
284
|
-
readonly updatedAt: string;
|
|
285
|
-
} | null;
|
|
286
275
|
readonly messages: readonly {
|
|
287
276
|
readonly id: string & import("effect/Brand").Brand<"MessageId">;
|
|
288
277
|
readonly role: "user" | "assistant" | "system";
|
|
@@ -460,15 +449,6 @@ export declare const makeThreadApplication: () => Effect.Effect<{
|
|
|
460
449
|
readonly updatedAt: string;
|
|
461
450
|
readonly archivedAt: string | null;
|
|
462
451
|
readonly deletedAt: string | null;
|
|
463
|
-
readonly goal: {
|
|
464
|
-
readonly objective: string;
|
|
465
|
-
readonly status: "active" | "paused" | "budgetLimited" | "complete";
|
|
466
|
-
readonly tokensUsed: number;
|
|
467
|
-
readonly tokenBudget: number | null;
|
|
468
|
-
readonly timeUsedSeconds: number;
|
|
469
|
-
readonly createdAt: string;
|
|
470
|
-
readonly updatedAt: string;
|
|
471
|
-
} | null;
|
|
472
452
|
readonly messages: readonly {
|
|
473
453
|
readonly id: string & import("effect/Brand").Brand<"MessageId">;
|
|
474
454
|
readonly role: "user" | "assistant" | "system";
|
|
@@ -530,7 +510,7 @@ export declare const makeThreadApplication: () => Effect.Effect<{
|
|
|
530
510
|
} | null;
|
|
531
511
|
};
|
|
532
512
|
}, ProjectLookupError | import("../domain/error.ts").ModelSelectionError | ThreadSessionError | import("../rpc/error.ts").RpcError, never>;
|
|
533
|
-
watchThread: (threadId: string) =>
|
|
513
|
+
watchThread: (threadId: string) => Stream.Stream<import("./service.ts").WaitEvent, ThreadSessionError | import("../rpc/error.ts").RpcError, never>;
|
|
534
514
|
waitForThread: (threadId: string) => Effect.Effect<{
|
|
535
515
|
readonly id: string & import("effect/Brand").Brand<"ThreadId">;
|
|
536
516
|
readonly projectId: string & import("effect/Brand").Brand<"ProjectId">;
|
|
@@ -563,15 +543,6 @@ export declare const makeThreadApplication: () => Effect.Effect<{
|
|
|
563
543
|
readonly updatedAt: string;
|
|
564
544
|
readonly archivedAt: string | null;
|
|
565
545
|
readonly deletedAt: string | null;
|
|
566
|
-
readonly goal: {
|
|
567
|
-
readonly objective: string;
|
|
568
|
-
readonly status: "active" | "paused" | "budgetLimited" | "complete";
|
|
569
|
-
readonly tokensUsed: number;
|
|
570
|
-
readonly tokenBudget: number | null;
|
|
571
|
-
readonly timeUsedSeconds: number;
|
|
572
|
-
readonly createdAt: string;
|
|
573
|
-
readonly updatedAt: string;
|
|
574
|
-
} | null;
|
|
575
546
|
readonly messages: readonly {
|
|
576
547
|
readonly id: string & import("effect/Brand").Brand<"MessageId">;
|
|
577
548
|
readonly role: "user" | "assistant" | "system";
|
package/dist/src/cli/flags.d.ts
CHANGED
|
@@ -3,6 +3,9 @@ export declare const projectFlag: Flag.Flag<import("effect/Option").Option<strin
|
|
|
3
3
|
export declare const threadFlag: Flag.Flag<import("effect/Option").Option<string>>;
|
|
4
4
|
export declare const worktreeFlag: Flag.Flag<import("effect/Option").Option<string>>;
|
|
5
5
|
export declare const projectPathFlag: Flag.Flag<string>;
|
|
6
|
+
export declare const yesFlag: Flag.Flag<boolean>;
|
|
7
|
+
export declare const forceFlag: Flag.Flag<boolean>;
|
|
8
|
+
export declare const selfActionForceFlag: Flag.Flag<boolean>;
|
|
6
9
|
export declare const formatFlag: Flag.Flag<"auto" | "human" | "json">;
|
|
7
10
|
export declare const threadFormatFlag: Flag.Flag<"auto" | "human" | "json" | "ndjson">;
|
|
8
11
|
export declare const waitFormatFlag: Flag.Flag<"auto" | "human" | "ndjson">;
|
|
@@ -7,3 +7,5 @@ export type HumanNdjsonFormat = (typeof humanNdjsonFormatChoices)[number];
|
|
|
7
7
|
export type HumanJsonNdjsonFormat = (typeof humanJsonNdjsonFormatChoices)[number];
|
|
8
8
|
export declare function resolveOutputFormat<T extends "json" | "ndjson">(format: "auto" | "human" | T, environment: EnvironmentShape, nonHumanFormat: T): "human" | T;
|
|
9
9
|
export declare function canRenderLiveTerminal(environment: EnvironmentShape): boolean;
|
|
10
|
+
export declare function isInteractiveHumanTerminal(environment: EnvironmentShape): boolean;
|
|
11
|
+
export declare function isAgentEnvironment(environment: EnvironmentShape): boolean;
|
|
@@ -21,11 +21,24 @@ declare const ThreadSessionError_base: Schema.Class<ThreadSessionError, Schema.T
|
|
|
21
21
|
}>, import("effect/Cause").YieldableError>;
|
|
22
22
|
export declare class ThreadSessionError extends ThreadSessionError_base {
|
|
23
23
|
}
|
|
24
|
+
declare const ThreadLookupError_base: Schema.Class<ThreadLookupError, Schema.TaggedStruct<"ThreadLookupError", {
|
|
25
|
+
readonly message: Schema.String;
|
|
26
|
+
readonly threadId: Schema.String;
|
|
27
|
+
}>, import("effect/Cause").YieldableError>;
|
|
28
|
+
export declare class ThreadLookupError extends ThreadLookupError_base {
|
|
29
|
+
}
|
|
24
30
|
declare const ProjectCreateVisibilityError_base: Schema.Class<ProjectCreateVisibilityError, Schema.TaggedStruct<"ProjectCreateVisibilityError", {
|
|
25
31
|
readonly message: Schema.String;
|
|
26
32
|
readonly projectId: Schema.String;
|
|
27
33
|
}>, import("effect/Cause").YieldableError>;
|
|
28
34
|
export declare class ProjectCreateVisibilityError extends ProjectCreateVisibilityError_base {
|
|
29
35
|
}
|
|
30
|
-
|
|
36
|
+
declare const TerminalLookupError_base: Schema.Class<TerminalLookupError, Schema.TaggedStruct<"TerminalLookupError", {
|
|
37
|
+
readonly message: Schema.String;
|
|
38
|
+
readonly threadId: Schema.String;
|
|
39
|
+
readonly terminalId: Schema.String;
|
|
40
|
+
}>, import("effect/Cause").YieldableError>;
|
|
41
|
+
export declare class TerminalLookupError extends TerminalLookupError_base {
|
|
42
|
+
}
|
|
43
|
+
export type DomainError = ProjectLookupError | ModelSelectionError | ThreadEventError | ThreadSessionError | ThreadLookupError | ProjectCreateVisibilityError | TerminalLookupError;
|
|
31
44
|
export {};
|
|
@@ -83,15 +83,6 @@ export declare const resolveProjectScope: (snapshot: {
|
|
|
83
83
|
readonly updatedAt: string;
|
|
84
84
|
readonly providerInstanceId?: (string & import("effect/Brand").Brand<"ProviderInstanceId">) | undefined;
|
|
85
85
|
} | null;
|
|
86
|
-
readonly goal: {
|
|
87
|
-
readonly objective: string;
|
|
88
|
-
readonly status: "active" | "paused" | "budgetLimited" | "complete";
|
|
89
|
-
readonly tokensUsed: number;
|
|
90
|
-
readonly tokenBudget: number | null;
|
|
91
|
-
readonly timeUsedSeconds: number;
|
|
92
|
-
readonly createdAt: string;
|
|
93
|
-
readonly updatedAt: string;
|
|
94
|
-
} | null;
|
|
95
86
|
readonly latestUserMessageAt: string | null;
|
|
96
87
|
readonly hasPendingApprovals: boolean;
|
|
97
88
|
readonly hasPendingUserInput: boolean;
|
|
@@ -66,7 +66,6 @@ export declare function firstSelectableProvider(providers: ReadonlyArray<ServerP
|
|
|
66
66
|
readonly groupKey: string;
|
|
67
67
|
} | undefined;
|
|
68
68
|
readonly showInteractionModeToggle?: boolean | undefined;
|
|
69
|
-
readonly requiresNewThreadForModelChange?: boolean | undefined;
|
|
70
69
|
readonly message?: string | undefined;
|
|
71
70
|
readonly availability?: "available" | "unavailable" | undefined;
|
|
72
71
|
readonly unavailableReason?: string | undefined;
|
|
@@ -116,6 +115,35 @@ export declare function firstSelectableModel(provider: ServerProvider): {
|
|
|
116
115
|
readonly shortName?: string | undefined;
|
|
117
116
|
readonly subProvider?: string | undefined;
|
|
118
117
|
} | undefined;
|
|
118
|
+
export declare function findSelectableModel(provider: ServerProvider, slug: string): {
|
|
119
|
+
readonly slug: string;
|
|
120
|
+
readonly name: string;
|
|
121
|
+
readonly isCustom: boolean;
|
|
122
|
+
readonly capabilities: {
|
|
123
|
+
readonly optionDescriptors?: readonly ({
|
|
124
|
+
readonly type: "select";
|
|
125
|
+
readonly options: readonly {
|
|
126
|
+
readonly id: string;
|
|
127
|
+
readonly label: string;
|
|
128
|
+
readonly description?: string | undefined;
|
|
129
|
+
readonly isDefault?: boolean | undefined;
|
|
130
|
+
}[];
|
|
131
|
+
readonly id: string;
|
|
132
|
+
readonly label: string;
|
|
133
|
+
readonly currentValue?: string | undefined;
|
|
134
|
+
readonly promptInjectedValues?: readonly string[] | undefined;
|
|
135
|
+
readonly description?: string | undefined;
|
|
136
|
+
} | {
|
|
137
|
+
readonly type: "boolean";
|
|
138
|
+
readonly id: string;
|
|
139
|
+
readonly label: string;
|
|
140
|
+
readonly currentValue?: boolean | undefined;
|
|
141
|
+
readonly description?: string | undefined;
|
|
142
|
+
})[] | undefined;
|
|
143
|
+
} | null;
|
|
144
|
+
readonly shortName?: string | undefined;
|
|
145
|
+
readonly subProvider?: string | undefined;
|
|
146
|
+
} | undefined;
|
|
119
147
|
export declare function findSelectableProvider(providers: ReadonlyArray<ServerProvider>, instanceId: string): {
|
|
120
148
|
readonly instanceId: string & import("effect/Brand").Brand<"ProviderInstanceId">;
|
|
121
149
|
readonly driver: string & import("effect/Brand").Brand<"ProviderDriverKind">;
|
|
@@ -182,7 +210,6 @@ export declare function findSelectableProvider(providers: ReadonlyArray<ServerPr
|
|
|
182
210
|
readonly groupKey: string;
|
|
183
211
|
} | undefined;
|
|
184
212
|
readonly showInteractionModeToggle?: boolean | undefined;
|
|
185
|
-
readonly requiresNewThreadForModelChange?: boolean | undefined;
|
|
186
213
|
readonly message?: string | undefined;
|
|
187
214
|
readonly availability?: "available" | "unavailable" | undefined;
|
|
188
215
|
readonly unavailableReason?: string | undefined;
|
|
@@ -273,7 +300,6 @@ export declare function filterProvidersForModelListing(input: {
|
|
|
273
300
|
readonly groupKey: string;
|
|
274
301
|
} | undefined;
|
|
275
302
|
readonly showInteractionModeToggle?: boolean | undefined;
|
|
276
|
-
readonly requiresNewThreadForModelChange?: boolean | undefined;
|
|
277
303
|
readonly message?: string | undefined;
|
|
278
304
|
readonly availability?: "available" | "unavailable" | undefined;
|
|
279
305
|
readonly unavailableReason?: string | undefined;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { type OrchestrationEvent, type OrchestrationMessage as OrchestrationMessageType, type OrchestrationThread, type OrchestrationThreadShell } from "#t3tools/contracts";
|
|
1
|
+
import { type OrchestrationEvent, type OrchestrationMessage as OrchestrationMessageType, type OrchestrationSession, type OrchestrationThread, type OrchestrationThreadShell } from "#t3tools/contracts";
|
|
2
|
+
export declare function sessionNeedsStopBeforeDelete(session: OrchestrationSession | null): boolean;
|
|
2
3
|
export declare function isThreadActive(thread: OrchestrationThreadShell | OrchestrationThread): boolean;
|
|
3
4
|
export type ThreadLifecycleStatus = ReturnType<typeof threadStatus>;
|
|
4
5
|
export declare function threadStatus(thread: OrchestrationThreadShell | OrchestrationThread): "unknown" | "error" | "idle" | "starting" | "running" | "ready" | "interrupted" | "stopped" | "completed" | "pending";
|
|
@@ -51,15 +52,6 @@ export declare function applyThreadEvent(current: OrchestrationThread, event: Or
|
|
|
51
52
|
readonly updatedAt: string;
|
|
52
53
|
readonly archivedAt: string | null;
|
|
53
54
|
readonly deletedAt: string | null;
|
|
54
|
-
readonly goal: {
|
|
55
|
-
readonly objective: string;
|
|
56
|
-
readonly status: "active" | "paused" | "budgetLimited" | "complete";
|
|
57
|
-
readonly tokensUsed: number;
|
|
58
|
-
readonly tokenBudget: number | null;
|
|
59
|
-
readonly timeUsedSeconds: number;
|
|
60
|
-
readonly createdAt: string;
|
|
61
|
-
readonly updatedAt: string;
|
|
62
|
-
} | null;
|
|
63
55
|
readonly messages: readonly {
|
|
64
56
|
readonly id: string & import("effect/Brand").Brand<"MessageId">;
|
|
65
57
|
readonly role: "user" | "assistant" | "system";
|