t3code-cli 0.14.2 → 0.15.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 +36 -1
- package/dist/application.d.ts +2 -2
- package/dist/application.js +1 -1
- package/dist/auth.d.ts +1 -1
- package/dist/auth.js +1 -1
- package/dist/bin.js +935 -336
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +1 -1
- package/dist/client-runtime/authorization.d.ts +1 -1
- package/dist/client-runtime/authorization.js +1 -1
- package/dist/client-runtime/connection.d.ts +1 -1
- package/dist/client-runtime/connection.js +1 -1
- package/dist/client-runtime/environment.d.ts +3 -1
- package/dist/client-runtime/environment.js +1 -1
- package/dist/client-runtime/errors.js +1 -1
- package/dist/client-runtime/operations/projects.d.ts +1 -1
- package/dist/client-runtime/operations.d.ts +1 -1
- package/dist/client-runtime/platform.d.ts +1 -1
- package/dist/client-runtime/platform.js +1 -1
- package/dist/client-runtime/relay.d.ts +9 -2
- package/dist/client-runtime/relay.js +12 -2
- package/dist/client-runtime/rpc.d.ts +2 -2
- package/dist/client-runtime/rpc.js +2 -2
- package/dist/client-runtime/state/assets.d.ts +1 -1
- package/dist/client-runtime/state/assets.js +1 -1
- package/dist/client-runtime/state/auth.d.ts +1 -1
- package/dist/client-runtime/state/auth.js +1 -1
- package/dist/client-runtime/state/connections.js +1 -1
- package/dist/client-runtime/state/entities.d.ts +1 -1
- package/dist/client-runtime/state/filesystem.d.ts +1 -1
- package/dist/client-runtime/state/filesystem.js +1 -1
- package/dist/client-runtime/state/git.d.ts +2 -1
- package/dist/client-runtime/state/git.js +1 -1
- package/dist/client-runtime/state/models.d.ts +1 -1
- package/dist/client-runtime/state/models.js +1 -1
- package/dist/client-runtime/state/orchestration.d.ts +1 -1
- package/dist/client-runtime/state/orchestration.js +1 -1
- package/dist/client-runtime/state/presentation.d.ts +7 -1
- package/dist/client-runtime/state/presentation.js +1 -1
- package/dist/client-runtime/state/preview.d.ts +5 -2
- package/dist/client-runtime/state/preview.js +3 -2
- package/dist/client-runtime/state/project-grouping.d.ts +1 -1
- package/dist/client-runtime/state/project-grouping.js +1 -1
- package/dist/client-runtime/state/projects.d.ts +1 -1
- package/dist/client-runtime/state/pull-requests.d.ts +478 -0
- package/dist/client-runtime/state/pull-requests.js +172 -0
- package/dist/client-runtime/state/relay.d.ts +1 -1
- package/dist/client-runtime/state/relay.js +1 -1
- package/dist/client-runtime/state/review.d.ts +1 -1
- package/dist/client-runtime/state/review.js +1 -1
- package/dist/client-runtime/state/runtime.d.ts +2 -2
- package/dist/client-runtime/state/runtime.js +2 -2
- package/dist/client-runtime/state/server.d.ts +13 -1
- package/dist/client-runtime/state/server.js +1 -1
- package/dist/client-runtime/state/session.d.ts +13 -1
- package/dist/client-runtime/state/session.js +1 -1
- package/dist/client-runtime/state/shell.d.ts +7 -1
- package/dist/client-runtime/state/shell.js +1 -1
- package/dist/client-runtime/state/source-control.d.ts +1 -1
- package/dist/client-runtime/state/source-control.js +1 -1
- package/dist/client-runtime/state/subagentRuntime.d.ts +1 -1
- package/dist/client-runtime/state/terminal.d.ts +1 -1
- package/dist/client-runtime/state/terminal.js +1 -1
- package/dist/client-runtime/state/thread-search.d.ts +1 -1
- package/dist/client-runtime/state/thread-search.js +1 -1
- package/dist/client-runtime/state/thread-settled.d.ts +11 -8
- package/dist/client-runtime/state/thread-settled.js +2 -229
- package/dist/client-runtime/state/thread-sort.d.ts +1 -1
- package/dist/client-runtime/state/thread-sort.js +1 -1
- package/dist/client-runtime/state/threads.d.ts +1 -1
- package/dist/client-runtime/state/threads.js +1 -1
- package/dist/client-runtime/state/vcs.d.ts +1 -1
- package/dist/client-runtime/state/vcs.js +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/config.js +1 -1
- package/dist/connection.d.ts +1 -1
- package/dist/connection.js +1 -1
- package/dist/contracts.d.ts +1 -1
- package/dist/contracts.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/node.d.ts +1 -1
- package/dist/node.js +1 -1
- package/dist/orchestration.d.ts +12 -6
- package/dist/orchestration.js +2 -2
- package/dist/preview.d.ts +1 -1
- package/dist/rpc.d.ts +4 -9
- package/dist/rpc.js +1 -1
- package/dist/runtime.d.ts +1 -1
- package/dist/shared/DrainableWorker.js +1 -1
- package/dist/shared/KeyedCoalescingWorker.js +1 -1
- package/dist/shared/Net.d.ts +6 -0
- package/dist/shared/Net.js +2 -1
- package/dist/shared/advertisedEndpoint.d.ts +1 -1
- package/dist/shared/advertisedEndpoint.js +1 -1
- package/dist/shared/agentAwareness.d.ts +1 -1
- package/dist/shared/backgroundActivitySettings.d.ts +1 -1
- package/dist/shared/connectAuth.d.ts +23 -4
- package/dist/shared/connectAuth.js +40 -7
- package/dist/shared/devHome.js +1 -1
- package/dist/shared/dpop.js +1 -1
- package/dist/shared/git.d.ts +1 -1
- package/dist/shared/httpObservability.js +1 -1
- package/dist/shared/httpReadiness.js +1 -1
- package/dist/shared/keybindings.d.ts +1 -1
- package/dist/shared/model.d.ts +1 -1
- package/dist/shared/oauthScope.js +1 -1
- package/dist/shared/observability.js +1 -1
- package/dist/shared/preview.js +1 -1
- package/dist/shared/previewViewport.d.ts +1 -1
- package/dist/shared/previewViewport.js +1 -1
- package/dist/shared/projectScripts.d.ts +1 -1
- package/dist/shared/relayAuth.js +1 -1
- package/dist/shared/relayClient.d.ts +1 -1
- package/dist/shared/relayClient.js +1 -1
- package/dist/shared/relayJwt.js +1 -1
- package/dist/shared/relayTracing.js +1 -1
- package/dist/shared/relayUrl.js +1 -1
- package/dist/shared/remote.js +1 -1
- package/dist/shared/schemaYaml.js +1 -1
- package/dist/shared/serverSettings.d.ts +1 -1
- package/dist/shared/serverSettings.js +1 -1
- package/dist/shared/shell.js +1 -1
- package/dist/shared/sourceControl.d.ts +1 -1
- package/dist/shared/t3ProjectFile.d.ts +1 -1
- package/dist/shared/t3ProjectFile.js +1 -1
- package/dist/shared/terminalLabels.d.ts +1 -1
- package/dist/shared/threadEnvMode.d.ts +1 -1
- package/dist/shared/toolActivity.d.ts +1 -1
- package/dist/shared/usageFormat.d.ts +16 -3
- package/dist/shared/usageFormat.js +92 -6
- package/dist/shared/usageMerge.d.ts +13 -2
- package/dist/shared/usageMerge.js +23 -0
- package/dist/shared.d.ts +3470 -378
- package/dist/shared.js +2434 -617
- package/dist/t3tools.d.ts +2 -2
- package/dist/t3tools.js +2 -2
- package/package.json +2 -2
- package/src/application/error.ts +2 -2
- package/src/application/index.ts +1 -0
- package/src/application/service.ts +38 -4
- package/src/application/thread-commands.ts +78 -0
- package/src/application/threads.ts +113 -16
- package/src/cli/app.ts +2 -0
- package/src/cli/ask-lifecycle.ts +331 -0
- package/src/cli/ask.ts +390 -0
- package/src/cli/error.ts +70 -0
- package/src/cli/format/thread.ts +26 -6
- package/src/cli/thread.ts +12 -0
- package/src/cli/threads/messages.ts +33 -3
- package/src/cli/threads/pin.ts +46 -0
- package/src/cli/threads/send.ts +5 -1
- package/src/cli/threads/settle.ts +46 -0
- package/src/cli/threads/snooze.ts +117 -0
- package/src/cli/threads/start.ts +6 -1
- package/src/cli/threads/unpin.ts +48 -0
- package/src/cli/threads/unsettle.ts +48 -0
- package/src/cli/threads/unsnooze.ts +48 -0
- package/src/connection/prepared.ts +12 -2
- package/src/orchestration/error.ts +10 -0
- package/src/orchestration/index.ts +1 -0
- package/src/orchestration/layer.ts +72 -0
- package/src/orchestration/service.ts +11 -3
- package/src/rpc/ws-group.ts +1 -0
- package/src/runtime/layer.ts +9 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $O as EnvironmentAuthorizationError, Cw as VcsProcessExitError, Da as EnvironmentNotRegisteredError, Dw as VcsProcessOutputLimitError, Ew as VcsProcessMissingExitCodeError, Fw as VcsRepositoryDetectionError, Hw as GitCommandError, Lw as VcsUnsupportedOperationError, Mw as VcsProcessTimeoutError, Oa as EnvironmentRegistry, Ow as VcsProcessOutputReadError, f as AtomCommand, hn as EnvironmentRpcUnavailableError, jw as VcsProcessStdinWriteError, kw as VcsProcessSpawnError, vk as EnvironmentId } from "../../shared.js";
|
|
2
2
|
import { Atom } from "effect/unstable/reactivity";
|
|
3
3
|
//#region upstream-t3code/packages/client-runtime/src/state/review.d.ts
|
|
4
4
|
declare function createReviewEnvironmentAtoms<R, E>(runtime: Atom.AtomRuntime<EnvironmentRegistry | R, E>): {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { _r as createEnvironmentRpcCommand, lc as WS_METHODS, mr as createAtomCommandScheduler, vr as createEnvironmentRpcQueryAtomFamily } from "../../shared.js";
|
|
2
2
|
//#region upstream-t3code/packages/client-runtime/src/state/review.ts
|
|
3
3
|
function createReviewEnvironmentAtoms(runtime) {
|
|
4
4
|
const diffFileScheduler = createAtomCommandScheduler();
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
export { AtomCommand, AtomCommandConcurrency, AtomCommandFailure, AtomCommandOptions, AtomCommandReporter, AtomCommandResult, AtomCommandScheduler, AtomCommandSuccess, SettledAsyncResult, createAtomCommandScheduler, createEnvironmentCommand, createEnvironmentRpcCommand, createEnvironmentRpcQueryAtomFamily, createEnvironmentRpcStreamCommand, createEnvironmentRpcSubscriptionAtomFamily, createEnvironmentSubscriptionAtomFamily, createRuntimeCommand, createRuntimeStreamCommand, environmentRpcKey, executeAtomCommand, executeAtomQuery, followStreamInEnvironment, isAtomCommandInterrupted, mapAtomCommandResult, reportAtomCommandResult, runAtomCommand, runInEnvironment, runStreamInEnvironment, scheduleAtomCommandEffect, settleAsyncResult, settlePromise, squashAtomCommandFailure };
|
|
1
|
+
import { A as createRuntimeStreamCommand, B as runStreamInEnvironment, C as createEnvironmentQueryAtomFamily, D as createEnvironmentRpcSubscriptionAtomFamily, E as createEnvironmentRpcStreamCommand, F as isAtomCommandInterrupted, H as settleAsyncResult, I as mapAtomCommandResult, L as reportAtomCommandResult, M as executeAtomCommand, N as executeAtomQuery, O as createEnvironmentSubscriptionAtomFamily, P as followStreamInEnvironment, R as runAtomCommand, S as createEnvironmentCommand, T as createEnvironmentRpcQueryAtomFamily, U as settlePromise, V as scheduleAtomCommandEffect, W as squashAtomCommandFailure, _ as AtomCommandResult, b as SettledAsyncResult, f as AtomCommand, g as AtomCommandReporter, h as AtomCommandOptions, j as environmentRpcKey, k as createRuntimeCommand, m as AtomCommandFailure, p as AtomCommandConcurrency, v as AtomCommandScheduler, w as createEnvironmentRpcCommand, x as createAtomCommandScheduler, y as AtomCommandSuccess, z as runInEnvironment } from "../../shared.js";
|
|
2
|
+
export { AtomCommand, AtomCommandConcurrency, AtomCommandFailure, AtomCommandOptions, AtomCommandReporter, AtomCommandResult, AtomCommandScheduler, AtomCommandSuccess, SettledAsyncResult, createAtomCommandScheduler, createEnvironmentCommand, createEnvironmentQueryAtomFamily, createEnvironmentRpcCommand, createEnvironmentRpcQueryAtomFamily, createEnvironmentRpcStreamCommand, createEnvironmentRpcSubscriptionAtomFamily, createEnvironmentSubscriptionAtomFamily, createRuntimeCommand, createRuntimeStreamCommand, environmentRpcKey, executeAtomCommand, executeAtomQuery, followStreamInEnvironment, isAtomCommandInterrupted, mapAtomCommandResult, reportAtomCommandResult, runAtomCommand, runInEnvironment, runStreamInEnvironment, scheduleAtomCommandEffect, settleAsyncResult, settlePromise, squashAtomCommandFailure };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Ar as
|
|
2
|
-
export { createAtomCommandScheduler, createEnvironmentCommand, createEnvironmentRpcCommand, createEnvironmentRpcQueryAtomFamily, createEnvironmentRpcStreamCommand, createEnvironmentRpcSubscriptionAtomFamily, createEnvironmentSubscriptionAtomFamily, createRuntimeCommand, createRuntimeStreamCommand, environmentRpcKey, executeAtomCommand, executeAtomQuery, followStreamInEnvironment, isAtomCommandInterrupted, mapAtomCommandResult, reportAtomCommandResult, runAtomCommand, runInEnvironment, runStreamInEnvironment, scheduleAtomCommandEffect, settleAsyncResult, settlePromise, squashAtomCommandFailure };
|
|
1
|
+
import { Ar as reportAtomCommandResult, Cr as createRuntimeStreamCommand, Dr as followStreamInEnvironment, Er as executeAtomQuery, Fr as settleAsyncResult, Ir as settlePromise, Lr as squashAtomCommandFailure, Mr as runInEnvironment, Nr as runStreamInEnvironment, Or as isAtomCommandInterrupted, Pr as scheduleAtomCommandEffect, Sr as createRuntimeCommand, Tr as executeAtomCommand, _r as createEnvironmentRpcCommand, br as createEnvironmentRpcSubscriptionAtomFamily, gr as createEnvironmentQueryAtomFamily, hr as createEnvironmentCommand, jr as runAtomCommand, kr as mapAtomCommandResult, mr as createAtomCommandScheduler, vr as createEnvironmentRpcQueryAtomFamily, wr as environmentRpcKey, xr as createEnvironmentSubscriptionAtomFamily, yr as createEnvironmentRpcStreamCommand } from "../../shared.js";
|
|
2
|
+
export { createAtomCommandScheduler, createEnvironmentCommand, createEnvironmentQueryAtomFamily, createEnvironmentRpcCommand, createEnvironmentRpcQueryAtomFamily, createEnvironmentRpcStreamCommand, createEnvironmentRpcSubscriptionAtomFamily, createEnvironmentSubscriptionAtomFamily, createRuntimeCommand, createRuntimeStreamCommand, environmentRpcKey, executeAtomCommand, executeAtomQuery, followStreamInEnvironment, isAtomCommandInterrupted, mapAtomCommandResult, reportAtomCommandResult, runAtomCommand, runInEnvironment, runStreamInEnvironment, scheduleAtomCommandEffect, settleAsyncResult, settlePromise, squashAtomCommandFailure };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $O as EnvironmentAuthorizationError, Aa as EnvironmentSupervisor, Cs as WS_METHODS, Da as EnvironmentNotRegisteredError, Du as ServerConfigStreamEvent, Fu as ServerLifecycleStreamReadyEvent, Ia as EnvironmentCacheStore, Id as KeybindingWhenNode, Lu as ServerLifecycleWelcomePayload, Oa as EnvironmentRegistry, Rd as KeybindingsConfigError, Sl as UsageReadError, Su as ServerConfig, Xv as ServerSettingsError, f as AtomCommand, gd as ServerSelfUpdateProgressEvent, hn as EnvironmentRpcUnavailableError, on as EnvironmentRpcInput, rd as ServerProviderUpdateError, vd as ServerSelfUpdateResult, vk as EnvironmentId } from "../../shared.js";
|
|
2
2
|
import * as Effect from "effect/Effect";
|
|
3
3
|
import * as Stream from "effect/Stream";
|
|
4
4
|
import * as Schema from "effect/Schema";
|
|
@@ -112,6 +112,7 @@ declare function createServerEnvironmentAtoms<R, E>(runtime: Atom.AtomRuntime<En
|
|
|
112
112
|
readonly capabilities: {
|
|
113
113
|
readonly repositoryIdentity: boolean;
|
|
114
114
|
readonly connectionProbe?: boolean;
|
|
115
|
+
readonly pullRequests?: boolean;
|
|
115
116
|
readonly threadSettlement?: boolean;
|
|
116
117
|
readonly threadSnooze?: boolean;
|
|
117
118
|
readonly threadPinning?: boolean;
|
|
@@ -119,6 +120,7 @@ declare function createServerEnvironmentAtoms<R, E>(runtime: Atom.AtomRuntime<En
|
|
|
119
120
|
readonly threadTitleRegeneration?: boolean;
|
|
120
121
|
readonly serverSelfUpdate?: "boot-service" | "desktop-managed" | "respawn";
|
|
121
122
|
readonly serverSelfUpdateProgress?: boolean;
|
|
123
|
+
readonly agentActivityPublishing?: boolean;
|
|
122
124
|
};
|
|
123
125
|
};
|
|
124
126
|
readonly auth: {
|
|
@@ -253,6 +255,10 @@ declare function createServerEnvironmentAtoms<R, E>(runtime: Atom.AtomRuntime<En
|
|
|
253
255
|
};
|
|
254
256
|
}[];
|
|
255
257
|
readonly availableEditors: readonly ("antigravity" | "aqua" | "clion" | "cursor" | "datagrip" | "dataspell" | "file-manager" | "goland" | "idea" | "kiro" | "phpstorm" | "pycharm" | "rider" | "rubymine" | "rustrover" | "trae" | "vscode" | "vscode-insiders" | "vscodium" | "webstorm" | "zed")[];
|
|
258
|
+
readonly remoteOpenTargets?: readonly {
|
|
259
|
+
readonly kind: "mdns" | "tailscale";
|
|
260
|
+
readonly host: string;
|
|
261
|
+
}[];
|
|
256
262
|
readonly observability: {
|
|
257
263
|
readonly logsDirectoryPath: string;
|
|
258
264
|
readonly localTracingEnabled: boolean;
|
|
@@ -893,6 +899,9 @@ declare function createServerEnvironmentAtoms<R, E>(runtime: Atom.AtomRuntime<En
|
|
|
893
899
|
readonly sinceDay: string & import("effect/Brand").Brand<"UsageDay">;
|
|
894
900
|
readonly untilDay: string & import("effect/Brand").Brand<"UsageDay">;
|
|
895
901
|
readonly timeZone: string;
|
|
902
|
+
readonly resolution?: "day" | "hour" | undefined;
|
|
903
|
+
readonly sinceTime?: string | undefined;
|
|
904
|
+
readonly untilTime?: string | undefined;
|
|
896
905
|
};
|
|
897
906
|
}) => Atom.Atom<AsyncResult.AsyncResult<{
|
|
898
907
|
readonly contractVersion: number;
|
|
@@ -902,6 +911,7 @@ declare function createServerEnvironmentAtoms<R, E>(runtime: Atom.AtomRuntime<En
|
|
|
902
911
|
readonly untilDay: string & import("effect/Brand").Brand<"UsageDay">;
|
|
903
912
|
readonly buckets: readonly {
|
|
904
913
|
readonly day: string & import("effect/Brand").Brand<"UsageDay">;
|
|
914
|
+
readonly hourStart?: string | undefined;
|
|
905
915
|
readonly provider: "claude" | "codex";
|
|
906
916
|
readonly model: string;
|
|
907
917
|
readonly totals: {
|
|
@@ -959,6 +969,7 @@ declare function createServerEnvironmentAtoms<R, E>(runtime: Atom.AtomRuntime<En
|
|
|
959
969
|
readonly capabilities: {
|
|
960
970
|
readonly repositoryIdentity: boolean;
|
|
961
971
|
readonly connectionProbe?: boolean;
|
|
972
|
+
readonly pullRequests?: boolean;
|
|
962
973
|
readonly threadSettlement?: boolean;
|
|
963
974
|
readonly threadSnooze?: boolean;
|
|
964
975
|
readonly threadPinning?: boolean;
|
|
@@ -966,6 +977,7 @@ declare function createServerEnvironmentAtoms<R, E>(runtime: Atom.AtomRuntime<En
|
|
|
966
977
|
readonly threadTitleRegeneration?: boolean;
|
|
967
978
|
readonly serverSelfUpdate?: "boot-service" | "desktop-managed" | "respawn";
|
|
968
979
|
readonly serverSelfUpdateProgress?: boolean;
|
|
980
|
+
readonly agentActivityPublishing?: boolean;
|
|
969
981
|
};
|
|
970
982
|
};
|
|
971
983
|
readonly cwd: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $
|
|
1
|
+
import { $A as runHead, $j as ignore, Aj as andThen, By as changes, CM as sync, DD as set, DN as seconds, Dr as followStreamInEnvironment, ED as make$2, EM as timeoutOption, EN as minutes, GM as hasInterruptsOnly, GN as none, Gj as flatMap, HN as isSome, Ha as safeErrorLogAttributes, Hj as exit, Hy as make$1, Ia as EnvironmentRegistry, JM as squash, KM as isFailReason, KN as some, Ka as EnvironmentCacheStore, Kj as fn, Kr as make, LA as filter, Lk as String, Mj as as, NA as debounce, NM as void_, Nj as asVoid, Nk as Literals, OD as update, Oj as addFinalizer, PN as flatten, Pr as scheduleAtomCommandEffect, QA as runForEach, Qj as gen, RA as filterMap, RN as getOrNull, Ra as EnvironmentSupervisor, SN as succeed$1, Sr as createRuntimeCommand, TD as get$1, UN as map, Uj as fail, Uy as set$1, VA as fromQueue, VN as isNone, Vy as get, WA as mapAccum, WN as match, Wj as failCause, Wr as family, Xj as forkChild, Xk as optional, Yr as withLabel, Zj as forkScoped, _r as createEnvironmentRpcCommand, ai as isRpcClientError, bM as sleep, bj as sliding, br as createEnvironmentRpcSubscriptionAtomFamily, cM as onExit, cN as isFailure, ci as subscribe, ei as value, gj as offer, jj as annotateLogs, lN as isSuccess, lc as WS_METHODS, mr as createAtomCommandScheduler, nM as logWarning, oi as request, qN as toArray, qr as setIdleTTL, rM as map$1, si as runStream, sj as unwrap, vN as failVoid, vr as createEnvironmentRpcQueryAtomFamily, xM as succeed, zj as catch_, zk as TaggedErrorClass } from "../../shared.js";
|
|
2
2
|
//#region upstream-t3code/packages/client-runtime/src/state/server.ts
|
|
3
3
|
const IDLE_SERVER_UPDATE_STATE = { status: "idle" };
|
|
4
4
|
const EMPTY_SERVER_UPDATE_STATE_ATOM = make(IDLE_SERVER_UPDATE_STATE).pipe(withLabel("environment-data:server:update-state:empty"));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Id as KeybindingWhenNode, Oa as EnvironmentRegistry, Su as ServerConfig, ms as PreparedConnection, no as RemoteEnvironmentRequestError, wo as ManagedRelayDpopSigner } from "../../shared.js";
|
|
2
2
|
import * as Effect from "effect/Effect";
|
|
3
3
|
import * as Option from "effect/Option";
|
|
4
4
|
import { HttpClient } from "effect/unstable/http";
|
|
@@ -39,6 +39,7 @@ declare function createEnvironmentSessionAtoms<R, E>(runtime: Atom.AtomRuntime<E
|
|
|
39
39
|
readonly capabilities: {
|
|
40
40
|
readonly repositoryIdentity: boolean;
|
|
41
41
|
readonly connectionProbe?: boolean;
|
|
42
|
+
readonly pullRequests?: boolean;
|
|
42
43
|
readonly threadSettlement?: boolean;
|
|
43
44
|
readonly threadSnooze?: boolean;
|
|
44
45
|
readonly threadPinning?: boolean;
|
|
@@ -46,6 +47,7 @@ declare function createEnvironmentSessionAtoms<R, E>(runtime: Atom.AtomRuntime<E
|
|
|
46
47
|
readonly threadTitleRegeneration?: boolean;
|
|
47
48
|
readonly serverSelfUpdate?: "boot-service" | "desktop-managed" | "respawn";
|
|
48
49
|
readonly serverSelfUpdateProgress?: boolean;
|
|
50
|
+
readonly agentActivityPublishing?: boolean;
|
|
49
51
|
};
|
|
50
52
|
};
|
|
51
53
|
readonly auth: {
|
|
@@ -180,6 +182,10 @@ declare function createEnvironmentSessionAtoms<R, E>(runtime: Atom.AtomRuntime<E
|
|
|
180
182
|
};
|
|
181
183
|
}[];
|
|
182
184
|
readonly availableEditors: readonly ("antigravity" | "aqua" | "clion" | "cursor" | "datagrip" | "dataspell" | "file-manager" | "goland" | "idea" | "kiro" | "phpstorm" | "pycharm" | "rider" | "rubymine" | "rustrover" | "trae" | "vscode" | "vscode-insiders" | "vscodium" | "webstorm" | "zed")[];
|
|
185
|
+
readonly remoteOpenTargets?: readonly {
|
|
186
|
+
readonly kind: "mdns" | "tailscale";
|
|
187
|
+
readonly host: string;
|
|
188
|
+
}[];
|
|
183
189
|
readonly observability: {
|
|
184
190
|
readonly logsDirectoryPath: string;
|
|
185
191
|
readonly localTracingEnabled: boolean;
|
|
@@ -305,6 +311,7 @@ declare function createEnvironmentSessionAtoms<R, E>(runtime: Atom.AtomRuntime<E
|
|
|
305
311
|
readonly capabilities: {
|
|
306
312
|
readonly repositoryIdentity: boolean;
|
|
307
313
|
readonly connectionProbe?: boolean;
|
|
314
|
+
readonly pullRequests?: boolean;
|
|
308
315
|
readonly threadSettlement?: boolean;
|
|
309
316
|
readonly threadSnooze?: boolean;
|
|
310
317
|
readonly threadPinning?: boolean;
|
|
@@ -312,6 +319,7 @@ declare function createEnvironmentSessionAtoms<R, E>(runtime: Atom.AtomRuntime<E
|
|
|
312
319
|
readonly threadTitleRegeneration?: boolean;
|
|
313
320
|
readonly serverSelfUpdate?: "boot-service" | "desktop-managed" | "respawn";
|
|
314
321
|
readonly serverSelfUpdateProgress?: boolean;
|
|
322
|
+
readonly agentActivityPublishing?: boolean;
|
|
315
323
|
};
|
|
316
324
|
};
|
|
317
325
|
readonly auth: {
|
|
@@ -446,6 +454,10 @@ declare function createEnvironmentSessionAtoms<R, E>(runtime: Atom.AtomRuntime<E
|
|
|
446
454
|
};
|
|
447
455
|
}[];
|
|
448
456
|
readonly availableEditors: readonly ("antigravity" | "aqua" | "clion" | "cursor" | "datagrip" | "dataspell" | "file-manager" | "goland" | "idea" | "kiro" | "phpstorm" | "pycharm" | "rider" | "rubymine" | "rustrover" | "trae" | "vscode" | "vscode-insiders" | "vscodium" | "webstorm" | "zed")[];
|
|
457
|
+
readonly remoteOpenTargets?: readonly {
|
|
458
|
+
readonly kind: "mdns" | "tailscale";
|
|
459
|
+
readonly host: string;
|
|
460
|
+
}[];
|
|
449
461
|
readonly observability: {
|
|
450
462
|
readonly logsDirectoryPath: string;
|
|
451
463
|
readonly localTracingEnabled: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { By as changes, Dr as followStreamInEnvironment, GA as mapEffect, GN as none, Ha as safeErrorLogAttributes, Ho as makeEnvironmentHttpApiClient, Hr as buildEnvironmentAuthHeaders, Jr as swr, KN as some, Kj as fn, Ko as environmentEndpointUrl, Kr as make, LN as getOrElse, Mj as as, Qj as gen, RN as getOrNull, Ra as EnvironmentSupervisor, Ur as withEnvironmentCredentials, Vo as executeEnvironmentHttpRequest, WN as match, Wr as family, Yr as withLabel, ei as value, jj as annotateLogs, nM as logWarning, qr as setIdleTTL, rM as map, ro as ManagedRelayDpopSigner, sM as never, sj as unwrap, xM as succeed, yM as serviceOption, zj as catch_ } from "../../shared.js";
|
|
2
2
|
//#region upstream-t3code/packages/client-runtime/src/state/session.ts
|
|
3
3
|
function initialConfigOption(initialConfig) {
|
|
4
4
|
return initialConfig.pipe(map(some), catch_((error) => logWarning("Could not load the initial environment configuration.").pipe(annotateLogs({ ...safeErrorLogAttributes(error) }), as(none()))));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $
|
|
1
|
+
import { $O as EnvironmentAuthorizationError, Aa as EnvironmentSupervisor, B_ as ExternalLauncherUnsupportedEditorError, Da as EnvironmentNotRegisteredError, F_ as ExternalLauncherBrowserSpawnError, I_ as ExternalLauncherCommandNotFoundError, Ia as EnvironmentCacheStore, Id as KeybindingWhenNode, L_ as ExternalLauncherEditorSpawnError, Oa as EnvironmentRegistry, Su as ServerConfig, ab as OrchestrationShellSnapshot, at as EnvironmentMessage, ct as EnvironmentThreadShell, dt as scopeThreadShell, f as AtomCommand, ft as selectEnvironmentThreadShell, hn as EnvironmentRpcUnavailableError, lt as scopeProject, ms as PreparedConnection, no as RemoteEnvironmentRequestError, ob as OrchestrationShellStreamEvent, ot as EnvironmentProject, st as EnvironmentThread, u as EnvironmentCatalogState, ut as scopeThread, vk as EnvironmentId, wo as ManagedRelayDpopSigner, z_ as ExternalLauncherUnknownEditorError } from "../../shared.js";
|
|
2
2
|
import * as Context from "effect/Context";
|
|
3
3
|
import * as Effect from "effect/Effect";
|
|
4
4
|
import * as Stream from "effect/Stream";
|
|
@@ -301,6 +301,7 @@ declare function createEnvironmentServerConfigsAtom(input: {
|
|
|
301
301
|
readonly capabilities: {
|
|
302
302
|
readonly repositoryIdentity: boolean;
|
|
303
303
|
readonly connectionProbe?: boolean;
|
|
304
|
+
readonly pullRequests?: boolean;
|
|
304
305
|
readonly threadSettlement?: boolean;
|
|
305
306
|
readonly threadSnooze?: boolean;
|
|
306
307
|
readonly threadPinning?: boolean;
|
|
@@ -308,6 +309,7 @@ declare function createEnvironmentServerConfigsAtom(input: {
|
|
|
308
309
|
readonly threadTitleRegeneration?: boolean;
|
|
309
310
|
readonly serverSelfUpdate?: "boot-service" | "desktop-managed" | "respawn";
|
|
310
311
|
readonly serverSelfUpdateProgress?: boolean;
|
|
312
|
+
readonly agentActivityPublishing?: boolean;
|
|
311
313
|
};
|
|
312
314
|
};
|
|
313
315
|
readonly auth: {
|
|
@@ -442,6 +444,10 @@ declare function createEnvironmentServerConfigsAtom(input: {
|
|
|
442
444
|
};
|
|
443
445
|
}[];
|
|
444
446
|
readonly availableEditors: readonly ("antigravity" | "aqua" | "clion" | "cursor" | "datagrip" | "dataspell" | "file-manager" | "goland" | "idea" | "kiro" | "phpstorm" | "pycharm" | "rider" | "rubymine" | "rustrover" | "trae" | "vscode" | "vscode-insiders" | "vscodium" | "webstorm" | "zed")[];
|
|
447
|
+
readonly remoteOpenTargets?: readonly {
|
|
448
|
+
readonly kind: "mdns" | "tailscale";
|
|
449
|
+
readonly host: string;
|
|
450
|
+
}[];
|
|
445
451
|
readonly observability: {
|
|
446
452
|
readonly logsDirectoryPath: string;
|
|
447
453
|
readonly localTracingEnabled: boolean;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Br as fetchEnvironmentShellSnapshot, Rr as applyShellStreamEvent, Vr as shellSnapshotLoaderLayer, ar as createEnvironmentShellSummaryAtom, cr as createEnvironmentSnapshotAtom, dr as scopeThread, fr as scopeThreadShell, ir as createEnvironmentShellAtoms, lr as createShellEnvironmentAtoms, or as makeEnvironmentShellState, pr as selectEnvironmentThreadShell, rr as createEnvironmentServerConfigsAtom, sr as shellStateChanges, ur as scopeProject, zr as ShellSnapshotLoader } from "../../shared.js";
|
|
2
2
|
export { ShellSnapshotLoader, applyShellStreamEvent, createEnvironmentServerConfigsAtom, createEnvironmentShellAtoms, createEnvironmentShellSummaryAtom, createEnvironmentSnapshotAtom, createShellEnvironmentAtoms, fetchEnvironmentShellSnapshot, makeEnvironmentShellState, scopeProject, scopeThread, scopeThreadShell, selectEnvironmentThreadShell, shellSnapshotLoaderLayer, shellStateChanges };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $O as EnvironmentAuthorizationError, Da as EnvironmentNotRegisteredError, Ia as EnvironmentCacheStore, Oa as EnvironmentRegistry, XD as SourceControlRepositoryError, f as AtomCommand, hn as EnvironmentRpcUnavailableError, vk as EnvironmentId } from "../../shared.js";
|
|
2
2
|
import { Atom } from "effect/unstable/reactivity";
|
|
3
3
|
//#region upstream-t3code/packages/client-runtime/src/state/sourceControl.d.ts
|
|
4
4
|
declare function createSourceControlEnvironmentAtoms<R, E>(runtime: Atom.AtomRuntime<EnvironmentRegistry | EnvironmentCacheStore | R, E>): {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { St as vcsCommandScheduler,
|
|
1
|
+
import { St as vcsCommandScheduler, _r as createEnvironmentRpcCommand, lc as WS_METHODS, mr as createAtomCommandScheduler, vr as createEnvironmentRpcQueryAtomFamily, vt as invalidateCachedVcsRefs, xt as vcsCommandConcurrency } from "../../shared.js";
|
|
2
2
|
//#region upstream-t3code/packages/client-runtime/src/state/sourceControl.ts
|
|
3
3
|
function createSourceControlEnvironmentAtoms(runtime) {
|
|
4
4
|
const commandScheduler = createAtomCommandScheduler();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { db as OrchestrationThreadActivity } from "../../shared.js";
|
|
2
2
|
//#region upstream-t3code/packages/client-runtime/src/state/subagentRuntime.d.ts
|
|
3
3
|
type RuntimeSubagentStatus = "pending" | "running" | "waiting" | "idle" | "completed" | "failed" | "cancelled" | "interrupted";
|
|
4
4
|
interface SubagentUsage {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $O as EnvironmentAuthorizationError, $S as TerminalCwdStatError, Da as EnvironmentNotRegisteredError, Nk as ThreadId, Oa as EnvironmentRegistry, QS as TerminalCwdNotFoundError, ZS as TerminalCwdNotDirectoryError, dC as TerminalSessionSnapshot, f as AtomCommand, hC as TerminalWriteError, hn as EnvironmentRpcUnavailableError, iC as TerminalNotRunningError, nC as TerminalHistoryError, oC as TerminalResizeError, pC as TerminalSummary, qS as TerminalAttachStreamEvent, rC as TerminalMetadataStreamEvent, uC as TerminalSessionLookupError, vk as EnvironmentId } from "../../shared.js";
|
|
2
2
|
import { Atom } from "effect/unstable/reactivity";
|
|
3
3
|
//#region upstream-t3code/packages/client-runtime/src/state/terminalSession.d.ts
|
|
4
4
|
interface TerminalSessionState {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { _r as createEnvironmentRpcCommand, br as createEnvironmentRpcSubscriptionAtomFamily, ci as subscribe, lc as WS_METHODS, mr as createAtomCommandScheduler, tj as scan, xr as createEnvironmentSubscriptionAtomFamily } from "../../shared.js";
|
|
2
2
|
//#region upstream-t3code/packages/client-runtime/src/state/terminalSession.ts
|
|
3
3
|
function selectRunningSubprocessTerminalIds(sessions) {
|
|
4
4
|
return sessions.filter((session) => session.state.hasRunningSubprocess).map((session) => session.target.terminalId);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { gb as OrchestrationThreadSearchMatch, nb as OrchestrationSearchThreadsResult, vk as EnvironmentId } from "../../shared.js";
|
|
2
2
|
import { AsyncResult, Atom } from "effect/unstable/reactivity";
|
|
3
3
|
//#region upstream-t3code/packages/client-runtime/src/state/threadSearch.d.ts
|
|
4
4
|
interface EnvironmentThreadSearchMatch extends OrchestrationThreadSearchMatch {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Bk as Tuple, Dk as ArraySchema, Kk as decodeUnknownSync, Kr as make, ME as EnvironmentId, OC as OrchestrationSearchThreadsInput, RN as getOrNull, Wr as family, Yr as withLabel, ei as value } from "../../shared.js";
|
|
2
2
|
const decodeThreadSearchKey = decodeUnknownSync(Tuple([ArraySchema(EnvironmentId), OrchestrationSearchThreadsInput.fields.query]));
|
|
3
3
|
function makeThreadSearchKey(environmentIds, query) {
|
|
4
4
|
return JSON.stringify([[...environmentIds].sort((left, right) => left.localeCompare(right)), query]);
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { vb as OrchestrationThreadShell } from "../../shared.js";
|
|
2
2
|
//#region upstream-t3code/packages/client-runtime/src/state/threadSettled.d.ts
|
|
3
3
|
type ChangeRequestStateLike = "open" | "closed" | "merged";
|
|
4
|
+
/** Returns whether the change request state settles the thread immediately. */
|
|
5
|
+
declare function changeRequestAutoSettles(state: ChangeRequestStateLike | null | undefined, autoSettleOnMerge?: boolean): boolean;
|
|
4
6
|
declare function threadLastActivityAt(shell: OrchestrationThreadShell): string | null;
|
|
5
7
|
/**
|
|
6
8
|
* A queued turn start lives for at most this long: session adoption takes
|
|
@@ -90,18 +92,19 @@ declare function threadWokeAt(shell: ThreadSnoozeShell, options: {
|
|
|
90
92
|
* queued turn) are checked first and hold a thread active regardless of any
|
|
91
93
|
* override. Past the blockers, the explicit user override (thread.settle /
|
|
92
94
|
* thread.unsettle commands, projected into settledOverride + settledAt)
|
|
93
|
-
* wins in both directions; without one, a thread auto-
|
|
94
|
-
* merged
|
|
95
|
-
*
|
|
95
|
+
* wins in both directions; without one, a thread can auto-settle on a
|
|
96
|
+
* merged PR, always settles on a closed PR, or settles on inactivity past
|
|
97
|
+
* the window. An open PR blocks the inactivity path entirely. The server
|
|
96
98
|
* un-settles on real activity (user message, session start, approval/
|
|
97
99
|
* user-input request), so an override never goes stale silently.
|
|
98
100
|
*/
|
|
99
101
|
declare function effectiveSettled(shell: OrchestrationThreadShell, options: {
|
|
100
102
|
readonly now: string;
|
|
101
103
|
readonly autoSettleAfterDays: number | null;
|
|
104
|
+
readonly autoSettleOnMerge?: boolean;
|
|
102
105
|
readonly changeRequestState?: ChangeRequestStateLike | null;
|
|
103
106
|
}): boolean;
|
|
104
|
-
type SnoozePresetId = "hour" | "evening" | "tomorrow" | "next-week";
|
|
107
|
+
type SnoozePresetId = "hour" | "three-hours" | "evening" | "tomorrow" | "next-week";
|
|
105
108
|
interface SnoozePreset {
|
|
106
109
|
readonly id: SnoozePresetId;
|
|
107
110
|
readonly label: string;
|
|
@@ -113,8 +116,8 @@ interface SnoozePreset {
|
|
|
113
116
|
}
|
|
114
117
|
/**
|
|
115
118
|
* Shared "snooze until" choices for every client. "This evening" only
|
|
116
|
-
* appears while it is meaningfully before evening; after that the
|
|
117
|
-
*
|
|
119
|
+
* appears while it is meaningfully before evening; after that the calendar
|
|
120
|
+
* choices start at "Tomorrow".
|
|
118
121
|
*/
|
|
119
122
|
declare function resolveSnoozePresets(now: Date): ReadonlyArray<SnoozePreset>;
|
|
120
123
|
/**
|
|
@@ -126,4 +129,4 @@ declare function snoozeWakeLabel(snoozedUntil: string, options: {
|
|
|
126
129
|
readonly now: string;
|
|
127
130
|
}): string;
|
|
128
131
|
//#endregion
|
|
129
|
-
export { ChangeRequestStateLike, QUEUED_TURN_START_GRACE_MS, SnoozePreset, SnoozePresetId, ThreadSnoozeShell, canSettle, canSnooze, effectiveSettled, effectiveSnoozed, hasQueuedTurnStart, resolveSnoozePresets, snoozeWakeLabel, threadLastActivityAt, threadRaisedHandWhileSnoozed, threadWokeAt };
|
|
132
|
+
export { ChangeRequestStateLike, QUEUED_TURN_START_GRACE_MS, SnoozePreset, SnoozePresetId, ThreadSnoozeShell, canSettle, canSnooze, changeRequestAutoSettles, effectiveSettled, effectiveSnoozed, hasQueuedTurnStart, resolveSnoozePresets, snoozeWakeLabel, threadLastActivityAt, threadRaisedHandWhileSnoozed, threadWokeAt };
|
|
@@ -1,229 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
function threadLastActivityAt(shell) {
|
|
4
|
-
const candidates = [
|
|
5
|
-
shell.latestUserMessageAt,
|
|
6
|
-
shell.latestTurn?.requestedAt,
|
|
7
|
-
shell.latestTurn?.startedAt,
|
|
8
|
-
shell.latestTurn?.completedAt
|
|
9
|
-
];
|
|
10
|
-
let latest = null;
|
|
11
|
-
let latestTimestamp = Number.NEGATIVE_INFINITY;
|
|
12
|
-
for (const candidate of candidates) {
|
|
13
|
-
if (candidate === null || candidate === void 0) continue;
|
|
14
|
-
const timestamp = Date.parse(candidate);
|
|
15
|
-
if (timestamp > latestTimestamp) {
|
|
16
|
-
latest = candidate;
|
|
17
|
-
latestTimestamp = timestamp;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
return latest;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* A queued turn start lives for at most this long: session adoption takes
|
|
24
|
-
* seconds, so a user message still unadopted after the grace window is a
|
|
25
|
-
* failed start (or stale data — shells from older servers can carry user
|
|
26
|
-
* messages with no latestTurn at all), not pending work. Without this bound
|
|
27
|
-
* such threads would be permanently unsettleable.
|
|
28
|
-
*/
|
|
29
|
-
const QUEUED_TURN_START_GRACE_MS = 120 * 1e3;
|
|
30
|
-
/**
|
|
31
|
-
* A user message no turn has picked up yet: the turn.start command was
|
|
32
|
-
* dispatched (message-sent + turn-start-requested) but no session has
|
|
33
|
-
* adopted it, so `session` is still null and the pending work is invisible
|
|
34
|
-
* to the session-status checks. Detectable as a user message strictly newer
|
|
35
|
-
* than every timestamp on the latest turn — on adoption the new turn's
|
|
36
|
-
* requestedAt equals the message time, clearing the condition — and only
|
|
37
|
-
* within the adoption grace window.
|
|
38
|
-
*/
|
|
39
|
-
function hasQueuedTurnStart(shell, options) {
|
|
40
|
-
if (shell.latestUserMessageAt == null) return false;
|
|
41
|
-
if (shell.session?.status === "error") return false;
|
|
42
|
-
const messageAt = Date.parse(shell.latestUserMessageAt);
|
|
43
|
-
if (Number.isNaN(messageAt)) return false;
|
|
44
|
-
const nowMs = Date.parse(options.now);
|
|
45
|
-
if (Number.isNaN(nowMs)) return false;
|
|
46
|
-
if (Math.abs(nowMs - messageAt) > 12e4) return false;
|
|
47
|
-
const turn = shell.latestTurn;
|
|
48
|
-
if (turn === null) return true;
|
|
49
|
-
return [
|
|
50
|
-
turn.requestedAt,
|
|
51
|
-
turn.startedAt,
|
|
52
|
-
turn.completedAt
|
|
53
|
-
].every((candidate) => candidate == null || Date.parse(candidate) < messageAt);
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* A thread may be settled only when none of effectiveSettled's activity
|
|
57
|
-
* blockers hold. This is deliberately the same list: anything the partition
|
|
58
|
-
* refuses to CLASSIFY as settled must also be refused as a settle TARGET.
|
|
59
|
-
* The server enforces its own invariants; this client-side twin exists so
|
|
60
|
-
* the UI can disable/reject before a round trip.
|
|
61
|
-
*/
|
|
62
|
-
function canSettle(shell, options) {
|
|
63
|
-
if (shell.hasPendingApprovals || shell.hasPendingUserInput) return false;
|
|
64
|
-
if (shell.session?.status === "starting" || shell.session?.status === "running") return false;
|
|
65
|
-
if (hasQueuedTurnStart(shell, options)) return false;
|
|
66
|
-
return true;
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* A snoozed thread "raises its hand" when something happens that outranks
|
|
70
|
-
* the user's snooze: the agent is blocked on them (approval / user input),
|
|
71
|
-
* the session failed, or a run completed after the snooze was set — the
|
|
72
|
-
* v1 taste of event-based snooze ("something happened" wakes early).
|
|
73
|
-
* Raising a hand never clears the server-side snooze fields; it only stops
|
|
74
|
-
* the thread from CLASSIFYING as snoozed, exactly like blocked work and
|
|
75
|
-
* effectiveSettled.
|
|
76
|
-
*/
|
|
77
|
-
function threadRaisedHandWhileSnoozed(shell) {
|
|
78
|
-
if (shell.hasPendingApprovals || shell.hasPendingUserInput) return true;
|
|
79
|
-
if (shell.session?.status === "error" && (shell.snoozedAt == null || Date.parse(shell.session.updatedAt) > Date.parse(shell.snoozedAt))) return true;
|
|
80
|
-
if (shell.snoozedAt != null && shell.latestTurn?.state === "completed" && shell.latestTurn.completedAt != null && Date.parse(shell.latestTurn.completedAt) > Date.parse(shell.snoozedAt)) return true;
|
|
81
|
-
return false;
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* A thread may be snoozed unless the agent is blocked on the user: hiding a
|
|
85
|
-
* pending approval or user-input request defeats the request, and a queued
|
|
86
|
-
* turn start (a message no turn has adopted yet) is invisible pending work
|
|
87
|
-
* the same way it is for settle. A running session IS snoozable — snooze
|
|
88
|
-
* only affects visibility, never the agent. Client-side twin of the server
|
|
89
|
-
* invariants so the UI can reject before a round trip.
|
|
90
|
-
*/
|
|
91
|
-
function canSnooze(shell, options) {
|
|
92
|
-
if (shell.hasPendingApprovals || shell.hasPendingUserInput) return false;
|
|
93
|
-
if (hasQueuedTurnStart(shell, options)) return false;
|
|
94
|
-
return true;
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* Snoozed resolution: hidden from the inbox while the wake time is in the
|
|
98
|
-
* future and the thread has not raised its hand. Timer wakes are derived —
|
|
99
|
-
* no server event fires when snoozedUntil passes; the stale fields simply
|
|
100
|
-
* stop classifying as snoozed (and feed the woke indicator until the user
|
|
101
|
-
* visits or re-engages).
|
|
102
|
-
*/
|
|
103
|
-
function effectiveSnoozed(shell, options) {
|
|
104
|
-
if (shell.snoozedUntil == null) return false;
|
|
105
|
-
const wakeAtMs = Date.parse(shell.snoozedUntil);
|
|
106
|
-
if (Number.isNaN(wakeAtMs)) return false;
|
|
107
|
-
if (wakeAtMs <= Date.parse(options.now)) return false;
|
|
108
|
-
return !threadRaisedHandWhileSnoozed(shell);
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* When a previously-snoozed thread woke, or null if it never snoozed / is
|
|
112
|
-
* still snoozed. Used for the "Woke" indicator: the thread reappears in its
|
|
113
|
-
* original sort position (the inbox sort is deliberately static), so the
|
|
114
|
-
* wake signal has to carry the weight. Compare against the client's
|
|
115
|
-
* lastVisitedAt — visiting clears the indicator like it clears unread.
|
|
116
|
-
*
|
|
117
|
-
* Timer wakes report the wake time itself; raised-hand wakes report the
|
|
118
|
-
* triggering timestamp so a visit BEFORE the early wake doesn't suppress
|
|
119
|
-
* the indicator.
|
|
120
|
-
*/
|
|
121
|
-
function threadWokeAt(shell, options) {
|
|
122
|
-
if (shell.snoozedUntil == null) return null;
|
|
123
|
-
const wakeAtMs = Date.parse(shell.snoozedUntil);
|
|
124
|
-
if (Number.isNaN(wakeAtMs)) return null;
|
|
125
|
-
if (threadRaisedHandWhileSnoozed(shell)) {
|
|
126
|
-
if (shell.snoozedAt != null && shell.latestTurn?.state === "completed" && shell.latestTurn.completedAt != null && Date.parse(shell.latestTurn.completedAt) > Date.parse(shell.snoozedAt)) return shell.latestTurn.completedAt;
|
|
127
|
-
return shell.session?.updatedAt ?? shell.snoozedAt ?? null;
|
|
128
|
-
}
|
|
129
|
-
return wakeAtMs <= Date.parse(options.now) ? shell.snoozedUntil : null;
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* Settled resolution over the server-backed settled lifecycle. Activity
|
|
133
|
-
* blockers (pending approval/user-input, a live session, an unadjudicated
|
|
134
|
-
* queued turn) are checked first and hold a thread active regardless of any
|
|
135
|
-
* override. Past the blockers, the explicit user override (thread.settle /
|
|
136
|
-
* thread.unsettle commands, projected into settledOverride + settledAt)
|
|
137
|
-
* wins in both directions; without one, a thread auto-settles on a
|
|
138
|
-
* merged/closed PR immediately or on inactivity past the window — except
|
|
139
|
-
* that an open PR blocks the inactivity path entirely. The server
|
|
140
|
-
* un-settles on real activity (user message, session start, approval/
|
|
141
|
-
* user-input request), so an override never goes stale silently.
|
|
142
|
-
*/
|
|
143
|
-
function effectiveSettled(shell, options) {
|
|
144
|
-
if (shell.hasPendingApprovals || shell.hasPendingUserInput) return false;
|
|
145
|
-
if (shell.session?.status === "starting" || shell.session?.status === "running") return false;
|
|
146
|
-
if (hasQueuedTurnStart(shell, { now: options.now })) {
|
|
147
|
-
if (!(shell.settledOverride === "settled" && shell.settledAt !== null && shell.latestUserMessageAt !== null && Date.parse(shell.settledAt) >= Date.parse(shell.latestUserMessageAt))) return false;
|
|
148
|
-
}
|
|
149
|
-
if (shell.settledOverride === "settled") return true;
|
|
150
|
-
if (shell.settledOverride === "active") return false;
|
|
151
|
-
if (options.changeRequestState === "merged" || options.changeRequestState === "closed") return true;
|
|
152
|
-
if (options.changeRequestState === "open") return false;
|
|
153
|
-
if (options.autoSettleAfterDays === null) return false;
|
|
154
|
-
const lastActivityAt = threadLastActivityAt(shell);
|
|
155
|
-
if (lastActivityAt === null) return false;
|
|
156
|
-
return Date.parse(lastActivityAt) < Date.parse(options.now) - options.autoSettleAfterDays * DAY_MS;
|
|
157
|
-
}
|
|
158
|
-
const HOUR_MS = 3600 * 1e3;
|
|
159
|
-
const EVENING_HOUR = 18;
|
|
160
|
-
const MORNING_HOUR = 9;
|
|
161
|
-
function snoozeTimeOfDayLabel(date) {
|
|
162
|
-
return date.toLocaleTimeString(void 0, {
|
|
163
|
-
hour: "numeric",
|
|
164
|
-
minute: "2-digit"
|
|
165
|
-
});
|
|
166
|
-
}
|
|
167
|
-
function snoozeAtHour(base, hour) {
|
|
168
|
-
const next = new Date(base);
|
|
169
|
-
next.setHours(hour, 0, 0, 0);
|
|
170
|
-
return next;
|
|
171
|
-
}
|
|
172
|
-
function addSnoozeDays(base, days) {
|
|
173
|
-
const next = new Date(base);
|
|
174
|
-
next.setDate(next.getDate() + days);
|
|
175
|
-
return next;
|
|
176
|
-
}
|
|
177
|
-
/**
|
|
178
|
-
* Shared "snooze until" choices for every client. "This evening" only
|
|
179
|
-
* appears while it is meaningfully before evening; after that the list
|
|
180
|
-
* starts at "Tomorrow".
|
|
181
|
-
*/
|
|
182
|
-
function resolveSnoozePresets(now) {
|
|
183
|
-
const inAnHour = new Date(now.getTime() + HOUR_MS);
|
|
184
|
-
const presets = [{
|
|
185
|
-
id: "hour",
|
|
186
|
-
label: "In 1 hour",
|
|
187
|
-
whenLabel: snoozeTimeOfDayLabel(inAnHour),
|
|
188
|
-
snoozedUntil: inAnHour.toISOString()
|
|
189
|
-
}];
|
|
190
|
-
const evening = snoozeAtHour(now, EVENING_HOUR);
|
|
191
|
-
if (evening.getTime() - now.getTime() > HOUR_MS) presets.push({
|
|
192
|
-
id: "evening",
|
|
193
|
-
label: "This evening",
|
|
194
|
-
whenLabel: snoozeTimeOfDayLabel(evening),
|
|
195
|
-
snoozedUntil: evening.toISOString()
|
|
196
|
-
});
|
|
197
|
-
const tomorrow = snoozeAtHour(addSnoozeDays(now, 1), MORNING_HOUR);
|
|
198
|
-
presets.push({
|
|
199
|
-
id: "tomorrow",
|
|
200
|
-
label: "Tomorrow",
|
|
201
|
-
whenLabel: snoozeTimeOfDayLabel(tomorrow),
|
|
202
|
-
snoozedUntil: tomorrow.toISOString()
|
|
203
|
-
});
|
|
204
|
-
const nextWeek = snoozeAtHour(addSnoozeDays(now, (1 - now.getDay() + 7) % 7 || 7), MORNING_HOUR);
|
|
205
|
-
presets.push({
|
|
206
|
-
id: "next-week",
|
|
207
|
-
label: "Next week",
|
|
208
|
-
whenLabel: `${nextWeek.toLocaleDateString(void 0, { weekday: "short" })} ${snoozeTimeOfDayLabel(nextWeek)}`,
|
|
209
|
-
snoozedUntil: nextWeek.toISOString()
|
|
210
|
-
});
|
|
211
|
-
return presets;
|
|
212
|
-
}
|
|
213
|
-
/**
|
|
214
|
-
* Compact "wakes in" label for snoozed rows: "2h", "18h", "3d". Minutes
|
|
215
|
-
* round up so a snooze never reads "0m" while still hidden. Shared by web
|
|
216
|
-
* and mobile so the same wake time never reads differently per client.
|
|
217
|
-
*/
|
|
218
|
-
function snoozeWakeLabel(snoozedUntil, options) {
|
|
219
|
-
const wakeMs = Date.parse(snoozedUntil);
|
|
220
|
-
const nowMs = Date.parse(options.now);
|
|
221
|
-
if (Number.isNaN(wakeMs) || Number.isNaN(nowMs)) return "now";
|
|
222
|
-
const remainingMs = wakeMs - nowMs;
|
|
223
|
-
if (remainingMs <= 0) return "now";
|
|
224
|
-
if (remainingMs < HOUR_MS) return `${Math.max(1, Math.ceil(remainingMs / 6e4))}m`;
|
|
225
|
-
if (remainingMs < DAY_MS) return `${Math.ceil(remainingMs / HOUR_MS)}h`;
|
|
226
|
-
return `${Math.ceil(remainingMs / DAY_MS)}d`;
|
|
227
|
-
}
|
|
228
|
-
//#endregion
|
|
229
|
-
export { QUEUED_TURN_START_GRACE_MS, canSettle, canSnooze, effectiveSettled, effectiveSnoozed, hasQueuedTurnStart, resolveSnoozePresets, snoozeWakeLabel, threadLastActivityAt, threadRaisedHandWhileSnoozed, threadWokeAt };
|
|
1
|
+
import { $s as threadRaisedHandWhileSnoozed, Gs as canSnooze, Js as effectiveSnoozed, Ks as changeRequestAutoSettles, Qs as threadLastActivityAt, Us as QUEUED_TURN_START_GRACE_MS, Ws as canSettle, Xs as resolveSnoozePresets, Ys as hasQueuedTurnStart, Zs as snoozeWakeLabel, ec as threadWokeAt, qs as effectiveSettled } from "../../shared.js";
|
|
2
|
+
export { QUEUED_TURN_START_GRACE_MS, canSettle, canSnooze, changeRequestAutoSettles, effectiveSettled, effectiveSnoozed, hasQueuedTurnStart, resolveSnoozePresets, snoozeWakeLabel, threadLastActivityAt, threadRaisedHandWhileSnoozed, threadWokeAt };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ek as ProjectId, ry as SidebarThreadSortOrder, ty as SidebarProjectSortOrder } from "../../shared.js";
|
|
2
2
|
//#region upstream-t3code/packages/client-runtime/src/state/threadSort.d.ts
|
|
3
3
|
interface ThreadSortInput {
|
|
4
4
|
readonly createdAt: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $N as flip, JN as Number$1, XN as Struct, YN as String, eP as mapInput, gN as sort } from "../../shared.js";
|
|
2
2
|
//#region upstream-t3code/packages/client-runtime/src/state/threadSort.ts
|
|
3
3
|
function toSortableTimestamp(iso) {
|
|
4
4
|
if (!iso) return null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $
|
|
1
|
+
import { $O as EnvironmentAuthorizationError, Aa as EnvironmentSupervisor, At as UnarchiveThreadInput, Ay as OrchestrationDispatchCommandError, By as OrchestrationGetTurnDiffResult, Ct as RevertThreadCheckpointInput, Da as EnvironmentNotRegisteredError, Dt as SnoozeThreadInput, Et as SettleThreadInput, Ft as UpdateThreadMetadataInput, Ia as EnvironmentCacheStore, Iy as OrchestrationGetFullThreadDiffResult, Mt as UnsettleThreadInput, Nk as ThreadId, Nt as UnsnoozeThreadInput, Oa as EnvironmentRegistry, Ot as StartThreadTurnInput, St as RespondToThreadUserInputInput, Tt as SetThreadRuntimeModeInput, _t as DeleteThreadInput, ab as OrchestrationShellSnapshot, bt as ReorderPinnedThreadInput, ct as EnvironmentThreadShell, f as AtomCommand, hn as EnvironmentRpcUnavailableError, ht as CreateThreadInput, jt as UnpinThreadInput, jy as OrchestrationEvent, kt as StopThreadSessionInput, lO as ScopedProjectRef, mb as OrchestrationThreadDetailSnapshot, ms as PreparedConnection, no as RemoteEnvironmentRequestError, pt as ArchiveThreadInput, st as EnvironmentThread, u as EnvironmentCatalogState, uO as ScopedThreadRef, ub as OrchestrationThread, vk as EnvironmentId, vt as InterruptThreadTurnInput, wo as ManagedRelayDpopSigner, wt as SetThreadInteractionModeInput, xt as RespondToThreadApprovalInput, yt as PinThreadInput } from "../../shared.js";
|
|
2
2
|
import * as Context from "effect/Context";
|
|
3
3
|
import * as Effect from "effect/Effect";
|
|
4
4
|
import * as Stream from "effect/Stream";
|