t3code-cli 0.6.0 → 0.8.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.
Files changed (50) hide show
  1. package/dist/auth.js +2 -2
  2. package/dist/bin.js +56 -5
  3. package/dist/connection.js +3 -3
  4. package/dist/{error-B2t1bAP9.js → error-ChTsLQTu.js} +2 -2
  5. package/dist/{error-jwMt3VoW.js → error-CjADNVm8.js} +1 -1
  6. package/dist/index.js +1 -1
  7. package/dist/{layer-DvHnKBYj.js → layer-CMo36MrX.js} +3 -3
  8. package/dist/{layer-CfC5qZol.js → layer-Do8wK1t6.js} +3 -3
  9. package/dist/{layer-DIg0RxSO.js → layer-DwI3Skkh.js} +69 -63
  10. package/dist/orchestration.js +1 -1
  11. package/dist/rpc.js +1 -1
  12. package/dist/runtime.js +1 -1
  13. package/dist/src/application/layer.d.ts +61 -0
  14. package/dist/src/application/models.d.ts +1 -0
  15. package/dist/src/application/projects.d.ts +9 -0
  16. package/dist/src/application/service.d.ts +9 -0
  17. package/dist/src/application/shell-sequence.d.ts +9 -0
  18. package/dist/src/application/thread-wait.d.ts +9 -0
  19. package/dist/src/application/threads.d.ts +52 -1
  20. package/dist/src/cli-path/layer.d.ts +3 -0
  21. package/dist/src/cli-path/service.d.ts +8 -0
  22. package/dist/src/domain/helpers.d.ts +11 -3
  23. package/dist/src/domain/model-config.d.ts +3 -0
  24. package/dist/src/domain/thread-lifecycle.d.ts +9 -0
  25. package/dist/src/orchestration/layer.d.ts +215 -0
  26. package/dist/src/rpc/layer.d.ts +466 -0
  27. package/dist/src/rpc/ws-group.d.ts +142 -0
  28. package/dist/src/runtime/layer.d.ts +1 -1
  29. package/dist/{src-KdbHqrex.js → src-aiFPmAG7.js} +169 -13
  30. package/dist/t3tools.js +2 -2
  31. package/dist/{transport-D3zBdZ1h.js → transport-MI0Z3d2T.js} +2 -2
  32. package/dist/upstream-t3code/packages/contracts/src/environmentHttp.d.ts +33 -10
  33. package/dist/upstream-t3code/packages/contracts/src/ipc.d.ts +6 -0
  34. package/dist/upstream-t3code/packages/contracts/src/orchestration.d.ts +657 -1
  35. package/dist/upstream-t3code/packages/contracts/src/provider.d.ts +14 -0
  36. package/dist/upstream-t3code/packages/contracts/src/providerRuntime.d.ts +175 -1
  37. package/dist/upstream-t3code/packages/contracts/src/rpc.d.ts +492 -0
  38. package/dist/upstream-t3code/packages/contracts/src/server.d.ts +45 -0
  39. package/dist/upstream-t3code/packages/contracts/src/settings.d.ts +21 -0
  40. package/dist/upstream-t3code/packages/contracts/src/terminal.d.ts +6 -3
  41. package/package.json +6 -3
  42. package/src/application/service.ts +13 -0
  43. package/src/application/threads.ts +15 -3
  44. package/src/cli/thread.ts +2 -0
  45. package/src/cli/threads/callback.ts +92 -0
  46. package/src/cli-path/layer.ts +10 -0
  47. package/src/cli-path/service.ts +7 -0
  48. package/src/domain/helpers.test.ts +103 -0
  49. package/src/domain/helpers.ts +61 -85
  50. package/src/runtime/layer.ts +2 -0
package/dist/auth.js CHANGED
@@ -1,3 +1,3 @@
1
- import { a as makeT3AuthPairing, b as makeT3LocalAuthOrigin, c as T3LocalAuthLive, d as T3LocalAuthTokenLive, f as makeT3LocalAuthToken, i as T3AuthPairingLive, l as makeT3LocalAuth, n as makeT3Auth, o as parsePairingUrl, r as T3AuthPairing, s as T3LocalAuth, t as T3AuthLive, u as T3LocalAuthToken, v as T3LocalAuthOrigin, x as T3Auth, y as T3LocalAuthOriginLive } from "./layer-CfC5qZol.js";
2
- import { a as AuthLocalSigningError, i as AuthLocalSecretError, n as AuthLocalDatabaseError, o as AuthPairingUrlError, r as AuthLocalError, s as AuthTransportError, t as AuthConfigError } from "./error-jwMt3VoW.js";
1
+ import { a as makeT3AuthPairing, b as makeT3LocalAuthOrigin, c as T3LocalAuthLive, d as T3LocalAuthTokenLive, f as makeT3LocalAuthToken, i as T3AuthPairingLive, l as makeT3LocalAuth, n as makeT3Auth, o as parsePairingUrl, r as T3AuthPairing, s as T3LocalAuth, t as T3AuthLive, u as T3LocalAuthToken, v as T3LocalAuthOrigin, x as T3Auth, y as T3LocalAuthOriginLive } from "./layer-Do8wK1t6.js";
2
+ import { a as AuthLocalSigningError, i as AuthLocalSecretError, n as AuthLocalDatabaseError, o as AuthPairingUrlError, r as AuthLocalError, s as AuthTransportError, t as AuthConfigError } from "./error-CjADNVm8.js";
3
3
  export { AuthConfigError, AuthLocalDatabaseError, AuthLocalError, AuthLocalSecretError, AuthLocalSigningError, AuthPairingUrlError, AuthTransportError, T3Auth, T3AuthLive, T3AuthPairing, T3AuthPairingLive, T3LocalAuth, T3LocalAuthLive, T3LocalAuthOrigin, T3LocalAuthOriginLive, T3LocalAuthToken, T3LocalAuthTokenLive, makeT3Auth, makeT3AuthPairing, makeT3LocalAuth, makeT3LocalAuthOrigin, makeT3LocalAuthToken, parsePairingUrl };
