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
package/dist/rpc.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $i as makeT3RpcOperations, Qi as T3RpcOperationsLive, Xn as makeT3RpcLayer, Yn as T3RpcLive, Zi as T3RpcOperations, ea as T3Rpc, ta as RpcError } from "./shared.js";
|
|
2
2
|
export { RpcError, T3Rpc, T3RpcLive, T3RpcOperations, T3RpcOperationsLive, makeT3RpcLayer, makeT3RpcOperations };
|
package/dist/runtime.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { An as
|
|
1
|
+
import { An as AppLayer, Bn as T3OrchestrationLayer, Fn as T3AuthPairingLayer, In as T3AuthTransportLayer, Ln as T3LocalAuthLayer, Mn as BaseAppLayer, Nn as BaseAuthAppLayer, Pn as T3AuthLayer, Rn as T3LocalAuthOriginLayer, Vn as T3PreviewAutomationLayer, jn as AuthAppLayer, zn as T3LocalAuthTokenLayer } from "./shared.js";
|
|
2
2
|
export { AppLayer, AuthAppLayer, BaseAppLayer, BaseAuthAppLayer, T3AuthLayer, T3AuthPairingLayer, T3AuthTransportLayer, T3LocalAuthLayer, T3LocalAuthOriginLayer, T3LocalAuthTokenLayer, T3OrchestrationLayer, T3PreviewAutomationLayer };
|
package/dist/runtime.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Bn as
|
|
1
|
+
import { Bn as BaseAuthAppLayer, Gn as T3LocalAuthOriginLayer, Hn as T3AuthPairingLayer, Jn as T3PreviewAutomationLayer, Kn as T3LocalAuthTokenLayer, Ln as AppLayer, Rn as AuthAppLayer, Un as T3AuthTransportLayer, Vn as T3AuthLayer, Wn as T3LocalAuthLayer, qn as T3OrchestrationLayer, zn as BaseAppLayer } from "./shared.js";
|
|
2
2
|
export { AppLayer, AuthAppLayer, BaseAppLayer, BaseAuthAppLayer, T3AuthLayer, T3AuthPairingLayer, T3AuthTransportLayer, T3LocalAuthLayer, T3LocalAuthOriginLayer, T3LocalAuthTokenLayer, T3OrchestrationLayer, T3PreviewAutomationLayer };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ay as get, Bk as gen, Dy as shutdown, Ey as offer, Lk as forever, Ny as update, Oy as take, _A as tx, bA as void_, dA as tap, hk as acquireRelease, jy as make, kk as ensuring, ky as unbounded, vA as txRetry, zk as forkScoped } from "../shared.js";
|
|
2
2
|
//#region upstream-t3code/packages/shared/src/DrainableWorker.ts
|
|
3
3
|
/**
|
|
4
4
|
* Create a drainable worker that processes items from an unbounded queue.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ay as get, Bk as gen, Ck as catchCause, Dy as shutdown, Ey as offer, Lk as forever, My as modify, Nk as flatMap, Oy as take, _A as tx, bA as void_, dA as tap, hk as acquireRelease, jy as make, ky as unbounded, vA as txRetry, xk as asVoid, zk as forkScoped } from "../shared.js";
|
|
2
2
|
//#region upstream-t3code/packages/shared/src/KeyedCoalescingWorker.ts
|
|
3
3
|
const makeKeyedCoalescingWorker = (options) => gen(function* () {
|
|
4
4
|
const queue = yield* acquireRelease(unbounded(), shutdown);
|
package/dist/shared/Net.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Bj as hasProperty, Bk as gen, Gj as isString, SA as zipWith, Sk as callback, VA as sync$1, Wj as isObject, cA as succeed, hj as Service, jk as fail, kA as TaggedError, uA as sync } from "../shared.js";
|
|
2
2
|
import * as NodeNet from "node:net";
|
|
3
3
|
//#region upstream-t3code/packages/shared/src/Net.ts
|
|
4
4
|
var NetError = class extends TaggedError("NetError") {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Dn as createAdvertisedEndpoint, En as classifyHostedHttpsCompatibility, On as deriveWsBaseUrl, Tn as CreateAdvertisedEndpointInput, kn as normalizeHttpBaseUrl } from "../shared.js";
|
|
2
2
|
export { CreateAdvertisedEndpointInput, classifyHostedHttpsCompatibility, createAdvertisedEndpoint, deriveWsBaseUrl, normalizeHttpBaseUrl };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Go as createAdvertisedEndpoint, Ko as deriveWsBaseUrl, Wo as classifyHostedHttpsCompatibility, qo as normalizeHttpBaseUrl } from "../shared.js";
|
|
2
2
|
export { classifyHostedHttpsCompatibility, createAdvertisedEndpoint, deriveWsBaseUrl, normalizeHttpBaseUrl };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CD as EnvironmentId, RD as ThreadId, Vy as OrchestrationThreadShell, vy as OrchestrationProjectShell } from "../shared.js";
|
|
2
2
|
//#region upstream-t3code/packages/shared/src/agentAwareness.d.ts
|
|
3
3
|
type AgentAwarenessPhase = "starting" | "running" | "waiting_for_approval" | "waiting_for_input" | "completed" | "failed" | "stale";
|
|
4
4
|
interface AgentAwarenessState {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b_ as BackgroundActivitySettings, v_ as BackgroundActivityProfile, vv as ServerSettings } from "../shared.js";
|
|
2
2
|
import * as Duration from "effect/Duration";
|
|
3
3
|
//#region upstream-t3code/packages/shared/src/backgroundActivitySettings.d.ts
|
|
4
4
|
interface ResolvedBackgroundActivitySettings {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
//#region upstream-t3code/packages/shared/src/composerInlineTokens.ts
|
|
2
2
|
const SKILL_TOKEN_REGEX = /(^|\s)\$([a-zA-Z][a-zA-Z0-9:_-]*)(?=\s)/g;
|
|
3
3
|
const MENTION_TOKEN_REGEX = /(^|\s)@(?:"((?:\\.|[^"\\])*)"|([^\s@"]+))(?=\s)/g;
|
|
4
|
-
const FILE_LINK_TOKEN_REGEX =
|
|
4
|
+
const FILE_LINK_TOKEN_REGEX = new RegExp(`(^|\\s)\\[((?:\\\\.|[^\\]\\\\]){0,512})\\]\\(([^)\\s]+)\\)(?=\\s)`, "g");
|
|
5
5
|
const URI_SCHEME_REGEX = /^[A-Za-z][A-Za-z0-9+.-]*:/;
|
|
6
6
|
const WINDOWS_DRIVE_PATH_REGEX = /^[A-Za-z]:[\\/]/;
|
|
7
7
|
const SCOPED_PACKAGE_REFERENCE_REGEX = /^[a-z0-9][a-z0-9._-]*\/[a-z0-9][a-z0-9._-]*(?:\/[^\s@"]+)*$/;
|
package/dist/shared/devHome.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $k as orElseSucceed, Bk as gen, Dj as isSome, Zk as option, fO as Path, mO as FileSystem } from "../shared.js";
|
|
2
2
|
//#region upstream-t3code/packages/shared/src/devHome.ts
|
|
3
3
|
/**
|
|
4
4
|
* Where development state lives, and how to keep it away from the shared
|
package/dist/shared/dpop.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BD as isNonEmpty, CD as Literal, Ej as isNone, HD as optionalKey, ID as decodeUnknownOption, OD as String$1, RD as fromJsonString, SD as Int, TD as Never, aO as decodeBase64Url, kD as Struct, n as normalizeDpopHtu, oO as decodeBase64UrlString, oj as getOrThrow, r as stableStringify, sO as encodeBase64Url, t as DpopPublicJwk$1 } from "../shared.js";
|
|
2
2
|
import * as nc from "node:crypto";
|
|
3
3
|
//#region node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/cryptoNode.js
|
|
4
4
|
/**
|
package/dist/shared/git.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $
|
|
1
|
+
import { $w as SourceControlProviderInfo, Iw as VcsStatusLocalResult, Lw as VcsStatusRemoteResult, Nw as VcsRef, Rw as VcsStatusResult, zw as VcsStatusStreamEvent } from "../shared.js";
|
|
2
2
|
//#region upstream-t3code/packages/shared/src/git.d.ts
|
|
3
3
|
declare const WORKTREE_BRANCH_PREFIX = "t3code";
|
|
4
4
|
/**
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ho as httpHeaderRedactionLayer } from "../shared.js";
|
|
2
2
|
export { httpHeaderRedactionLayer };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Bk as gen, EA as upTo, Kk as mapError, Pk as fn, TA as spaced, Uk as logDebug, Vk as ignore, Wk as logWarning, _T as get, bT as set, cA as succeed, dT as HttpClient, fA as tapError, fT as filterStatusOk, hT as transform, jk as fail, kj as match, mT as tap, pA as timeoutOption, pT as retry, uj as millis, vT as get$1, yT as make } from "../shared.js";
|
|
2
2
|
//#region upstream-t3code/packages/shared/src/httpReadiness.ts
|
|
3
3
|
const DEFAULT_HTTP_READY_PROBE_TIMEOUT_MS = 1e3;
|
|
4
4
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ld as ResolvedKeybindingRule, Rd as ResolvedKeybindingsConfig, Sd as KeybindingShortcut, Td as KeybindingWhenNode, xd as KeybindingRule } from "../shared.js";
|
|
2
2
|
//#region upstream-t3code/packages/shared/src/keybindings.d.ts
|
|
3
3
|
declare const DEFAULT_KEYBINDINGS: ReadonlyArray<KeybindingRule>;
|
|
4
4
|
declare function parseKeybindingShortcut(value: string): KeybindingShortcut | null;
|
|
@@ -6,7 +6,7 @@ declare function parseKeybindingWhenExpression(expression: string): KeybindingWh
|
|
|
6
6
|
declare function compileResolvedKeybindingRule(rule: KeybindingRule): ResolvedKeybindingRule | null;
|
|
7
7
|
declare function compileResolvedKeybindingsConfig(config: ReadonlyArray<KeybindingRule>): ResolvedKeybindingsConfig;
|
|
8
8
|
declare const DEFAULT_RESOLVED_KEYBINDINGS: readonly {
|
|
9
|
-
readonly command: "chat.new" | "chat.newLocal" | "commandPalette.toggle" | "composer.stash" | "diff.toggle" | "editor.openFavorite" | "modelPicker.jump.1" | "modelPicker.jump.2" | "modelPicker.jump.3" | "modelPicker.jump.4" | "modelPicker.jump.5" | "modelPicker.jump.6" | "modelPicker.jump.7" | "modelPicker.jump.8" | "modelPicker.jump.9" | "modelPicker.toggle" | "preview.focusUrl" | "preview.refresh" | "preview.resetZoom" | "preview.toggle" | "preview.zoomIn" | "preview.zoomOut" | "rightPanel.toggle" | "sidebar.toggle" | "terminal.close" | "terminal.new" | "terminal.split" | "terminal.splitVertical" | "terminal.toggle" | "thread.jump.1" | "thread.jump.2" | "thread.jump.3" | "thread.jump.4" | "thread.jump.5" | "thread.jump.6" | "thread.jump.7" | "thread.jump.8" | "thread.jump.9" | "thread.next" | "thread.previous" | `script.${string}.run`;
|
|
9
|
+
readonly command: "chat.new" | "chat.newLocal" | "commandPalette.toggle" | "composer.stash" | "diff.toggle" | "editor.openFavorite" | "filePicker.toggle" | "modelPicker.jump.1" | "modelPicker.jump.2" | "modelPicker.jump.3" | "modelPicker.jump.4" | "modelPicker.jump.5" | "modelPicker.jump.6" | "modelPicker.jump.7" | "modelPicker.jump.8" | "modelPicker.jump.9" | "modelPicker.toggle" | "preview.focusUrl" | "preview.refresh" | "preview.resetZoom" | "preview.toggle" | "preview.zoomIn" | "preview.zoomOut" | "projectSearch.toggle" | "rightPanel.toggle" | "sidebar.toggle" | "terminal.close" | "terminal.new" | "terminal.split" | "terminal.splitVertical" | "terminal.toggle" | "themeEditor.toggle" | "thread.jump.1" | "thread.jump.2" | "thread.jump.3" | "thread.jump.4" | "thread.jump.5" | "thread.jump.6" | "thread.jump.7" | "thread.jump.8" | "thread.jump.9" | "thread.next" | "thread.previous" | `script.${string}.run`;
|
|
10
10
|
readonly shortcut: {
|
|
11
11
|
readonly key: string;
|
|
12
12
|
readonly metaKey: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ph as MODEL_PICKER_JUMP_KEYBINDING_COMMANDS, zh as THREAD_JUMP_KEYBINDING_COMMANDS } from "../shared.js";
|
|
2
2
|
//#region upstream-t3code/packages/shared/src/keybindings.ts
|
|
3
3
|
const DEFAULT_KEYBINDINGS = [
|
|
4
4
|
{
|
|
@@ -77,6 +77,20 @@ const DEFAULT_KEYBINDINGS = [
|
|
|
77
77
|
command: "commandPalette.toggle",
|
|
78
78
|
when: "!terminalFocus"
|
|
79
79
|
},
|
|
80
|
+
{
|
|
81
|
+
key: "mod+p",
|
|
82
|
+
command: "filePicker.toggle",
|
|
83
|
+
when: "!terminalFocus"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
key: "mod+shift+f",
|
|
87
|
+
command: "projectSearch.toggle",
|
|
88
|
+
when: "!terminalFocus"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
key: "mod+alt+shift+t",
|
|
92
|
+
command: "themeEditor.toggle"
|
|
93
|
+
},
|
|
80
94
|
{
|
|
81
95
|
key: "mod+s",
|
|
82
96
|
command: "composer.stash",
|
package/dist/shared/model.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Hm as ProviderInstanceId, Im as ProviderDriverKind, Wv as ModelSelection, Zd as ModelCapabilities, rf as ProviderOptionSelection, tf as ProviderOptionDescriptor } from "../shared.js";
|
|
2
2
|
//#region upstream-t3code/packages/shared/src/model.d.ts
|
|
3
3
|
interface SelectableModelOption {
|
|
4
4
|
slug: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Jo as OAuthScopeEncodingError, Qo as parseOAuthScope, Xo as oauthScopeSetEquals, Yo as encodeOAuthScope, Zo as parseAllowedOAuthScope } from "../shared.js";
|
|
2
2
|
export { OAuthScopeEncodingError, encodeOAuthScope, oauthScopeSetEquals, parseAllowedOAuthScope, parseOAuthScope };
|
|
@@ -92,6 +92,13 @@ interface SerializableSpan {
|
|
|
92
92
|
readonly events: ReadonlyArray<readonly [name: string, startTime: bigint, attributes: Record<string, unknown>]>;
|
|
93
93
|
}
|
|
94
94
|
declare function compactTraceAttributes(attributes: Readonly<Record<string, unknown>>): TraceAttributes;
|
|
95
|
+
/**
|
|
96
|
+
* Clamps oversized attribute values on the serialized trace record so the file
|
|
97
|
+
* sink stays small, including strings nested inside arrays and objects (e.g.
|
|
98
|
+
* error stacks). Returns a new record when anything was clamped; never
|
|
99
|
+
* mutates the input (the live span's attributes are shared with other tracers).
|
|
100
|
+
*/
|
|
101
|
+
declare function truncateTraceAttributes(attributes: TraceAttributes): TraceAttributes;
|
|
95
102
|
declare function spanToTraceRecord(span: SerializableSpan): EffectTraceRecord;
|
|
96
103
|
declare const makeTraceSink: (options: TraceSinkOptions) => Effect.Effect<{
|
|
97
104
|
filePath: string;
|
|
@@ -102,4 +109,4 @@ declare const makeTraceSink: (options: TraceSinkOptions) => Effect.Effect<{
|
|
|
102
109
|
declare const makeLocalFileTracer: (options: LocalFileTracerOptions) => Effect.Effect<Tracer.Tracer, never, import("effect/Scope").Scope>;
|
|
103
110
|
declare function decodeOtlpTraceRecords(payload: OtlpTracer.TraceData): ReadonlyArray<OtlpTraceRecord>;
|
|
104
111
|
//#endregion
|
|
105
|
-
export { EffectTraceRecord, LocalFileTracerOptions, OtlpTraceRecord, TraceAttributes, TraceRecord, TraceRecordEvent, TraceRecordLink, TraceSink, TraceSinkFlushStats, TraceSinkOptions, causeErrorTag, compactTraceAttributes, decodeOtlpTraceRecords, errorTag, makeLocalFileTracer, makeTraceSink, spanToTraceRecord };
|
|
112
|
+
export { EffectTraceRecord, LocalFileTracerOptions, OtlpTraceRecord, TraceAttributes, TraceRecord, TraceRecordEvent, TraceRecordLink, TraceSink, TraceSinkFlushStats, TraceSinkOptions, causeErrorTag, compactTraceAttributes, decodeOtlpTraceRecords, errorTag, makeLocalFileTracer, makeTraceSink, spanToTraceRecord, truncateTraceAttributes };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $
|
|
1
|
+
import { $A as make, D as RotatingFileSink, Dj as isSome, Lk as forever, MA as hasInterruptsOnly, Nk as flatMap, PA as pretty, Pk as fn, QA as NativeSpan, Tj as getOrUndefined, Vk as ignore, XA as isSuccess, bA as void_, gk as addFinalizer, jA as findErrorOption, sA as sleep, uA as sync, vk as andThen, xA as withTracerEnabled, zk as forkScoped } from "../shared.js";
|
|
2
2
|
//#region upstream-t3code/packages/shared/src/observability.ts
|
|
3
3
|
const FLUSH_BUFFER_THRESHOLD = 256;
|
|
4
4
|
const textEncoder = new TextEncoder();
|
|
@@ -68,6 +68,50 @@ function formatTraceExit(exit) {
|
|
|
68
68
|
cause: pretty(exit.cause)
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
|
+
const TRACE_ATTRIBUTE_MAX_LENGTH = 500;
|
|
72
|
+
const TRACE_ATTRIBUTE_TRUNCATED_LENGTH = 200;
|
|
73
|
+
const TRACE_ATTRIBUTE_TRUNCATION_SUFFIX = "…[truncated]";
|
|
74
|
+
const ALWAYS_TRUNCATED_TRACE_ATTRIBUTES = /* @__PURE__ */ new Set(["db.query.text"]);
|
|
75
|
+
function truncateNestedValue(value) {
|
|
76
|
+
if (typeof value === "string") return value.length <= TRACE_ATTRIBUTE_MAX_LENGTH ? value : `${value.slice(0, TRACE_ATTRIBUTE_MAX_LENGTH)}${TRACE_ATTRIBUTE_TRUNCATION_SUFFIX}`;
|
|
77
|
+
if (Array.isArray(value)) {
|
|
78
|
+
const truncated = value.map(truncateNestedValue);
|
|
79
|
+
return truncated.some((entry, index) => entry !== value[index]) ? truncated : value;
|
|
80
|
+
}
|
|
81
|
+
if (isPlainObject(value)) {
|
|
82
|
+
let truncated;
|
|
83
|
+
for (const [key, entry] of Object.entries(value)) {
|
|
84
|
+
const next = truncateNestedValue(entry);
|
|
85
|
+
if (next === entry) continue;
|
|
86
|
+
truncated ??= { ...value };
|
|
87
|
+
truncated[key] = next;
|
|
88
|
+
}
|
|
89
|
+
return truncated ?? value;
|
|
90
|
+
}
|
|
91
|
+
return value;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Clamps oversized attribute values on the serialized trace record so the file
|
|
95
|
+
* sink stays small, including strings nested inside arrays and objects (e.g.
|
|
96
|
+
* error stacks). Returns a new record when anything was clamped; never
|
|
97
|
+
* mutates the input (the live span's attributes are shared with other tracers).
|
|
98
|
+
*/
|
|
99
|
+
function truncateTraceAttributes(attributes) {
|
|
100
|
+
let truncated;
|
|
101
|
+
for (const [key, value] of Object.entries(attributes)) {
|
|
102
|
+
if (typeof value === "string" && ALWAYS_TRUNCATED_TRACE_ATTRIBUTES.has(key)) {
|
|
103
|
+
if (value.length <= TRACE_ATTRIBUTE_TRUNCATED_LENGTH) continue;
|
|
104
|
+
truncated ??= { ...attributes };
|
|
105
|
+
truncated[key] = `${value.slice(0, TRACE_ATTRIBUTE_TRUNCATED_LENGTH)}${TRACE_ATTRIBUTE_TRUNCATION_SUFFIX}`;
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
const next = truncateNestedValue(value);
|
|
109
|
+
if (next === value) continue;
|
|
110
|
+
truncated ??= { ...attributes };
|
|
111
|
+
truncated[key] = next;
|
|
112
|
+
}
|
|
113
|
+
return truncated ?? attributes;
|
|
114
|
+
}
|
|
71
115
|
function spanToTraceRecord(span) {
|
|
72
116
|
const status = span.status;
|
|
73
117
|
const parentSpanId = getOrUndefined(span.parent)?.spanId;
|
|
@@ -82,16 +126,16 @@ function spanToTraceRecord(span) {
|
|
|
82
126
|
startTimeUnixNano: String(status.startTime),
|
|
83
127
|
endTimeUnixNano: String(status.endTime),
|
|
84
128
|
durationMs: Number(status.endTime - status.startTime) / 1e6,
|
|
85
|
-
attributes: compactTraceAttributes(Object.fromEntries(span.attributes)),
|
|
129
|
+
attributes: truncateTraceAttributes(compactTraceAttributes(Object.fromEntries(span.attributes))),
|
|
86
130
|
events: span.events.map(([name, startTime, attributes]) => ({
|
|
87
131
|
name,
|
|
88
132
|
timeUnixNano: String(startTime),
|
|
89
|
-
attributes: compactTraceAttributes(attributes)
|
|
133
|
+
attributes: truncateTraceAttributes(compactTraceAttributes(attributes))
|
|
90
134
|
})),
|
|
91
135
|
links: span.links.map((link) => ({
|
|
92
136
|
traceId: link.span.traceId,
|
|
93
137
|
spanId: link.span.spanId,
|
|
94
|
-
attributes: compactTraceAttributes(link.attributes)
|
|
138
|
+
attributes: truncateTraceAttributes(compactTraceAttributes(link.attributes))
|
|
95
139
|
})),
|
|
96
140
|
exit: formatTraceExit(status.exit)
|
|
97
141
|
};
|
|
@@ -343,4 +387,4 @@ function parseBigInt(input) {
|
|
|
343
387
|
}
|
|
344
388
|
}
|
|
345
389
|
//#endregion
|
|
346
|
-
export { causeErrorTag, compactTraceAttributes, decodeOtlpTraceRecords, errorTag, makeLocalFileTracer, makeTraceSink, spanToTraceRecord };
|
|
390
|
+
export { causeErrorTag, compactTraceAttributes, decodeOtlpTraceRecords, errorTag, makeLocalFileTracer, makeTraceSink, spanToTraceRecord, truncateTraceAttributes };
|
package/dist/shared/path.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { an as
|
|
1
|
+
import { an as isExplicitRelativePath, cn as isWindowsDrivePath, ln as normalizeProjectPathForComparison, on as isUncPath, sn as isWindowsAbsolutePath, un as normalizeProjectPathForDispatch } from "../shared.js";
|
|
2
2
|
export { isExplicitRelativePath, isUncPath, isWindowsAbsolutePath, isWindowsDrivePath, normalizeProjectPathForComparison, normalizeProjectPathForDispatch };
|
package/dist/shared/preview.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AD as TaggedErrorClass, DD as Number, OD as String, VD as optional, wD as Literals, xD as Defect, zD as is } from "../shared.js";
|
|
2
2
|
//#region upstream-t3code/packages/shared/src/preview.ts
|
|
3
3
|
/**
|
|
4
4
|
* Pure URL helpers shared between the preview server, desktop main process,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { bx as PreviewAutomationResizeInput, cS as PreviewViewportPresetId, lS as PreviewViewportSetting } from "../shared.js";
|
|
2
2
|
//#region upstream-t3code/packages/shared/src/previewViewport.d.ts
|
|
3
3
|
interface PreviewViewportPreset {
|
|
4
4
|
readonly id: PreviewViewportPresetId;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
//#region upstream-t3code/packages/shared/src/projectFavicon.d.ts
|
|
2
2
|
declare const PROJECT_FAVICON_FALLBACK_MARKER = "project-favicon-missing";
|
|
3
|
+
declare function getProjectFaviconCacheKey(environmentId: string, workspaceRoot: string, url: string): string;
|
|
3
4
|
declare function isProjectFaviconFallbackUrl(url: string | null | undefined): boolean;
|
|
4
5
|
//#endregion
|
|
5
|
-
export { PROJECT_FAVICON_FALLBACK_MARKER, isProjectFaviconFallbackUrl };
|
|
6
|
+
export { PROJECT_FAVICON_FALLBACK_MARKER, getProjectFaviconCacheKey, isProjectFaviconFallbackUrl };
|
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
//#region upstream-t3code/packages/shared/src/projectFavicon.ts
|
|
2
2
|
const PROJECT_FAVICON_FALLBACK_MARKER = "project-favicon-missing";
|
|
3
|
+
function getProjectFaviconCacheKey(environmentId, workspaceRoot, url) {
|
|
4
|
+
let revision = url;
|
|
5
|
+
try {
|
|
6
|
+
const pathname = new URL(url, "https://t3.invalid").pathname;
|
|
7
|
+
revision = pathname.slice(pathname.lastIndexOf("/") + 1);
|
|
8
|
+
} catch {}
|
|
9
|
+
return JSON.stringify([
|
|
10
|
+
environmentId,
|
|
11
|
+
workspaceRoot,
|
|
12
|
+
revision
|
|
13
|
+
]);
|
|
14
|
+
}
|
|
3
15
|
function isProjectFaviconFallbackUrl(url) {
|
|
4
16
|
if (!url) return false;
|
|
5
17
|
try {
|
|
@@ -10,4 +22,4 @@ function isProjectFaviconFallbackUrl(url) {
|
|
|
10
22
|
}
|
|
11
23
|
}
|
|
12
24
|
//#endregion
|
|
13
|
-
export { PROJECT_FAVICON_FALLBACK_MARKER, isProjectFaviconFallbackUrl };
|
|
25
|
+
export { PROJECT_FAVICON_FALLBACK_MARKER, getProjectFaviconCacheKey, isProjectFaviconFallbackUrl };
|
package/dist/shared/relayAuth.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AD as TaggedErrorClass, OD as String, VD as optional, wD as Literals, xD as Defect } from "../shared.js";
|
|
2
2
|
//#region upstream-t3code/packages/shared/src/relayAuth.ts
|
|
3
3
|
const ClerkPublishableKeyPrefix = Literals([
|
|
4
4
|
"pk_test",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Aj as none, Bk as gen, DA as currentTimeMillis, Dj as isSome, Dk as catch_, Ej as isNone, GD as Crypto, IA as effect, Kk as mapError, Nk as flatMap$1, Pk as fn, QD as ChildProcessSpawner, Qk as orDie, Tj as getOrUndefined, Tk as catchTag, Vk as ignore, XD as make$1, Zk as option$1, _T as get, aA as scoped, bA as void_, bk as as, cA as succeed, cO as encodeHex, dT as HttpClient, ek as make, fD as all, fO as Path, gT as filterStatusOk, hD as string, hj as Service, jj as some, jk as fail, kA as TaggedError, kk as ensuring, lA as suspend, mD as option, mO as FileSystem, pD as map, sA as sleep, vj as flatMap, w as HostProcessPlatform, y as HostProcessArchitecture } from "../shared.js";
|
|
2
2
|
//#region upstream-t3code/packages/shared/src/relayClient.ts
|
|
3
3
|
const CLOUDFLARED_VERSION = "2026.5.2";
|
|
4
4
|
const CLOUDFLARED_PATH_ENV_NAME = "T3CODE_CLOUDFLARED_PATH";
|
package/dist/shared/relayJwt.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ao as RELAY_ACTIVITY_PUBLISH_TYP, co as RELAY_LINK_PROOF_TYP, do as RelayJwtError, fo as decodeRelayJwt, ho as verifyRelayJwt, lo as RELAY_MINT_REQUEST_TYP, mo as signRelayJwt, oo as RELAY_HEALTH_REQUEST_TYP, po as normalizeRelayIssuer, so as RELAY_HEALTH_RESPONSE_TYP, uo as RELAY_MINT_RESPONSE_TYP } from "../shared.js";
|
|
2
2
|
export { RELAY_ACTIVITY_PUBLISH_TYP, RELAY_HEALTH_REQUEST_TYP, RELAY_HEALTH_RESPONSE_TYP, RELAY_LINK_PROOF_TYP, RELAY_MINT_REQUEST_TYP, RELAY_MINT_RESPONSE_TYP, RelayJwtError, decodeRelayJwt, normalizeRelayIssuer, signRelayJwt, verifyRelayJwt };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $o as RelayClientTracer, es as makeRelayClientTracingLayer, ts as withRelayClientTracing } from "../shared.js";
|
|
2
2
|
export { RelayClientTracer, makeRelayClientTracingLayer, withRelayClientTracing };
|
package/dist/shared/relayUrl.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { io as normalizeSecureRelayUrl, ro as isSecureRelayUrl } from "../shared.js";
|
|
2
2
|
export { isSecureRelayUrl, normalizeSecureRelayUrl };
|
package/dist/shared/remote.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Aa as resolveRemotePairingTarget, Ca as RemotePairingCodeMissingError, Da as getPairingTokenFromUrl, Ea as RemotePairingUrlInvalidError, Ma as stripPairingTokenFromUrl, Oa as readHashParams, Sa as RemoteBackendUrlMissingError, Ta as RemotePairingTokenMissingError, ja as setPairingTokenOnUrl, ka as readHostedPairingRequest, wa as RemotePairingTargetError, xa as RemoteBackendUrlInvalidError } from "../shared.js";
|
|
2
2
|
export { RemoteBackendUrlInvalidError, RemoteBackendUrlMissingError, RemotePairingCodeMissingError, RemotePairingTargetError, RemotePairingTokenMissingError, RemotePairingUrlInvalidError, getPairingTokenFromUrl, readHashParams, readHostedPairingRequest, resolveRemotePairingTarget, setPairingTokenOnUrl, stripPairingTokenFromUrl };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as __toESM } from "../rolldown-runtime.js";
|
|
2
|
-
import {
|
|
2
|
+
import { OD as String, PD as decodeTo, dO as InvalidValue, gA as try_, iO as transformOrFail, oD as require_dist, rO as Transformation } from "../shared.js";
|
|
3
3
|
//#region upstream-t3code/packages/shared/src/schemaYaml.ts
|
|
4
4
|
var import_dist = /* @__PURE__ */ __toESM(require_dist(), 1);
|
|
5
5
|
function formatYamlParseError(error) {
|
|
@@ -34,7 +34,7 @@ function formatYamlParseError(error) {
|
|
|
34
34
|
function parseYaml(options) {
|
|
35
35
|
return transformOrFail((input) => try_({
|
|
36
36
|
try: () => (0, import_dist.parse)(input, options),
|
|
37
|
-
catch: (error) => new InvalidValue(
|
|
37
|
+
catch: (error) => new InvalidValue({ message: formatYamlParseError(error) })
|
|
38
38
|
}));
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
@@ -63,7 +63,7 @@ function parseYaml(options) {
|
|
|
63
63
|
function stringifyYaml(options) {
|
|
64
64
|
return transformOrFail((input) => try_({
|
|
65
65
|
try: () => (0, import_dist.stringify)(input, options),
|
|
66
|
-
catch: () => new InvalidValue(
|
|
66
|
+
catch: () => new InvalidValue({ message: "Failed to stringify YAML." })
|
|
67
67
|
}));
|
|
68
68
|
}
|
|
69
69
|
/**
|
package/dist/shared/semver.js
CHANGED
|
@@ -7,7 +7,7 @@ function normalizeSemverVersion(version) {
|
|
|
7
7
|
const trimmed = segment.trim();
|
|
8
8
|
if (trimmed.length > 0) segments.push(trimmed);
|
|
9
9
|
}
|
|
10
|
-
|
|
10
|
+
while (segments.length > 0 && segments.length < 3) segments.push("0");
|
|
11
11
|
return prerelease ? `${segments.join(".")}-${prerelease}` : segments.join(".");
|
|
12
12
|
}
|
|
13
13
|
function parseSemver(value) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Iu as ServerProvider, Wv as ModelSelection, vv as ServerSettings, xv as ServerSettingsPatch } from "../shared.js";
|
|
2
2
|
//#region upstream-t3code/packages/shared/src/serverSettings.d.ts
|
|
3
3
|
declare function isModelSelectionProviderEnabled(settings: ServerSettings, selection: ModelSelection): boolean;
|
|
4
4
|
declare function resolveSourceControlWriterModelSelection(settings: ServerSettings, providers?: ReadonlyArray<ServerProvider>): ModelSelection;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $p as isProviderAvailable, Dj as isSome, ID as decodeUnknownOption, N as createModelSelection, Xm as ServerSettings, c as resolveBackgroundActivitySettings, g as fromLenientJson, i as getBackgroundActivityBaseProfile, o as normalizeBackgroundActivitySettings, s as normalizeServerBackgroundActivitySettings, u as deepMerge, vw as isProviderDriverKind } from "../shared.js";
|
|
2
2
|
const decodeServerSettingsJson = decodeUnknownOption(fromLenientJson(ServerSettings));
|
|
3
3
|
const getLegacyProviderSettings = (settings, provider) => settings.providers[provider];
|
|
4
4
|
function isModelSelectionProviderEnabled(settings, selection) {
|
package/dist/shared/shell.d.ts
CHANGED
|
@@ -42,10 +42,15 @@ declare const CommandAvailability: Context.Reference<CommandAvailabilityChecker>
|
|
|
42
42
|
declare function readEnvironmentFromWindowsShell(names: ReadonlyArray<string>, execFile?: ExecFileSyncLike): Partial<Record<string, string>>;
|
|
43
43
|
declare function readEnvironmentFromWindowsShell(names: ReadonlyArray<string>, options?: WindowsEnvironmentProbeOptions, execFile?: ExecFileSyncLike): Partial<Record<string, string>>;
|
|
44
44
|
declare function mergePathValues(preferredPath: string | undefined, inheritedPath: string | undefined, platform: NodeJS.Platform): string | undefined;
|
|
45
|
+
interface CommandResolutionCacheEntry {
|
|
46
|
+
readonly resolvedPath: string | null;
|
|
47
|
+
readonly expiresAtNanos: bigint;
|
|
48
|
+
}
|
|
49
|
+
declare const CommandResolutionCache: Context.Reference<Map<string, CommandResolutionCacheEntry>>;
|
|
45
50
|
declare const resolveCommandPath: (command: string, options?: CommandAvailabilityOptions | undefined) => Effect.Effect<string, CommandResolutionError, FileSystem.FileSystem | Path.Path>;
|
|
46
51
|
declare const resolveSpawnCommand: (command: string, args: readonly string[], options?: CommandAvailabilityOptions | undefined) => Effect.Effect<ResolvedSpawnCommand, never, never>;
|
|
47
52
|
declare const isCommandAvailable: (command: string, options?: CommandAvailabilityOptions | undefined) => Effect.Effect<boolean, never, FileSystem.FileSystem | Path.Path>;
|
|
48
53
|
declare function resolveKnownWindowsCliDirs(env: NodeJS.ProcessEnv): ReadonlyArray<string>;
|
|
49
54
|
declare const resolveWindowsEnvironment: (env: NodeJS.ProcessEnv) => Effect.Effect<Partial<NodeJS.ProcessEnv>, never, FileSystem.FileSystem | Path.Path>;
|
|
50
55
|
//#endregion
|
|
51
|
-
export { CommandAvailability, CommandAvailabilityChecker, CommandAvailabilityOptions, CommandResolutionError, ResolvedSpawnCommand, ShellEnvironmentReader, SpawnExecutableResolution, SpawnExecutableResolver, WindowsEnvironmentProbeOptions, WindowsShellEnvironment, WindowsShellEnvironmentReader, extractPathFromShellOutput, isCommandAvailable, listLoginShellCandidates, mergePathEntries, mergePathValues, readEnvironmentFromLoginShell, readEnvironmentFromWindowsShell, readPathFromLaunchctl, readPathFromLoginShell, resolveCommandPath, resolveKnownWindowsCliDirs, resolveSpawnCommand, resolveWindowsEnvironment };
|
|
56
|
+
export { CommandAvailability, CommandAvailabilityChecker, CommandAvailabilityOptions, CommandResolutionCache, CommandResolutionError, ResolvedSpawnCommand, ShellEnvironmentReader, SpawnExecutableResolution, SpawnExecutableResolver, WindowsEnvironmentProbeOptions, WindowsShellEnvironment, WindowsShellEnvironmentReader, extractPathFromShellOutput, isCommandAvailable, listLoginShellCandidates, mergePathEntries, mergePathValues, readEnvironmentFromLoginShell, readEnvironmentFromWindowsShell, readPathFromLaunchctl, readPathFromLoginShell, resolveCommandPath, resolveKnownWindowsCliDirs, resolveSpawnCommand, resolveWindowsEnvironment };
|
package/dist/shared/shell.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $k as orElseSucceed, OA as currentTimeNanos, Pk as fn, Tk as catchTag, bk as as, cA as succeed, fO as Path, kA as TaggedError, mO as FileSystem, mj as Reference, w as HostProcessPlatform, x as HostProcessEnvironment } from "../shared.js";
|
|
2
2
|
import * as NodeOS from "node:os";
|
|
3
3
|
import * as NodeChildProcess from "node:child_process";
|
|
4
4
|
import * as NodeFS from "node:fs";
|
|
@@ -278,6 +278,20 @@ function resolveCommandCandidates(command, platform, windowsPathExtensions, extn
|
|
|
278
278
|
}
|
|
279
279
|
return Array.from(new Set(candidates));
|
|
280
280
|
}
|
|
281
|
+
const COMMAND_RESOLUTION_CACHE_TTL_NANOS = 30000000000n;
|
|
282
|
+
const COMMAND_RESOLUTION_CACHE_MAX_ENTRIES = 512;
|
|
283
|
+
const COMMAND_RESOLUTION_CACHE_KEY_SEPARATOR = String.fromCharCode(0);
|
|
284
|
+
const CommandResolutionCache = Reference("@t3tools/shared/shell/CommandResolutionCache", { defaultValue: () => /* @__PURE__ */ new Map() });
|
|
285
|
+
function cacheCommandResolution(cache, cacheKey, resolvedPath, nowNanos) {
|
|
286
|
+
if (cache.size >= COMMAND_RESOLUTION_CACHE_MAX_ENTRIES) {
|
|
287
|
+
const oldestKey = cache.keys().next().value;
|
|
288
|
+
if (oldestKey !== void 0) cache.delete(oldestKey);
|
|
289
|
+
}
|
|
290
|
+
cache.set(cacheKey, {
|
|
291
|
+
resolvedPath,
|
|
292
|
+
expiresAtNanos: nowNanos + COMMAND_RESOLUTION_CACHE_TTL_NANOS
|
|
293
|
+
});
|
|
294
|
+
}
|
|
281
295
|
const isExecutableFile = fn("shell.isExecutableFile")(function* (filePath, platform, windowsPathExtensions) {
|
|
282
296
|
const fileSystem = yield* FileSystem;
|
|
283
297
|
const path = yield* Path;
|
|
@@ -308,6 +322,22 @@ const resolveCommandPathForPlatform = fn("shell.resolveCommandPathForPlatform")(
|
|
|
308
322
|
command,
|
|
309
323
|
reason: "not-found"
|
|
310
324
|
});
|
|
325
|
+
const cacheKey = [
|
|
326
|
+
platform,
|
|
327
|
+
pathValue,
|
|
328
|
+
windowsPathExtensions.join(";"),
|
|
329
|
+
command
|
|
330
|
+
].join(COMMAND_RESOLUTION_CACHE_KEY_SEPARATOR);
|
|
331
|
+
const cache = yield* CommandResolutionCache;
|
|
332
|
+
const nowNanos = yield* currentTimeNanos;
|
|
333
|
+
const cached = cache.get(cacheKey);
|
|
334
|
+
if (cached !== void 0 && cached.expiresAtNanos > nowNanos) {
|
|
335
|
+
if (cached.resolvedPath === null) return yield* new CommandResolutionError({
|
|
336
|
+
command,
|
|
337
|
+
reason: "not-found"
|
|
338
|
+
});
|
|
339
|
+
return cached.resolvedPath;
|
|
340
|
+
}
|
|
311
341
|
const pathEntries = [];
|
|
312
342
|
for (const entry of pathValue.split(pathDelimiterForPlatform(platform))) {
|
|
313
343
|
const pathEntry = stripWrappingQuotes(entry.trim());
|
|
@@ -315,8 +345,12 @@ const resolveCommandPathForPlatform = fn("shell.resolveCommandPathForPlatform")(
|
|
|
315
345
|
}
|
|
316
346
|
for (const pathEntry of pathEntries) for (const candidate of commandCandidates) {
|
|
317
347
|
const candidatePath = path.join(pathEntry, candidate);
|
|
318
|
-
if (yield* isExecutableFile(candidatePath, platform, windowsPathExtensions))
|
|
348
|
+
if (yield* isExecutableFile(candidatePath, platform, windowsPathExtensions)) {
|
|
349
|
+
cacheCommandResolution(cache, cacheKey, candidatePath, nowNanos);
|
|
350
|
+
return candidatePath;
|
|
351
|
+
}
|
|
319
352
|
}
|
|
353
|
+
cacheCommandResolution(cache, cacheKey, null, nowNanos);
|
|
320
354
|
return yield* new CommandResolutionError({
|
|
321
355
|
command,
|
|
322
356
|
reason: "not-found"
|
|
@@ -364,7 +398,11 @@ function resolveKnownWindowsCliDirs(env) {
|
|
|
364
398
|
...appData ? [`${appData}\\npm`] : [],
|
|
365
399
|
...localAppData ? [`${localAppData}\\Programs\\nodejs`, `${localAppData}\\Volta\\bin`] : [],
|
|
366
400
|
...localAppData ? [`${localAppData}\\pnpm`] : [],
|
|
367
|
-
...userProfile ? [
|
|
401
|
+
...userProfile ? [
|
|
402
|
+
`${userProfile}\\.local\\bin`,
|
|
403
|
+
`${userProfile}\\.bun\\bin`,
|
|
404
|
+
`${userProfile}\\scoop\\shims`
|
|
405
|
+
] : []
|
|
368
406
|
];
|
|
369
407
|
}
|
|
370
408
|
function readWindowsEnvironmentSafely(readEnvironment, names, options) {
|
|
@@ -405,4 +443,4 @@ const resolveWindowsEnvironment = fn("shell.resolveWindowsEnvironment")(function
|
|
|
405
443
|
} : baselinePatch;
|
|
406
444
|
});
|
|
407
445
|
//#endregion
|
|
408
|
-
export { CommandAvailability, CommandResolutionError, SpawnExecutableResolution, WindowsShellEnvironment, extractPathFromShellOutput, isCommandAvailable, listLoginShellCandidates, mergePathEntries, mergePathValues, readEnvironmentFromLoginShell, readEnvironmentFromWindowsShell, readPathFromLaunchctl, readPathFromLoginShell, resolveCommandPath, resolveKnownWindowsCliDirs, resolveSpawnCommand, resolveWindowsEnvironment };
|
|
446
|
+
export { CommandAvailability, CommandResolutionCache, CommandResolutionError, SpawnExecutableResolution, WindowsShellEnvironment, extractPathFromShellOutput, isCommandAvailable, listLoginShellCandidates, mergePathEntries, mergePathValues, readEnvironmentFromLoginShell, readEnvironmentFromWindowsShell, readPathFromLaunchctl, readPathFromLoginShell, resolveCommandPath, resolveKnownWindowsCliDirs, resolveSpawnCommand, resolveWindowsEnvironment };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $w as SourceControlProviderInfo, eT as SourceControlProviderKind } from "../shared.js";
|
|
2
2
|
//#region upstream-t3code/packages/shared/src/sourceControl.d.ts
|
|
3
3
|
interface ChangeRequestPresentation {
|
|
4
4
|
readonly icon: "github" | "gitlab" | "azure-devops" | "bitbucket" | "change-request";
|