Files
t3code/packages/shared/package.json
T
Theo BrowneandClaude Fable 5 590103ee7f Surface-derived workspace defaults, pinned worktree bases, and worktree registry
Implements the new-thread workspace model: every new thread starts from the
resolved default workspace mode instead of inheriting the previous thread's
choices, and worktree threads pin a fresh remote base with visible provenance.

Surface-derived defaults
- New `deriveThreadEnvModeFromSurface` setting (default on): attached
  surfaces (desktop app, loopback browser on a host-managed environment)
  default to the current checkout; detached surfaces (remote browser,
  mobile, relay/SSH) default to a fresh worktree. Explicit
  `defaultThreadEnvMode` still pins a mode globally when derivation is off,
  keeping the wire value decodable by older clients.
- Sticky per-draft inheritance retired: sidebar/new-thread actions no longer
  seed mode/branch/worktree from the active thread. `chat.newLocal` remains
  the explicit current-checkout exception (draft-only).
- Per-project override (`projectThreadEnvModeOverrides` client setting) via
  an explicit "Always … for this project" action in the workspace picker —
  the only sanctioned way a composer choice retrains the default.

Fresh worktree bases without a blocking fetch
- `WorktreeBasePlanner`: fetch within the 30s freshness window counts as
  fresh; concurrent fetches dedupe per repository; a failed fetch with a
  successful fetch within the last hour proceeds on the last-known remote
  commit (fail-visible, "stale" provenance); otherwise the bootstrap fails
  closed and never silently falls back to a local ref.
- Composer prefetch: worktree-mode drafts fire `vcs.prefetchRemote` on open
  so the send-time check almost always hits the fresh window.
- `newWorktreesStartFromOrigin` now defaults on.

Provenance and registry
- Bootstrap records a `worktree.base-pinned` thread activity (base ref, sha,
  provenance, fetch time); the branch toolbar renders the pinned fact
  ("Worktree · a1b2c3f") with provenance on hover.
- `WorktreeRegistry` persists thread↔worktree records to
  `stateDir/worktree-registry.json`, updated at bootstrap and on thread
  deletion — groundwork for lifecycle/GC tooling.
- Deterministic branch naming: worktree branches derive from the thread id
  (`t3code/<uuid-prefix>`), with collision suffixing server-side.

Composer UX
- Dirty-checkout disclosure both directions with one-click mode switch.
- Workspace picker labels choices as "this draft only".

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-13 19:57:26 -07:00

210 lines
5.3 KiB
JSON