package/dist/bin.js CHANGED
@@ -3,12 +3,12 @@ import { A as none, C as isNone, Ft as BaseProto, Mn as pipe, Nt as withFiber, O
3
3
  import { $n as makeUnsafe, Ct as serviceOption, E as effectify, F as fnUntraced, Fn as succeed$2, Ft as tryPromise, G as interrupt, Ir as sync$1, It as try_, L as forEach, Ln as sync$2, Lt as uninterruptible, Mn as mergeAll, Mt as tapError, Nn as provide, Ot as suspend, P as fn, Pn as provideMerge, Pt as timeoutOrElse, Qn as isDone, Tt as succeed, U as gen, V as forkScoped, Vt as void_, W as ignore, X as map$1, Xn as doneUnsafe, Yn as _await, a as badArgument, b as catchTags, c as addFinalizer, cr as succeed$1, d as as, dr as ConsoleRef, dt as provideService, fn as fail$1, h as callback, ht as runFork, j as flatMap$1, k as fail, kn as effect, kt as sync, l as andThen, li as fail$2, lt as provide$1, n as TypeId$4, nt as matchEffect, o as systemError, p as asVoid, pi as succeed$3, pt as result, qn as MinimumLogLevel, r as BadArgument, s as acquireRelease, st as orDie, t as Path$1, ti as map$2, ut as provideContext, v as catchFilter, x as catch_, xt as scoped } from "./Path-D8WPdPwR.js";
4
4
  import { Bt as runCollect, Ht as runFold, Jt as splitLines, Kt as runLast, L as fromJsonString, Mt as merge, Nt as mkString, On as nominal, P as decodeUnknownEffect, Qt as tap, Sn as offerUnsafe, Tt as fromIterable, Vt as runDrain, Yt as succeed$4, an as drain, b as Struct, bn as offer, cn as isSink, dt as FileSystem, et as optionalKey, ft as FileTypeId, gn as endUnsafe, gt as callback$1, ht as make$9, in as make$10, kt as isStream, mt as WatchBackend, nn as unwrap, nt as tag, pt as Size, rn as get, s as ErrorClass, tn as transduce, u as Literal, ut as FileDescriptor, vn as failCauseUnsafe, vt as decodeText, x as TaggedErrorClass, y as String$1, yn as make$11, yt as empty$1, zt as run$1 } from "./Schema-DsQxYh6_.js";
5
5
  import { A as isBoolean, C as getParamMetadata, D as string$1, E as optional$1, F as ShowHelp, I as UnknownSubcommand, L as UnrecognizedOption, M as isTrueValue, N as DuplicateOption, O as getChoiceKeys, P as InvalidValue, R as isCliError, S as extractSingleParams, T as isParam, _ as string$2, a as threadFlag, b as withDescription$1, c as worktreeFlag, d as boolean, f as choice, g as optional$2, h as map$3, i as projectPathFlag, j as isFalseValue, k as getTypeName, l as canRenderLiveTerminal, m as integer, n as modelFlags, o as threadFormatFlag, p as choiceWithValue, r as projectFlag, s as waitFormatFlag, t as formatFlag, u as resolveOutputFormat, v as withAlias, w as isFlagParam, x as argumentKind, y as withDefault, z as makeRunMain } from "./flags-CM7_iGdA.js";
6
- import { c as fromReadable, l as fromWritable } from "./layer-DvHnKBYj.js";
7
- import { C as make$12, S as Crypto, x as T3Auth } from "./layer-CfC5qZol.js";
6
+ import { c as fromReadable, l as fromWritable } from "./layer-CMo36MrX.js";
7
+ import { C as make$12, S as Crypto, x as T3Auth } from "./layer-Do8wK1t6.js";
8
8
  import { n as T3Config, t as Environment } from "./service-CLmRO2Dp.js";
9
9
  import { t as T3Application } from "./service-ybOWV9pL.js";
10
10
  import { i as resolveWorktreePath, r as resolveThreadId, t as resolveCommandProjectRef } from "./scope-GycYiJ54.js";
11
- import { d as latestAssistantMessage, f as threadStatus, m as ThreadSessionError, p as ProjectLookupError, t as AppLayer } from "./layer-DIg0RxSO.js";
11
+ import { d as latestAssistantMessage, f as threadStatus, h as CliPath, m as ThreadSessionError, p as ProjectLookupError, t as AppLayer } from "./layer-DwI3Skkh.js";
12
12
  import { t as NodeEnvironmentLive } from "./layer-DHhKS5jd.js";
13
13
  import * as NodeChildProcess from "node:child_process";
14
14
  import * as NodeCrypto from "node:crypto";
@@ -4400,6 +4400,56 @@ const archiveThreadCommand = make("archive", {
4400
4400
  return yield* output.printInfo(`thread archived: ${threadId}\nsequence: ${dispatch.sequence}`);
4401
4401
  })).pipe(withDescription("archive thread"));
4402
4402
  //#endregion
4403
+ //#region src/cli/threads/callback.ts
4404
+ const callbackThreadCommand = make("callback", {
4405
+ from: string$2("from").pipe(withDescription$1("Thread ID to watch for completion")),
4406
+ thread: threadFlag,
4407
+ prompt: string$2("prompt").pipe(withDescription$1("Message to send to target thread")),
4408
+ background: boolean("background").pipe(withDescription$1("Fork and detach as background process"), optional$2)
4409
+ }, ({ from, thread, prompt, background }) => gen(function* () {
4410
+ const application = yield* T3Application;
4411
+ const environment = yield* Environment;
4412
+ const output = yield* T3Output;
4413
+ const cliPath = yield* CliPath;
4414
+ const spawner = yield* ChildProcessSpawner;
4415
+ const fromThreadId = from;
4416
+ const targetThreadId = resolveThreadId({
4417
+ value: getOrUndefined(thread),
4418
+ env: environment.env
4419
+ });
4420
+ if (targetThreadId === void 0) return yield* fail(new MissingThreadError({ message: "target thread id is required: pass --thread or set T3CODE_THREAD_ID" }));
4421
+ if (getOrElse(background, () => false)) {
4422
+ const args = [
4423
+ cliPath.path,
4424
+ "thread",
4425
+ "callback",
4426
+ "--from",
4427
+ fromThreadId,
4428
+ "--thread",
4429
+ targetThreadId,
4430
+ "--prompt",
4431
+ prompt
4432
+ ];
4433
+ const proc = make$6(process.execPath, args, {
4434
+ detached: true,
4435
+ stdin: "ignore",
4436
+ stdout: "ignore",
4437
+ stderr: "ignore"
4438
+ });
4439
+ const handle = yield* spawner.spawn(proc);
4440
+ yield* (yield* handle.unref).pipe(ignore);
4441
+ yield* output.printInfo(`background callback scheduled: ${fromThreadId} -> ${targetThreadId} (pid: ${handle.pid})`);
4442
+ return;
4443
+ }
4444
+ yield* output.printInfo(`watching thread ${fromThreadId} for completion...`);
4445
+ const result = yield* application.callbackThread({
4446
+ fromThreadId,
4447
+ targetThreadId,
4448
+ prompt
4449
+ });
4450
+ yield* output.printInfo(`callback sent to ${result.targetThreadId} (dispatch: ${result.dispatch.sequence})`);
4451
+ })).pipe(withDescription("watch a thread and send a message when it completes"));
4452
+ //#endregion
4403
4453
  //#region src/cli/require.ts
