clawdlets 0.2.2 → 0.3.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 (279) hide show
  1. package/dist/main.mjs +4589 -0
  2. package/{dist → node_modules/@clawdlets/core/dist}/lib/context.d.ts +2 -2
  3. package/{dist → node_modules/@clawdlets/core/dist}/lib/context.d.ts.map +1 -1
  4. package/{dist → node_modules/@clawdlets/core/dist}/lib/context.js +2 -2
  5. package/node_modules/@clawdlets/core/dist/lib/context.js.map +1 -0
  6. package/{dist → node_modules/@clawdlets/core/dist}/lib/host-resolve.js +2 -2
  7. package/node_modules/@clawdlets/core/dist/lib/host-resolve.js.map +1 -0
  8. package/node_modules/@clawdlets/core/dist/repo-layout.d.ts +1 -0
  9. package/node_modules/@clawdlets/core/dist/repo-layout.d.ts.map +1 -1
  10. package/node_modules/@clawdlets/core/dist/repo-layout.js +2 -0
  11. package/node_modules/@clawdlets/core/dist/repo-layout.js.map +1 -1
  12. package/node_modules/@clawdlets/core/package.json +1 -3
  13. package/package.json +16 -16
  14. package/dist/commands/bootstrap.d.ts +0 -43
  15. package/dist/commands/bootstrap.d.ts.map +0 -1
  16. package/dist/commands/bootstrap.js +0 -318
  17. package/dist/commands/bootstrap.js.map +0 -1
  18. package/dist/commands/bot.d.ts +0 -2
  19. package/dist/commands/bot.d.ts.map +0 -1
  20. package/dist/commands/bot.js +0 -97
  21. package/dist/commands/bot.js.map +0 -1
  22. package/dist/commands/cattle/common.d.ts +0 -29
  23. package/dist/commands/cattle/common.d.ts.map +0 -1
  24. package/dist/commands/cattle/common.js +0 -102
  25. package/dist/commands/cattle/common.js.map +0 -1
  26. package/dist/commands/cattle/destroy.d.ts +0 -33
  27. package/dist/commands/cattle/destroy.d.ts.map +0 -1
  28. package/dist/commands/cattle/destroy.js +0 -72
  29. package/dist/commands/cattle/destroy.js.map +0 -1
  30. package/dist/commands/cattle/list.d.ts +0 -20
  31. package/dist/commands/cattle/list.d.ts.map +0 -1
  32. package/dist/commands/cattle/list.js +0 -78
  33. package/dist/commands/cattle/list.js.map +0 -1
  34. package/dist/commands/cattle/logs.d.ts +0 -34
  35. package/dist/commands/cattle/logs.d.ts.map +0 -1
  36. package/dist/commands/cattle/logs.js +0 -55
  37. package/dist/commands/cattle/logs.js.map +0 -1
  38. package/dist/commands/cattle/persona.d.ts +0 -2
  39. package/dist/commands/cattle/persona.d.ts.map +0 -1
  40. package/dist/commands/cattle/persona.js +0 -85
  41. package/dist/commands/cattle/persona.js.map +0 -1
  42. package/dist/commands/cattle/reap.d.ts +0 -20
  43. package/dist/commands/cattle/reap.d.ts.map +0 -1
  44. package/dist/commands/cattle/reap.js +0 -60
  45. package/dist/commands/cattle/reap.js.map +0 -1
  46. package/dist/commands/cattle/spawn.d.ts +0 -73
  47. package/dist/commands/cattle/spawn.d.ts.map +0 -1
  48. package/dist/commands/cattle/spawn.js +0 -147
  49. package/dist/commands/cattle/spawn.js.map +0 -1
  50. package/dist/commands/cattle/ssh.d.ts +0 -20
  51. package/dist/commands/cattle/ssh.d.ts.map +0 -1
  52. package/dist/commands/cattle/ssh.js +0 -37
  53. package/dist/commands/cattle/ssh.js.map +0 -1
  54. package/dist/commands/cattle.d.ts +0 -2
  55. package/dist/commands/cattle.d.ts.map +0 -1
  56. package/dist/commands/cattle.js +0 -21
  57. package/dist/commands/cattle.js.map +0 -1
  58. package/dist/commands/config.d.ts +0 -2
  59. package/dist/commands/config.d.ts.map +0 -1
  60. package/dist/commands/config.js +0 -163
  61. package/dist/commands/config.js.map +0 -1
  62. package/dist/commands/doctor.d.ts +0 -35
  63. package/dist/commands/doctor.d.ts.map +0 -1
  64. package/dist/commands/doctor.js +0 -65
  65. package/dist/commands/doctor.js.map +0 -1
  66. package/dist/commands/env.d.ts +0 -22
  67. package/dist/commands/env.d.ts.map +0 -1
  68. package/dist/commands/env.js +0 -132
  69. package/dist/commands/env.js.map +0 -1
  70. package/dist/commands/fleet.d.ts +0 -2
  71. package/dist/commands/fleet.d.ts.map +0 -1
  72. package/dist/commands/fleet.js +0 -61
  73. package/dist/commands/fleet.js.map +0 -1
  74. package/dist/commands/host.d.ts +0 -2
  75. package/dist/commands/host.d.ts.map +0 -1
  76. package/dist/commands/host.js +0 -277
  77. package/dist/commands/host.js.map +0 -1
  78. package/dist/commands/image.d.ts +0 -2
  79. package/dist/commands/image.d.ts.map +0 -1
  80. package/dist/commands/image.js +0 -133
  81. package/dist/commands/image.js.map +0 -1
  82. package/dist/commands/infra.d.ts +0 -2
  83. package/dist/commands/infra.d.ts.map +0 -1
  84. package/dist/commands/infra.js +0 -171
  85. package/dist/commands/infra.js.map +0 -1
  86. package/dist/commands/lockdown.d.ts +0 -25
  87. package/dist/commands/lockdown.d.ts.map +0 -1
  88. package/dist/commands/lockdown.js +0 -93
  89. package/dist/commands/lockdown.js.map +0 -1
  90. package/dist/commands/project.d.ts +0 -2
  91. package/dist/commands/project.d.ts.map +0 -1
  92. package/dist/commands/project.js +0 -264
  93. package/dist/commands/project.js.map +0 -1
  94. package/dist/commands/secrets/common.d.ts +0 -8
  95. package/dist/commands/secrets/common.d.ts.map +0 -1
  96. package/dist/commands/secrets/common.js +0 -20
  97. package/dist/commands/secrets/common.js.map +0 -1
  98. package/dist/commands/secrets/init.d.ts +0 -39
  99. package/dist/commands/secrets/init.d.ts.map +0 -1
  100. package/dist/commands/secrets/init.js +0 -455
  101. package/dist/commands/secrets/init.js.map +0 -1
  102. package/dist/commands/secrets/path.d.ts +0 -11
  103. package/dist/commands/secrets/path.d.ts.map +0 -1
  104. package/dist/commands/secrets/path.js +0 -24
  105. package/dist/commands/secrets/path.js.map +0 -1
  106. package/dist/commands/secrets/sync.d.ts +0 -25
  107. package/dist/commands/secrets/sync.d.ts.map +0 -1
  108. package/dist/commands/secrets/sync.js +0 -67
  109. package/dist/commands/secrets/sync.js.map +0 -1
  110. package/dist/commands/secrets/verify.d.ts +0 -28
  111. package/dist/commands/secrets/verify.d.ts.map +0 -1
  112. package/dist/commands/secrets/verify.js +0 -118
  113. package/dist/commands/secrets/verify.js.map +0 -1
  114. package/dist/commands/secrets.d.ts +0 -2
  115. package/dist/commands/secrets.d.ts.map +0 -1
  116. package/dist/commands/secrets.js +0 -18
  117. package/dist/commands/secrets.js.map +0 -1
  118. package/dist/commands/server/common.d.ts +0 -3
  119. package/dist/commands/server/common.d.ts.map +0 -1
  120. package/dist/commands/server/common.js +0 -3
  121. package/dist/commands/server/common.js.map +0 -1
  122. package/dist/commands/server/deploy.d.ts +0 -53
  123. package/dist/commands/server/deploy.d.ts.map +0 -1
  124. package/dist/commands/server/deploy.js +0 -177
  125. package/dist/commands/server/deploy.js.map +0 -1
  126. package/dist/commands/server/github-sync.d.ts +0 -2
  127. package/dist/commands/server/github-sync.d.ts.map +0 -1
  128. package/dist/commands/server/github-sync.js +0 -166
  129. package/dist/commands/server/github-sync.js.map +0 -1
  130. package/dist/commands/server/manifest.d.ts +0 -28
  131. package/dist/commands/server/manifest.d.ts.map +0 -1
  132. package/dist/commands/server/manifest.js +0 -82
  133. package/dist/commands/server/manifest.js.map +0 -1
  134. package/dist/commands/server.d.ts +0 -2
  135. package/dist/commands/server.d.ts.map +0 -1
  136. package/dist/commands/server.js +0 -267
  137. package/dist/commands/server.js.map +0 -1
  138. package/dist/commands/ssh-target.d.ts +0 -3
  139. package/dist/commands/ssh-target.d.ts.map +0 -1
  140. package/dist/commands/ssh-target.js +0 -15
  141. package/dist/commands/ssh-target.js.map +0 -1
  142. package/dist/lib/context.js.map +0 -1
  143. package/dist/lib/deploy-gate.d.ts +0 -9
  144. package/dist/lib/deploy-gate.d.ts.map +0 -1
  145. package/dist/lib/deploy-gate.js +0 -20
  146. package/dist/lib/deploy-gate.js.map +0 -1
  147. package/dist/lib/deploy-manifest.d.ts +0 -11
  148. package/dist/lib/deploy-manifest.d.ts.map +0 -1
  149. package/dist/lib/deploy-manifest.js +0 -46
  150. package/dist/lib/deploy-manifest.js.map +0 -1
  151. package/dist/lib/doctor-render.d.ts +0 -14
  152. package/dist/lib/doctor-render.d.ts.map +0 -1
  153. package/dist/lib/doctor-render.js +0 -131
  154. package/dist/lib/doctor-render.js.map +0 -1
  155. package/dist/lib/host-resolve.js.map +0 -1
  156. package/dist/lib/linux-build.d.ts +0 -8
  157. package/dist/lib/linux-build.d.ts.map +0 -1
  158. package/dist/lib/linux-build.js +0 -15
  159. package/dist/lib/linux-build.js.map +0 -1
  160. package/dist/lib/manifest-signature.d.ts +0 -17
  161. package/dist/lib/manifest-signature.d.ts.map +0 -1
  162. package/dist/lib/manifest-signature.js +0 -52
  163. package/dist/lib/manifest-signature.js.map +0 -1
  164. package/dist/lib/template-spec.d.ts +0 -9
  165. package/dist/lib/template-spec.d.ts.map +0 -1
  166. package/dist/lib/template-spec.js +0 -50
  167. package/dist/lib/template-spec.js.map +0 -1
  168. package/dist/lib/version.d.ts +0 -3
  169. package/dist/lib/version.d.ts.map +0 -1
  170. package/dist/lib/version.js +0 -17
  171. package/dist/lib/version.js.map +0 -1
  172. package/dist/lib/wizard.d.ts +0 -10
  173. package/dist/lib/wizard.d.ts.map +0 -1
  174. package/dist/lib/wizard.js +0 -25
  175. package/dist/lib/wizard.js.map +0 -1
  176. package/dist/main.d.ts +0 -3
  177. package/dist/main.d.ts.map +0 -1
  178. package/dist/main.js +0 -50
  179. package/dist/main.js.map +0 -1
  180. package/node_modules/@clawdlets/clf-queue/dist/client.d.ts +0 -21
  181. package/node_modules/@clawdlets/clf-queue/dist/client.d.ts.map +0 -1
  182. package/node_modules/@clawdlets/clf-queue/dist/client.js +0 -132
  183. package/node_modules/@clawdlets/clf-queue/dist/client.js.map +0 -1
  184. package/node_modules/@clawdlets/clf-queue/dist/index.d.ts +0 -9
  185. package/node_modules/@clawdlets/clf-queue/dist/index.d.ts.map +0 -1
  186. package/node_modules/@clawdlets/clf-queue/dist/index.js +0 -5
  187. package/node_modules/@clawdlets/clf-queue/dist/index.js.map +0 -1
  188. package/node_modules/@clawdlets/clf-queue/dist/jobs.d.ts +0 -32
  189. package/node_modules/@clawdlets/clf-queue/dist/jobs.d.ts.map +0 -1
  190. package/node_modules/@clawdlets/clf-queue/dist/jobs.js +0 -24
  191. package/node_modules/@clawdlets/clf-queue/dist/jobs.js.map +0 -1
  192. package/node_modules/@clawdlets/clf-queue/dist/protocol.d.ts +0 -118
  193. package/node_modules/@clawdlets/clf-queue/dist/protocol.d.ts.map +0 -1
  194. package/node_modules/@clawdlets/clf-queue/dist/protocol.js +0 -46
  195. package/node_modules/@clawdlets/clf-queue/dist/protocol.js.map +0 -1
  196. package/node_modules/@clawdlets/clf-queue/dist/queue/bootstrap-tokens.d.ts +0 -3
  197. package/node_modules/@clawdlets/clf-queue/dist/queue/bootstrap-tokens.d.ts.map +0 -1
  198. package/node_modules/@clawdlets/clf-queue/dist/queue/bootstrap-tokens.js +0 -112
  199. package/node_modules/@clawdlets/clf-queue/dist/queue/bootstrap-tokens.js.map +0 -1
  200. package/node_modules/@clawdlets/clf-queue/dist/queue/jobs.d.ts +0 -3
  201. package/node_modules/@clawdlets/clf-queue/dist/queue/jobs.d.ts.map +0 -1
  202. package/node_modules/@clawdlets/clf-queue/dist/queue/jobs.js +0 -313
  203. package/node_modules/@clawdlets/clf-queue/dist/queue/jobs.js.map +0 -1
  204. package/node_modules/@clawdlets/clf-queue/dist/queue/migrate.d.ts +0 -2
  205. package/node_modules/@clawdlets/clf-queue/dist/queue/migrate.d.ts.map +0 -1
  206. package/node_modules/@clawdlets/clf-queue/dist/queue/migrate.js +0 -74
  207. package/node_modules/@clawdlets/clf-queue/dist/queue/migrate.js.map +0 -1
  208. package/node_modules/@clawdlets/clf-queue/dist/queue/open.d.ts +0 -3
  209. package/node_modules/@clawdlets/clf-queue/dist/queue/open.d.ts.map +0 -1
  210. package/node_modules/@clawdlets/clf-queue/dist/queue/open.js +0 -27
  211. package/node_modules/@clawdlets/clf-queue/dist/queue/open.js.map +0 -1
  212. package/node_modules/@clawdlets/clf-queue/dist/queue/types.d.ts +0 -113
  213. package/node_modules/@clawdlets/clf-queue/dist/queue/types.d.ts.map +0 -1
  214. package/node_modules/@clawdlets/clf-queue/dist/queue/types.js +0 -2
  215. package/node_modules/@clawdlets/clf-queue/dist/queue/types.js.map +0 -1
  216. package/node_modules/@clawdlets/clf-queue/dist/queue/util.d.ts +0 -10
  217. package/node_modules/@clawdlets/clf-queue/dist/queue/util.d.ts.map +0 -1
  218. package/node_modules/@clawdlets/clf-queue/dist/queue/util.js +0 -30
  219. package/node_modules/@clawdlets/clf-queue/dist/queue/util.js.map +0 -1
  220. package/node_modules/@clawdlets/clf-queue/dist/queue.d.ts +0 -3
  221. package/node_modules/@clawdlets/clf-queue/dist/queue.d.ts.map +0 -1
  222. package/node_modules/@clawdlets/clf-queue/dist/queue.js +0 -2
  223. package/node_modules/@clawdlets/clf-queue/dist/queue.js.map +0 -1
  224. package/node_modules/@clawdlets/clf-queue/package.json +0 -34
  225. package/node_modules/@clawdlets/core/dist/lib/cattle-state.d.ts +0 -25
  226. package/node_modules/@clawdlets/core/dist/lib/cattle-state.d.ts.map +0 -1
  227. package/node_modules/@clawdlets/core/dist/lib/cattle-state.js +0 -136
  228. package/node_modules/@clawdlets/core/dist/lib/cattle-state.js.map +0 -1
  229. package/node_modules/better-sqlite3/LICENSE +0 -21
  230. package/node_modules/better-sqlite3/README.md +0 -99
  231. package/node_modules/better-sqlite3/binding.gyp +0 -38
  232. package/node_modules/better-sqlite3/deps/common.gypi +0 -68
  233. package/node_modules/better-sqlite3/deps/copy.js +0 -31
  234. package/node_modules/better-sqlite3/deps/defines.gypi +0 -41
  235. package/node_modules/better-sqlite3/deps/download.sh +0 -122
  236. package/node_modules/better-sqlite3/deps/patches/1208.patch +0 -15
  237. package/node_modules/better-sqlite3/deps/sqlite3/sqlite3.c +0 -265969
  238. package/node_modules/better-sqlite3/deps/sqlite3/sqlite3.h +0 -13968
  239. package/node_modules/better-sqlite3/deps/sqlite3/sqlite3ext.h +0 -730
  240. package/node_modules/better-sqlite3/deps/sqlite3.gyp +0 -80
  241. package/node_modules/better-sqlite3/deps/test_extension.c +0 -21
  242. package/node_modules/better-sqlite3/lib/database.js +0 -90
  243. package/node_modules/better-sqlite3/lib/index.js +0 -3
  244. package/node_modules/better-sqlite3/lib/methods/aggregate.js +0 -43
  245. package/node_modules/better-sqlite3/lib/methods/backup.js +0 -67
  246. package/node_modules/better-sqlite3/lib/methods/function.js +0 -31
  247. package/node_modules/better-sqlite3/lib/methods/inspect.js +0 -7
  248. package/node_modules/better-sqlite3/lib/methods/pragma.js +0 -12
  249. package/node_modules/better-sqlite3/lib/methods/serialize.js +0 -16
  250. package/node_modules/better-sqlite3/lib/methods/table.js +0 -189
  251. package/node_modules/better-sqlite3/lib/methods/transaction.js +0 -78
  252. package/node_modules/better-sqlite3/lib/methods/wrappers.js +0 -54
  253. package/node_modules/better-sqlite3/lib/sqlite-error.js +0 -20
  254. package/node_modules/better-sqlite3/lib/util.js +0 -12
  255. package/node_modules/better-sqlite3/package.json +0 -59
  256. package/node_modules/better-sqlite3/src/addon.cpp +0 -47
  257. package/node_modules/better-sqlite3/src/better_sqlite3.cpp +0 -74
  258. package/node_modules/better-sqlite3/src/objects/backup.cpp +0 -120
  259. package/node_modules/better-sqlite3/src/objects/backup.hpp +0 -36
  260. package/node_modules/better-sqlite3/src/objects/database.cpp +0 -417
  261. package/node_modules/better-sqlite3/src/objects/database.hpp +0 -103
  262. package/node_modules/better-sqlite3/src/objects/statement-iterator.cpp +0 -113
  263. package/node_modules/better-sqlite3/src/objects/statement-iterator.hpp +0 -50
  264. package/node_modules/better-sqlite3/src/objects/statement.cpp +0 -383
  265. package/node_modules/better-sqlite3/src/objects/statement.hpp +0 -58
  266. package/node_modules/better-sqlite3/src/util/bind-map.cpp +0 -73
  267. package/node_modules/better-sqlite3/src/util/binder.cpp +0 -193
  268. package/node_modules/better-sqlite3/src/util/constants.cpp +0 -172
  269. package/node_modules/better-sqlite3/src/util/custom-aggregate.cpp +0 -121
  270. package/node_modules/better-sqlite3/src/util/custom-function.cpp +0 -59
  271. package/node_modules/better-sqlite3/src/util/custom-table.cpp +0 -409
  272. package/node_modules/better-sqlite3/src/util/data-converter.cpp +0 -17
  273. package/node_modules/better-sqlite3/src/util/data.cpp +0 -194
  274. package/node_modules/better-sqlite3/src/util/helpers.cpp +0 -109
  275. package/node_modules/better-sqlite3/src/util/macros.cpp +0 -70
  276. package/node_modules/better-sqlite3/src/util/query-macros.cpp +0 -71
  277. package/node_modules/better-sqlite3/src/util/row-builder.cpp +0 -49
  278. /package/{dist → node_modules/@clawdlets/core/dist}/lib/host-resolve.d.ts +0 -0
  279. /package/{dist → node_modules/@clawdlets/core/dist}/lib/host-resolve.d.ts.map +0 -0
