t3code-cli 0.14.1 → 0.14.2
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 +1 -0
- 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 +544 -262
- 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 +5 -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 +2 -2
- package/dist/client-runtime/operations/projects.js +2 -2
- package/dist/client-runtime/operations.d.ts +2 -2
- package/dist/client-runtime/operations.js +2 -2
- package/dist/client-runtime/platform.d.ts +1 -1
- package/dist/client-runtime/platform.js +1 -1
- package/dist/client-runtime/relay.d.ts +5 -1
- package/dist/client-runtime/relay.js +1 -1
- 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 +17 -11
- 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/entities.js +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 +5 -5
- 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 +42 -2
- package/dist/client-runtime/state/orchestration.js +13 -1
- package/dist/client-runtime/state/presentation.d.ts +9 -3
- package/dist/client-runtime/state/presentation.js +1 -1
- package/dist/client-runtime/state/preview.d.ts +55 -48
- package/dist/client-runtime/state/preview.js +1 -1
- package/dist/client-runtime/state/project-grouping.d.ts +26 -2
- package/dist/client-runtime/state/project-grouping.js +83 -3
- package/dist/client-runtime/state/projects.d.ts +24 -18
- package/dist/client-runtime/state/projects.js +1 -1
- 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 +16 -1
- package/dist/client-runtime/state/review.js +27 -6
- 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 +299 -172
- package/dist/client-runtime/state/server.js +192 -16
- package/dist/client-runtime/state/session.d.ts +65 -7
- package/dist/client-runtime/state/session.js +32 -3
- package/dist/client-runtime/state/shell.d.ts +41 -7
- package/dist/client-runtime/state/shell.js +1 -1
- package/dist/client-runtime/state/source-control.d.ts +2 -2
- package/dist/client-runtime/state/source-control.js +1 -1
- package/dist/client-runtime/state/subagentRuntime.d.ts +145 -0
- package/dist/client-runtime/state/subagentRuntime.js +521 -0
- package/dist/client-runtime/state/terminal.d.ts +17 -17
- package/dist/client-runtime/state/terminal.js +1 -1
- package/dist/client-runtime/state/thread-search.d.ts +23 -0
- package/dist/client-runtime/state/thread-search.js +38 -0
- package/dist/client-runtime/state/thread-settled.d.ts +28 -3
- package/dist/client-runtime/state/thread-settled.js +74 -2
- package/dist/client-runtime/state/thread-sort.d.ts +59 -2
- package/dist/client-runtime/state/thread-sort.js +128 -2
- package/dist/client-runtime/state/threads.d.ts +115 -3
- package/dist/client-runtime/state/threads.js +309 -28
- package/dist/client-runtime/state/vcs.d.ts +14 -14
- 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 +144 -1
- package/dist/orchestration.js +1 -1
- package/dist/preview.d.ts +1 -1
- package/dist/preview.js +1 -1
- package/dist/rpc.d.ts +883 -351
- package/dist/rpc.js +1 -1
- package/dist/runtime.d.ts +1 -1
- package/dist/runtime.js +1 -1
- package/dist/shared/DrainableWorker.js +1 -1
- package/dist/shared/KeyedCoalescingWorker.js +1 -1
- package/dist/shared/Net.js +1 -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/composerInlineTokens.js +1 -1
- package/dist/shared/connectAuth.js +1 -1
- 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 +2 -2
- package/dist/shared/keybindings.js +15 -1
- package/dist/shared/model.d.ts +1 -1
- package/dist/shared/oauthScope.js +1 -1
- package/dist/shared/observability.d.ts +8 -1
- package/dist/shared/observability.js +49 -5
- package/dist/shared/path.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/projectFavicon.d.ts +2 -1
- package/dist/shared/projectFavicon.js +13 -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 +3 -3
- package/dist/shared/semver.js +1 -1
- package/dist/shared/serverSettings.d.ts +1 -1
- package/dist/shared/serverSettings.js +1 -1
- package/dist/shared/shell.d.ts +6 -1
- package/dist/shared/shell.js +42 -4
- package/dist/shared/sourceControl.d.ts +1 -1
- package/dist/shared/t3ProjectFile.d.ts +9 -1
- package/dist/shared/t3ProjectFile.js +12 -2
- package/dist/shared/terminalLabels.d.ts +1 -1
- package/dist/shared/threadEnvMode.d.ts +29 -0
- package/dist/shared/threadEnvMode.js +24 -0
- package/dist/shared/toolActivity.d.ts +1 -1
- package/dist/shared/usageFormat.d.ts +21 -0
- package/dist/shared/usageFormat.js +90 -0
- package/dist/shared/usageMerge.d.ts +67 -0
- package/dist/shared/usageMerge.js +218 -0
- package/dist/shared.d.ts +4472 -668
- package/dist/shared.js +16867 -16273
- package/dist/t3tools.d.ts +2 -2
- package/dist/t3tools.js +2 -2
- package/package.json +5 -5
- package/src/application/index.ts +1 -0
- package/src/application/service.ts +5 -1
- package/src/application/threads.ts +43 -1
- package/src/cli/app.ts +2 -0
- package/src/cli/format/thread.ts +23 -1
- package/src/cli/search.ts +48 -0
- package/src/config/persist/schema.ts +1 -1
- package/src/orchestration/layer.ts +6 -0
- package/src/orchestration/service.ts +5 -0
- package/src/rpc/error.ts +2 -0
- package/src/rpc/operation.ts +2 -0
- package/src/rpc/ws-group.ts +2 -0
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import { $
|
|
1
|
+
import { $k as orElseSucceed, $r as make, AO as fromQueue, Aj as none, An as unsettleThread, Bk as gen, Bo as makeEnvironmentHttpApiClient, Br as buildEnvironmentAuthHeaders, Cj as getOrNull, Ck as catchCause, Cn as setThreadRuntimeMode, Cw as EnvironmentId, Dj as isSome, Dk as catch_, Dn as stopThreadSession, EO as filter$1, Ej as isNone, Ek as catchTags, En as startThreadTurn, FA as squash, Fy as get$1, Gk as map, HO as runHead, IA as effect, IO as never, Ia as EnvironmentSupervisor, Ij as combine, Iy as make$1, La as ConnectionWakeups, Lj as combineAll, Ly as set$1, MO as map$3, Nj as Number$1, Nk as flatMap$1, Nn as updateThreadMetadata, Oj as map$2, On as unarchiveThread, Os as connectionProjectionPhase, PA as pretty, Pj as String, Pk as fn, Py as changes, Qt as parseThreadKey, Ra as shouldResubscribeAfterWakeup, Ry as update, SO as debounce, Sj as getOrElse, Sn as setThreadInteractionMode, Tn as snoozeThread, Tr as followStreamInEnvironment, Uk as logDebug, Uo as environmentEndpointUrl, VO as runForEach, Vb as ORCHESTRATION_WS_METHODS, Vr as withEnvironmentCredentials, Wa as EnvironmentCacheStore, Wk as logWarning, Xr as subscribeDynamic, YO as unwrap, Yj as pipe, Yt as arrayElementsEqual, Zr as family, Zt as parseProjectRefCollectionKey, _k as all, _n as pinThread, ak as offerUnsafe, bA as void_, bT as set, bk as as, bn as respondToThreadUserInput, cA as succeed, ck as sliding, dT as HttpClient, dn as archiveThread, dr as scopeThreadShell, ei as setIdleTTL, ej as append, ek as make$3, en as projectRefCollectionKey, gk as addFinalizer, gn as interruptThreadTurn, hj as Service, hn as deleteThread, ik as offer, jj as some, jn as unsnoozeThread, kj as match, kn as unpinThread, mj as Reference, mr as createEnvironmentCommand, nA as provideService, ni as withLabel, nj as map$1, nn as threadKey, oA as serviceOption, pn as createThread, pr as createAtomCommandScheduler, rj as sort, rn as threadRefsEqual, si as value, tj as filter, to as ManagedRelayDpopSigner, uA as sync, ur as scopeThread, vT as get, vj as flatMap, vk as andThen, vn as reorderPinnedThread, wj as getOrThrow, wn as settleThread, xT as update$1, xn as revertThreadCheckpoint, yT as make$2, yk as annotateLogs, yn as respondToThreadApproval, zj as mapInput, zk as forkScoped, zo as executeEnvironmentHttpRequest } from "../../shared.js";
|
|
2
2
|
//#region upstream-t3code/packages/client-runtime/src/state/threadSnapshotHttp.ts
|
|
3
3
|
const DEFAULT_THREAD_SNAPSHOT_TIMEOUT_MS = 6e3;
|
|
4
|
-
/**
|
|
5
|
-
* Load a thread's detail snapshot over HTTP instead of embedding it in the
|
|
6
|
-
* WebSocket subscription's first frame. The response is gzip-compressible by
|
|
7
|
-
* the transport and keeps the (potentially multi-KB) snapshot off the socket.
|
|
8
|
-
*/
|
|
9
4
|
const fetchEnvironmentThreadSnapshot = fn("clientRuntime.state.fetchEnvironmentThreadSnapshot")(function* (input) {
|
|
10
5
|
const requestUrl = environmentEndpointUrl(input.prepared.httpBaseUrl, `/api/orchestration/threads/${input.threadId}`);
|
|
11
6
|
const client = yield* makeEnvironmentHttpApiClient(input.prepared.httpBaseUrl);
|
|
12
7
|
const headers = yield* buildEnvironmentAuthHeaders(input.prepared.httpAuthorization, "GET", requestUrl, input.signer);
|
|
13
8
|
return yield* executeEnvironmentHttpRequest(requestUrl, input.timeoutMs ?? DEFAULT_THREAD_SNAPSHOT_TIMEOUT_MS, withEnvironmentCredentials(input.prepared.httpAuthorization, client.orchestration.threadSnapshot({
|
|
14
9
|
params: { threadId: input.threadId },
|
|
10
|
+
payload: {
|
|
11
|
+
...input.window !== void 0 ? { turnLimit: input.window.turnLimit } : {},
|
|
12
|
+
...input.window?.beforeCursor !== void 0 ? { beforeCursor: input.window.beforeCursor } : {}
|
|
13
|
+
},
|
|
15
14
|
headers
|
|
16
15
|
})));
|
|
17
16
|
});
|
|
@@ -25,10 +24,11 @@ var ThreadSnapshotLoader = class extends Service()("@t3tools/client-runtime/stat
|
|
|
25
24
|
const threadSnapshotLoaderLayer = effect(ThreadSnapshotLoader, gen(function* () {
|
|
26
25
|
const httpClient = yield* HttpClient;
|
|
27
26
|
const signer = yield* serviceOption(ManagedRelayDpopSigner);
|
|
28
|
-
return ThreadSnapshotLoader.of({ load: (prepared, threadId) => fetchEnvironmentThreadSnapshot({
|
|
27
|
+
return ThreadSnapshotLoader.of({ load: (prepared, threadId, window) => fetchEnvironmentThreadSnapshot({
|
|
29
28
|
prepared,
|
|
30
29
|
threadId,
|
|
31
|
-
signer
|
|
30
|
+
signer,
|
|
31
|
+
...window !== void 0 ? { window } : {}
|
|
32
32
|
}).pipe(map(some), provideService(HttpClient, httpClient), catchTags({ EnvironmentResourceNotFoundError: () => logDebug("Thread snapshot not found over HTTP; deferring to the socket subscription.").pipe(annotateLogs({ threadId }), as(none())) }), catchCause((cause) => logWarning("Could not load the thread snapshot over HTTP; using the socket snapshot instead.").pipe(annotateLogs({
|
|
33
33
|
threadId,
|
|
34
34
|
cause: pretty(cause)
|
|
@@ -44,6 +44,17 @@ const activityOrder = combineAll([
|
|
|
44
44
|
mapInput(String, (a) => a.id)
|
|
45
45
|
]);
|
|
46
46
|
/**
|
|
47
|
+
* Matches the validity rule in `deriveLatestContextWindowSnapshot` (and the
|
|
48
|
+
* server's snapshot-side `dropStaleContextWindowActivities`): rows without a
|
|
49
|
+
* finite, non-negative `usedTokens` are skipped during the consumer's backward
|
|
50
|
+
* walk, so they must not replace an earlier resolvable row here.
|
|
51
|
+
*/
|
|
52
|
+
function isResolvableContextWindowActivity(activity) {
|
|
53
|
+
if (activity.kind !== "context-window.updated") return false;
|
|
54
|
+
const usedTokens = (activity.payload && typeof activity.payload === "object" ? activity.payload : null)?.usedTokens;
|
|
55
|
+
return typeof usedTokens === "number" && Number.isFinite(usedTokens) && usedTokens >= 0;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
47
58
|
* Apply a single orchestration event to an `OrchestrationThread`, returning
|
|
48
59
|
* the updated thread, a deletion signal, or an "unchanged" marker when the
|
|
49
60
|
* event doesn't affect this thread.
|
|
@@ -90,6 +101,7 @@ function applyThreadDetailEvent(thread, event) {
|
|
|
90
101
|
thread: {
|
|
91
102
|
...thread,
|
|
92
103
|
archivedAt: event.payload.archivedAt,
|
|
104
|
+
titleRegeneration: null,
|
|
93
105
|
updatedAt: event.payload.updatedAt
|
|
94
106
|
}
|
|
95
107
|
};
|
|
@@ -137,11 +149,38 @@ function applyThreadDetailEvent(thread, event) {
|
|
|
137
149
|
updatedAt: event.payload.updatedAt
|
|
138
150
|
}
|
|
139
151
|
};
|
|
152
|
+
case "thread.pinned": return {
|
|
153
|
+
kind: "updated",
|
|
154
|
+
thread: {
|
|
155
|
+
...thread,
|
|
156
|
+
pinnedAt: event.payload.pinnedAt,
|
|
157
|
+
...event.payload.pinOrderKey !== void 0 ? { pinOrderKey: event.payload.pinOrderKey } : {},
|
|
158
|
+
updatedAt: event.payload.updatedAt
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
case "thread.unpinned": return {
|
|
162
|
+
kind: "updated",
|
|
163
|
+
thread: {
|
|
164
|
+
...thread,
|
|
165
|
+
pinnedAt: null,
|
|
166
|
+
pinOrderKey: null,
|
|
167
|
+
updatedAt: event.payload.updatedAt
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
case "thread.pin-reordered": return {
|
|
171
|
+
kind: "updated",
|
|
172
|
+
thread: {
|
|
173
|
+
...thread,
|
|
174
|
+
pinOrderKey: event.payload.orderKey,
|
|
175
|
+
updatedAt: event.payload.updatedAt
|
|
176
|
+
}
|
|
177
|
+
};
|
|
140
178
|
case "thread.meta-updated": return {
|
|
141
179
|
kind: "updated",
|
|
142
180
|
thread: {
|
|
143
181
|
...thread,
|
|
144
182
|
...event.payload.title !== void 0 ? { title: event.payload.title } : {},
|
|
183
|
+
...event.payload.titleRegeneration !== void 0 ? { titleRegeneration: event.payload.titleRegeneration } : {},
|
|
145
184
|
...event.payload.modelSelection !== void 0 ? { modelSelection: event.payload.modelSelection } : {},
|
|
146
185
|
...event.payload.branch !== void 0 ? { branch: event.payload.branch } : {},
|
|
147
186
|
...event.payload.worktreePath !== void 0 ? { worktreePath: event.payload.worktreePath } : {},
|
|
@@ -341,7 +380,9 @@ function applyThreadDetailEvent(thread, event) {
|
|
|
341
380
|
};
|
|
342
381
|
}
|
|
343
382
|
case "thread.activity-appended": {
|
|
344
|
-
const
|
|
383
|
+
const activity = event.payload.activity;
|
|
384
|
+
const supersedesContextWindow = isResolvableContextWindowActivity(activity);
|
|
385
|
+
const activities = pipe(thread.activities, filter((entry) => entry.id !== activity.id && !(supersedesContextWindow && entry.turnId === activity.turnId && isResolvableContextWindowActivity(entry))), append(activity), sort(activityOrder));
|
|
345
386
|
return {
|
|
346
387
|
kind: "updated",
|
|
347
388
|
thread: {
|
|
@@ -401,8 +442,16 @@ const THREAD_STATE_IDLE_TTL_MS = 5 * 6e4;
|
|
|
401
442
|
const EMPTY_ENVIRONMENT_THREAD_STATE = {
|
|
402
443
|
data: none(),
|
|
403
444
|
status: "empty",
|
|
404
|
-
error: none()
|
|
445
|
+
error: none(),
|
|
446
|
+
page: none()
|
|
405
447
|
};
|
|
448
|
+
/** Whether the thread has older turns that can be loaded with more pages. */
|
|
449
|
+
function threadHasOlderTurns(state) {
|
|
450
|
+
return match(state.page, {
|
|
451
|
+
onNone: () => false,
|
|
452
|
+
onSome: (page) => page.hasMore
|
|
453
|
+
});
|
|
454
|
+
}
|
|
406
455
|
//#endregion
|
|
407
456
|
//#region upstream-t3code/packages/client-runtime/src/state/archivedThreads.ts
|
|
408
457
|
const ARCHIVED_THREADS_ENVIRONMENT_KEY_SEPARATOR = "";
|
|
@@ -493,6 +542,24 @@ function createThreadEnvironmentAtoms(runtime) {
|
|
|
493
542
|
scheduler,
|
|
494
543
|
concurrency
|
|
495
544
|
}),
|
|
545
|
+
pin: createEnvironmentCommand(runtime, {
|
|
546
|
+
label: "environment-data:commands:thread:pin",
|
|
547
|
+
execute: (input) => pinThread(input),
|
|
548
|
+
scheduler,
|
|
549
|
+
concurrency
|
|
550
|
+
}),
|
|
551
|
+
unpin: createEnvironmentCommand(runtime, {
|
|
552
|
+
label: "environment-data:commands:thread:unpin",
|
|
553
|
+
execute: (input) => unpinThread(input),
|
|
554
|
+
scheduler,
|
|
555
|
+
concurrency
|
|
556
|
+
}),
|
|
557
|
+
reorderPin: createEnvironmentCommand(runtime, {
|
|
558
|
+
label: "environment-data:commands:thread:reorder-pin",
|
|
559
|
+
execute: (input) => reorderPinnedThread(input),
|
|
560
|
+
scheduler,
|
|
561
|
+
concurrency
|
|
562
|
+
}),
|
|
496
563
|
updateMetadata: createEnvironmentCommand(runtime, {
|
|
497
564
|
label: "environment-data:commands:thread:update-metadata",
|
|
498
565
|
execute: (input) => updateThreadMetadata(input),
|
|
@@ -586,6 +653,8 @@ function mergeEnvironmentThread(detail, shell) {
|
|
|
586
653
|
settledAt: shell.settledAt,
|
|
587
654
|
snoozedUntil: shell.snoozedUntil,
|
|
588
655
|
snoozedAt: shell.snoozedAt,
|
|
656
|
+
pinnedAt: shell.pinnedAt,
|
|
657
|
+
pinOrderKey: shell.pinOrderKey,
|
|
589
658
|
session: shell.session
|
|
590
659
|
};
|
|
591
660
|
}
|
|
@@ -744,6 +813,58 @@ function createEnvironmentThreadShellAtoms(input) {
|
|
|
744
813
|
function statusWithoutLiveData(data) {
|
|
745
814
|
return isSome(data) ? "cached" : "empty";
|
|
746
815
|
}
|
|
816
|
+
/**
|
|
817
|
+
* Turn window sizes for paginated thread loads: the initial page covers the
|
|
818
|
+
* last 10 user-anchored turns (subagent/fan-out turns ride along), each
|
|
819
|
+
* "load earlier" tap fetches 20 more. Sized so first paint on the heaviest
|
|
820
|
+
* observed threads stays around 100K gzipped while median threads load fully.
|
|
821
|
+
*/
|
|
822
|
+
const INITIAL_THREAD_USER_TURN_LIMIT = 10;
|
|
823
|
+
const OLDER_THREAD_PAGE_USER_TURN_LIMIT = 20;
|
|
824
|
+
function pageStateFromSnapshot(page) {
|
|
825
|
+
return page === void 0 ? none() : some({
|
|
826
|
+
beforeCursor: page.beforeCursor,
|
|
827
|
+
hasMore: page.hasMore,
|
|
828
|
+
loadingOlder: false
|
|
829
|
+
});
|
|
830
|
+
}
|
|
831
|
+
function makeThreadOlderTurnRequestRegistry() {
|
|
832
|
+
const handlers = /* @__PURE__ */ new Map();
|
|
833
|
+
return {
|
|
834
|
+
register: (key, handler) => {
|
|
835
|
+
handlers.set(key, handler);
|
|
836
|
+
return () => {
|
|
837
|
+
if (handlers.get(key) === handler) handlers.delete(key);
|
|
838
|
+
};
|
|
839
|
+
},
|
|
840
|
+
request: (key) => {
|
|
841
|
+
const handler = handlers.get(key);
|
|
842
|
+
if (handler === void 0) return false;
|
|
843
|
+
handler();
|
|
844
|
+
return true;
|
|
845
|
+
}
|
|
846
|
+
};
|
|
847
|
+
}
|
|
848
|
+
const defaultOlderTurnRequestRegistry = makeThreadOlderTurnRequestRegistry();
|
|
849
|
+
/**
|
|
850
|
+
* Channel from UI actions to the live per-thread state machines. The machines
|
|
851
|
+
* resolve it from the Effect environment (overridable in tests); the default
|
|
852
|
+
* instance is shared with the sync `requestOlderThreadTurns` entry point so
|
|
853
|
+
* the apps get working wiring without providing anything.
|
|
854
|
+
*/
|
|
855
|
+
var ThreadOlderTurnRequests = class extends Reference("@t3tools/client-runtime/state/threads/ThreadOlderTurnRequests", { defaultValue: () => defaultOlderTurnRequestRegistry }) {};
|
|
856
|
+
/**
|
|
857
|
+
* Asks the live state machine for `threadId` to fetch the next older page.
|
|
858
|
+
* Returns false when no machine is live or no fetch was started (no cursor,
|
|
859
|
+
* already loading); callers render from `EnvironmentThreadState.page` and can
|
|
860
|
+
* treat false as "nothing to do".
|
|
861
|
+
*/
|
|
862
|
+
function requestOlderThreadTurns(environmentId, threadId) {
|
|
863
|
+
return defaultOlderTurnRequestRegistry.request(threadKey({
|
|
864
|
+
environmentId,
|
|
865
|
+
threadId
|
|
866
|
+
}));
|
|
867
|
+
}
|
|
747
868
|
function formatThreadError(cause) {
|
|
748
869
|
const error = squash(cause);
|
|
749
870
|
return error instanceof Error && error.message.trim().length > 0 ? error.message : "Could not synchronize the thread.";
|
|
@@ -767,13 +888,18 @@ const makeEnvironmentThreadState = fn("EnvironmentThreadState.make")(function* (
|
|
|
767
888
|
const state = yield* make$1({
|
|
768
889
|
data: cachedThread,
|
|
769
890
|
status: statusWithoutLiveData(cachedThread),
|
|
770
|
-
error: none()
|
|
891
|
+
error: none(),
|
|
892
|
+
page: flatMap(cached, (snapshot) => pageStateFromSnapshot(snapshot.page))
|
|
771
893
|
});
|
|
772
894
|
const lastSequence = yield* make$1(match(cached, {
|
|
773
895
|
onNone: () => 0,
|
|
774
896
|
onSome: (snapshot) => snapshot.snapshotSequence
|
|
775
897
|
}));
|
|
776
898
|
const awaitingCompletion = yield* make$2(false);
|
|
899
|
+
const historyEpoch = yield* make$2(0);
|
|
900
|
+
const applyLock = yield* make$3(1);
|
|
901
|
+
const paginationSupported = yield* make$2(false);
|
|
902
|
+
const pendingOlderPage = yield* make$2(null);
|
|
777
903
|
const persistence = yield* sliding(1);
|
|
778
904
|
const persist = fn("EnvironmentThreadState.persist")(function* (snapshot) {
|
|
779
905
|
yield* cache.saveThread(environmentId, snapshot).pipe(catch_((error) => logWarning("Could not persist the thread cache.").pipe(annotateLogs({
|
|
@@ -795,6 +921,7 @@ const makeEnvironmentThreadState = fn("EnvironmentThreadState.make")(function* (
|
|
|
795
921
|
});
|
|
796
922
|
const setDisconnected = gen(function* () {
|
|
797
923
|
yield* set(awaitingCompletion, false);
|
|
924
|
+
yield* set(paginationSupported, false);
|
|
798
925
|
yield* update(state, (current) => ({
|
|
799
926
|
...current,
|
|
800
927
|
status: current.status === "deleted" ? current.status : statusWithoutLiveData(current.data)
|
|
@@ -805,27 +932,39 @@ const makeEnvironmentThreadState = fn("EnvironmentThreadState.make")(function* (
|
|
|
805
932
|
status: current.status === "deleted" ? current.status : statusWithoutLiveData(current.data),
|
|
806
933
|
error: some(formatThreadError(cause))
|
|
807
934
|
}))));
|
|
808
|
-
const setThread = fn("EnvironmentThreadState.setThread")(function* (thread) {
|
|
935
|
+
const setThread = fn("EnvironmentThreadState.setThread")(function* (thread, page) {
|
|
809
936
|
const waiting = yield* get(awaitingCompletion);
|
|
810
|
-
yield*
|
|
937
|
+
yield* update(state, (current) => ({
|
|
811
938
|
data: some(thread),
|
|
812
939
|
status: waiting ? "synchronizing" : "live",
|
|
813
|
-
error: none()
|
|
814
|
-
|
|
940
|
+
error: none(),
|
|
941
|
+
page: page === "keep" ? current.page : page
|
|
942
|
+
}));
|
|
815
943
|
if (shouldPersistThread(thread)) {
|
|
816
944
|
const snapshotSequence = yield* get$1(lastSequence);
|
|
945
|
+
const currentPage = yield* get$1(state).pipe(map((value) => value.page));
|
|
817
946
|
yield* offer(persistence, {
|
|
818
947
|
snapshotSequence,
|
|
819
|
-
thread
|
|
948
|
+
thread,
|
|
949
|
+
...match(currentPage, {
|
|
950
|
+
onNone: () => ({}),
|
|
951
|
+
onSome: (value) => ({ page: {
|
|
952
|
+
beforeCursor: value.beforeCursor,
|
|
953
|
+
hasMore: value.hasMore,
|
|
954
|
+
snapshotSequence
|
|
955
|
+
} })
|
|
956
|
+
})
|
|
820
957
|
});
|
|
821
958
|
}
|
|
822
959
|
});
|
|
823
960
|
const setDeleted = fn("EnvironmentThreadState.setDeleted")(function* () {
|
|
824
961
|
yield* set(awaitingCompletion, false);
|
|
962
|
+
yield* update$1(historyEpoch, (epoch) => epoch + 1);
|
|
825
963
|
yield* set$1(state, {
|
|
826
964
|
data: none(),
|
|
827
965
|
status: "deleted",
|
|
828
|
-
error: none()
|
|
966
|
+
error: none(),
|
|
967
|
+
page: none()
|
|
829
968
|
});
|
|
830
969
|
yield* cache.removeThread(environmentId, threadId).pipe(catch_((error) => logWarning("Could not remove the cached thread.").pipe(annotateLogs({
|
|
831
970
|
environmentId,
|
|
@@ -833,7 +972,7 @@ const makeEnvironmentThreadState = fn("EnvironmentThreadState.make")(function* (
|
|
|
833
972
|
error: error.message
|
|
834
973
|
}))));
|
|
835
974
|
});
|
|
836
|
-
const
|
|
975
|
+
const applyItemLocked = fn("EnvironmentThreadState.applyItemLocked")(function* (item) {
|
|
837
976
|
if (item.kind === "synchronized") {
|
|
838
977
|
yield* set(awaitingCompletion, false);
|
|
839
978
|
yield* update(state, (current) => isSome(current.data) && current.status !== "deleted" ? {
|
|
@@ -844,8 +983,9 @@ const makeEnvironmentThreadState = fn("EnvironmentThreadState.make")(function* (
|
|
|
844
983
|
return;
|
|
845
984
|
}
|
|
846
985
|
if (item.kind === "snapshot") {
|
|
986
|
+
yield* update$1(historyEpoch, (epoch) => epoch + 1);
|
|
847
987
|
yield* set$1(lastSequence, item.snapshot.snapshotSequence);
|
|
848
|
-
yield* setThread(item.snapshot.thread);
|
|
988
|
+
yield* setThread(item.snapshot.thread, pageStateFromSnapshot(item.snapshot.page));
|
|
849
989
|
return;
|
|
850
990
|
}
|
|
851
991
|
const sequence = yield* get$1(lastSequence);
|
|
@@ -856,9 +996,117 @@ const makeEnvironmentThreadState = fn("EnvironmentThreadState.make")(function* (
|
|
|
856
996
|
if (item.event.type === "thread.deleted") yield* setDeleted();
|
|
857
997
|
return;
|
|
858
998
|
}
|
|
999
|
+
if (item.event.type === "thread.reverted") yield* update$1(historyEpoch, (epoch) => epoch + 1);
|
|
859
1000
|
const result = applyThreadDetailEvent(current.data.value, item.event);
|
|
860
|
-
if (result.kind === "updated") yield* setThread(result.thread);
|
|
1001
|
+
if (result.kind === "updated") yield* setThread(result.thread, "keep");
|
|
861
1002
|
else if (result.kind === "deleted") yield* setDeleted();
|
|
1003
|
+
yield* tryMergePendingOlderPage();
|
|
1004
|
+
});
|
|
1005
|
+
const tryMergePendingOlderPage = fn("EnvironmentThreadState.tryMergePendingOlderPage")(function* () {
|
|
1006
|
+
const pending = yield* get(pendingOlderPage);
|
|
1007
|
+
if (pending === null) return;
|
|
1008
|
+
if ((yield* get(historyEpoch)) !== pending.epoch) {
|
|
1009
|
+
yield* set(pendingOlderPage, null);
|
|
1010
|
+
yield* update(state, (value) => ({
|
|
1011
|
+
...value,
|
|
1012
|
+
page: map$2(value.page, (existing) => ({
|
|
1013
|
+
...existing,
|
|
1014
|
+
loadingOlder: false
|
|
1015
|
+
}))
|
|
1016
|
+
}));
|
|
1017
|
+
return;
|
|
1018
|
+
}
|
|
1019
|
+
const watermark = pending.snapshot.page?.threadSequence;
|
|
1020
|
+
const loadedSequence = yield* get$1(lastSequence);
|
|
1021
|
+
if (watermark !== void 0 && watermark > loadedSequence) return;
|
|
1022
|
+
yield* set(pendingOlderPage, null);
|
|
1023
|
+
yield* mergeOlderPage(pending.snapshot);
|
|
1024
|
+
});
|
|
1025
|
+
const applyItem = fn("EnvironmentThreadState.applyItem")(function* (item) {
|
|
1026
|
+
yield* applyLock.withPermits(1)(applyItemLocked(item));
|
|
1027
|
+
});
|
|
1028
|
+
const mergeOlderPage = fn("EnvironmentThreadState.mergeOlderPage")(function* (snapshot) {
|
|
1029
|
+
let merged = null;
|
|
1030
|
+
yield* update(state, (value) => {
|
|
1031
|
+
if (isNone(value.data)) return value;
|
|
1032
|
+
const loaded = value.data.value;
|
|
1033
|
+
const older = snapshot.thread;
|
|
1034
|
+
const mergeById = (olderRows, loadedRows) => {
|
|
1035
|
+
const seen = new Set(loadedRows.map((row) => row.id));
|
|
1036
|
+
return [...olderRows.filter((row) => !seen.has(row.id)), ...loadedRows];
|
|
1037
|
+
};
|
|
1038
|
+
const seenCheckpoints = new Set(loaded.checkpoints.map((row) => row.turnId));
|
|
1039
|
+
merged = {
|
|
1040
|
+
...loaded,
|
|
1041
|
+
messages: mergeById(older.messages, loaded.messages),
|
|
1042
|
+
activities: mergeById(older.activities, loaded.activities),
|
|
1043
|
+
proposedPlans: mergeById(older.proposedPlans, loaded.proposedPlans),
|
|
1044
|
+
checkpoints: [...older.checkpoints.filter((row) => !seenCheckpoints.has(row.turnId)), ...loaded.checkpoints]
|
|
1045
|
+
};
|
|
1046
|
+
return {
|
|
1047
|
+
...value,
|
|
1048
|
+
data: some(merged),
|
|
1049
|
+
page: pageStateFromSnapshot(snapshot.page)
|
|
1050
|
+
};
|
|
1051
|
+
});
|
|
1052
|
+
if (merged !== null && shouldPersistThread(merged)) {
|
|
1053
|
+
const snapshotSequence = yield* get$1(lastSequence);
|
|
1054
|
+
yield* offer(persistence, {
|
|
1055
|
+
snapshotSequence,
|
|
1056
|
+
thread: merged,
|
|
1057
|
+
...snapshot.page === void 0 ? {} : { page: {
|
|
1058
|
+
...snapshot.page,
|
|
1059
|
+
snapshotSequence
|
|
1060
|
+
} }
|
|
1061
|
+
});
|
|
1062
|
+
}
|
|
1063
|
+
});
|
|
1064
|
+
const loadOlderTurns = fn("EnvironmentThreadState.loadOlderTurns")(function* () {
|
|
1065
|
+
if (!(yield* get(paginationSupported))) return;
|
|
1066
|
+
const page = getOrNull((yield* get$1(state)).page);
|
|
1067
|
+
if (page === null || page.loadingOlder || !page.hasMore || page.beforeCursor === null) return;
|
|
1068
|
+
const prepared = getOrNull(yield* get$1(supervisor.prepared));
|
|
1069
|
+
if (prepared === null) return;
|
|
1070
|
+
const epochAtStart = yield* get(historyEpoch);
|
|
1071
|
+
yield* update(state, (value) => ({
|
|
1072
|
+
...value,
|
|
1073
|
+
page: map$2(value.page, (existing) => ({
|
|
1074
|
+
...existing,
|
|
1075
|
+
loadingOlder: true
|
|
1076
|
+
}))
|
|
1077
|
+
}));
|
|
1078
|
+
const window = {
|
|
1079
|
+
turnLimit: 20,
|
|
1080
|
+
beforeCursor: page.beforeCursor
|
|
1081
|
+
};
|
|
1082
|
+
const response = yield* snapshotLoader.load(prepared, threadId, window);
|
|
1083
|
+
yield* applyLock.withPermits(1)(gen(function* () {
|
|
1084
|
+
const epochNow = yield* get(historyEpoch);
|
|
1085
|
+
const loadedSequence = yield* get$1(lastSequence);
|
|
1086
|
+
const stale = epochNow !== epochAtStart || match(response, {
|
|
1087
|
+
onNone: () => false,
|
|
1088
|
+
onSome: (snapshot) => snapshot.snapshotSequence < loadedSequence
|
|
1089
|
+
});
|
|
1090
|
+
if (isNone(response) || stale) {
|
|
1091
|
+
yield* update(state, (value) => ({
|
|
1092
|
+
...value,
|
|
1093
|
+
page: map$2(value.page, (existing) => ({
|
|
1094
|
+
...existing,
|
|
1095
|
+
loadingOlder: false
|
|
1096
|
+
}))
|
|
1097
|
+
}));
|
|
1098
|
+
return;
|
|
1099
|
+
}
|
|
1100
|
+
const watermark = response.value.page?.threadSequence;
|
|
1101
|
+
if (watermark !== void 0 && watermark > loadedSequence) {
|
|
1102
|
+
yield* set(pendingOlderPage, {
|
|
1103
|
+
snapshot: response.value,
|
|
1104
|
+
epoch: epochNow
|
|
1105
|
+
});
|
|
1106
|
+
return;
|
|
1107
|
+
}
|
|
1108
|
+
yield* mergeOlderPage(response.value);
|
|
1109
|
+
}));
|
|
862
1110
|
});
|
|
863
1111
|
yield* changes(supervisor.state).pipe(runForEach((connectionState) => {
|
|
864
1112
|
switch (connectionProjectionPhase(connectionState)) {
|
|
@@ -869,20 +1117,34 @@ const makeEnvironmentThreadState = fn("EnvironmentThreadState.make")(function* (
|
|
|
869
1117
|
}), forkScoped);
|
|
870
1118
|
const foregroundResubscriptions = match(wakeups, {
|
|
871
1119
|
onNone: () => never,
|
|
872
|
-
onSome: (service) => service.changes.pipe(filter$1(
|
|
1120
|
+
onSome: (service) => service.changes.pipe(filter$1(shouldResubscribeAfterWakeup))
|
|
873
1121
|
});
|
|
874
1122
|
yield* setSynchronizing;
|
|
875
1123
|
yield* forkScoped(subscribeDynamic(ORCHESTRATION_WS_METHODS.subscribeThread, fn("EnvironmentThreadState.makeSubscribeInput")(function* (session) {
|
|
876
|
-
const
|
|
1124
|
+
const config = yield* session.initialConfig.pipe(orElseSucceed(() => ({})));
|
|
1125
|
+
const supportsCompletionMarker = config.threadResumeCompletionMarker === true;
|
|
1126
|
+
const supportsPagination = config.threadSnapshotPagination === true;
|
|
1127
|
+
yield* set(paginationSupported, supportsPagination);
|
|
877
1128
|
yield* set(awaitingCompletion, supportsCompletionMarker);
|
|
878
1129
|
yield* setSynchronizing;
|
|
879
1130
|
let current = yield* get$1(state);
|
|
1131
|
+
if (!supportsPagination && isSome(current.page)) {
|
|
1132
|
+
yield* update$1(historyEpoch, (epoch) => epoch + 1);
|
|
1133
|
+
yield* update(state, (value) => ({
|
|
1134
|
+
...value,
|
|
1135
|
+
data: none(),
|
|
1136
|
+
status: value.status === "deleted" ? value.status : "empty",
|
|
1137
|
+
page: none()
|
|
1138
|
+
}));
|
|
1139
|
+
yield* set$1(lastSequence, 0);
|
|
1140
|
+
current = yield* get$1(state);
|
|
1141
|
+
}
|
|
880
1142
|
if (isNone(current.data) && current.status !== "deleted") {
|
|
881
|
-
const prepared = yield* get$1(supervisor.prepared).pipe(flatMap(match({
|
|
1143
|
+
const prepared = yield* get$1(supervisor.prepared).pipe(flatMap$1(match({
|
|
882
1144
|
onSome: succeed,
|
|
883
1145
|
onNone: () => changes(supervisor.prepared).pipe(filter$1(isSome), map$3((value) => value.value), runHead, map(getOrThrow))
|
|
884
1146
|
})));
|
|
885
|
-
const httpSnapshot = yield* snapshotLoader.load(prepared, threadId);
|
|
1147
|
+
const httpSnapshot = yield* snapshotLoader.load(prepared, threadId, supportsPagination ? { turnLimit: 10 } : void 0);
|
|
886
1148
|
if (isSome(httpSnapshot)) {
|
|
887
1149
|
yield* applyItem({
|
|
888
1150
|
kind: "snapshot",
|
|
@@ -901,18 +1163,37 @@ const makeEnvironmentThreadState = fn("EnvironmentThreadState.make")(function* (
|
|
|
901
1163
|
return {
|
|
902
1164
|
threadId,
|
|
903
1165
|
...canResume ? { afterSequence: sequence } : {},
|
|
904
|
-
...supportsCompletionMarker ? { requestCompletionMarker: true } : {}
|
|
1166
|
+
...supportsCompletionMarker ? { requestCompletionMarker: true } : {},
|
|
1167
|
+
...supportsPagination ? { turnLimit: 10 } : {}
|
|
905
1168
|
};
|
|
906
1169
|
}), {
|
|
907
1170
|
onExpectedFailure: setStreamError,
|
|
908
1171
|
retryExpectedFailureAfter: "250 millis",
|
|
909
1172
|
resubscribe: foregroundResubscriptions
|
|
910
1173
|
}).pipe(runForEach(applyItem)));
|
|
911
|
-
|
|
1174
|
+
const olderTurnRequestRegistry = yield* ThreadOlderTurnRequests;
|
|
1175
|
+
const olderTurnRequests = yield* sliding(1);
|
|
1176
|
+
yield* fromQueue(olderTurnRequests).pipe(runForEach(() => loadOlderTurns()), forkScoped);
|
|
1177
|
+
const deregister = olderTurnRequestRegistry.register(threadKey({
|
|
1178
|
+
environmentId,
|
|
1179
|
+
threadId
|
|
1180
|
+
}), () => {
|
|
1181
|
+
offerUnsafe(olderTurnRequests, void 0);
|
|
1182
|
+
});
|
|
1183
|
+
yield* addFinalizer(() => sync(deregister));
|
|
1184
|
+
yield* addFinalizer(() => all([get$1(state), get$1(lastSequence)]).pipe(flatMap$1(([current, snapshotSequence]) => match(current.data, {
|
|
912
1185
|
onNone: () => void_,
|
|
913
1186
|
onSome: (thread) => shouldPersistThread(thread) ? persist({
|
|
914
1187
|
snapshotSequence,
|
|
915
|
-
thread
|
|
1188
|
+
thread,
|
|
1189
|
+
...match(current.page, {
|
|
1190
|
+
onNone: () => ({}),
|
|
1191
|
+
onSome: (page) => ({ page: {
|
|
1192
|
+
beforeCursor: page.beforeCursor,
|
|
1193
|
+
hasMore: page.hasMore,
|
|
1194
|
+
snapshotSequence
|
|
1195
|
+
} })
|
|
1196
|
+
})
|
|
916
1197
|
}) : void_
|
|
917
1198
|
}))));
|
|
918
1199
|
return state;
|
|
@@ -931,4 +1212,4 @@ function createEnvironmentThreadStateAtoms(runtime) {
|
|
|
931
1212
|
})) };
|
|
932
1213
|
}
|
|
933
1214
|
//#endregion
|
|
934
|
-
export { EMPTY_ENVIRONMENT_THREAD_STATE, ThreadSnapshotLoader, applyThreadDetailEvent, createArchivedThreadSnapshotsAtomFamily, createEnvironmentThreadDetailAtoms, createEnvironmentThreadShellAtoms, createEnvironmentThreadStateAtoms, createThreadEnvironmentAtoms, fetchEnvironmentThreadSnapshot, makeArchivedThreadsEnvironmentKey, makeEnvironmentThreadState, mergeEnvironmentThread, parseArchivedThreadsEnvironmentKey, threadSnapshotLoaderLayer, threadStateChanges };
|
|
1215
|
+
export { EMPTY_ENVIRONMENT_THREAD_STATE, INITIAL_THREAD_USER_TURN_LIMIT, OLDER_THREAD_PAGE_USER_TURN_LIMIT, ThreadOlderTurnRequests, ThreadSnapshotLoader, applyThreadDetailEvent, createArchivedThreadSnapshotsAtomFamily, createEnvironmentThreadDetailAtoms, createEnvironmentThreadShellAtoms, createEnvironmentThreadStateAtoms, createThreadEnvironmentAtoms, fetchEnvironmentThreadSnapshot, makeArchivedThreadsEnvironmentKey, makeEnvironmentThreadState, mergeEnvironmentThread, parseArchivedThreadsEnvironmentKey, requestOlderThreadTurns, threadHasOlderTurns, threadSnapshotLoaderLayer, threadStateChanges };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Aa as ConnectionPersistenceError, Aw as VcsListRefsResult, CD as EnvironmentId, Cw as TextGenerationError, Da as EnvironmentSupervisor, JC as VcsProcessOutputReadError, KC as VcsProcessMissingExitCodeError, Ly as OrchestrationThreadDetailSnapshot, Na as EnvironmentCacheStore, Nw as VcsRef$1, Oy as OrchestrationShellSnapshot, QC as VcsProcessTimeoutError, Qw as SourceControlProviderError, RD as ThreadId, Rw as VcsStatusResult, Sw as GitStackedAction, Ta as EnvironmentRegistry, UC as VcsProcessExitError, YC as VcsProcessSpawnError, ZC as VcsProcessStdinWriteError, _ as AtomCommandResult, _w as GitRunStackedActionInput, cw as GitCommandError, du as ServerConfig, f as AtomCommand, iD as EnvironmentAuthorizationError, iw as GitActionProgressEvent, kw as VcsListRefsInput, lw as GitManagerError, mn as EnvironmentRpcUnavailableError, pw as GitPullRequestMaterializationError, qC as VcsProcessOutputLimitError, rw as VcsUnsupportedOperationError, tw as VcsRepositoryDetectionError, vw as GitRunStackedActionResult, wa as EnvironmentNotRegisteredError } 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";
|
|
@@ -304,9 +304,9 @@ declare function createVcsEnvironmentAtoms<R, E>(runtime: Atom.AtomRuntime<Envir
|
|
|
304
304
|
}, E | EnvironmentAuthorizationError | EnvironmentRpcUnavailableError | GitCommandError | import("effect/Cause").NoSuchElementError | import("effect/unstable/rpc/RpcClientError").RpcClientError>>;
|
|
305
305
|
status: (target: {
|
|
306
306
|
readonly environmentId: EnvironmentId;
|
|
307
|
-
readonly input:
|
|
308
|
-
readonly cwd:
|
|
309
|
-
}
|
|
307
|
+
readonly input: {
|
|
308
|
+
readonly cwd: string;
|
|
309
|
+
};
|
|
310
310
|
}) => Atom.Atom<import("effect/unstable/reactivity/AsyncResult").AsyncResult<{
|
|
311
311
|
readonly isRepo: boolean;
|
|
312
312
|
readonly sourceControlProvider?: {
|
|
@@ -342,9 +342,9 @@ declare function createVcsEnvironmentAtoms<R, E>(runtime: Atom.AtomRuntime<Envir
|
|
|
342
342
|
}, E | EnvironmentAuthorizationError | GitCommandError | GitManagerError | GitPullRequestMaterializationError | import("effect/Cause").NoSuchElementError | import("effect/unstable/rpc/RpcClientError").RpcClientError | SourceControlProviderError | TextGenerationError>>;
|
|
343
343
|
pull: AtomCommand<{
|
|
344
344
|
readonly environmentId: EnvironmentId;
|
|
345
|
-
readonly input:
|
|
346
|
-
readonly cwd:
|
|
347
|
-
}
|
|
345
|
+
readonly input: {
|
|
346
|
+
readonly cwd: string;
|
|
347
|
+
};
|
|
348
348
|
}, {
|
|
349
349
|
readonly status: "pulled" | "skipped_up_to_date";
|
|
350
350
|
readonly refName: string;
|
|
@@ -352,9 +352,9 @@ declare function createVcsEnvironmentAtoms<R, E>(runtime: Atom.AtomRuntime<Envir
|
|
|
352
352
|
}, E | EnvironmentAuthorizationError | EnvironmentNotRegisteredError | EnvironmentRpcUnavailableError | GitCommandError | import("effect/unstable/rpc/RpcClientError").RpcClientError>;
|
|
353
353
|
refreshStatus: AtomCommand<{
|
|
354
354
|
readonly environmentId: EnvironmentId;
|
|
355
|
-
readonly input:
|
|
356
|
-
readonly cwd:
|
|
357
|
-
}
|
|
355
|
+
readonly input: {
|
|
356
|
+
readonly cwd: string;
|
|
357
|
+
};
|
|
358
358
|
}, {
|
|
359
359
|
readonly isRepo: boolean;
|
|
360
360
|
readonly sourceControlProvider?: {
|
|
@@ -423,10 +423,10 @@ declare function createVcsEnvironmentAtoms<R, E>(runtime: Atom.AtomRuntime<Envir
|
|
|
423
423
|
}, E | EnvironmentAuthorizationError | EnvironmentNotRegisteredError | EnvironmentRpcUnavailableError | GitCommandError | import("effect/unstable/rpc/RpcClientError").RpcClientError>;
|
|
424
424
|
switchRef: AtomCommand<{
|
|
425
425
|
readonly environmentId: EnvironmentId;
|
|
426
|
-
readonly input:
|
|
427
|
-
readonly cwd:
|
|
428
|
-
readonly refName:
|
|
429
|
-
}
|
|
426
|
+
readonly input: {
|
|
427
|
+
readonly cwd: string;
|
|
428
|
+
readonly refName: string;
|
|
429
|
+
};
|
|
430
430
|
}, {
|
|
431
431
|
readonly refName: string | null;
|
|
432
432
|
}, E | EnvironmentAuthorizationError | EnvironmentNotRegisteredError | EnvironmentRpcUnavailableError | GitCommandError | import("effect/unstable/rpc/RpcClientError").RpcClientError>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $
|
|
1
|
+
import { $r as make, AA as fail$1, AD as TaggedErrorClass, Aj as none, Ba as safeErrorLogAttributes, Bk as gen, CA as exponential, Cw as EnvironmentId, DD as Number, DO as filterMap, Dk as catch_, ED as NullOr, FA as squash, Fy as get, Ia as EnvironmentSupervisor, Jr as runStream, KO as switchMap, LD as decodeUnknownSync, LO as retry, Ld as GitStackedAction, MA as hasInterruptsOnly, MD as Union, MO as map, NO as mapAccum, Nk as flatMap, OD as String, OO as fromEffect, Pk as fn, Py as changes, Q as applyGitStatusStreamEvent, Qr as keepAlive, St as vcsCommandScheduler, TO as empty, Tr as followStreamInEnvironment, Us as WS_METHODS, VO as runForEach, Wa as EnvironmentCacheStore, Wk as logWarning, YO as unwrap, Yr as subscribe, Zr as family, ai as failure, aj as failVoid, bA as void_, bO as changes$1, bk as as, br as createRuntimeCommand, bt as withVcsRefsPersistenceLock, cA as succeed, dj as min, ei as setIdleTTL, fA as tapError, hr as createEnvironmentRpcCommand, jD as Tuple, jj as some, jk as fail, jr as runStreamInEnvironment, kj as match, kk as ensuring, lA as suspend, lO as nowUnsafe, lj as succeed$1, nA as provideService, ni as withLabel, oi as isSuccess, pj as seconds, qr as request, ri as AtomRegistry, rt as isTemporaryWorktreeBranch, uA as sync, uO as toEpochMillis, vt as invalidateCachedVcsRefs, wA as modifyDelay, wD as Literals, wd as GitActionProgressPhase, xD as Defect, xO as concat, xt as vcsCommandConcurrency, yk as annotateLogs, yr as createEnvironmentSubscriptionAtomFamily, yt as vcsRefsCacheStateAtom } from "../../shared.js";
|
|
2
2
|
//#region upstream-t3code/packages/client-runtime/src/state/gitActions.ts
|
|
3
3
|
function buildGitActionProgressStages(input) {
|
|
4
4
|
const branchStages = input.featureBranch ? ["Preparing feature branch..."] : [];
|
package/dist/config.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $i as ConfigServiceError, $n as T3CliEnvShape, Ar as cipher_d_exports, Cr as service_d_exports, Dr as KeystoreUnavailableError, Er as service_d_exports$1, Or as EncryptedToken, Qi as ConfigError, Qn as T3CliEnvScope, Sr as service_d_exports$2, Tr as T3MasterKeyKeystoreFactory, Zi as UrlError, Zn as T3CliEnvConfig, _r as EncryptedConfig, br as UpsertEnvironmentInput, er as loadT3CliEnv, gr as config_d_exports, jr as CredentialCipherError, kr as T3CredentialCipher, vr as EnvironmentSummary, wr as MasterKeyReadResult, yr as ResolvedConfig } from "./shared.js";
|
|
2
2
|
import * as Effect from "effect/Effect";
|
|
3
3
|
import * as Option from "effect/Option";
|
|
4
4
|
import * as Layer from "effect/Layer";
|
package/dist/config.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as __exportAll } from "./rolldown-runtime.js";
|
|
2
|
-
import { $
|
|
2
|
+
import { $T as loadT3CliEnv, $w as config_exports, AT as cipher_exports, BA as succeed, Bk as gen, CT as file_exports, DT as service_exports$1, ET as resolveT3cliConfigDir, Fi as resolveT3BaseDir, Fs as cipher_node_exports, Ls as CredentialCipherError, Ms as keyring_node_exports, OT as ConfigError, Ps as KeystoreUnavailableError, QT as T3CliEnvConfig, ST as service_exports, TT as resolveKeyFilePath, aT as validateEnvironmentName, cT as toWebSocketBaseUrl, eT as service_exports$2, hA as tryPromise, iT as slugifyEnvironmentName, jT as credentialTokenFromEnv, jk as fail, kT as T3CredentialCipher, lT as toWebSocketEndpointUrl, nT as defaultEnvironmentNameFromUrl, oT as normalizeHttpBaseUrl, rT as migrateV1EnvironmentName, sT as toHttpEndpointUrl, tT as defaultEnvironmentNameForLocal, uT as UrlError, wT as resolveConfigFilePath } from "./shared.js";
|
|
3
3
|
//#region src/config/credential/cipher-web.ts
|
|
4
4
|
var cipher_web_exports = /* @__PURE__ */ __exportAll({ layerWeb: () => layerWeb });
|
|
5
5
|
const aesGcmAlgorithm = "AES-GCM";
|
package/dist/connection.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Gn as T3CodeConnectionProvider, Jn as T3CodeAuth, Kn as T3CodeConnectionProviderLive, Xi as T3CodeConnectionError, Xn as T3CodeOrigin, Yn as T3CodeConnection, qn as makeT3CodeConnectionProvider, vi as T3Rpc } from "./shared.js";
|
|
2
2
|
import * as Layer from "effect/Layer";
|
|
3
3
|
//#region src/connection/layer.d.ts
|
|
4
4
|
declare function makeT3CodeRpcLayer(): Layer.Layer<T3Rpc, never, import("effect/unstable/http/HttpClient").HttpClient | T3CodeConnectionProvider | import("effect/unstable/socket/Socket").WebSocketConstructor>;
|
package/dist/connection.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fn as T3CodeRpcLayer, In as makeT3CodeRpcLayer, ci as T3CodeConnectionProvider, li as T3CodeConnectionProviderLive, na as T3CodeConnectionError, ui as makeT3CodeConnectionProvider } from "./shared.js";
|
|
2
2
|
export { T3CodeConnectionError, T3CodeConnectionProvider, T3CodeConnectionProviderLive, T3CodeRpcLayer, makeT3CodeConnectionProvider, makeT3CodeRpcLayer };
|