{
"name": "@t3tools/shared",
"private": true,
"type": "module",
"exports": {
"./model": {
"types": "./src/model.ts",
"import": "./src/model.ts"
},
"./advertisedEndpoint": {
"types": "./src/advertisedEndpoint.ts",
"import": "./src/advertisedEndpoint.ts"
},
"./agentAwareness": {
"types": "./src/agentAwareness.ts",
"import": "./src/agentAwareness.ts"
},
"./git": {
"types": "./src/git.ts",
"import": "./src/git.ts"
},
"./threadEnvMode": {
"types": "./src/threadEnvMode.ts",
"import": "./src/threadEnvMode.ts"
},
"./sourceControl": {
"types": "./src/sourceControl.ts",
"import": "./src/sourceControl.ts"
},
"./logging": {
"types": "./src/logging.ts",
"import": "./src/logging.ts"
},
"./observability": {
"types": "./src/observability.ts",
"import": "./src/observability.ts"
},
"./httpObservability": {
"types": "./src/httpObservability.ts",
"import": "./src/httpObservability.ts"
},
"./shell": {
"types": "./src/shell.ts",
"import": "./src/shell.ts"
},
"./semver": {
"types": "./src/semver.ts",
"import": "./src/semver.ts"
},
"./Net": {
"types": "./src/Net.ts",
"import": "./src/Net.ts"
},
"./DrainableWorker": {
"types": "./src/DrainableWorker.ts",
"import": "./src/DrainableWorker.ts"
},
"./KeyedCoalescingWorker": {
"types": "./src/KeyedCoalescingWorker.ts",
"import": "./src/KeyedCoalescingWorker.ts"
},
"./schemaJson": {
"types": "./src/schemaJson.ts",
"import": "./src/schemaJson.ts"
},
"./schemaYaml": {
"types": "./src/schemaYaml.ts",
"import": "./src/schemaYaml.ts"
},
"./toolActivity": {
"types": "./src/toolActivity.ts",
"import": "./src/toolActivity.ts"
},
"./Struct": {
"types": "./src/Struct.ts",
"import": "./src/Struct.ts"
},
"./serverSettings": {
"types": "./src/serverSettings.ts",
"import": "./src/serverSettings.ts"
},
"./String": {
"types": "./src/String.ts",
"import": "./src/String.ts"
},
"./projectScripts": {
"types": "./src/projectScripts.ts",
"import": "./src/projectScripts.ts"
},
"./orchestrationTiming": {
"types": "./src/orchestrationTiming.ts",
"import": "./src/orchestrationTiming.ts"
},
"./remote": {
"types": "./src/remote.ts",
"import": "./src/remote.ts"
},
"./relaySigning": {
"types": "./src/relaySigning.ts",
"import": "./src/relaySigning.ts"
},
"./dpop": {
"types": "./src/dpop.ts",
"import": "./src/dpop.ts"
},
"./dpopCommon": {
"types": "./src/dpopCommon.ts",
"import": "./src/dpopCommon.ts"
},
"./relayAuth": {
"types": "./src/relayAuth.ts",
"import": "./src/relayAuth.ts"
},
"./relayUrl": {
"types": "./src/relayUrl.ts",
"import": "./src/relayUrl.ts"
},
"./relayJwt": {
"types": "./src/relayJwt.ts",
"import": "./src/relayJwt.ts"
},
"./oauthScope": {
"types": "./src/oauthScope.ts",
"import": "./src/oauthScope.ts"
},
"./searchRanking": {
"types": "./src/searchRanking.ts",
"import": "./src/searchRanking.ts"
},
"./qrCode": {
"types": "./src/qrCode.ts",
"import": "./src/qrCode.ts"
},
"./cliArgs": {
"types": "./src/cliArgs.ts",
"import": "./src/cliArgs.ts"
},
"./path": {
"types": "./src/path.ts",
"import": "./src/path.ts"
},
"./keybindings": {
"types": "./src/keybindings.ts",
"import": "./src/keybindings.ts"
},
"./composerTrigger": {
"types": "./src/composerTrigger.ts",
"import": "./src/composerTrigger.ts"
},
"./composerInlineTokens": {
"types": "./src/composerInlineTokens.ts",
"import": "./src/composerInlineTokens.ts"
},
"./terminalLabels": {
"types": "./src/terminalLabels.ts",
"import": "./src/terminalLabels.ts"
},
"./relayClient": {
"types": "./src/relayClient.ts",
"import": "./src/relayClient.ts"
},
"./relayTracing": {
"types": "./src/relayTracing.ts",
"import": "./src/relayTracing.ts"
},
"./preview": {
"types": "./src/preview.ts",
"import": "./src/preview.ts"
},
"./previewViewport": {
"types": "./src/previewViewport.ts",
"import": "./src/previewViewport.ts"
},
"./filePreview": {
"types": "./src/filePreview.ts",
"import": "./src/filePreview.ts"
},
"./chatList": {
"types": "./src/chatList.ts",
"import": "./src/chatList.ts"
},
"./hostProcess": {
"types": "./src/hostProcess.ts",
"import": "./src/hostProcess.ts"
},
"./httpReadiness": {
"types": "./src/httpReadiness.ts",
"import": "./src/httpReadiness.ts"
}
},
"scripts": {
"typecheck": "tsgo --noEmit",
"test": "vp test run"
},
"dependencies": {
"@noble/curves": "catalog:",
"@noble/hashes": "catalog:",
"@t3tools/contracts": "workspace:*",
"effect": "catalog:",
"jose": "catalog:",
"yaml": "catalog:"
},
"devDependencies": {
"@effect/platform-node": "catalog:",
"@effect/vitest": "catalog:",
"@types/node": "catalog:",
"vite-plus": "catalog:"
}
}