@@ -1,85 +0,0 @@
1
- import fs from "node:fs";
2
- import path from "node:path";
3
- import process from "node:process";
4
- import { defineCommand } from "citty";
5
- import { ensureDir, writeFileAtomic } from "@clawdlets/core/lib/fs-safe";
6
- import { PersonaNameSchema } from "@clawdlets/core/lib/identifiers";
7
- import { findRepoRoot } from "@clawdlets/core/lib/repo";
8
- function getPersonasDir(repoRoot) {
9
- return path.join(repoRoot, "cattle", "personas");
10
- }
11
- const personaAdd = defineCommand({
12
- meta: { name: "add", description: "Create a cattle persona skeleton under cattle/personas/<name>/." },
13
- args: {
14
- name: { type: "string", description: "Persona name (safe: [a-z][a-z0-9_-]*).", required: true },
15
- force: { type: "boolean", description: "Overwrite existing files.", default: false },
16
- dryRun: { type: "boolean", description: "Print planned writes without writing.", default: false },
17
- },
18
- async run({ args }) {
19
- const repoRoot = findRepoRoot(process.cwd());
20
- const name = PersonaNameSchema.parse(String(args.name || "").trim());
21
- const personasDir = getPersonasDir(repoRoot);
22
- const dir = path.join(personasDir, name);
23
- const soulPath = path.join(dir, "SOUL.md");
24
- const configPath = path.join(dir, "config.json");
25
- const skillsDir = path.join(dir, "skills");
26
- const memoryDir = path.join(dir, "memory");
27
- const soulText = `# ${name}\n\n- tone: (fill)\n- values: (fill)\n- constraints: (fill)\n`;
28
- const configJson = {
29
- schemaVersion: 1,
30
- model: { primary: "", fallbacks: [] },
31
- skills: { allowBundled: [] },
32
- defaults: { maxConcurrent: 1 },
33
- };
34
- const plannedWrites = [soulPath, configPath, skillsDir, memoryDir];
35
- if (args.dryRun) {
36
- for (const p of plannedWrites)
37
- console.log(`planned: ${path.relative(repoRoot, p)}`);
38
- return;
39
- }
40
- await ensureDir(skillsDir);
41
- await ensureDir(memoryDir);
42
- if (!args.force) {
43
- if (fs.existsSync(soulPath))
44
- throw new Error(`already exists: ${soulPath} (pass --force to overwrite)`);
45
- if (fs.existsSync(configPath))
46
- throw new Error(`already exists: ${configPath} (pass --force to overwrite)`);
47
- }
48
- await writeFileAtomic(soulPath, soulText.endsWith("\n") ? soulText : `${soulText}\n`);
49
- await writeFileAtomic(configPath, `${JSON.stringify(configJson, null, 2)}\n`);
50
- console.log(`ok: created cattle/personas/${name}`);
51
- },
52
- });
53
- const personaList = defineCommand({
54
- meta: { name: "list", description: "List cattle personas under cattle/personas/." },
55
- args: {
56
- json: { type: "boolean", description: "Output JSON.", default: false },
57
- },
58
- async run({ args }) {
59
- const repoRoot = findRepoRoot(process.cwd());
60
- const personasDir = getPersonasDir(repoRoot);
61
- const out = [];
62
- if (fs.existsSync(personasDir)) {
63
- for (const ent of fs.readdirSync(personasDir, { withFileTypes: true })) {
64
- if (!ent.isDirectory())
65
- continue;
66
- const name = ent.name;
67
- const ok = PersonaNameSchema.safeParse(name);
68
- if (!ok.success)
69
- continue;
70
- out.push(name);
71
- }
72
- }
73
- out.sort();
74
- if (args.json)
75
- console.log(JSON.stringify({ personas: out }, null, 2));
76
- else
77
- for (const n of out)
78
- console.log(n);
79
- },
80
- });
81
- export const cattlePersona = defineCommand({
82
- meta: { name: "persona", description: "Cattle persona registry helpers (cattle/personas/<name>/)." },
83
- subCommands: { add: personaAdd, list: personaList },
84
- });
85
- //# sourceMappingURL=persona.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"persona.js","sourceRoot":"","sources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AAiB,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;gBAC7C,IAAI,CAAC,EAAE,CAAC,OAAO;oBAAE,SAAS;gBAC1B,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACjB,CAAC;QACH,CAAC;QACD,GAAG,CAAC,IAAI,EAAE,CAAC;QAEX,IAAI,IAAI,CAAC,IAAI;YAAE,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;;YAClE,KAAK,MAAM,CAAC,IAAI,GAAG;gBAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAC3C,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,aAAa,GAAG,aAAa,CAAC;IACzC,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,4DAA4D,EAAE;IACpG,WAAW,EAAE,EAAE,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,WAAW,EAAE;CACpD,CAAC,CAAC"}
@@ -1,20 +0,0 @@
1
- export declare const cattleReap: import("citty").CommandDef<{
2
- runtimeDir: {
3
- type: "string";
4
- description: string;
5
- };
6
- envFile: {
7
- type: "string";
8
- description: string;
9
- };
10
- host: {
11
- type: "string";
12
- description: string;
13
- };
14
- dryRun: {
15
- type: "boolean";
16
- description: string;
17
- default: false;
18
- };
19
- }>;
20
- //# sourceMappingURL=reap.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"reap.d.ts","sourceRoot":"","sources":["../../../src/commands/cattle/reap.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;EAyDrB,CAAC"}
@@ -1,60 +0,0 @@
1
- import process from "node:process";
2
- import { defineCommand } from "citty";
3
- import { loadDeployCreds } from "@clawdlets/core/lib/deploy-creds";
4
- import { openCattleState } from "@clawdlets/core/lib/cattle-state";
5
- import { buildCattleLabelSelector, reapExpiredCattle } from "@clawdlets/core/lib/hcloud-cattle";
6
- import { loadHostContextOrExit } from "../../lib/context.js";
7
- import { formatTable, requireEnabled, unixSecondsNow } from "./common.js";
8
- export const cattleReap = defineCommand({
9
- meta: { name: "reap", description: "Destroy expired cattle servers (TTL enforcement)." },
10
- args: {
11
- runtimeDir: { type: "string", description: "Runtime directory (default: .clawdlets)." },
12
- envFile: { type: "string", description: "Env file for deploy creds (default: <runtimeDir>/env)." },
13
- host: { type: "string", description: "Host name (defaults to clawdlets.json defaultHost / sole host)." },
14
- dryRun: { type: "boolean", description: "Print plan without deleting.", default: false },
15
- },
16
- async run({ args }) {
17
- const cwd = process.cwd();
18
- const ctx = loadHostContextOrExit({ cwd, runtimeDir: args.runtimeDir, hostArg: args.host });
19
- if (!ctx)
20
- return;
21
- const { layout, config } = ctx;
22
- requireEnabled({
23
- enabled: Boolean(config.cattle?.enabled),
24
- hint: "cattle is disabled (set cattle.enabled=true in fleet/clawdlets.json)",
25
- });
26
- const deployCreds = loadDeployCreds({ cwd, runtimeDir: args.runtimeDir, envFile: args.envFile });
27
- const hcloudToken = String(deployCreds.values.HCLOUD_TOKEN || "").trim();
28
- if (!hcloudToken)
29
- throw new Error("missing HCLOUD_TOKEN (set in .clawdlets/env or env var; run: clawdlets env init)");
30
- const now = unixSecondsNow();
31
- const res = await reapExpiredCattle({
32
- token: hcloudToken,
33
- labelSelector: buildCattleLabelSelector(),
34
- now: new Date(now * 1000),
35
- dryRun: args.dryRun,
36
- });
37
- const expired = res.expired;
38
- if (expired.length === 0) {
39
- console.log("ok: no expired cattle servers");
40
- return;
41
- }
42
- console.log(formatTable([
43
- ["ID", "NAME", "PERSONA", "TASK", "EXPIRES", "STATUS"],
44
- ...expired.map((s) => [s.id, s.name, s.persona || "-", s.taskId || "-", String(Math.floor(s.expiresAt.getTime() / 1000)), s.status]),
45
- ]));
46
- if (args.dryRun)
47
- return;
48
- const st = openCattleState(layout.cattleDbPath);
49
- try {
50
- for (const id of res.deletedIds) {
51
- st.markDeletedById(id, now);
52
- }
53
- }
54
- finally {
55
- st.close();
56
- }
57
- console.log(`ok: reaped ${res.deletedIds.length} cattle server(s)`);
58
- },
59
- });
60
- //# sourceMappingURL=reap.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"reap.js","sourceRoot":"","sources":["../../../src/commands/cattle/reap.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAChG,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE1E,MAAM,CAAC,MAAM,UAAU,GAAG,aAAa,CAAC;IACtC,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,mDAAmD,EAAE;IACxF,IAAI,EAAE;QACJ,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,0CAA0C,EAAE;QACvF,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,wDAAwD,EAAE;QAClG,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,iEAAiE,EAAE;QACxG,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,8BAA8B,EAAE,OAAO,EAAE,KAAK,EAAE;KACzF;IACD,KAAK,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE;QAChB,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;QAC1B,MAAM,GAAG,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ACtD,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,OAAO,IAAI,GAAG,EAAE,CAAC,CAAC,MAAM,IAAI,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC;SACrI,CAAC,CACH,CAAC;QAEF,IAAI,IAAI,CAAC,MAAM;YAAE,OAAO;QAExB,MAAM,EAAE,GAAG,eAAe,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;QAChD,IAAI,CAAC;YACH,KAAK,MAAM,EAAE,IAAI,GAAG,CAAC,UAAU,EAAE,CAAC;gBAChC,EAAE,CAAC,eAAe,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;YAC9B,CAAC;QACH,CAAC;gBAAS,CAAC;YACT,EAAE,CAAC,KAAK,EAAE,CAAC;QACb,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,cAAc,GAAG,CAAC,UAAU,CAAC,MAAM,mBAAmB,CAAC,CAAC;IACtE,CAAC;CACF,CAAC,CAAC"}
@@ -1,73 +0,0 @@
1
- export declare const cattleSpawn: import("citty").CommandDef<{
2
- runtimeDir: {
3
- type: "string";
4
- description: string;
5
- };
6
- host: {
7
- type: "string";
8
- description: string;
9
- };
10
- persona: {
11
- type: "string";
12
- description: string;
13
- required: true;
14
- };
15
- taskFile: {
16
- type: "string";
17
- description: string;
18
- required: true;
19
- };
20
- ttl: {
21
- type: "string";
22
- description: string;
23
- };
24
- image: {
25
- type: "string";
26
- description: string;
27
- };
28
- serverType: {
29
- type: "string";
30
- description: string;
31
- };
32
- location: {
33
- type: "string";
34
- description: string;
35
- };
36
- autoShutdown: {
37
- type: "boolean";
38
- description: string;
39
- };
40
- withGithubToken: {
41
- type: "boolean";
42
- description: string;
43
- default: false;
44
- };
45
- socket: {
46
- type: "string";
47
- description: string;
48
- };
49
- requester: {
50
- type: "string";
51
- description: string;
52
- };
53
- idempotencyKey: {
54
- type: "string";
55
- description: string;
56
- };
57
- wait: {
58
- type: "boolean";
59
- description: string;
60
- default: true;
61
- };
62
- waitTimeout: {
63
- type: "string";
64
- description: string;
65
- default: string;
66
- };
67
- dryRun: {
68
- type: "boolean";
69
- description: string;
70
- default: false;
71
- };
72
- }>;
73
- //# sourceMappingURL=spawn.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"spawn.d.ts","sourceRoot":"","sources":["../../../src/commands/cattle/spawn.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0JtB,CAAC"}
@@ -1,147 +0,0 @@
1
- import path from "node:path";
2
- import process from "node:process";
3
- import { defineCommand } from "citty";
4
- import { CLF_PROTOCOL_VERSION, createClfClient } from "@clawdlets/clf-queue";
5
- import { sanitizeOperatorId } from "@clawdlets/core/lib/identifiers";
6
- import { openCattleState } from "@clawdlets/core/lib/cattle-state";
7
- import { loadHostContextOrExit } from "../../lib/context.js";
8
- import { loadTaskFromFile, requireEnabled, requireFile, requireTtlSeconds, unixSecondsNow, waitForClfJobTerminal } from "./common.js";
9
- export const cattleSpawn = defineCommand({
10
- meta: { name: "spawn", description: "Enqueue a cattle.spawn job via clf-orchestrator (no secrets in user_data)." },
11
- args: {
12
- runtimeDir: { type: "string", description: "Runtime directory (default: .clawdlets)." },
13
- host: { type: "string", description: "Host name (defaults to clawdlets.json defaultHost / sole host)." },
14
- persona: { type: "string", description: "Persona name.", required: true },
15
- taskFile: { type: "string", description: "Task JSON file (schemaVersion 1).", required: true },
16
- ttl: { type: "string", description: "TTL override (default: cattle.hetzner.defaultTtl)." },
17
- image: { type: "string", description: "Hetzner image override (default: cattle.hetzner.image)." },
18
- serverType: { type: "string", description: "Hetzner server type override (default: cattle.hetzner.serverType)." },
19
- location: { type: "string", description: "Hetzner location override (default: cattle.hetzner.location)." },
20
- autoShutdown: { type: "boolean", description: "Auto poweroff after task (default: cattle.defaults.autoShutdown)." },
21
- withGithubToken: { type: "boolean", description: "Include GITHUB_TOKEN in cattle env (explicit).", default: false },
22
- socket: { type: "string", description: "clf-orchestrator unix socket path (default: /run/clf/orchestrator.sock)." },
23
- requester: { type: "string", description: "Requester id (default: $USER)." },
24
- idempotencyKey: { type: "string", description: "Idempotency key (optional)." },
25
- wait: { type: "boolean", description: "Wait for job completion.", default: true },
26
- waitTimeout: { type: "string", description: "Wait timeout seconds.", default: "300" },
27
- dryRun: { type: "boolean", description: "Print enqueue request without enqueueing.", default: false },
28
- },
29
- async run({ args }) {
30
- const cwd = process.cwd();
31
- const ctx = loadHostContextOrExit({ cwd, runtimeDir: args.runtimeDir, hostArg: args.host });
32
- if (!ctx)
33
- return;
34
- const { layout, config } = ctx;
35
- requireEnabled({
36
- enabled: Boolean(config.cattle?.enabled),
37
- hint: "cattle is disabled (set cattle.enabled=true in fleet/clawdlets.json)",
38
- });
39
- const persona = String(args.persona || "").trim();
40
- if (!persona)
41
- throw new Error("missing --persona");
42
- const taskFileRaw = String(args.taskFile || "").trim();
43
- if (!taskFileRaw)
44
- throw new Error("missing --task-file");
45
- const taskFile = path.isAbsolute(taskFileRaw) ? taskFileRaw : path.resolve(cwd, taskFileRaw);
46
- requireFile(taskFile, "task file");
47
- const taskFromFile = loadTaskFromFile(taskFile);
48
- const task = { ...taskFromFile, callbackUrl: "" };
49
- const ttlRaw = String(args.ttl || config.cattle?.hetzner?.defaultTtl || "").trim();
50
- if (ttlRaw)
51
- requireTtlSeconds(ttlRaw);
52
- const payload = {
53
- persona,
54
- task,
55
- ttl: ttlRaw,
56
- image: String(args.image || config.cattle?.hetzner?.image || "").trim(),
57
- serverType: String(args.serverType || config.cattle?.hetzner?.serverType || "").trim(),
58
- location: String(args.location || config.cattle?.hetzner?.location || "").trim(),
59
- ...(typeof args.autoShutdown === "boolean"
60
- ? { autoShutdown: Boolean(args.autoShutdown) }
61
- : typeof config.cattle?.defaults?.autoShutdown === "boolean"
62
- ? { autoShutdown: Boolean(config.cattle.defaults.autoShutdown) }
63
- : {}),
64
- ...(args.withGithubToken ? { withGithubToken: true } : {}),
65
- };
66
- const socketPath = String(args.socket || process.env.CLF_SOCKET_PATH || "/run/clf/orchestrator.sock").trim();
67
- if (!socketPath)
68
- throw new Error("missing --socket (or set CLF_SOCKET_PATH)");
69
- const requester = sanitizeOperatorId(String(args.requester || process.env.USER || "operator"));
70
- const idempotencyKey = String(args.idempotencyKey || "").trim();
71
- const request = {
72
- protocolVersion: CLF_PROTOCOL_VERSION,
73
- requester,
74
- idempotencyKey,
75
- kind: "cattle.spawn",
76
- payload,
77
- runAt: "",
78
- priority: 0,
79
- };
80
- if (args.dryRun) {
81
- console.log(JSON.stringify({ action: "clf.jobs.enqueue", socketPath, request }, null, 2));
82
- return;
83
- }
84
- const client = createClfClient({ socketPath });
85
- const res = await client.enqueue(request);
86
- const waitTimeoutRaw = String(args.waitTimeout || "300").trim();
87
- if (!/^\d+$/.test(waitTimeoutRaw) || Number(waitTimeoutRaw) <= 0) {
88
- throw new Error(`invalid --wait-timeout: ${waitTimeoutRaw}`);
89
- }
90
- const timeoutMs = Number(waitTimeoutRaw) * 1000;
91
- if (!args.wait) {
92
- console.log(res.jobId);
93
- return;
94
- }
95
- const job = await waitForClfJobTerminal({
96
- client,
97
- jobId: res.jobId,
98
- timeoutMs,
99
- pollMs: 1_000,
100
- });
101
- if (job.status !== "done") {
102
- const err = String(job.lastError || "").trim();
103
- throw new Error(`spawn job ${res.jobId} ${job.status}${err ? `: ${err}` : ""}`);
104
- }
105
- const server = job.result?.server;
106
- if (server && typeof server === "object") {
107
- const id = String(server.id || "").trim();
108
- const name = String(server.name || "").trim();
109
- const ipv4 = String(server.ipv4 || "").trim();
110
- const createdAtIso = String(server.createdAt || "").trim();
111
- const expiresAtIso = String(server.expiresAt || "").trim();
112
- const createdAt = Number.isFinite(Date.parse(createdAtIso)) ? Math.floor(Date.parse(createdAtIso) / 1000) : unixSecondsNow();
113
- const expiresAt = Number.isFinite(Date.parse(expiresAtIso)) ? Math.floor(Date.parse(expiresAtIso) / 1000) : 0;
114
- const ttlSeconds = typeof server.ttlSeconds === "number" && Number.isFinite(server.ttlSeconds)
115
- ? Math.max(0, Math.floor(server.ttlSeconds))
116
- : Math.max(0, expiresAt - createdAt);
117
- const labels = server.labels && typeof server.labels === "object" && !Array.isArray(server.labels)
118
- ? server.labels
119
- : {};
120
- if (id && name) {
121
- const st = openCattleState(layout.cattleDbPath);
122
- try {
123
- st.upsertServer({
124
- id,
125
- name,
126
- persona: String(server.persona || persona),
127
- task: String(server.taskId || task.taskId),
128
- taskId: String(server.taskId || task.taskId),
129
- ttlSeconds,
130
- createdAt,
131
- expiresAt,
132
- labels,
133
- lastStatus: String(server.status || "unknown"),
134
- lastIpv4: ipv4,
135
- });
136
- }
137
- finally {
138
- st.close();
139
- }
140
- }
141
- console.log(`ok: spawned ${name || "cattle"} (id=${id || "?"} ipv4=${ipv4 || "?"} job=${res.jobId})`);
142
- return;
143
- }
144
- console.log(`ok: spawn completed (job=${res.jobId})`);
145
- },
146
- });
147
- //# sourceMappingURL=spawn.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"spawn.js","sourceRoot":"","sources":["../../../src/commands/cattle/spawn.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAEnE,OAAO,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AM,CAAC;gBAC5G,CAAC,CAAG,MAAc,CAAC,MAAiC;gBACpD,CAAC,CAAC,EAAE,CAAC;YAET,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC;gBACf,MAAM,EAAE,GAAG,eAAe,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;gBAChD,IAAI,CAAC;oBACH,EAAE,CAAC,YAAY,CAAC;wBACd,EAAE;wBACF,IAAI;wBACJ,OAAO,EAAE,MAAM,CAAE,MAAc,CAAC,OAAO,IAAI,OAAO,CAAC;wBACnD,IAAI,EAAE,MAAM,CAAE,MAAc,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC;wBACnD,MAAM,EAAE,MAAM,CAAE,MAAc,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC;wBACrD,UAAU;wBACV,SAAS;wBACT,SAAS;wBACT,MAAM;wBACN,UAAU,EAAE,MAAM,CAAE,MAAc,CAAC,MAAM,IAAI,SAAS,CAAC;wBACvD,QAAQ,EAAE,IAAI;qBACf,CAAC,CAAC;gBACL,CAAC;wBAAS,CAAC;oBACT,EAAE,CAAC,KAAK,EAAE,CAAC;gBACb,CAAC;YACH,CAAC;YAED,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,IAAI,QAAQ,QAAQ,EAAE,IAAI,GAAG,SAAS,IAAI,IAAI,GAAG,QAAQ,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC;YACtG,OAAO;QACT,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,4BAA4B,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC;IACxD,CAAC;CACF,CAAC,CAAC"}
@@ -1,20 +0,0 @@
1
- export declare const cattleSsh: import("citty").CommandDef<{
2
- runtimeDir: {
3
- type: "string";
4
- description: string;
5
- };
6
- envFile: {
7
- type: "string";
8
- description: string;
9
- };
10
- host: {
11
- type: "string";
12
- description: string;
13
- };
14
- idOrName: {
15
- type: "string";
16
- description: string;
17
- required: true;
18
- };
19
- }>;
20
- //# sourceMappingURL=ssh.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ssh.d.ts","sourceRoot":"","sources":["../../../src/commands/cattle/ssh.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;EA+BpB,CAAC"}
@@ -1,37 +0,0 @@
1
- import process from "node:process";
2
- import { defineCommand } from "citty";
3
- import { loadDeployCreds } from "@clawdlets/core/lib/deploy-creds";
4
- import { buildCattleLabelSelector, listCattleServers } from "@clawdlets/core/lib/hcloud-cattle";
5
- import { run } from "@clawdlets/core/lib/run";
6
- import { loadHostContextOrExit } from "../../lib/context.js";
7
- import { requireEnabled, resolveOne, resolveTailscaleIpv4 } from "./common.js";
8
- export const cattleSsh = defineCommand({
9
- meta: { name: "ssh", description: "SSH into a cattle VM over tailnet (admin@<tailscale-ip>)." },
10
- args: {
11
- runtimeDir: { type: "string", description: "Runtime directory (default: .clawdlets)." },
12
- envFile: { type: "string", description: "Env file for deploy creds (default: <runtimeDir>/env)." },
13
- host: { type: "string", description: "Host name (defaults to clawdlets.json defaultHost / sole host)." },
14
- idOrName: { type: "string", description: "Cattle server id or name.", required: true },
15
- },
16
- async run({ args }) {
17
- const cwd = process.cwd();
18
- const ctx = loadHostContextOrExit({ cwd, runtimeDir: args.runtimeDir, hostArg: args.host });
19
- if (!ctx)
20
- return;
21
- const { config } = ctx;
22
- requireEnabled({
23
- enabled: Boolean(config.cattle?.enabled),
24
- hint: "cattle is disabled (set cattle.enabled=true in fleet/clawdlets.json)",
25
- });
26
- const deployCreds = loadDeployCreds({ cwd, runtimeDir: args.runtimeDir, envFile: args.envFile });
27
- const hcloudToken = String(deployCreds.values.HCLOUD_TOKEN || "").trim();
28
- if (!hcloudToken)
29
- throw new Error("missing HCLOUD_TOKEN (set in .clawdlets/env or env var; run: clawdlets env init)");
30
- const servers = await listCattleServers({ token: hcloudToken, labelSelector: buildCattleLabelSelector() });
31
- const server = resolveOne(servers, String(args.idOrName || ""));
32
- const ip = await resolveTailscaleIpv4(server.name);
33
- const targetHost = `admin@${ip}`;
34
- await run("ssh", ["-t", "--", targetHost], { redact: [] });
35
- },
36
- });
37
- //# sourceMappingURL=ssh.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ssh.js","sourceRoot":"","sources":["../../../src/commands/cattle/ssh.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAChG,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAE/E,MAAM,CAAC,MAAM,SAAS,GAAG,aAAa,CAAC;IACrC,IAAI,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,2DAA2D,EAAE;IAC/F,IAAI,EAAE;QACJ,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,0CAA0C,EAAE;QACvF,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,wDAAwD,EAAE;QAClG,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,iEAAiE,EAAE;QACxG,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,2BAA2B,EAAE,QAAQ,EAAE,IAAI,EAAE;KACvF;IACD,KAAK,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE;QAChB,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;QAC1B,MAAM,GAAG,GAAG,qBAAqB,CAAC,EAAE,GA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ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cattle.d.ts","sourceRoot":"","sources":["../../src/commands/cattle.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,MAAM,qDAWjB,CAAC"}
@@ -1,21 +0,0 @@
1
- import { defineCommand } from "citty";
2
- import { cattleDestroy } from "./cattle/destroy.js";
3
- import { cattleList } from "./cattle/list.js";
4
- import { cattleLogs } from "./cattle/logs.js";
5
- import { cattlePersona } from "./cattle/persona.js";
6
- import { cattleReap } from "./cattle/reap.js";
7
- import { cattleSpawn } from "./cattle/spawn.js";
8
- import { cattleSsh } from "./cattle/ssh.js";
9
- export const cattle = defineCommand({
10
- meta: { name: "cattle", description: "Cattle (ephemeral agents on Hetzner Cloud)." },
11
- subCommands: {
12
- spawn: cattleSpawn,
13
- list: cattleList,
14
- destroy: cattleDestroy,
15
- reap: cattleReap,
16
- logs: cattleLogs,
17
- ssh: cattleSsh,
18
- persona: cattlePersona,
19
- },
20
- });
21
- //# sourceMappingURL=cattle.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cattle.js","sourceRoot":"","sources":["../../src/commands/cattle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,MAAM,CAAC,MAAM,MAAM,GAAG,aAAa,CAAC;IAClC,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,6CAA6C,EAAE;IACpF,WAAW,EAAE;QACX,KAAK,EAAE,WAAW;QAClB,IAAI,EAAE,UAAU;QAChB,OAAO,EAAE,aAAa;QACtB,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,UAAU;QAChB,GAAG,EAAE,SAAS;QACd,OAAO,EAAE,aAAa;KACvB;CACF,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export declare const config: import("citty").CommandDef<import("citty").ArgsDef>;
2
- //# sourceMappingURL=config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/commands/config.ts"],"names":[],"mappings":"AA0KA,eAAO,MAAM,MAAM,qDAGjB,CAAC"}