t3code-cli 0.8.0 → 0.9.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 (59) hide show
  1. package/README.md +90 -35
  2. package/dist/application.js +1 -1
  3. package/dist/auth.js +1 -2
  4. package/dist/bin.js +189 -44
  5. package/dist/cli.js +1 -1
  6. package/dist/config.js +1 -3
  7. package/dist/connection.js +1 -4
  8. package/dist/index.js +1 -4
  9. package/dist/layout.js +1 -1
  10. package/dist/orchestration.js +1 -1
  11. package/dist/rpc.js +1 -1
  12. package/dist/runtime.js +1 -2
  13. package/dist/scope.js +1 -1
  14. package/dist/shared.js +85492 -0
  15. package/dist/src/application/layer.d.ts +25 -2
  16. package/dist/src/application/projects.d.ts +1 -1
  17. package/dist/src/application/service.d.ts +21 -1
  18. package/dist/src/application/thread-commands.d.ts +27 -1
  19. package/dist/src/application/threads.d.ts +50 -1
  20. package/dist/src/domain/thread-activities.d.ts +14 -0
  21. package/dist/src/domain/thread-lifecycle.d.ts +1 -0
  22. package/dist/src/runtime/layer.d.ts +1 -1
  23. package/dist/t3tools.js +1 -1
  24. package/package.json +1 -1
  25. package/src/application/service.ts +19 -0
  26. package/src/application/thread-commands.ts +45 -0
  27. package/src/application/threads.ts +85 -0
  28. package/src/cli/error.ts +15 -0
  29. package/src/cli/message-input.ts +30 -0
  30. package/src/cli/thread-format.ts +47 -0
  31. package/src/cli/thread.ts +6 -0
  32. package/src/cli/threads/approve.ts +61 -0
  33. package/src/cli/threads/archive.ts +18 -3
  34. package/src/cli/threads/respond.ts +70 -0
  35. package/src/cli/threads/show.ts +43 -0
  36. package/src/domain/thread-activities.test.ts +321 -0
  37. package/src/domain/thread-activities.ts +244 -0
  38. package/src/domain/thread-lifecycle.ts +2 -0
  39. package/dist/Context-DueQ9iMH.js +0 -4916
  40. package/dist/Path-D8WPdPwR.js +0 -11406
  41. package/dist/Schema-DsQxYh6_.js +0 -13581
  42. package/dist/UrlParams-BA6gBvaY.js +0 -205
  43. package/dist/base-dir-R12OMDso.js +0 -20
  44. package/dist/error-BHRnjLux.js +0 -15
  45. package/dist/error-ChTsLQTu.js +0 -169
  46. package/dist/error-CjADNVm8.js +0 -54
  47. package/dist/flags-CM7_iGdA.js +0 -13371
  48. package/dist/layer-CMo36MrX.js +0 -29466
  49. package/dist/layer-DHhKS5jd.js +0 -13
  50. package/dist/layer-DUv99vsS.js +0 -72
  51. package/dist/layer-Do8wK1t6.js +0 -1508
  52. package/dist/layer-DwI3Skkh.js +0 -1223
  53. package/dist/scope-GycYiJ54.js +0 -29
  54. package/dist/service-CLmRO2Dp.js +0 -8
  55. package/dist/service-ybOWV9pL.js +0 -5
  56. package/dist/src-aiFPmAG7.js +0 -9030
  57. package/dist/transport-MI0Z3d2T.js +0 -539
  58. package/dist/url-SlsaG8nY.js +0 -165
  59. /package/dist/{chunk-B5meny8j.js → rolldown-runtime.js} +0 -0
