t3code-cli 0.14.1 → 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 +37 -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 +1305 -424
- 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 +7 -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 +13 -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 +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 +6 -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 +15 -3
- package/dist/client-runtime/state/presentation.js +1 -1
- package/dist/client-runtime/state/preview.d.ts +58 -48
- package/dist/client-runtime/state/preview.js +3 -2
- 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/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 +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 +311 -172
- package/dist/client-runtime/state/server.js +192 -16
- package/dist/client-runtime/state/session.d.ts +77 -7
- package/dist/client-runtime/state/session.js +32 -3
- package/dist/client-runtime/state/shell.d.ts +47 -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 +32 -4
- package/dist/client-runtime/state/thread-settled.js +2 -157
- 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 +155 -6
- package/dist/orchestration.js +2 -2
- package/dist/preview.d.ts +1 -1
- package/dist/preview.js +1 -1
- package/dist/rpc.d.ts +887 -360
- 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.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/composerInlineTokens.js +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 +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 +34 -0
- package/dist/shared/usageFormat.js +176 -0
- package/dist/shared/usageMerge.d.ts +78 -0
- package/dist/shared/usageMerge.js +241 -0
- package/dist/shared.d.ts +8268 -1372
- package/dist/shared.js +22185 -19774
- package/dist/t3tools.d.ts +2 -2
- package/dist/t3tools.js +2 -2
- package/package.json +5 -5
- package/src/application/error.ts +2 -2
- package/src/application/index.ts +2 -0
- package/src/application/service.ts +43 -5
- package/src/application/thread-commands.ts +78 -0
- package/src/application/threads.ts +156 -17
- package/src/cli/app.ts +4 -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 +49 -7
- package/src/cli/search.ts +48 -0
- 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/config/persist/schema.ts +1 -1
- 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 +78 -0
- package/src/orchestration/service.ts +16 -3
- package/src/rpc/error.ts +2 -0
- package/src/rpc/operation.ts +2 -0
- package/src/rpc/ws-group.ts +3 -0
- package/src/runtime/layer.ts +9 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Qv as ServerSettingsPatch, Yv as ServerSettings, qu as ServerProvider, xy as ModelSelection } 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 { DE as isProviderDriverKind, Gk as decodeUnknownOption, Gm as ServerSettings, HN as isSome, Jp as isProviderAvailable, N as createModelSelection, c as resolveBackgroundActivitySettings, g as fromLenientJson, i as getBackgroundActivityBaseProfile, o as normalizeBackgroundActivitySettings, s as normalizeServerBackgroundActivitySettings, u as deepMerge } 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 { CA as Path, HM as TaggedError, Kj as fn, Lj as catchTag, Mj as as, TA as FileSystem, VM as currentTimeNanos, fM as orElseSucceed, kN as Reference, w as HostProcessPlatform, x as HostProcessEnvironment, xM as succeed } 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 { GD as SourceControlProviderKind, WD as SourceControlProviderInfo } 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";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { vu as T3ProjectFile } from "../shared.js";
|
|
1
2
|
import * as Schema from "effect/Schema";
|
|
2
3
|
//#region upstream-t3code/packages/shared/src/t3ProjectFile.d.ts
|
|
3
4
|
/**
|
|
@@ -7,6 +8,7 @@ import * as Schema from "effect/Schema";
|
|
|
7
8
|
declare const T3ProjectFileFromJson: Schema.decodeTo<Schema.Struct<{
|
|
8
9
|
readonly $schema: Schema.optionalKey<Schema.String>;
|
|
9
10
|
readonly iconPath: Schema.optionalKey<Schema.decodeTo<Schema.String, Schema.String, never, never>>;
|
|
11
|
+
readonly defaultThreadEnvMode: Schema.optionalKey<Schema.Literals<readonly ["local", "worktree"]>>;
|
|
10
12
|
readonly scripts: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
11
13
|
readonly name: Schema.decodeTo<Schema.String, Schema.String, never, never>;
|
|
12
14
|
readonly command: Schema.decodeTo<Schema.String, Schema.String, never, never>;
|
|
@@ -16,6 +18,12 @@ declare const T3ProjectFileFromJson: Schema.decodeTo<Schema.Struct<{
|
|
|
16
18
|
readonly autoOpenPreview: Schema.optionalKey<Schema.Boolean>;
|
|
17
19
|
}>>>;
|
|
18
20
|
}>, Schema.String, never, never>;
|
|
21
|
+
/**
|
|
22
|
+
* Decode raw `t3.json` contents, treating invalid or malformed files as
|
|
23
|
+
* absent. Clients use this to read optional defaults (scripts, thread env
|
|
24
|
+
* mode) without surfacing decode errors to the user.
|
|
25
|
+
*/
|
|
26
|
+
declare function parseT3ProjectFile(contents: string): T3ProjectFile | null;
|
|
19
27
|
/**
|
|
20
28
|
* Build the publishable JSON Schema document for `t3.json` (draft 2020-12).
|
|
21
29
|
*
|
|
@@ -24,4 +32,4 @@ declare const T3ProjectFileFromJson: Schema.decodeTo<Schema.Struct<{
|
|
|
24
32
|
*/
|
|
25
33
|
declare function buildT3ProjectFileJsonSchema(): Record<string, unknown>;
|
|
26
34
|
//#endregion
|
|
27
|
-
export { T3ProjectFileFromJson, buildT3ProjectFileJsonSchema };
|
|
35
|
+
export { T3ProjectFileFromJson, buildT3ProjectFileJsonSchema, parseT3ProjectFile };
|
|
@@ -1,10 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Hk as decodeExit, Qk as toJsonSchemaDocument, g as fromLenientJson, if as T3_PROJECT_FILE_SCHEMA_URL, lN as isSuccess, tf as T3ProjectFile } from "../shared.js";
|
|
2
2
|
//#region upstream-t3code/packages/shared/src/t3ProjectFile.ts
|
|
3
3
|
/**
|
|
4
4
|
* Codec between the raw `t3.json` file contents (lenient JSONC string) and the
|
|
5
5
|
* decoded {@link T3ProjectFile}.
|
|
6
6
|
*/
|
|
7
7
|
const T3ProjectFileFromJson = fromLenientJson(T3ProjectFile);
|
|
8
|
+
const decodeT3ProjectFile = decodeExit(T3ProjectFileFromJson);
|
|
9
|
+
/**
|
|
10
|
+
* Decode raw `t3.json` contents, treating invalid or malformed files as
|
|
11
|
+
* absent. Clients use this to read optional defaults (scripts, thread env
|
|
12
|
+
* mode) without surfacing decode errors to the user.
|
|
13
|
+
*/
|
|
14
|
+
function parseT3ProjectFile(contents) {
|
|
15
|
+
const decoded = decodeT3ProjectFile(contents);
|
|
16
|
+
return isSuccess(decoded) ? decoded.value : null;
|
|
17
|
+
}
|
|
8
18
|
/**
|
|
9
19
|
* Build the publishable JSON Schema document for `t3.json` (draft 2020-12).
|
|
10
20
|
*
|
|
@@ -22,4 +32,4 @@ function buildT3ProjectFileJsonSchema() {
|
|
|
22
32
|
return jsonSchema;
|
|
23
33
|
}
|
|
24
34
|
//#endregion
|
|
25
|
-
export { T3ProjectFileFromJson, buildT3ProjectFileJsonSchema };
|
|
35
|
+
export { T3ProjectFileFromJson, buildT3ProjectFileJsonSchema, parseT3ProjectFile };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { pC as TerminalSummary } from "../shared.js";
|
|
2
2
|
//#region upstream-t3code/packages/shared/src/terminalLabels.d.ts
|
|
3
3
|
/** Human-readable label for a terminal tab; matches mobile and web sidebars. */
|
|
4
4
|
declare function getTerminalLabel(terminalId: string): string;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { mO as ThreadEnvMode } from "../shared.js";
|
|
2
|
+
//#region upstream-t3code/packages/shared/src/threadEnvMode.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Canonical priority order for a project's default thread env mode:
|
|
5
|
+
* per-project setting > checked-in t3.json > global server setting.
|
|
6
|
+
*
|
|
7
|
+
* An explicit composer pick outranks all of these; callers apply it before
|
|
8
|
+
* consulting the defaults. Web resolves the sources imperatively at draft
|
|
9
|
+
* creation, mobile reactively — both must route through this function so the
|
|
10
|
+
* platforms cannot disagree on the order.
|
|
11
|
+
*/
|
|
12
|
+
declare function resolveDefaultThreadEnvMode(sources: {
|
|
13
|
+
readonly projectSetting: ThreadEnvMode | null | undefined;
|
|
14
|
+
readonly projectFile: ThreadEnvMode | null | undefined;
|
|
15
|
+
readonly globalDefault: ThreadEnvMode;
|
|
16
|
+
}): ThreadEnvMode;
|
|
17
|
+
/**
|
|
18
|
+
* True once the resolved default can no longer change: an explicit pick or a
|
|
19
|
+
* source that outranks t3.json decided, or the file read settled. While
|
|
20
|
+
* false, nothing may persist the provisional default (for example into a
|
|
21
|
+
* draft's workspace selection) — it could differ from the final value.
|
|
22
|
+
*/
|
|
23
|
+
declare function isDefaultThreadEnvModeSettled(sources: {
|
|
24
|
+
readonly explicitMode: ThreadEnvMode | undefined;
|
|
25
|
+
readonly projectSetting: ThreadEnvMode | null | undefined;
|
|
26
|
+
readonly projectFilePending: boolean;
|
|
27
|
+
}): boolean;
|
|
28
|
+
//#endregion
|
|
29
|
+
export { isDefaultThreadEnvModeSettled, resolveDefaultThreadEnvMode };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
//#region upstream-t3code/packages/shared/src/threadEnvMode.ts
|
|
2
|
+
/**
|
|
3
|
+
* Canonical priority order for a project's default thread env mode:
|
|
4
|
+
* per-project setting > checked-in t3.json > global server setting.
|
|
5
|
+
*
|
|
6
|
+
* An explicit composer pick outranks all of these; callers apply it before
|
|
7
|
+
* consulting the defaults. Web resolves the sources imperatively at draft
|
|
8
|
+
* creation, mobile reactively — both must route through this function so the
|
|
9
|
+
* platforms cannot disagree on the order.
|
|
10
|
+
*/
|
|
11
|
+
function resolveDefaultThreadEnvMode(sources) {
|
|
12
|
+
return sources.projectSetting ?? sources.projectFile ?? sources.globalDefault;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* True once the resolved default can no longer change: an explicit pick or a
|
|
16
|
+
* source that outranks t3.json decided, or the file read settled. While
|
|
17
|
+
* false, nothing may persist the provisional default (for example into a
|
|
18
|
+
* draft's workspace selection) — it could differ from the final value.
|
|
19
|
+
*/
|
|
20
|
+
function isDefaultThreadEnvModeSettled(sources) {
|
|
21
|
+
return sources.explicitMode !== void 0 || sources.projectSetting != null || !sources.projectFilePending;
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { isDefaultThreadEnvModeSettled, resolveDefaultThreadEnvMode };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jm as ToolLifecycleItemType } from "../shared.js";
|
|
2
2
|
//#region upstream-t3code/packages/shared/src/toolActivity.d.ts
|
|
3
3
|
interface ToolActivityPresentationInput {
|
|
4
4
|
readonly itemType?: ToolLifecycleItemType | null | undefined;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Cl as UsageResolution, Ol as UsageSummaryInput } from "../shared.js";
|
|
2
|
+
//#region upstream-t3code/packages/shared/src/usageFormat.d.ts
|
|
3
|
+
declare function formatUsd(value: number): string;
|
|
4
|
+
declare function formatCount(value: number): string;
|
|
5
|
+
/**
|
|
6
|
+
* Compacts a token count to three significant figures with a unit suffix, so
|
|
7
|
+
* columns of numbers line up at a glance (`19.9B`, `76.7M`, `804K`).
|
|
8
|
+
*/
|
|
9
|
+
declare function formatTokens(value: number): string;
|
|
10
|
+
declare function formatPercent(share: number, digits?: number): string;
|
|
11
|
+
/** `2026-08-07` to `Aug 7`. */
|
|
12
|
+
declare function formatDayShort(day: string): string;
|
|
13
|
+
/** Inclusive day list between two `YYYY-MM-DD` bounds. */
|
|
14
|
+
declare function enumerateDays(sinceDay: string, untilDay: string): readonly string[];
|
|
15
|
+
/** Every fixed-duration bucket start in an hourly rolling window. */
|
|
16
|
+
declare function enumerateHourStarts(sinceTime: string, untilTime: string): readonly string[];
|
|
17
|
+
/**
|
|
18
|
+
* A rolling bucket start rendered in the viewer's requested time zone.
|
|
19
|
+
*
|
|
20
|
+
* Repeated wall-clock hours during a fall-back transition include their short
|
|
21
|
+
* zone name so the two distinct buckets remain distinguishable.
|
|
22
|
+
*/
|
|
23
|
+
declare function formatHourShort(hourStart: string, timeZone?: string): string;
|
|
24
|
+
/** `2026-08-11T14:37:00Z` to `Aug 11, 2 PM` in the requested zone. */
|
|
25
|
+
declare function formatDateTimeShort(instant: string, timeZone?: string): string;
|
|
26
|
+
/** An hourly tooltip label relative to the rolling window's end date. */
|
|
27
|
+
declare function formatRelativeHourShort(hourStart: string, relativeTo: string, timeZone?: string): string;
|
|
28
|
+
/**
|
|
29
|
+
* The window the page requests, expressed in the viewer's own time zone so days
|
|
30
|
+
* line up with what they actually experienced.
|
|
31
|
+
*/
|
|
32
|
+
declare function makeWindow(days: number, now?: Date, resolution?: UsageResolution): UsageSummaryInput;
|
|
33
|
+
//#endregion
|
|
34
|
+
export { enumerateDays, enumerateHourStarts, formatCount, formatDateTimeShort, formatDayShort, formatHourShort, formatPercent, formatRelativeHourShort, formatTokens, formatUsd, makeWindow };
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { iu as UsageDay } from "../shared.js";
|
|
2
|
+
//#region upstream-t3code/packages/shared/src/usageFormat.ts
|
|
3
|
+
/**
|
|
4
|
+
* Display formatting for the usage page.
|
|
5
|
+
*
|
|
6
|
+
* @module usageFormat
|
|
7
|
+
*/
|
|
8
|
+
const CURRENCY = new Intl.NumberFormat("en-US", {
|
|
9
|
+
style: "currency",
|
|
10
|
+
currency: "USD",
|
|
11
|
+
minimumFractionDigits: 2,
|
|
12
|
+
maximumFractionDigits: 2
|
|
13
|
+
});
|
|
14
|
+
const INTEGER = new Intl.NumberFormat("en-US");
|
|
15
|
+
function formatUsd(value) {
|
|
16
|
+
return CURRENCY.format(value);
|
|
17
|
+
}
|
|
18
|
+
function formatCount(value) {
|
|
19
|
+
return INTEGER.format(Math.round(value));
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Compacts a token count to three significant figures with a unit suffix, so
|
|
23
|
+
* columns of numbers line up at a glance (`19.9B`, `76.7M`, `804K`).
|
|
24
|
+
*/
|
|
25
|
+
function formatTokens(value) {
|
|
26
|
+
const abs = Math.abs(value);
|
|
27
|
+
if (abs >= 0xe8d4a51000) return `${trim(value / 0xe8d4a51000)}T`;
|
|
28
|
+
if (abs >= 1e9) return `${trim(value / 1e9)}B`;
|
|
29
|
+
if (abs >= 1e6) return `${trim(value / 1e6)}M`;
|
|
30
|
+
if (abs >= 1e3) return `${trim(value / 1e3)}K`;
|
|
31
|
+
return INTEGER.format(Math.round(value));
|
|
32
|
+
}
|
|
33
|
+
function trim(value) {
|
|
34
|
+
const abs = Math.abs(value);
|
|
35
|
+
const digits = abs >= 100 ? 0 : abs >= 10 ? 1 : 2;
|
|
36
|
+
return value.toFixed(digits).replace(/\.0+$/, "");
|
|
37
|
+
}
|
|
38
|
+
function formatPercent(share, digits = 1) {
|
|
39
|
+
return `${(share * 100).toFixed(digits)}%`;
|
|
40
|
+
}
|
|
41
|
+
/** `2026-08-07` to `Aug 7`. */
|
|
42
|
+
function formatDayShort(day) {
|
|
43
|
+
const [year, month, dayOfMonth] = day.split("-").map((part) => Number(part));
|
|
44
|
+
if (year === void 0 || month === void 0 || dayOfMonth === void 0) return day;
|
|
45
|
+
return `${[
|
|
46
|
+
"Jan",
|
|
47
|
+
"Feb",
|
|
48
|
+
"Mar",
|
|
49
|
+
"Apr",
|
|
50
|
+
"May",
|
|
51
|
+
"Jun",
|
|
52
|
+
"Jul",
|
|
53
|
+
"Aug",
|
|
54
|
+
"Sep",
|
|
55
|
+
"Oct",
|
|
56
|
+
"Nov",
|
|
57
|
+
"Dec"
|
|
58
|
+
][month - 1] ?? ""} ${dayOfMonth}`;
|
|
59
|
+
}
|
|
60
|
+
/** Inclusive day list between two `YYYY-MM-DD` bounds. */
|
|
61
|
+
function enumerateDays(sinceDay, untilDay) {
|
|
62
|
+
const days = [];
|
|
63
|
+
const start = Date.parse(`${sinceDay}T00:00:00Z`);
|
|
64
|
+
const end = Date.parse(`${untilDay}T00:00:00Z`);
|
|
65
|
+
if (Number.isNaN(start) || Number.isNaN(end) || end < start) return days;
|
|
66
|
+
for (let cursor = start; cursor <= end; cursor += 864e5) days.push(new Date(cursor).toISOString().slice(0, 10));
|
|
67
|
+
return days;
|
|
68
|
+
}
|
|
69
|
+
const HOUR_MS = 3600 * 1e3;
|
|
70
|
+
/** Every fixed-duration bucket start in an hourly rolling window. */
|
|
71
|
+
function enumerateHourStarts(sinceTime, untilTime) {
|
|
72
|
+
const starts = [];
|
|
73
|
+
const start = Date.parse(sinceTime);
|
|
74
|
+
const end = Date.parse(untilTime);
|
|
75
|
+
if (Number.isNaN(start) || Number.isNaN(end) || end <= start) return starts;
|
|
76
|
+
for (let cursor = start; cursor < end; cursor += HOUR_MS) starts.push(new Date(cursor).toISOString());
|
|
77
|
+
return starts;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* A rolling bucket start rendered in the viewer's requested time zone.
|
|
81
|
+
*
|
|
82
|
+
* Repeated wall-clock hours during a fall-back transition include their short
|
|
83
|
+
* zone name so the two distinct buckets remain distinguishable.
|
|
84
|
+
*/
|
|
85
|
+
function formatHourShort(hourStart, timeZone) {
|
|
86
|
+
const instant = new Date(hourStart);
|
|
87
|
+
if (Number.isNaN(instant.getTime())) return hourStart;
|
|
88
|
+
const options = timeZone === void 0 ? {} : { timeZone };
|
|
89
|
+
const hourFormat = new Intl.DateTimeFormat("en-US", {
|
|
90
|
+
...options,
|
|
91
|
+
hour: "numeric"
|
|
92
|
+
});
|
|
93
|
+
const wallHourFormat = new Intl.DateTimeFormat("en-CA", {
|
|
94
|
+
...options,
|
|
95
|
+
year: "numeric",
|
|
96
|
+
month: "2-digit",
|
|
97
|
+
day: "2-digit",
|
|
98
|
+
hour: "2-digit",
|
|
99
|
+
hourCycle: "h23"
|
|
100
|
+
});
|
|
101
|
+
const wallHour = wallHourFormat.format(instant);
|
|
102
|
+
if (![-36e5, HOUR_MS].some((offset) => wallHourFormat.format(new Date(instant.getTime() + offset)) === wallHour)) return hourFormat.format(instant);
|
|
103
|
+
return new Intl.DateTimeFormat("en-US", {
|
|
104
|
+
...timeZone === void 0 ? {} : { timeZone },
|
|
105
|
+
hour: "numeric",
|
|
106
|
+
timeZoneName: "short"
|
|
107
|
+
}).format(instant);
|
|
108
|
+
}
|
|
109
|
+
/** `2026-08-11T14:37:00Z` to `Aug 11, 2 PM` in the requested zone. */
|
|
110
|
+
function formatDateTimeShort(instant, timeZone) {
|
|
111
|
+
const date = new Date(instant);
|
|
112
|
+
if (Number.isNaN(date.getTime())) return instant;
|
|
113
|
+
return new Intl.DateTimeFormat("en-US", {
|
|
114
|
+
...timeZone === void 0 ? {} : { timeZone },
|
|
115
|
+
month: "short",
|
|
116
|
+
day: "numeric",
|
|
117
|
+
hour: "numeric"
|
|
118
|
+
}).format(date);
|
|
119
|
+
}
|
|
120
|
+
/** An hourly tooltip label relative to the rolling window's end date. */
|
|
121
|
+
function formatRelativeHourShort(hourStart, relativeTo, timeZone) {
|
|
122
|
+
const instant = new Date(hourStart);
|
|
123
|
+
const reference = new Date(relativeTo);
|
|
124
|
+
if (Number.isNaN(instant.getTime()) || Number.isNaN(reference.getTime())) return formatDateTimeShort(hourStart, timeZone);
|
|
125
|
+
const dayFormat = new Intl.DateTimeFormat("en-CA", {
|
|
126
|
+
...timeZone === void 0 ? {} : { timeZone },
|
|
127
|
+
year: "numeric",
|
|
128
|
+
month: "2-digit",
|
|
129
|
+
day: "2-digit"
|
|
130
|
+
});
|
|
131
|
+
const instantDay = Date.parse(`${dayFormat.format(instant)}T00:00:00Z`);
|
|
132
|
+
const referenceDay = Date.parse(`${dayFormat.format(reference)}T00:00:00Z`);
|
|
133
|
+
const calendarDaysAgo = Math.round((referenceDay - instantDay) / (24 * HOUR_MS));
|
|
134
|
+
const hour = formatHourShort(hourStart, timeZone);
|
|
135
|
+
if (calendarDaysAgo === 0) return `${hour} today`;
|
|
136
|
+
if (calendarDaysAgo === 1) return `${hour} yesterday`;
|
|
137
|
+
return formatDateTimeShort(hourStart, timeZone);
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* The window the page requests, expressed in the viewer's own time zone so days
|
|
141
|
+
* line up with what they actually experienced.
|
|
142
|
+
*/
|
|
143
|
+
function makeWindow(days, now = /* @__PURE__ */ new Date(), resolution = "day") {
|
|
144
|
+
const timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone || "UTC";
|
|
145
|
+
const format = new Intl.DateTimeFormat("en-CA", {
|
|
146
|
+
timeZone,
|
|
147
|
+
year: "numeric",
|
|
148
|
+
month: "2-digit",
|
|
149
|
+
day: "2-digit"
|
|
150
|
+
});
|
|
151
|
+
const untilDay = format.format(now);
|
|
152
|
+
if (resolution === "hour") {
|
|
153
|
+
const untilTimeMs = Math.floor(now.getTime() / 6e4) * 6e4;
|
|
154
|
+
const sinceTimeMs = untilTimeMs - 24 * HOUR_MS;
|
|
155
|
+
const sinceTime = new Date(sinceTimeMs);
|
|
156
|
+
const untilTime = new Date(untilTimeMs);
|
|
157
|
+
return {
|
|
158
|
+
sinceDay: UsageDay.make(format.format(sinceTime)),
|
|
159
|
+
untilDay: UsageDay.make(format.format(untilTime)),
|
|
160
|
+
timeZone,
|
|
161
|
+
resolution,
|
|
162
|
+
sinceTime: sinceTime.toISOString(),
|
|
163
|
+
untilTime: untilTime.toISOString()
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
const [year = 0, month = 1, dayOfMonth = 1] = untilDay.split("-").map((part) => Number.parseInt(part, 10));
|
|
167
|
+
const start = new Date(Date.UTC(year, month - 1, dayOfMonth - (days - 1)));
|
|
168
|
+
return {
|
|
169
|
+
sinceDay: UsageDay.make(start.toISOString().slice(0, 10)),
|
|
170
|
+
untilDay: UsageDay.make(untilDay),
|
|
171
|
+
timeZone,
|
|
172
|
+
resolution
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
//#endregion
|
|
176
|
+
export { enumerateDays, enumerateHourStarts, formatCount, formatDateTimeShort, formatDayShort, formatHourShort, formatPercent, formatRelativeHourShort, formatTokens, formatUsd, makeWindow };
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { Dl as UsageSummary, vk as EnvironmentId, xl as UsageProviderKind } from "../shared.js";
|
|
2
|
+
//#region upstream-t3code/packages/shared/src/usageMerge.d.ts
|
|
3
|
+
interface EnvironmentUsage {
|
|
4
|
+
readonly environmentId: EnvironmentId;
|
|
5
|
+
readonly label: string;
|
|
6
|
+
readonly summary: UsageSummary;
|
|
7
|
+
}
|
|
8
|
+
interface ProviderTotals {
|
|
9
|
+
readonly provider: UsageProviderKind;
|
|
10
|
+
readonly costUsd: number;
|
|
11
|
+
readonly totalTokens: number;
|
|
12
|
+
readonly records: number;
|
|
13
|
+
readonly costShare: number;
|
|
14
|
+
readonly tokenShare: number;
|
|
15
|
+
}
|
|
16
|
+
interface ModelTotals {
|
|
17
|
+
readonly model: string;
|
|
18
|
+
readonly provider: UsageProviderKind;
|
|
19
|
+
readonly costUsd: number;
|
|
20
|
+
readonly totalTokens: number;
|
|
21
|
+
readonly records: number;
|
|
22
|
+
readonly costShare: number;
|
|
23
|
+
}
|
|
24
|
+
interface DailyTotals {
|
|
25
|
+
readonly day: string;
|
|
26
|
+
readonly costUsd: number;
|
|
27
|
+
readonly totalTokens: number;
|
|
28
|
+
readonly byProvider: ReadonlyMap<UsageProviderKind, {
|
|
29
|
+
costUsd: number;
|
|
30
|
+
totalTokens: number;
|
|
31
|
+
}>;
|
|
32
|
+
}
|
|
33
|
+
interface HourlyTotals {
|
|
34
|
+
readonly day: string;
|
|
35
|
+
readonly hourStart: string;
|
|
36
|
+
readonly costUsd: number;
|
|
37
|
+
readonly totalTokens: number;
|
|
38
|
+
readonly byProvider: ReadonlyMap<UsageProviderKind, {
|
|
39
|
+
costUsd: number;
|
|
40
|
+
totalTokens: number;
|
|
41
|
+
}>;
|
|
42
|
+
}
|
|
43
|
+
interface CostQuality {
|
|
44
|
+
readonly providerReportedShare: number;
|
|
45
|
+
readonly modelPricedShare: number;
|
|
46
|
+
readonly unpricedShare: number;
|
|
47
|
+
readonly cacheSavingsUsd: number;
|
|
48
|
+
}
|
|
49
|
+
interface MergedUsage {
|
|
50
|
+
readonly costUsd: number;
|
|
51
|
+
readonly uncachedInputTokens: number;
|
|
52
|
+
readonly cachedInputTokens: number;
|
|
53
|
+
readonly cacheCreationTokens: number;
|
|
54
|
+
readonly outputTokens: number;
|
|
55
|
+
readonly reasoningTokens: number;
|
|
56
|
+
readonly totalTokens: number;
|
|
57
|
+
readonly records: number;
|
|
58
|
+
readonly sessions: number;
|
|
59
|
+
readonly providers: readonly ProviderTotals[];
|
|
60
|
+
readonly models: readonly ModelTotals[];
|
|
61
|
+
readonly daily: readonly DailyTotals[];
|
|
62
|
+
readonly hourly: readonly HourlyTotals[];
|
|
63
|
+
readonly costQuality: CostQuality;
|
|
64
|
+
/** Environments whose data was dropped as a duplicate of another's. */
|
|
65
|
+
readonly duplicateSources: readonly string[];
|
|
66
|
+
readonly contributingEnvironments: readonly EnvironmentId[];
|
|
67
|
+
readonly staleEnvironments: readonly EnvironmentId[];
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Merges every connected environment's summary.
|
|
71
|
+
*
|
|
72
|
+
* `expectedContractVersion` guards against an environment running older server
|
|
73
|
+
* code: rather than blocking the page, its data is excluded and its id is
|
|
74
|
+
* reported so the UI can say coverage is partial.
|
|
75
|
+
*/
|
|
76
|
+
declare function mergeUsage(environments: readonly EnvironmentUsage[], expectedContractVersion: number): MergedUsage;
|
|
77
|
+
//#endregion
|
|
78
|
+
export { CostQuality, DailyTotals, EnvironmentUsage, HourlyTotals, MergedUsage, ModelTotals, ProviderTotals, mergeUsage };
|