4404
4454
  const requireCommandProjectRef = fn("requireCommandProjectRef")(function* (input) {
4405
4455
  const resolved = yield* (yield* T3Config).resolve();
@@ -4784,7 +4834,8 @@ function createThreadCommand() {
4784
4834
  sendThreadCommand,
4785
4835
  archiveThreadCommand,
4786
4836
  getThreadMessagesCommand,
4787
- waitForThreadCommand
4837
+ waitForThreadCommand,
4838
+ callbackThreadCommand
4788
4839
  ]));
4789
4840
  }
4790
4841
  //#endregion
@@ -4859,7 +4910,7 @@ var T3Version = class extends Service()("t3cli/T3Version") {};
4859
4910
  //#endregion
4860
4911
  //#region src/version/layer.ts
4861
4912
  const PackageJsonSchema = fromJsonString(Struct({ version: String$1 }));
4862
- const T3VersionBundledLive = sync$2(T3Version, () => ({ version: "0.6.0" }));
4913
+ const T3VersionBundledLive = sync$2(T3Version, () => ({ version: "0.8.0" }));
4863
4914
  effect(T3Version, gen(function* () {
4864
4915
  const packageJson = yield* (yield* FileSystem).readFileString(fileURLToPath(new URL("../../package.json", import.meta.url)));
4865
4916
  return { version: (yield* decodeUnknownEffect(PackageJsonSchema)(packageJson)).version };
@@ -1,7 +1,7 @@
1
1
  import { Mn as mergeAll, Nn as provide } from "./Path-D8WPdPwR.js";
2
- import { n as T3AuthTransportLive } from "./transport-D3zBdZ1h.js";
3
- import { a as makeT3CodeConnectionProvider, i as T3CodeConnectionProviderLive, o as layerWebSocketConstructor, r as T3CodeConnectionProvider, s as layerUndici, t as T3RpcLive } from "./layer-DvHnKBYj.js";
4
- import { n as T3CodeConnectionError } from "./error-B2t1bAP9.js";
2
+ import { n as T3AuthTransportLive } from "./transport-MI0Z3d2T.js";
3
+ import { a as makeT3CodeConnectionProvider, i as T3CodeConnectionProviderLive, o as layerWebSocketConstructor, r as T3CodeConnectionProvider, s as layerUndici, t as T3RpcLive } from "./layer-CMo36MrX.js";
4
+ import { n as T3CodeConnectionError } from "./error-ChTsLQTu.js";
5
5
  //#region src/connection/layer.ts
6
6
  function makeT3CodeRpcLayer() {
7
7
  return T3RpcLive.pipe(provide(T3AuthTransportLive));
@@ -1,7 +1,7 @@
1
1
  import { $ as optional, E as Unknown, R as instanceOf, T as Union, a as Defect, et as optionalKey, nt as tag, s as ErrorClass, st as SchemaError, x as TaggedErrorClass, y as String } from "./Schema-DsQxYh6_.js";
2
- import { Dl as HttpClientErrorSchema, Mu as EnvironmentAuthorizationError, Oi as KeybindingsConfigError, fs as OrchestrationDispatchCommandError, si as ServerSettingsError, sl as SocketErrorReason, ys as OrchestrationGetSnapshotError } from "./src-KdbHqrex.js";
2
+ import { Rl as HttpClientErrorSchema, Uu as EnvironmentAuthorizationError, _s as OrchestrationDispatchCommandError, ji as KeybindingsConfigError, ui as ServerSettingsError, vl as SocketErrorReason, ws as OrchestrationGetSnapshotError } from "./src-aiFPmAG7.js";
3
3
  import { n as UrlError } from "./error-BHRnjLux.js";
4
- import { s as AuthTransportError } from "./error-jwMt3VoW.js";
4
+ import { s as AuthTransportError } from "./error-CjADNVm8.js";
5
5
  //#region node_modules/.pnpm/effect@4.0.0-beta.78/node_modules/effect/dist/unstable/workers/WorkerError.js
6
6
  const TypeId$1 = "~effect/workers/WorkerError";
7
7
  /**
@@ -1,6 +1,6 @@
1
1
  import { cn as IllegalArgumentError, i as PlatformError } from "./Path-D8WPdPwR.js";
2
2
  import { R as instanceOf, T as Union, d as Literals, et as optionalKey, st as SchemaError, x as TaggedErrorClass, y as String } from "./Schema-DsQxYh6_.js";
3
- import { Dl as HttpClientErrorSchema } from "./src-KdbHqrex.js";
3
+ import { Rl as HttpClientErrorSchema } from "./src-aiFPmAG7.js";
4
4
  import { n as UrlError, t as ConfigError } from "./error-BHRnjLux.js";
5
5
  //#region src/auth/error.ts
6
6
  var AuthPairingUrlError = class extends TaggedErrorClass()("AuthPairingUrlError", {
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { t as T3Application } from "./service-ybOWV9pL.js";
2
- import { n as AuthAppLayer, t as AppLayer } from "./layer-DIg0RxSO.js";
2
+ import { n as AuthAppLayer, t as AppLayer } from "./layer-DwI3Skkh.js";
3
3
  import "./application.js";
4
4
  import "./runtime.js";
5
5
  export { AppLayer, AuthAppLayer, T3Application };
@@ -2,11 +2,11 @@ import { a as __toESM, i as __require, n as __exportAll, r as __reExport, t as _
2
2
  import { A as none, An as identity, C as isNone, En as constVoid, It as Class, O as map, On as dual, Pn as pipeArguments, T as isSome, a as get, d as make$2, i as empty, it as PipeInspectableProto, j as some, l as getUnsafe$1, n as Service, r as add, t as Reference, x as getOrThrow } from "./Context-DueQ9iMH.js";
3
3
  import { $ as mapError, $t as catchDone, An as effectContext, B as forkIn, Bn as addFinalizerExit, Bt as useSpan, C as context, Ct as serviceOption, D as ensuring, F as fnUntraced, Fn as succeed$1, Ft as tryPromise, G as interrupt$1, Hn as fork, Ht as whileLoop, It as try_, J as logError, Jt as either, K as interruptible, L as forEach, Ln as sync$1, Nn as provide, Nt as timeout, On as buildWithScope, Ot as suspend, P as fn, R as forever, Rn as Scope, T as delay, Tn as squash, Tt as succeed, U as gen, Ut as withFiber, V as forkScoped, Vn as close, Vt as void_, W as ignore, Wt as withParentSpan, X as map$1, Xt as spaced, Y as makeSpanScoped, Yt as exponential, Zt as take, at as onExit, ct as promise, d as as, di as isSuccess$1, dn as done, dt as provideService, er as die, ft as raceFirst, g as catchCause, gt as runForkWith, h as callback, ht as runFork, ir as interrupt, it as onError, j as flatMap, jt as tapCause, k as fail, kn as effect, kt as sync, l as andThen, lr as void_$1, lt as provide$1, m as cached, mn as findError, mt as retry, ni as of, nr as failCause, or as isFailure, ot as onInterrupt, rt as never, s as acquireRelease, sn as Done, sr as isSuccess, st as orDie, tr as fail$1, tt as matchCauseEffect, u as annotateLogs, un as UnknownError, ut as provideContext, vn as interruptors, vt as runSync, w as contextWith, zn as addFinalizer } from "./Path-D8WPdPwR.js";
4
4
  import { Cn as makeUnsafe$1, Dt as fromQueue, I as encodeEffect, M as decodeSync, P as decodeUnknownEffect, T as Union, Tn as interrupt$2, Wt as runForEachArray, _n as failCause$1, a as Defect, b as Struct, dn as mapDone, hn as end, mn as bounded, nn as unwrap, on as fromChannel, p as NonEmptyArray, pn as makeUnsafe$2, rt as toCodecJson, un as fromTransform, wn as getCurrent, wt as fromChannel$1, xn as offerAll } from "./Schema-DsQxYh6_.js";
5
- import { a as make$4, c as make$3, i as layerMergedContext, o as getAndSet$1, s as makeUnsafe$3, t as T3AuthTransport } from "./transport-D3zBdZ1h.js";
6
- import { Al as empty$1, Bn as ServerConfig, Cl as setUrlParam, Dr as ServerProviders, El as HttpClientError, Fl as merge, Mu as EnvironmentAuthorizationError, Nl as empty$2, Oi as KeybindingsConfigError, Pl as fromInput, Tl as DecodeError, al as SocketCloseError, at as getStreamSchemas, c as WsOrchestrationDispatchCommandRpc, cl as SocketOpenError, dl as TypeId$2, hl as inspect$1, il as Socket, it as make$5, jl as fromSetCookie, kl as TransportError, ll as WebSocketConstructor, m as WsOrchestrationSubscribeThreadRpc, ml as TypeId$1, nt as make$6, ol as SocketError, ot as isStreamSchema, p as WsOrchestrationSubscribeShellRpc, rt as exitSchema, si as ServerSettingsError, t as WS_METHODS, ul as layerWebSocket, wl as toUrl, yl as get$1 } from "./src-KdbHqrex.js";
5
+ import { a as make$4, c as make$3, i as layerMergedContext, o as getAndSet$1, s as makeUnsafe$3, t as T3AuthTransport } from "./transport-MI0Z3d2T.js";
6
+ import { Al as get$1, Bl as TransportError, Bn as ServerConfig, Dr as ServerProviders, El as inspect$1, Fl as toUrl, Gl as fromInput, Hl as fromSetCookie, Il as DecodeError, Kl as merge, Ll as HttpClientError, Pl as setUrlParam, Sl as TypeId$2, Tl as TypeId$1, Uu as EnvironmentAuthorizationError, Vl as empty$1, Wl as empty$2, _l as SocketError, at as getStreamSchemas, bl as WebSocketConstructor, c as WsOrchestrationDispatchCommandRpc, gl as SocketCloseError, hl as Socket, it as make$5, ji as KeybindingsConfigError, m as WsOrchestrationSubscribeThreadRpc, nt as make$6, ot as isStreamSchema, p as WsOrchestrationSubscribeShellRpc, rt as exitSchema, t as WS_METHODS, ui as ServerSettingsError, xl as layerWebSocket, yl as SocketOpenError } from "./src-aiFPmAG7.js";
7
7
  import { n as fromInput$1 } from "./UrlParams-BA6gBvaY.js";
8
8
  import { r as toWebSocketEndpointUrl, t as normalizeHttpBaseUrl } from "./url-SlsaG8nY.js";
9
- import { i as RpcClientError, r as RpcClientDefect, t as RpcError } from "./error-B2t1bAP9.js";
9
+ import { i as RpcClientError, r as RpcClientDefect, t as RpcError } from "./error-ChTsLQTu.js";
10
10
  import { createRequire } from "node:module";
11
11
  import { Readable } from "node:stream";
12
12
  //#region node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.78_effect@4.0.0-beta.78/node_modules/@effect/platform-node-shared/dist/NodeSink.js
@@ -1,11 +1,11 @@
1
1
  import { $t as hash, Tn as constUndefined, X as Prototype, a as get, an as hasProperty, bn as isTagged, h as mutate, k as match, kn as flow, n as Service, o as getOption, r as add, t as Reference } from "./Context-DueQ9iMH.js";
2
2
  import { $ as mapError, Ar as makeSpanUnsafe, At as tap, Br as ParentSpan, Bt as useSpan, C as context, Ct as serviceOption, D as ensuring, F as fnUntraced, H as fromResult, Jn as TracerTimingEnabled, Kn as provide, O as exit, Ot as suspend, P as fn, Rn as Scope, Rt as uninterruptibleMask, S as clockWith, Tt as succeed, U as gen, Ur as reason, Ut as withFiber, Vn as close, Vt as void_, Wn as make$4, X as map, Y as makeSpanScoped, _r as endSpan, a as badArgument, at as onExit, b as catchTags, dt as provideService, gt as runForkWith, j as flatMap, k as fail, kn as effect, kt as sync, sr as isSuccess, st as orDie, t as Path, ut as provideContext, v as catchFilter, w as contextWith, xt as scoped, y as catchTag, zn as addFinalizer } from "./Path-D8WPdPwR.js";
3
3
  import { Bn as Clock, Dn as runIn, Dt as fromQueue, Fn as encodeBase64Url, In as add$1, Ln as formatIso, Rn as now, Sn as offerUnsafe, dt as FileSystem, nn as unwrap, vn as failCauseUnsafe, yn as make$5, zn as toEpochMillis } from "./Schema-DsQxYh6_.js";
4
- import { r as decodeAuthLocalRuntimeStateFromJson, t as T3AuthTransport } from "./transport-D3zBdZ1h.js";
5
- import { ou as AuthAdministrativeScopes, zu as AuthSessionId } from "./src-KdbHqrex.js";
4
+ import { r as decodeAuthLocalRuntimeStateFromJson, t as T3AuthTransport } from "./transport-MI0Z3d2T.js";
5
+ import { Xu as AuthSessionId, _u as AuthAdministrativeScopes } from "./src-aiFPmAG7.js";
6
6
  import { n as T3Config, t as Environment } from "./service-CLmRO2Dp.js";
7
7
  import { a as mutate$1, i as fromString, t as normalizeHttpBaseUrl } from "./url-SlsaG8nY.js";
8
- import { a as AuthLocalSigningError, i as AuthLocalSecretError, n as AuthLocalDatabaseError, o as AuthPairingUrlError, r as AuthLocalError, t as AuthConfigError } from "./error-jwMt3VoW.js";
8
+ import { a as AuthLocalSigningError, i as AuthLocalSecretError, n as AuthLocalDatabaseError, o as AuthPairingUrlError, r as AuthLocalError, t as AuthConfigError } from "./error-CjADNVm8.js";
9
9
  import { n as resolveT3BaseDir } from "./base-dir-R12OMDso.js";
10
10
  //#region node_modules/.pnpm/effect@4.0.0-beta.78/node_modules/effect/dist/Crypto.js
11
11
  /**
@@ -1,15 +1,18 @@
1
1
  import { An as identity, C as isNone, S as getOrUndefined, T as isSome, an as hasProperty, n as Service } from "./Context-DueQ9iMH.js";
2
2
  import { $ as mapError, Fn as succeed$1, It as try_, Mn as mergeAll, Mt as tapError, Nn as provide$1, P as fn, Tt as succeed, U as gen, Vt as void_, X as map, Yt as exponential, Zt as take, b as catchTags, bt as scope, dt as provideService, j as flatMap, k as fail, kn as effect, kt as sync, lt as provide, mt as retry, qt as collectWhile, st as orDie, t as Path, xt as scoped, zn as addFinalizer } from "./Path-D8WPdPwR.js";
3
3
  import { $ as optional, $t as tapError$1, At as map$1, Ct as flatMap$1, Et as fromIterableEffect, F as decodeUnknownSync, Ft as peel, Gt as runHead, Kt as runLast, Ln as formatIso, Rn as now, Rt as retry$1, St as filter, T as Union, Tt as fromIterable, Zt as takeUntil, _t as catchTags$1, a as Defect, g as Number, nn as unwrap, qt as scoped$1, sn as head, x as TaggedErrorClass, xt as fail$1, y as String } from "./Schema-DsQxYh6_.js";
4
- import { n as T3AuthTransportLive } from "./transport-D3zBdZ1h.js";
5
- import { a as makeT3CodeConnectionProvider, n as T3Rpc, o as layerWebSocketConstructor, r as T3CodeConnectionProvider, s as layerUndici, t as T3RpcLive } from "./layer-DvHnKBYj.js";
6
- import { S as Crypto, _ as layer, c as T3LocalAuthLive, d as T3LocalAuthTokenLive, g as makeCompilerSqlite, h as defaultTransforms, i as T3AuthPairingLive, m as make, p as SqlClientFactory, t as T3AuthLive, y as T3LocalAuthOriginLive } from "./layer-CfC5qZol.js";
7
- import { $c as ProviderInstanceId, Gu as MessageId, Vu as CommandId, Yu as ProjectId, is as ORCHESTRATION_WS_METHODS, rs as ModelSelection, t as WS_METHODS, td as ThreadId, ws as OrchestrationMessage } from "./src-KdbHqrex.js";
4
+ import { n as T3AuthTransportLive } from "./transport-MI0Z3d2T.js";
5
+ import { a as makeT3CodeConnectionProvider, n as T3Rpc, o as layerWebSocketConstructor, r as T3CodeConnectionProvider, s as layerUndici, t as T3RpcLive } from "./layer-CMo36MrX.js";
6
+ import { S as Crypto, _ as layer, c as T3LocalAuthLive, d as T3LocalAuthTokenLive, g as makeCompilerSqlite, h as defaultTransforms, i as T3AuthPairingLive, m as make, p as SqlClientFactory, t as T3AuthLive, y as T3LocalAuthOriginLive } from "./layer-Do8wK1t6.js";
7
+ import { Qu as CommandId, cs as ModelSelection, fd as ThreadId, ks as OrchestrationMessage, ls as ORCHESTRATION_WS_METHODS, nd as MessageId, od as ProjectId, t as WS_METHODS, ul as ProviderInstanceId } from "./src-aiFPmAG7.js";
8
8
  import { n as T3Config, t as Environment } from "./service-CLmRO2Dp.js";
9
9
  import { t as T3Application } from "./service-ybOWV9pL.js";
10
- import { i as RpcClientError, n as T3CodeConnectionError, t as RpcError } from "./error-B2t1bAP9.js";
10
+ import { i as RpcClientError, n as T3CodeConnectionError, t as RpcError } from "./error-ChTsLQTu.js";
11
11
  import { t as T3ConfigLive } from "./layer-DUv99vsS.js";
12
12
  import { DatabaseSync } from "node:sqlite";
13
+ //#region src/cli-path/service.ts
14
+ var CliPath = class extends Service()("t3cli/CliPath") {};
15
+ //#endregion
13
16
  //#region src/domain/error.ts
14
17
  var ProjectLookupError = class extends TaggedErrorClass()("ProjectLookupError", {
15
18
  message: String,
@@ -120,73 +123,68 @@ const makeModelsApplication = fn("makeModelsApplication")(function* () {
120
123
  //#endregion
121
124
  //#region src/domain/helpers.ts
122
125
  const resolveProjectScope = fn("resolveProjectScope")(function* (snapshot, input) {
123
- const absoluteRef = yield* resolveAbsolutePath(input.ref, input.cwd);
126
+ const path = yield* Path;
124
127
  const byId = findProjectById(snapshot, input.ref);
125
128
  if (byId !== null) return { project: byId };
126
- const byExactPath = yield* findProjectByWorkspaceRoot(snapshot, absoluteRef, input.cwd);
127
- if (byExactPath !== void 0) return { project: byExactPath };
128
- const byAncestor = yield* findProjectByAncestorPath(snapshot, absoluteRef, input.cwd);
129
- if (byAncestor !== void 0) return byAncestor;
130
- return yield* findProjectByKnownWorktreePath(snapshot, absoluteRef, input.cwd);
129
+ if (!path.isAbsolute(input.ref)) return;
130
+ return yield* findProjectByPathPriority(snapshot, path.normalize(input.ref));
131
131
  });
132
132
  function findProjectById(snapshot, projectId) {
133
133
  return snapshot.projects.find((project) => project.id === projectId) ?? null;
134
134
  }
135
- const resolveAbsolutePath = fn("resolveAbsolutePath")(function* (ref, cwd) {
136
- const path = yield* Path;
137
- return path.isAbsolute(ref) ? path.normalize(ref) : path.normalize(path.resolve(cwd, ref));
138
- });
139
135
  const isDescendantPath = fn("isDescendantPath")(function* (parent, child) {
140
136
  const path = yield* Path;
141
137
  if (child === parent) return true;
142
138
  const relative = path.relative(parent, child);
143
139
  return relative.length > 0 && !relative.startsWith("..") && !path.isAbsolute(relative);
144
140
  });
145
- const findProjectByWorkspaceRoot = fn("findProjectByWorkspaceRoot")(function* (snapshot, absolutePath, cwd) {
146
- for (const project of snapshot.projects) if ((yield* resolveAbsolutePath(project.workspaceRoot, cwd)) === absolutePath) return project;
147
- });
148
- const findProjectByAncestorPath = fn("findProjectByAncestorPath")(function* (snapshot, absolutePath, cwd) {
149
- let bestProject;
150
- let bestWorkspaceRoot = "";
151
- for (const project of snapshot.projects) {
152
- const workspaceRoot = yield* resolveAbsolutePath(project.workspaceRoot, cwd);
153
- if (!(yield* isDescendantPath(workspaceRoot, absolutePath))) continue;
154
- if (workspaceRoot.length > bestWorkspaceRoot.length) {
155
- bestProject = project;
156
- bestWorkspaceRoot = workspaceRoot;
157
- }
158
- }
159
- if (bestProject === void 0) return;
160
- if (absolutePath === bestWorkspaceRoot) return { project: bestProject };
161
- return {
162
- project: bestProject,
163
- inferredWorktreePath: absolutePath
164
- };
165
- });
166
- const findProjectByKnownWorktreePath = fn("findProjectByKnownWorktreePath")(function* (snapshot, absolutePath, cwd) {
141
+ const findProjectByPathPriority = fn("findProjectByPathPriority")(function* (snapshot, absolutePath) {
142
+ const path = yield* Path;
167
143
  const projectsById = new Map(snapshot.projects.map((project) => [project.id, project]));
168
- let bestProject;
169
- let bestKnownPath = "";
144
+ const workspaceRoots = new Map(snapshot.projects.map((project) => [project.id, path.normalize(project.workspaceRoot)]));
145
+ const candidates = [];
170
146
  for (const thread of snapshot.threads) {
171
147
  if (thread.worktreePath === null) continue;
172
148
  const project = projectsById.get(thread.projectId);
173
149
  if (project === void 0) continue;
174
- const knownPath = yield* resolveAbsolutePath(thread.worktreePath, cwd);
175
- if (!(yield* isDescendantPath(knownPath, absolutePath))) continue;
176
- if (knownPath.length > bestKnownPath.length) {
177
- bestProject = project;
178
- bestKnownPath = knownPath;
179
- }
150
+ const workspaceRoot = workspaceRoots.get(thread.projectId);
151
+ if (workspaceRoot === void 0) continue;
152
+ const matchPath = path.normalize(thread.worktreePath);
153
+ if (!(yield* isDescendantPath(matchPath, absolutePath))) continue;
154
+ candidates.push({
155
+ project,
156
+ matchPath,
157
+ workspaceRoot,
158
+ source: "worktree"
159
+ });
160
+ }
161
+ for (const project of snapshot.projects) {
162
+ const workspaceRoot = workspaceRoots.get(project.id);
163
+ if (workspaceRoot === void 0) continue;
164
+ if (!(yield* isDescendantPath(workspaceRoot, absolutePath))) continue;
165
+ candidates.push({
166
+ project,
167
+ matchPath: workspaceRoot,
168
+ workspaceRoot,
169
+ source: "project"
170
+ });
171
+ }
172
+ if (candidates.length === 0) return;
173
+ candidates.sort((left, right) => {
174
+ if (left.matchPath.length !== right.matchPath.length) return right.matchPath.length - left.matchPath.length;
175
+ if (left.source === right.source) return 0;
176
+ return left.source === "worktree" ? -1 : 1;
177
+ });
178
+ const best = candidates[0];
179
+ if (absolutePath === best.matchPath) {
180
+ if (best.source === "worktree" && best.matchPath !== best.workspaceRoot) return {
181
+ project: best.project,
182
+ inferredWorktreePath: best.matchPath
183
+ };
184
+ return { project: best.project };
180
185
  }
181
- if (bestProject === void 0) return;
182
- const workspaceRoot = yield* resolveAbsolutePath(bestProject.workspaceRoot, cwd);
183
- if (absolutePath === workspaceRoot) return { project: bestProject };
184
- if (absolutePath === bestKnownPath) return bestKnownPath === workspaceRoot ? { project: bestProject } : {
185
- project: bestProject,
186
- inferredWorktreePath: bestKnownPath
187
- };
188
186
  return {
189
- project: bestProject,
187
+ project: best.project,
190
188
  inferredWorktreePath: absolutePath
191
189
  };
192
190
  });
@@ -444,10 +442,7 @@ const makeThreadApplication = fn("makeThreadApplication")(function* () {
444
442
  const environment = yield* Environment;
445
443
  const listThreads = fn("T3ApplicationLive.listThreads")(function* (projectRef) {
446
444
  const snapshot = yield* orchestration.getShellSnapshot();
447
- const scope = yield* resolveProjectScope(snapshot, {
448
- ref: projectRef,
449
- cwd: environment.cwd
450
- }).pipe(provideService(Path, path));
445
+ const scope = yield* resolveProjectScope(snapshot, { ref: projectRef }).pipe(provideService(Path, path));
451
446
  if (scope === void 0) return yield* fail(new ProjectLookupError({
452
447
  message: `project not found: ${projectRef}`,
453
448
  ref: projectRef
@@ -471,10 +466,7 @@ const makeThreadApplication = fn("makeThreadApplication")(function* () {
471
466
  message: "project is required",
472
467
  ref: environment.cwd
473
468
  }));
474
- const scope = yield* resolveProjectScope(snapshot, {
475
- ref: projectRef,
476
- cwd: environment.cwd
477
- }).pipe(provideService(Path, path));
469
+ const scope = yield* resolveProjectScope(snapshot, { ref: projectRef }).pipe(provideService(Path, path));
478
470
  if (scope === void 0) return yield* fail(new ProjectLookupError({
479
471
  message: `project not found: ${projectRef}`,
480
472
  ref: projectRef
@@ -583,6 +575,19 @@ const makeThreadApplication = fn("makeThreadApplication")(function* () {
583
575
  });
584
576
  yield* failIfThreadError(thread);
585
577
  return thread;
578
+ }),
579
+ callbackThread: fn("T3ApplicationLive.callbackThread")(function* (input) {
580
+ yield* waitForThread({
581
+ orchestration,
582
+ threadId: input.fromThreadId
583
+ });
584
+ return {
585
+ dispatch: (yield* sendThread({
586
+ threadId: input.targetThreadId,
587
+ message: input.prompt
588
+ }, { until: "dispatch" })).dispatch,
589
+ targetThreadId: input.targetThreadId
590
+ };
586
591
  })
587
592
  };
588
593
  });
@@ -1191,6 +1196,7 @@ function toSqlInputValue(value) {
1191
1196
  }
1192
1197
  return JSON.stringify(value) ?? null;
1193
1198
  }
1199
+ const NodeCliPathLayer = effect(CliPath, sync(() => ({ path: process.argv[1] ?? "dist/bin.js" })));
1194
1200
  //#endregion
1195
1201
  //#region src/runtime/layer.ts
1196
1202
  const T3AuthTransportLayer = T3AuthTransportLive.pipe(provide$1(layerUndici));
@@ -1212,6 +1218,6 @@ const T3RpcLayer = T3RpcLive.pipe(provide$1(mergeAll(T3ConfigConnectionProviderL
1212
1218
  const T3OrchestrationLayer = T3OrchestrationLive.pipe(provide$1(T3RpcLayer));
1213
1219
  const T3ApplicationLayer = T3ApplicationLive.pipe(provide$1(T3OrchestrationLayer));
1214
1220
  const AuthAppLayer = mergeAll(T3ConfigLive, T3AuthLayer);
1215
- const AppLayer = mergeAll(T3ConfigLive, T3AuthLayer, T3RpcLayer, T3OrchestrationLayer, T3ApplicationLayer);
1221
+ const AppLayer = mergeAll(T3ConfigLive, T3AuthLayer, T3RpcLayer, T3OrchestrationLayer, T3ApplicationLayer, NodeCliPathLayer);
1216
1222
  //#endregion
1217
- export { T3AuthTransportLayer as a, T3LocalAuthTokenLayer as c, latestAssistantMessage as d, threadStatus as f, T3AuthPairingLayer as i, T3OrchestrationLayer as l, ThreadSessionError as m, AuthAppLayer as n, T3LocalAuthLayer as o, ProjectLookupError as p, T3AuthLayer as r, T3LocalAuthOriginLayer as s, AppLayer as t, T3Orchestration as u };
1223
+ export { T3AuthTransportLayer as a, T3LocalAuthTokenLayer as c, latestAssistantMessage as d, threadStatus as f, CliPath as h, T3AuthPairingLayer as i, T3OrchestrationLayer as l, ThreadSessionError as m, AuthAppLayer as n, T3LocalAuthLayer as o, ProjectLookupError as p, T3AuthLayer as r, T3LocalAuthOriginLayer as s, AppLayer as t, T3Orchestration as u };
@@ -1,2 +1,2 @@
1
- import { l as T3OrchestrationLayer, u as T3Orchestration } from "./layer-DIg0RxSO.js";
1
+ import { l as T3OrchestrationLayer, u as T3Orchestration } from "./layer-DwI3Skkh.js";
2
2
  export { T3Orchestration, T3OrchestrationLayer };
package/dist/rpc.js CHANGED
@@ -1,2 +1,2 @@
1
- import { t as RpcError } from "./error-B2t1bAP9.js";
1
+ import { t as RpcError } from "./error-ChTsLQTu.js";
2
2
  export { RpcError };
package/dist/runtime.js CHANGED
@@ -1,3 +1,3 @@
1
- import { a as T3AuthTransportLayer, c as T3LocalAuthTokenLayer, i as T3AuthPairingLayer, l as T3OrchestrationLayer, n as AuthAppLayer, o as T3LocalAuthLayer, r as T3AuthLayer, s as T3LocalAuthOriginLayer, t as AppLayer } from "./layer-DIg0RxSO.js";
1
+ import { a as T3AuthTransportLayer, c as T3LocalAuthTokenLayer, i as T3AuthPairingLayer, l as T3OrchestrationLayer, n as AuthAppLayer, o as T3LocalAuthLayer, r as T3AuthLayer, s as T3LocalAuthOriginLayer, t as AppLayer } from "./layer-DwI3Skkh.js";
2
2
  import { t as NodeEnvironmentLive } from "./layer-DHhKS5jd.js";
3
3
  export { AppLayer, AuthAppLayer, NodeEnvironmentLive, T3AuthLayer, T3AuthPairingLayer, T3AuthTransportLayer, T3LocalAuthLayer, T3LocalAuthOriginLayer, T3LocalAuthTokenLayer, T3OrchestrationLayer };
@@ -82,6 +82,15 @@ export declare const makeT3Application: () => Effect.Effect<{
82
82
  readonly updatedAt: string;
83
83
  readonly providerInstanceId?: (string & import("effect/Brand").Brand<"ProviderInstanceId">) | undefined;
84
84
  } | null;
85
+ readonly goal: {
86
+ readonly objective: string;
87
+ readonly status: "active" | "paused" | "budgetLimited" | "complete";
88
+ readonly tokensUsed: number;
89
+ readonly tokenBudget: number | null;
90
+ readonly timeUsedSeconds: number;
91
+ readonly createdAt: string;
92
+ readonly updatedAt: string;
93
+ } | null;
85
94
  readonly latestUserMessageAt: string | null;
86
95
  readonly hasPendingApprovals: boolean;
87
96
  readonly hasPendingUserInput: boolean;
@@ -120,6 +129,15 @@ export declare const makeT3Application: () => Effect.Effect<{
120
129
  readonly updatedAt: string;
121
130
  readonly archivedAt: string | null;
122
131
  readonly deletedAt: string | null;
132
+ readonly goal: {
133
+ readonly objective: string;
134
+ readonly status: "active" | "paused" | "budgetLimited" | "complete";
135
+ readonly tokensUsed: number;
136
+ readonly tokenBudget: number | null;
137
+ readonly timeUsedSeconds: number;
138
+ readonly createdAt: string;
139
+ readonly updatedAt: string;
140
+ } | null;
123
141
  readonly messages: readonly {
124
142
  readonly id: string & import("effect/Brand").Brand<"MessageId">;
125
143
  readonly role: "user" | "assistant" | "system";
@@ -225,6 +243,15 @@ export declare const makeT3Application: () => Effect.Effect<{
225
243
  readonly updatedAt: string;
226
244
  readonly archivedAt: string | null;
227
245
  readonly deletedAt: string | null;
246
+ readonly goal: {
247
+ readonly objective: string;
248
+ readonly status: "active" | "paused" | "budgetLimited" | "complete";
249
+ readonly tokensUsed: number;
250
+ readonly tokenBudget: number | null;
251
+ readonly timeUsedSeconds: number;
252
+ readonly createdAt: string;
253
+ readonly updatedAt: string;
254
+ } | null;
228
255
  readonly messages: readonly {
229
256
  readonly id: string & import("effect/Brand").Brand<"MessageId">;
230
257
  readonly role: "user" | "assistant" | "system";
@@ -401,6 +428,15 @@ export declare const makeT3Application: () => Effect.Effect<{
401
428
  readonly updatedAt: string;
402
429
  readonly archivedAt: string | null;
403
430
  readonly deletedAt: string | null;
431
+ readonly goal: {
432
+ readonly objective: string;
433
+ readonly status: "active" | "paused" | "budgetLimited" | "complete";
434
+ readonly tokensUsed: number;
435
+ readonly tokenBudget: number | null;
436
+ readonly timeUsedSeconds: number;
437
+ readonly createdAt: string;
438
+ readonly updatedAt: string;
439
+ } | null;
404
440
  readonly messages: readonly {
405
441
  readonly id: string & import("effect/Brand").Brand<"MessageId">;
406
442
  readonly role: "user" | "assistant" | "system";
@@ -495,6 +531,15 @@ export declare const makeT3Application: () => Effect.Effect<{
495
531
  readonly updatedAt: string;
496
532
  readonly archivedAt: string | null;
497
533
  readonly deletedAt: string | null;
534
+ readonly goal: {
535
+ readonly objective: string;
536
+ readonly status: "active" | "paused" | "budgetLimited" | "complete";
537
+ readonly tokensUsed: number;
538
+ readonly tokenBudget: number | null;
539
+ readonly timeUsedSeconds: number;
540
+ readonly createdAt: string;
541
+ readonly updatedAt: string;
542
+ } | null;
498
543
  readonly messages: readonly {
499
544
  readonly id: string & import("effect/Brand").Brand<"MessageId">;
500
545
  readonly role: "user" | "assistant" | "system";
@@ -555,6 +600,12 @@ export declare const makeT3Application: () => Effect.Effect<{
555
600
  readonly providerInstanceId?: (string & import("effect/Brand").Brand<"ProviderInstanceId">) | undefined;
556
601
  } | null;
557
602
  }, import("../domain/error.ts").ThreadSessionError | import("../rpc/error.ts").RpcError, never>;
603
+ callbackThread: (input: import("./service.ts").CallbackThreadInput) => Effect.Effect<{
604
+ dispatch: {
605
+ readonly sequence: number;
606
+ };
607
+ targetThreadId: string;
608
+ }, import("../domain/error.ts").ThreadSessionError | import("../rpc/error.ts").RpcError, never>;
558
609
  loadShell: () => Effect.Effect<{
559
610
  readonly snapshotSequence: number;
560
611
  readonly projects: readonly {
@@ -633,6 +684,15 @@ export declare const makeT3Application: () => Effect.Effect<{
633
684
  readonly updatedAt: string;
634
685
  readonly providerInstanceId?: (string & import("effect/Brand").Brand<"ProviderInstanceId">) | undefined;
635
686
  } | null;
687
+ readonly goal: {
688
+ readonly objective: string;
689
+ readonly status: "active" | "paused" | "budgetLimited" | "complete";
690
+ readonly tokensUsed: number;
691
+ readonly tokenBudget: number | null;
692
+ readonly timeUsedSeconds: number;
693
+ readonly createdAt: string;
694
+ readonly updatedAt: string;
695
+ } | null;
636
696
  readonly latestUserMessageAt: string | null;
637
697
  readonly hasPendingApprovals: boolean;
638
698
  readonly hasPendingUserInput: boolean;
@@ -752,6 +812,7 @@ export declare const makeT3Application: () => Effect.Effect<{
752
812
  readonly groupKey: string;
753
813
  } | undefined;
754
814
  readonly showInteractionModeToggle?: boolean | undefined;
815
+ readonly requiresNewThreadForModelChange?: boolean | undefined;
755
816
  readonly message?: string | undefined;
756
817
  readonly availability?: "available" | "unavailable" | undefined;
757
818
  readonly unavailableReason?: string | undefined;
@@ -70,6 +70,7 @@ export declare const makeModelsApplication: () => Effect.Effect<{
70
70
  readonly groupKey: string;
71
71
  } | undefined;
72
72
  readonly showInteractionModeToggle?: boolean | undefined;
73
+ readonly requiresNewThreadForModelChange?: boolean | undefined;
73
74
  readonly message?: string | undefined;
74
75
  readonly availability?: "available" | "unavailable" | undefined;
75
76
  readonly unavailableReason?: string | undefined;
@@ -83,6 +83,15 @@ export declare const makeProjectApplication: () => Effect.Effect<{
83
83
  readonly updatedAt: string;
84
84
  readonly providerInstanceId?: (string & import("effect/Brand").Brand<"ProviderInstanceId">) | undefined;
85
85
  } | null;
86
+ readonly goal: {
87
+ readonly objective: string;
88
+ readonly status: "active" | "paused" | "budgetLimited" | "complete";
89
+ readonly tokensUsed: number;
90
+ readonly tokenBudget: number | null;
91
+ readonly timeUsedSeconds: number;
92
+ readonly createdAt: string;
93
+ readonly updatedAt: string;
94
+ } | null;
86
95
  readonly latestUserMessageAt: string | null;
87
96
  readonly hasPendingApprovals: boolean;
88
97
  readonly hasPendingUserInput: boolean;
@@ -17,6 +17,11 @@ export type SendThreadInput = {
17
17
  readonly message: string;
18
18
  readonly options?: NonNullable<ModelSelection["options"]>;
19
19
  };
20
+ export type CallbackThreadInput = {
21
+ readonly fromThreadId: string;
22
+ readonly targetThreadId: string;
23
+ readonly prompt: string;
24
+ };
20
25
  export type StartThreadPolicy = {
21
26
  readonly until: "dispatch" | "visible" | "complete";
22
27
  };
@@ -66,6 +71,10 @@ declare const T3Application_base: Context.ServiceClass<T3Application, "t3cli/T3A
66
71
  }, ApplicationError>;
67
72
  readonly watchThread: (threadId: string) => Stream.Stream<WaitEvent, ApplicationError>;
68
73
  readonly waitForThread: (threadId: string) => Effect.Effect<OrchestrationThread, ApplicationError>;
74
+ readonly callbackThread: (input: CallbackThreadInput) => Effect.Effect<{
75
+ readonly dispatch: DispatchResult;
76
+ readonly targetThreadId: string;
77
+ }, ApplicationError>;
69
78
  }>;
70
79
  export declare class T3Application extends T3Application_base {
71
80
  }
@@ -82,6 +82,15 @@ export declare function waitForShellSequence(input: {
82
82
  readonly updatedAt: string;
83
83
  readonly providerInstanceId?: (string & import("effect/Brand").Brand<"ProviderInstanceId">) | undefined;
84
84
  } | null;
85
+ readonly goal: {
86
+ readonly objective: string;
87
+ readonly status: "active" | "paused" | "budgetLimited" | "complete";
88
+ readonly tokensUsed: number;
89
+ readonly tokenBudget: number | null;
90
+ readonly timeUsedSeconds: number;
91
+ readonly createdAt: string;
92
+ readonly updatedAt: string;
93
+ } | null;
85
94
  readonly latestUserMessageAt: string | null;
86
95
  readonly hasPendingApprovals: boolean;
87
96
  readonly hasPendingUserInput: boolean;
@@ -42,6 +42,15 @@ export declare function waitForThread(input: {
42
42
  readonly updatedAt: string;
43
43
  readonly archivedAt: string | null;
44
44
  readonly deletedAt: string | null;
45
+ readonly goal: {
46
+ readonly objective: string;
47
+ readonly status: "active" | "paused" | "budgetLimited" | "complete";
48
+ readonly tokensUsed: number;
49
+ readonly tokenBudget: number | null;
50
+ readonly timeUsedSeconds: number;
51
+ readonly createdAt: string;
52
+ readonly updatedAt: string;
53
+ } | null;
45
54
  readonly messages: readonly {
46
55
  readonly id: string & import("effect/Brand").Brand<"MessageId">;
47
56
  readonly role: "user" | "assistant" | "system";