@@ -1,13 +0,0 @@
1
- import { Fn as succeed } from "./Path-D8WPdPwR.js";
2
- import { t as Environment } from "./service-CLmRO2Dp.js";
3
- import { homedir } from "node:os";
4
- //#region src/environment/layer.ts
5
- const NodeEnvironmentLive = succeed(Environment)({
6
- cwd: process.cwd(),
7
- homeDir: homedir(),
8
- env: process.env,
9
- stdoutIsTTY: process.stdout.isTTY ?? false,
10
- stderrIsTTY: process.stderr.isTTY ?? false
11
- });
12
- //#endregion
13
- export { NodeEnvironmentLive as t };
@@ -1,72 +0,0 @@
1
- import { $ as mapError, P as fn, Tt as succeed, Ur as reason, k as fail, kn as effect, t as Path, v as catchFilter } from "./Path-D8WPdPwR.js";
2
- import { L as fromJsonString, P as decodeUnknownEffect, b as Struct, dt as FileSystem, et as optionalKey, n as Boolean, y as String } from "./Schema-DsQxYh6_.js";
3
- import { n as T3Config, t as Environment } from "./service-CLmRO2Dp.js";
4
- import { t as normalizeHttpBaseUrl } from "./url-SlsaG8nY.js";
5
- import { t as ConfigError } from "./error-BHRnjLux.js";
6
- //#region src/config/layer.ts
7
- const makeT3Config = fn("makeT3Config")(function* () {
8
- const fs = yield* FileSystem;
9
- const path = yield* Path;
10
- const environment = yield* Environment;
11
- const configFilePath = resolveConfigPath(path, environment);
12
- const readStored = fn("T3ConfigLive.readStored")(function* () {
13
- const raw = yield* fs.readFileString(configFilePath).pipe(catchFilter(reason("PlatformError", "NotFound"), () => succeed(void 0)), mapError((error) => new ConfigError({
14
- message: "failed to read config",
15
- cause: error
16
- })));
17
- if (raw === void 0) return {};
18
- return yield* parseStoredConfig(raw);
19
- });
20
- return {
21
- readStored,
22
- writeStored: fn("T3ConfigLive.writeStored")(function* (config) {
23
- yield* fs.makeDirectory(path.dirname(configFilePath), {
24
- recursive: true,
25
- mode: 448
26
- }).pipe(mapError((error) => new ConfigError({
27
- message: "failed to write config",
28
- cause: error
29
- })));
30
- yield* fs.writeFileString(configFilePath, `${JSON.stringify(config, null, 2)}\n`, { mode: 384 }).pipe(mapError((error) => new ConfigError({
31
- message: "failed to write config",
32
- cause: error
33
- })));
34
- }),
35
- resolve: fn("T3ConfigLive.resolve")(function* () {
36
- const stored = yield* readStored();
37
- const envUrl = environment.env["T3CODE_URL"];
38
- const envToken = environment.env["T3CODE_TOKEN"];
39
- const envUrlValue = envUrl?.trim();
40
- const envTokenValue = envToken?.trim();
41
- const url = envUrlValue !== void 0 && envUrlValue.length > 0 ? envUrlValue : stored.url;
42
- const token = envTokenValue !== void 0 && envTokenValue.length > 0 ? envTokenValue : stored.token;
43
- if (url === void 0 || url.length === 0 || token === void 0 || token.length === 0) return yield* fail(new ConfigError({ message: "not authenticated. run: t3cli auth pair <pairing-url>" }));
44
- const source = envUrlValue !== void 0 && envUrlValue.length > 0 || envTokenValue !== void 0 && envTokenValue.length > 0 ? "env" : "config";
45
- return {
46
- url: yield* normalizeHttpBaseUrl(url),
47
- token,
48
- source,
49
- local: stored.local ?? false
50
- };
51
- })
52
- };
53
- });
54
- const T3ConfigLive = effect(T3Config, makeT3Config());
55
- const StoredConfigSchema = Struct({
56
- url: optionalKey(String),
57
- token: optionalKey(String),
58
- local: optionalKey(Boolean)
59
- });
60
- function parseStoredConfig(raw) {
61
- return decodeUnknownEffect(fromJsonString(StoredConfigSchema))(raw).pipe(mapError((error) => new ConfigError({
62
- message: "failed to read config",
63
- cause: error
64
- })));
65
- }
66
- function resolveConfigPath(path, environment) {
67
- const xdgConfigHomeValue = environment.env["XDG_CONFIG_HOME"]?.trim();
68
- const root = xdgConfigHomeValue !== void 0 && xdgConfigHomeValue.length > 0 ? xdgConfigHomeValue : path.join(environment.homeDir, ".config");
69
- return path.join(root, "t3cli", "config.json");
70
- }
71
- //#endregion
72
- export { makeT3Config as n, T3ConfigLive as t };