@everywheredev/cli 0.0.5 → 0.0.7

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 (307) hide show
  1. package/README.md +1 -1
  2. package/dist/index.js +274 -59
  3. package/package.json +3 -2
  4. package/scripts/build.mjs +68 -0
  5. package/dist/agent/agent-loop.d.ts +0 -40
  6. package/dist/agent/agent-loop.d.ts.map +0 -1
  7. package/dist/agent/agent-loop.js +0 -162
  8. package/dist/agent/agent-loop.js.map +0 -1
  9. package/dist/agent/approval.d.ts +0 -38
  10. package/dist/agent/approval.d.ts.map +0 -1
  11. package/dist/agent/approval.js +0 -55
  12. package/dist/agent/approval.js.map +0 -1
  13. package/dist/agent/run-tracker.d.ts +0 -26
  14. package/dist/agent/run-tracker.d.ts.map +0 -1
  15. package/dist/agent/run-tracker.js +0 -43
  16. package/dist/agent/run-tracker.js.map +0 -1
  17. package/dist/auth/device-flow.d.ts +0 -61
  18. package/dist/auth/device-flow.d.ts.map +0 -1
  19. package/dist/auth/device-flow.js +0 -141
  20. package/dist/auth/device-flow.js.map +0 -1
  21. package/dist/auth/hydra-oauth-auth-provider.d.ts +0 -35
  22. package/dist/auth/hydra-oauth-auth-provider.d.ts.map +0 -1
  23. package/dist/auth/hydra-oauth-auth-provider.js +0 -153
  24. package/dist/auth/hydra-oauth-auth-provider.js.map +0 -1
  25. package/dist/auth/keychain.d.ts +0 -42
  26. package/dist/auth/keychain.d.ts.map +0 -1
  27. package/dist/auth/keychain.js +0 -138
  28. package/dist/auth/keychain.js.map +0 -1
  29. package/dist/auth/pkce.d.ts +0 -20
  30. package/dist/auth/pkce.d.ts.map +0 -1
  31. package/dist/auth/pkce.js +0 -44
  32. package/dist/auth/pkce.js.map +0 -1
  33. package/dist/auth/ports.d.ts +0 -25
  34. package/dist/auth/ports.d.ts.map +0 -1
  35. package/dist/auth/ports.js +0 -8
  36. package/dist/auth/ports.js.map +0 -1
  37. package/dist/commands/activity.d.ts +0 -17
  38. package/dist/commands/activity.d.ts.map +0 -1
  39. package/dist/commands/activity.js +0 -54
  40. package/dist/commands/activity.js.map +0 -1
  41. package/dist/commands/agent.d.ts +0 -25
  42. package/dist/commands/agent.d.ts.map +0 -1
  43. package/dist/commands/agent.js +0 -80
  44. package/dist/commands/agent.js.map +0 -1
  45. package/dist/commands/agents.d.ts +0 -9
  46. package/dist/commands/agents.d.ts.map +0 -1
  47. package/dist/commands/agents.js +0 -28
  48. package/dist/commands/agents.js.map +0 -1
  49. package/dist/commands/commits.d.ts +0 -16
  50. package/dist/commands/commits.d.ts.map +0 -1
  51. package/dist/commands/commits.js +0 -39
  52. package/dist/commands/commits.js.map +0 -1
  53. package/dist/commands/diff.d.ts +0 -15
  54. package/dist/commands/diff.d.ts.map +0 -1
  55. package/dist/commands/diff.js +0 -27
  56. package/dist/commands/diff.js.map +0 -1
  57. package/dist/commands/expose.d.ts +0 -15
  58. package/dist/commands/expose.d.ts.map +0 -1
  59. package/dist/commands/expose.js +0 -39
  60. package/dist/commands/expose.js.map +0 -1
  61. package/dist/commands/index.d.ts +0 -7
  62. package/dist/commands/index.d.ts.map +0 -1
  63. package/dist/commands/index.js +0 -12
  64. package/dist/commands/index.js.map +0 -1
  65. package/dist/commands/login.d.ts +0 -9
  66. package/dist/commands/login.d.ts.map +0 -1
  67. package/dist/commands/login.js +0 -27
  68. package/dist/commands/login.js.map +0 -1
  69. package/dist/commands/logout.d.ts +0 -9
  70. package/dist/commands/logout.d.ts.map +0 -1
  71. package/dist/commands/logout.js +0 -24
  72. package/dist/commands/logout.js.map +0 -1
  73. package/dist/commands/me.d.ts +0 -10
  74. package/dist/commands/me.d.ts.map +0 -1
  75. package/dist/commands/me.js +0 -25
  76. package/dist/commands/me.js.map +0 -1
  77. package/dist/commands/open.d.ts +0 -16
  78. package/dist/commands/open.d.ts.map +0 -1
  79. package/dist/commands/open.js +0 -34
  80. package/dist/commands/open.js.map +0 -1
  81. package/dist/commands/ports.d.ts +0 -75
  82. package/dist/commands/ports.d.ts.map +0 -1
  83. package/dist/commands/ports.js +0 -78
  84. package/dist/commands/ports.js.map +0 -1
  85. package/dist/commands/profile.d.ts +0 -21
  86. package/dist/commands/profile.d.ts.map +0 -1
  87. package/dist/commands/profile.js +0 -93
  88. package/dist/commands/profile.js.map +0 -1
  89. package/dist/commands/push.d.ts +0 -18
  90. package/dist/commands/push.d.ts.map +0 -1
  91. package/dist/commands/push.js +0 -116
  92. package/dist/commands/push.js.map +0 -1
  93. package/dist/commands/registry.d.ts +0 -15
  94. package/dist/commands/registry.d.ts.map +0 -1
  95. package/dist/commands/registry.js +0 -45
  96. package/dist/commands/registry.js.map +0 -1
  97. package/dist/commands/request.d.ts +0 -25
  98. package/dist/commands/request.d.ts.map +0 -1
  99. package/dist/commands/request.js +0 -58
  100. package/dist/commands/request.js.map +0 -1
  101. package/dist/commands/resume.d.ts +0 -22
  102. package/dist/commands/resume.d.ts.map +0 -1
  103. package/dist/commands/resume.js +0 -69
  104. package/dist/commands/resume.js.map +0 -1
  105. package/dist/commands/save.d.ts +0 -34
  106. package/dist/commands/save.d.ts.map +0 -1
  107. package/dist/commands/save.js +0 -141
  108. package/dist/commands/save.js.map +0 -1
  109. package/dist/commands/session.d.ts +0 -9
  110. package/dist/commands/session.d.ts.map +0 -1
  111. package/dist/commands/session.js +0 -282
  112. package/dist/commands/session.js.map +0 -1
  113. package/dist/commands/skills/markdown-loader.d.ts +0 -19
  114. package/dist/commands/skills/markdown-loader.d.ts.map +0 -1
  115. package/dist/commands/skills/markdown-loader.js +0 -108
  116. package/dist/commands/skills/markdown-loader.js.map +0 -1
  117. package/dist/commands/skills/registry.d.ts +0 -23
  118. package/dist/commands/skills/registry.d.ts.map +0 -1
  119. package/dist/commands/skills/registry.js +0 -45
  120. package/dist/commands/skills/registry.js.map +0 -1
  121. package/dist/commands/terminal.d.ts +0 -19
  122. package/dist/commands/terminal.d.ts.map +0 -1
  123. package/dist/commands/terminal.js +0 -39
  124. package/dist/commands/terminal.js.map +0 -1
  125. package/dist/commands/tree.d.ts +0 -16
  126. package/dist/commands/tree.d.ts.map +0 -1
  127. package/dist/commands/tree.js +0 -44
  128. package/dist/commands/tree.js.map +0 -1
  129. package/dist/commands/undo.d.ts +0 -18
  130. package/dist/commands/undo.d.ts.map +0 -1
  131. package/dist/commands/undo.js +0 -46
  132. package/dist/commands/undo.js.map +0 -1
  133. package/dist/config/config-store.d.ts +0 -19
  134. package/dist/config/config-store.d.ts.map +0 -1
  135. package/dist/config/config-store.js +0 -199
  136. package/dist/config/config-store.js.map +0 -1
  137. package/dist/config/defaults.d.ts +0 -22
  138. package/dist/config/defaults.d.ts.map +0 -1
  139. package/dist/config/defaults.js +0 -38
  140. package/dist/config/defaults.js.map +0 -1
  141. package/dist/config/ports.d.ts +0 -60
  142. package/dist/config/ports.d.ts.map +0 -1
  143. package/dist/config/ports.js +0 -8
  144. package/dist/config/ports.js.map +0 -1
  145. package/dist/config/profile-constants.d.ts +0 -4
  146. package/dist/config/profile-constants.d.ts.map +0 -1
  147. package/dist/config/profile-constants.js +0 -10
  148. package/dist/config/profile-constants.js.map +0 -1
  149. package/dist/config/profile.d.ts +0 -84
  150. package/dist/config/profile.d.ts.map +0 -1
  151. package/dist/config/profile.js +0 -66
  152. package/dist/config/profile.js.map +0 -1
  153. package/dist/contract/index.d.ts +0 -193
  154. package/dist/contract/index.d.ts.map +0 -1
  155. package/dist/contract/index.js +0 -14
  156. package/dist/contract/index.js.map +0 -1
  157. package/dist/core/app.d.ts +0 -35
  158. package/dist/core/app.d.ts.map +0 -1
  159. package/dist/core/app.js +0 -86
  160. package/dist/core/app.js.map +0 -1
  161. package/dist/core/command-router.d.ts +0 -29
  162. package/dist/core/command-router.d.ts.map +0 -1
  163. package/dist/core/command-router.js +0 -61
  164. package/dist/core/command-router.js.map +0 -1
  165. package/dist/core/errors.d.ts +0 -39
  166. package/dist/core/errors.d.ts.map +0 -1
  167. package/dist/core/errors.js +0 -106
  168. package/dist/core/errors.js.map +0 -1
  169. package/dist/core/preflight.d.ts +0 -16
  170. package/dist/core/preflight.d.ts.map +0 -1
  171. package/dist/core/preflight.js +0 -38
  172. package/dist/core/preflight.js.map +0 -1
  173. package/dist/core/repl.d.ts +0 -18
  174. package/dist/core/repl.d.ts.map +0 -1
  175. package/dist/core/repl.js +0 -128
  176. package/dist/core/repl.js.map +0 -1
  177. package/dist/di/container.d.ts +0 -13
  178. package/dist/di/container.d.ts.map +0 -1
  179. package/dist/di/container.js +0 -160
  180. package/dist/di/container.js.map +0 -1
  181. package/dist/di/tokens.d.ts +0 -20
  182. package/dist/di/tokens.d.ts.map +0 -1
  183. package/dist/di/tokens.js +0 -22
  184. package/dist/di/tokens.js.map +0 -1
  185. package/dist/index.d.ts +0 -9
  186. package/dist/index.d.ts.map +0 -1
  187. package/dist/index.js.map +0 -1
  188. package/dist/render/ink-renderer.d.ts +0 -28
  189. package/dist/render/ink-renderer.d.ts.map +0 -1
  190. package/dist/render/ink-renderer.js +0 -174
  191. package/dist/render/ink-renderer.js.map +0 -1
  192. package/dist/render/plain-renderer.d.ts +0 -16
  193. package/dist/render/plain-renderer.d.ts.map +0 -1
  194. package/dist/render/plain-renderer.js +0 -38
  195. package/dist/render/plain-renderer.js.map +0 -1
  196. package/dist/render/ports.d.ts +0 -12
  197. package/dist/render/ports.d.ts.map +0 -1
  198. package/dist/render/ports.js +0 -10
  199. package/dist/render/ports.js.map +0 -1
  200. package/dist/render/raw-renderer.d.ts +0 -11
  201. package/dist/render/raw-renderer.d.ts.map +0 -1
  202. package/dist/render/raw-renderer.js +0 -68
  203. package/dist/render/raw-renderer.js.map +0 -1
  204. package/dist/render/repl-input.d.ts +0 -15
  205. package/dist/render/repl-input.d.ts.map +0 -1
  206. package/dist/render/repl-input.js +0 -102
  207. package/dist/render/repl-input.js.map +0 -1
  208. package/dist/session/file-session-store.d.ts +0 -26
  209. package/dist/session/file-session-store.d.ts.map +0 -1
  210. package/dist/session/file-session-store.js +0 -174
  211. package/dist/session/file-session-store.js.map +0 -1
  212. package/dist/session/ports.d.ts +0 -50
  213. package/dist/session/ports.d.ts.map +0 -1
  214. package/dist/session/ports.js +0 -6
  215. package/dist/session/ports.js.map +0 -1
  216. package/dist/sync/git-sync.d.ts +0 -16
  217. package/dist/sync/git-sync.d.ts.map +0 -1
  218. package/dist/sync/git-sync.js +0 -28
  219. package/dist/sync/git-sync.js.map +0 -1
  220. package/dist/sync/git.d.ts +0 -12
  221. package/dist/sync/git.d.ts.map +0 -1
  222. package/dist/sync/git.js +0 -100
  223. package/dist/sync/git.js.map +0 -1
  224. package/dist/sync/reconciler.d.ts +0 -36
  225. package/dist/sync/reconciler.d.ts.map +0 -1
  226. package/dist/sync/reconciler.js +0 -143
  227. package/dist/sync/reconciler.js.map +0 -1
  228. package/dist/sync/walk.d.ts +0 -23
  229. package/dist/sync/walk.d.ts.map +0 -1
  230. package/dist/sync/walk.js +0 -81
  231. package/dist/sync/walk.js.map +0 -1
  232. package/dist/sync/watch.d.ts +0 -13
  233. package/dist/sync/watch.d.ts.map +0 -1
  234. package/dist/sync/watch.js +0 -75
  235. package/dist/sync/watch.js.map +0 -1
  236. package/dist/tools/git-diff.d.ts +0 -16
  237. package/dist/tools/git-diff.d.ts.map +0 -1
  238. package/dist/tools/git-diff.js +0 -25
  239. package/dist/tools/git-diff.js.map +0 -1
  240. package/dist/tools/http-request.d.ts +0 -25
  241. package/dist/tools/http-request.d.ts.map +0 -1
  242. package/dist/tools/http-request.js +0 -41
  243. package/dist/tools/http-request.js.map +0 -1
  244. package/dist/tools/index.d.ts +0 -7
  245. package/dist/tools/index.d.ts.map +0 -1
  246. package/dist/tools/index.js +0 -22
  247. package/dist/tools/index.js.map +0 -1
  248. package/dist/tools/ports.d.ts +0 -58
  249. package/dist/tools/ports.d.ts.map +0 -1
  250. package/dist/tools/ports.js +0 -17
  251. package/dist/tools/ports.js.map +0 -1
  252. package/dist/tools/read-file.d.ts +0 -16
  253. package/dist/tools/read-file.d.ts.map +0 -1
  254. package/dist/tools/read-file.js +0 -24
  255. package/dist/tools/read-file.js.map +0 -1
  256. package/dist/tools/registry.d.ts +0 -10
  257. package/dist/tools/registry.d.ts.map +0 -1
  258. package/dist/tools/registry.js +0 -28
  259. package/dist/tools/registry.js.map +0 -1
  260. package/dist/tools/run-command.d.ts +0 -20
  261. package/dist/tools/run-command.d.ts.map +0 -1
  262. package/dist/tools/run-command.js +0 -65
  263. package/dist/tools/run-command.js.map +0 -1
  264. package/dist/tools/write-file.d.ts +0 -24
  265. package/dist/tools/write-file.d.ts.map +0 -1
  266. package/dist/tools/write-file.js +0 -60
  267. package/dist/tools/write-file.js.map +0 -1
  268. package/dist/transport/composite-transport.d.ts +0 -30
  269. package/dist/transport/composite-transport.d.ts.map +0 -1
  270. package/dist/transport/composite-transport.js +0 -71
  271. package/dist/transport/composite-transport.js.map +0 -1
  272. package/dist/transport/device-browser.d.ts +0 -19
  273. package/dist/transport/device-browser.d.ts.map +0 -1
  274. package/dist/transport/device-browser.js +0 -243
  275. package/dist/transport/device-browser.js.map +0 -1
  276. package/dist/transport/device-git.d.ts +0 -14
  277. package/dist/transport/device-git.d.ts.map +0 -1
  278. package/dist/transport/device-git.js +0 -107
  279. package/dist/transport/device-git.js.map +0 -1
  280. package/dist/transport/device-http.d.ts +0 -10
  281. package/dist/transport/device-http.d.ts.map +0 -1
  282. package/dist/transport/device-http.js +0 -96
  283. package/dist/transport/device-http.js.map +0 -1
  284. package/dist/transport/device-terminal.d.ts +0 -44
  285. package/dist/transport/device-terminal.d.ts.map +0 -1
  286. package/dist/transport/device-terminal.js +0 -140
  287. package/dist/transport/device-terminal.js.map +0 -1
  288. package/dist/transport/http-transport.d.ts +0 -26
  289. package/dist/transport/http-transport.d.ts.map +0 -1
  290. package/dist/transport/http-transport.js +0 -125
  291. package/dist/transport/http-transport.js.map +0 -1
  292. package/dist/transport/ports.d.ts +0 -67
  293. package/dist/transport/ports.d.ts.map +0 -1
  294. package/dist/transport/ports.js +0 -11
  295. package/dist/transport/ports.js.map +0 -1
  296. package/dist/transport/reconnect.d.ts +0 -44
  297. package/dist/transport/reconnect.d.ts.map +0 -1
  298. package/dist/transport/reconnect.js +0 -69
  299. package/dist/transport/reconnect.js.map +0 -1
  300. package/dist/transport/terminal-transport.d.ts +0 -28
  301. package/dist/transport/terminal-transport.d.ts.map +0 -1
  302. package/dist/transport/terminal-transport.js +0 -63
  303. package/dist/transport/terminal-transport.js.map +0 -1
  304. package/dist/transport/ws-stream-transport.d.ts +0 -66
  305. package/dist/transport/ws-stream-transport.d.ts.map +0 -1
  306. package/dist/transport/ws-stream-transport.js +0 -246
  307. package/dist/transport/ws-stream-transport.js.map +0 -1
@@ -1,193 +0,0 @@
1
- export type ErrorCode = "bad_request" | "unauthorized" | "forbidden" | "not_found" | "conflict" | "agent_not_available" | "not_implemented" | "bad_gateway";
2
- export interface ApiError {
3
- error: ErrorCode;
4
- message?: string;
5
- }
6
- export interface AuthResponse {
7
- ok: boolean;
8
- project: string;
9
- branch: string;
10
- }
11
- export type Tier = "free" | "pro" | "team" | "enterprise";
12
- export interface Principal {
13
- subject: string;
14
- tenant?: string;
15
- roles?: string[];
16
- scopes?: string[];
17
- tier?: Tier;
18
- }
19
- /**
20
- * Effective entitlement projection (subscription-tiers.md §6 — the enforcement row, projected for a
21
- * client). `null` numeric caps mean "unmetered/none".
22
- */
23
- export interface Entitlement {
24
- tier: Tier;
25
- status: string;
26
- cloudRemote: boolean;
27
- maxConcurrentWorkspaces: number | null;
28
- computeClass: string;
29
- storageBytes: number | null;
30
- agentRunQuotaMonth: number | null;
31
- agentRunsUsedMonth: number;
32
- networkingEnabled: boolean;
33
- seats: number | null;
34
- orgId?: string | null;
35
- currentPeriodEnd?: number | null;
36
- cancelAtPeriodEnd?: boolean;
37
- }
38
- /** `GET /api/me` — identity + resolved entitlement projection. */
39
- export interface MeResponse {
40
- principal: Principal;
41
- tier: Tier;
42
- entitlement: Entitlement;
43
- }
44
- export interface Meta {
45
- project: string;
46
- branch: string;
47
- isRepo: boolean;
48
- usingPty: boolean;
49
- }
50
- export type EntryType = "file" | "dir";
51
- export interface TreeEntry {
52
- name: string;
53
- path: string;
54
- type: EntryType;
55
- size?: number;
56
- }
57
- export type DiffRangeType = "added" | "modified" | "removed";
58
- export interface DiffRange {
59
- start: number;
60
- end: number;
61
- type: DiffRangeType;
62
- }
63
- export interface FileContent {
64
- path: string;
65
- content: string;
66
- mtime: number;
67
- truncated?: boolean;
68
- ranges?: DiffRange[];
69
- }
70
- export interface Commit {
71
- hash: string;
72
- subject: string;
73
- author: string;
74
- date: string;
75
- additions?: number;
76
- deletions?: number;
77
- aiAuthored?: boolean;
78
- }
79
- /** One `git status` entry: a path + short status code ("M"|"A"|"D"|"??"|"R"). */
80
- export interface GitChange {
81
- path: string;
82
- status: string;
83
- }
84
- /** A per-file unified diff of uncommitted changes (the `git diff` patch text). */
85
- export interface GitDiff {
86
- path: string;
87
- patch: string;
88
- }
89
- /** CLI-provided git snapshot for a project (`POST /api/git`, served by `GET /api/changes`). */
90
- export interface GitMeta {
91
- branch: string;
92
- commits: Commit[];
93
- changes: GitChange[];
94
- diffs: GitDiff[];
95
- }
96
- /** `GET /api/projects` item — a project the host exposes to this account. */
97
- export interface ProjectSummary {
98
- id: string;
99
- name: string;
100
- branch?: string;
101
- isRepo?: boolean;
102
- updatedAt?: number;
103
- }
104
- /** `POST /api/projects` body. `ephemeral` projects are torn down when their live session disconnects. */
105
- export interface CreateProjectRequest {
106
- name: string;
107
- ephemeral?: boolean;
108
- }
109
- export type ActivityKind = "edit" | "create" | "delete" | "command" | "info";
110
- export interface ActivityEvent {
111
- id: string;
112
- kind: ActivityKind;
113
- message: string;
114
- path?: string;
115
- at: number;
116
- }
117
- export interface AgentInfo {
118
- id: string;
119
- name: string;
120
- available: boolean;
121
- }
122
- export interface ProxyRequest {
123
- method: string;
124
- url: string;
125
- headers?: Record<string, string>;
126
- body?: string;
127
- }
128
- export interface ProxyResponse {
129
- status: number;
130
- headers: Record<string, string>;
131
- body: string;
132
- }
133
- export interface ChatSession {
134
- id: string;
135
- title?: string;
136
- turns?: Array<Record<string, unknown>>;
137
- updatedAt: number;
138
- }
139
- export interface CheckoutHandoff {
140
- clientSecret: string;
141
- publishableKey: string;
142
- customerId?: string;
143
- ephemeralKey?: string;
144
- }
145
- export interface Envelope<T = unknown> {
146
- event: string;
147
- data?: T;
148
- id?: number;
149
- }
150
- export type FileChange = {
151
- event: "add" | "change" | "unlink";
152
- path: string;
153
- };
154
- export interface ServerEventMap {
155
- "activity:init": ActivityEvent[];
156
- activity: ActivityEvent;
157
- "files:changed": FileChange;
158
- "terminal:ready": {
159
- id: string;
160
- };
161
- "terminal:data": string;
162
- "terminal:exit": number;
163
- "agent:output": {
164
- runId: string;
165
- chunk: string;
166
- };
167
- "agent:tool": {
168
- runId: string;
169
- kind: "file" | "cmd" | "read";
170
- [k: string]: unknown;
171
- };
172
- "agent:end": {
173
- runId: string;
174
- code?: number;
175
- error?: string;
176
- };
177
- }
178
- export interface ClientEventMap {
179
- "terminal:create": {
180
- cols?: number;
181
- rows?: number;
182
- };
183
- "terminal:input": string;
184
- "terminal:resize": {
185
- cols: number;
186
- rows: number;
187
- };
188
- }
189
- export type ServerEvent = keyof ServerEventMap;
190
- export type ClientEvent = keyof ClientEventMap;
191
- export declare const HOST_DEFAULT_PORT = 4317;
192
- export declare const WS_PATH = "/ws";
193
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/contract/index.ts"],"names":[],"mappings":"AAcA,MAAM,MAAM,SAAS,GACjB,aAAa,GACb,cAAc,GACd,WAAW,GACX,WAAW,GACX,UAAU,GACV,qBAAqB,GACrB,iBAAiB,GACjB,aAAa,CAAC;AAElB,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,SAAS,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EA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,CAAC;IACzB,iBAAiB,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;CACnD;AAED,MAAM,MAAM,WAAW,GAAG,MAAM,cAAc,CAAC;AAC/C,MAAM,MAAM,WAAW,GAAG,MAAM,cAAc,CAAC;AAE/C,eAAO,MAAM,iBAAiB,OAAO,CAAC;AACtC,eAAO,MAAM,OAAO,QAAQ,CAAC"}
@@ -1,14 +0,0 @@
1
- // PocketDev CLI ⇄ host frozen contract — local mirror (names IDENTICAL to docs/contract).
2
- //
3
- // DIP/SRP: the rest of the CLI imports the wire shapes from here and never reaches across the package
4
- // boundary. The single source of truth remains `docs/contract/types/index.ts` (kept byte-for-byte
5
- // compatible with the OpenAPI spec, the Go host DTOs, and the Flutter Dart types). To keep this CLI
6
- // package self-contained under `rootDir: src` (so `bin` → `dist/index.js` stays correct) and because
7
- // `docs/contract/` is owned elsewhere and must not be modified, we mirror the *exact* type names
8
- // here. A CI contract test asserts these stay structurally equal to the canonical types (docs §16),
9
- // so any drift fails the build rather than silently diverging.
10
- //
11
- // IMPORTANT: every exported name below matches `docs/contract/types/index.ts` 1:1.
12
- export const HOST_DEFAULT_PORT = 4317;
13
- export const WS_PATH = "/ws";
14
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/contract/index.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAC1F,EAAE;AACF,sGAAsG;AACtG,kGAAkG;AAClG,oGAAoG;AACpG,qGAAqG;AACrG,iGAAiG;AACjG,oGAAoG;AACpG,+DAA+D;AAC/D,EAAE;AACF,mFAAmF;AAyNnF,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAC;AACtC,MAAM,CAAC,MAAM,OAAO,GAAG,KAAK,CAAC"}
@@ -1,35 +0,0 @@
1
- import type { DependencyContainer } from "tsyringe";
2
- import type { ResolvedConfig } from "../config/ports.js";
3
- import { CommandRegistry } from "./command-router.js";
4
- import { CliError } from "./errors.js";
5
- import type { ProjectGuard } from "./preflight.js";
6
- /** The three input modes (docs §3). Selected once, here. */
7
- export type RunMode = "repl" | "oneShot" | "pipe";
8
- export declare class App {
9
- private readonly container;
10
- private readonly config;
11
- private readonly registry;
12
- /** Reconciles the folder's bound project against the signed-in account before dispatch. */
13
- private readonly guard?;
14
- constructor(container: DependencyContainer, config: ResolvedConfig, registry: CommandRegistry,
15
- /** Reconciles the folder's bound project against the signed-in account before dispatch. */
16
- guard?: ProjectGuard | undefined);
17
- /** Classify the invocation. A bare `pocketdev` on a TTY → REPL; otherwise one-shot/pipe. */
18
- mode(argv: readonly string[]): RunMode;
19
- /**
20
- * Entry point after the container is built. Returns a process exit code.
21
- * `pocketdev` is a SINGLE command: it always runs the live SESSION (file sync + device terminal/preview
22
- * sharing), which signs the user in inline when needed. Arguments are ignored — there are no subcommands.
23
- */
24
- run(_argv: readonly string[]): Promise<number>;
25
- /** Uniform error reporting (docs §14): print message + hint, return the CliError exit code. */
26
- private reportError;
27
- }
28
- /**
29
- * Remove the global flags (and their values) that the ConfigStore owns, leaving the command name and
30
- * its own arguments. Keeps the router/command layer ignorant of process-wide flags.
31
- */
32
- export declare function stripGlobalFlags(argv: readonly string[]): string[];
33
- /** Re-export so index.ts can throw a typed config error symmetrically. */
34
- export { CliError };
35
- //# sourceMappingURL=app.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../src/core/app.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAiB,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAc,MAAM,aAAa,CAAC;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,4DAA4D;AAC5D,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC;AAElD,qBAAa,GAAG;IAEZ,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,2FAA2F;IAC3F,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC;gBAJN,SAAS,EAAE,mBAAmB,EAC9B,MAAM,EAAE,cAAc,EACtB,QAAQ,EAAE,eAAe;IAC1C,2FAA2F;IAC1E,KAAK,CAAC,EAAE,YAAY,YAAA;IAGvC,4FAA4F;IAC5F,IAAI,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO;IAMtC;;;;OAIG;IACG,GAAG,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC;IAUpD,+FAA+F;IAC/F,OAAO,CAAC,WAAW;CAUpB;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAiBlE;AAED,0EAA0E;AAC1E,OAAO,EAAE,QAAQ,EAAE,CAAC"}
package/dist/core/app.js DELETED
@@ -1,86 +0,0 @@
1
- // App — the top-level orchestrator that picks an input mode and drives it.
2
- //
3
- // SRP: decides, from the resolved config + argv, whether to run the interactive REPL, a one-shot
4
- // command, or non-TTY pipe mode (docs §3), then hands off to the CommandRouter. It does not implement
5
- // any command, transport, or rendering itself — those are injected/resolved. This keeps the three
6
- // run modes byte-identical below the dispatch boundary (the only difference is the Renderer chosen).
7
- //
8
- // DIP: constructed with the DI container + resolved config; resolves the router/registry lazily so
9
- // the foundation can boot even before the full command set is registered.
10
- import { CommandRouter } from "./command-router.js";
11
- import { CliError, isCliError } from "./errors.js";
12
- export class App {
13
- container;
14
- config;
15
- registry;
16
- guard;
17
- constructor(container, config, registry,
18
- /** Reconciles the folder's bound project against the signed-in account before dispatch. */
19
- guard) {
20
- this.container = container;
21
- this.config = config;
22
- this.registry = registry;
23
- this.guard = guard;
24
- }
25
- /** Classify the invocation. A bare `pocketdev` on a TTY → REPL; otherwise one-shot/pipe. */
26
- mode(argv) {
27
- const hasCommand = argv.some((a) => !a.startsWith("-"));
28
- if (!hasCommand && !this.config.print && !this.config.noTty)
29
- return "repl";
30
- return this.config.print || this.config.noTty ? "pipe" : "oneShot";
31
- }
32
- /**
33
- * Entry point after the container is built. Returns a process exit code.
34
- * `pocketdev` is a SINGLE command: it always runs the live SESSION (file sync + device terminal/preview
35
- * sharing), which signs the user in inline when needed. Arguments are ignored — there are no subcommands.
36
- */
37
- async run(_argv) {
38
- const router = new CommandRouter(this.registry, this.container);
39
- try {
40
- if (this.guard)
41
- await this.guard("session");
42
- return await router.dispatch(["session"]);
43
- }
44
- catch (err) {
45
- return this.reportError(err);
46
- }
47
- }
48
- /** Uniform error reporting (docs §14): print message + hint, return the CliError exit code. */
49
- reportError(err) {
50
- if (isCliError(err)) {
51
- process.stderr.write(`error: ${err.message}\n`);
52
- if (err.hint)
53
- process.stderr.write(`hint: ${err.hint}\n`);
54
- return err.exitCode;
55
- }
56
- const e = err;
57
- process.stderr.write(`error: ${e?.message ?? String(err)}\n`);
58
- return 1;
59
- }
60
- }
61
- /**
62
- * Remove the global flags (and their values) that the ConfigStore owns, leaving the command name and
63
- * its own arguments. Keeps the router/command layer ignorant of process-wide flags.
64
- */
65
- export function stripGlobalFlags(argv) {
66
- const valueFlags = new Set(["--host", "--mode", "--profile"]);
67
- const boolFlags = new Set(["--print", "-p", "--json", "--no-tty"]);
68
- const out = [];
69
- for (let i = 0; i < argv.length; i++) {
70
- const a = argv[i];
71
- if (valueFlags.has(a)) {
72
- i++; // skip the flag's value too
73
- continue;
74
- }
75
- if (boolFlags.has(a))
76
- continue;
77
- if (a.startsWith("--host=") || a.startsWith("--mode=") || a.startsWith("--profile=")) {
78
- continue;
79
- }
80
- out.push(a);
81
- }
82
- return out;
83
- }
84
- /** Re-export so index.ts can throw a typed config error symmetrically. */
85
- export { CliError };
86
- //# sourceMappingURL=app.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"app.js","sourceRoot":"","sources":["../../src/core/app.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,EAAE;AACF,iGAAiG;AACjG,sGAAsG;AACtG,kGAAkG;AAClG,qGAAqG;AACrG,EAAE;AACF,mGAAmG;AACnG,0EAA0E;AAI1E,OAAO,EAAmB,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAMnD,MAAM,OAAO,GAAG;IAEK;IACA;IACA;IAEA;IALnB,YACmB,SAA8B,EAC9B,MAAsB,EACtB,QAAyB;IAC1C,2FAA2F;IAC1E,KAAoB;QAJpB,cAAS,GAAT,SAAS,CAAqB;QAC9B,WAAM,GAAN,MAAM,CAAgB;QACtB,aAAQ,GAAR,QAAQ,CAAiB;QAEzB,UAAK,GAAL,KAAK,CAAe;IACpC,CAAC;IAEJ,4FAA4F;IAC5F,IAAI,CAAC,IAAuB;QAC1B,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;QACxD,IAAI,CAAC,UAAU,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK;YAAE,OAAO,MAAM,CAAC;QAC3E,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,IAAI,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IACrE,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,GAAG,CAAC,KAAwB;QAChC,MAAM,MAAM,GAAG,IAAI,aAAa,CAAC,IAAI,C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AC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAE,CAAC;QACnB,IAAI,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;YACtB,CAAC,EAAE,CAAC,CAAC,4BAA4B;YACjC,SAAS;QACX,CAAC;QACD,IAAI,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;YAAE,SAAS;QAC/B,IAAI,CAAC,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;YACrF,SAAS;QACX,CAAC;QACD,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACd,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,0EAA0E;AAC1E,OAAO,EAAE,QAAQ,EAAE,CAAC"}
@@ -1,29 +0,0 @@
1
- import type { DependencyContainer } from "tsyringe";
2
- /** Minimal command shape the router needs. The full `Command` interface (with zod schema) lives in
3
- * src/commands/ports.ts; the foundation router depends on this narrow structural type so it does not
4
- * pull the command layer into the core. */
5
- export interface RoutableCommand {
6
- readonly name: string;
7
- readonly summary: string;
8
- run(args: readonly string[], container: DependencyContainer): Promise<number | void>;
9
- }
10
- /** OCP extension point: commands register themselves here; the router never changes. */
11
- export declare class CommandRegistry {
12
- private readonly commands;
13
- register(cmd: RoutableCommand): this;
14
- get(name: string): RoutableCommand | undefined;
15
- all(): RoutableCommand[];
16
- }
17
- export declare class CommandRouter {
18
- private readonly registry;
19
- private readonly container;
20
- constructor(registry: CommandRegistry, container: DependencyContainer);
21
- /**
22
- * Dispatch a single invocation. Accepts both `["save", "src/x.ts"]` (one-shot) and a REPL line that
23
- * has already been tokenized; the leading `/` of slash commands is stripped by the caller (app.ts).
24
- * Returns a process exit code (0 on success).
25
- */
26
- dispatch(argv: readonly string[]): Promise<number>;
27
- printUsage(): void;
28
- }
29
- //# sourceMappingURL=command-router.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"command-router.d.ts","sourceRoot":"","sources":["../../src/core/command-router.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAGpD;;4CAE4C;AAC5C,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,GAAG,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,SAAS,EAAE,mBAAmB,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;CACtF;AAED,wFAAwF;AACxF,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAsC;IAE/D,QAAQ,CAAC,GAAG,EAAE,eAAe,GAAG,IAAI;IAQpC,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS;IAI9C,GAAG,IAAI,eAAe,EAAE;CAGzB;AAED,qBAAa,aAAa;IAEtB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,SAAS;gBADT,QAAQ,EAAE,eAAe,EACzB,SAAS,EAAE,mBAAmB;IAGjD;;;;OAIG;IACG,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC;IAiBxD,UAAU,IAAI,IAAI;CAOnB"}
@@ -1,61 +0,0 @@
1
- // CommandRouter — dispatches both `/slash` (REPL) and bare (one-shot) command forms.
2
- //
3
- // OCP: the router is closed for modification — new commands are *registered*, never grafted in here.
4
- // It resolves a command by name from a registry of `{ name, summary, run }` entries and invokes it
5
- // with a context bag of injected ports. The agent loop and renderer are not concerns of the router.
6
- //
7
- // SRP: parse the leading token → look up → run. Argument validation belongs to each command's zod
8
- // schema (commands/ports.ts), not here; the router only splits argv and surfaces unknown-command
9
- // errors with a helpful list.
10
- import { CliError } from "./errors.js";
11
- /** OCP extension point: commands register themselves here; the router never changes. */
12
- export class CommandRegistry {
13
- commands = new Map();
14
- register(cmd) {
15
- if (this.commands.has(cmd.name)) {
16
- throw CliError.config(`Duplicate command "${cmd.name}".`);
17
- }
18
- this.commands.set(cmd.name, cmd);
19
- return this;
20
- }
21
- get(name) {
22
- return this.commands.get(name);
23
- }
24
- all() {
25
- return [...this.commands.values()].sort((a, b) => a.name.localeCompare(b.name));
26
- }
27
- }
28
- export class CommandRouter {
29
- registry;
30
- container;
31
- constructor(registry, container) {
32
- this.registry = registry;
33
- this.container = container;
34
- }
35
- /**
36
- * Dispatch a single invocation. Accepts both `["save", "src/x.ts"]` (one-shot) and a REPL line that
37
- * has already been tokenized; the leading `/` of slash commands is stripped by the caller (app.ts).
38
- * Returns a process exit code (0 on success).
39
- */
40
- async dispatch(argv) {
41
- const [name, ...rest] = argv;
42
- if (!name) {
43
- this.printUsage();
44
- return 2;
45
- }
46
- const cmd = this.registry.get(name);
47
- if (!cmd) {
48
- throw CliError.config(`Unknown command "${name}".`, `Available: ${this.registry.all().map((c) => c.name).join(", ")}.`);
49
- }
50
- const code = await cmd.run(rest, this.container);
51
- return typeof code === "number" ? code : 0;
52
- }
53
- printUsage() {
54
- const lines = ["Usage: pocketdev <command> [args]", "", "Commands:"];
55
- for (const c of this.registry.all()) {
56
- lines.push(` ${c.name.padEnd(12)} ${c.summary}`);
57
- }
58
- process.stderr.write(`${lines.join("\n")}\n`);
59
- }
60
- }
61
- //# sourceMappingURL=command-router.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"command-router.js","sourceRoot":"","sources":["../../src/core/command-router.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,EAAE;AACF,qGAAqG;AACrG,mGAAmG;AACnG,oGAAoG;AACpG,EAAE;AACF,kGAAkG;AAClG,iGAAiG;AACjG,8BAA8B;AAG9B,OAAO,EAAE,QAAQ,EAAE,MA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AAE,CAAC;YACT,MAAM,QAAQ,CAAC,MAAM,CACnB,oBAAoB,IAAI,IAAI,EAC5B,cAAc,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CACnE,CAAC;QACJ,CAAC;QACD,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;QACjD,OAAO,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7C,CAAC;IAED,UAAU;QACR,MAAM,KAAK,GAAG,CAAC,mCAAmC,EAAE,EAAE,EAAE,WAAW,CAAC,CAAC;QACrE,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC;YACpC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;QACpD,CAAC;QACD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAChD,CAAC;CACF"}
@@ -1,39 +0,0 @@
1
- import type { ErrorCode } from "../contract/index.js";
2
- /** Stable, user-facing failure categories. Independent of transport internals. */
3
- export type CliErrorKind = "unauthorized" | "forbidden" | "not_found" | "conflict" | "agent_unavailable" | "not_implemented" | "bad_gateway" | "bad_request" | "network" | "config" | "auth" | "internal";
4
- export interface CliErrorOptions {
5
- /** HTTP status from the host, when this originated from a REST/WS response. */
6
- status?: number;
7
- /** Frozen contract error code from the response body, when present. */
8
- code?: ErrorCode;
9
- /** One-line remediation shown under the message (e.g. "run `pocketdev login`"). */
10
- hint?: string;
11
- /** Underlying cause for stack chaining. */
12
- cause?: unknown;
13
- }
14
- export declare class CliError extends Error {
15
- readonly kind: CliErrorKind;
16
- readonly status?: number;
17
- readonly code?: ErrorCode;
18
- readonly hint?: string;
19
- constructor(kind: CliErrorKind, message: string, opts?: CliErrorOptions);
20
- /** Process exit code convention: 0 ok, 1 generic, 2 usage/config. */
21
- get exitCode(): number;
22
- /**
23
- * Map a host HTTP status (+ optional contract error body) to a CliError with a default hint.
24
- * Centralizing this keeps the HttpTransport free of policy and guarantees uniform UX (docs §14).
25
- */
26
- static fromStatus(status: number, body?: {
27
- error?: ErrorCode;
28
- message?: string;
29
- }): CliError;
30
- /** Wrap a transport-level network failure (connection refused, DNS, WS drop). */
31
- static network(message: string, cause?: unknown): CliError;
32
- /** Configuration / usage failure (unknown profile, bad flag). */
33
- static config(message: string, hint?: string): CliError;
34
- /** Authentication failure (login/refresh/device-flow). */
35
- static auth(message: string, hint?: string, cause?: unknown): CliError;
36
- }
37
- /** Narrowing helper used by the top-level handler and command router. */
38
- export declare function isCliError(e: unknown): e is CliError;
39
- //# sourceMappingURL=errors.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/core/errors.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD,kFAAkF;AAClF,MAAM,MAAM,YAAY,GACpB,cAAc,GACd,WAAW,GACX,WAAW,GACX,UAAU,GACV,mBAAmB,GACnB,iBAAiB,GACjB,aAAa,GACb,aAAa,GACb,SAAS,GACT,QAAQ,GACR,MAAM,GACN,UAAU,CAAC;AAEf,MAAM,WAAW,eAAe;IAC9B,+EAA+E;IAC/E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,uEAAuE;IACvE,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,mFAAmF;IACnF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,2CAA2C;IAC3C,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,qBAAa,QAAS,SAAQ,KAAK;IACjC,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;gBAEX,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,GAAE,eAAoB;IAW3E,qEAAqE;IACrE,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,SAAS,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,QAAQ;IAwD3F,iFAAiF;IACjF,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,QAAQ;IAS1D,iEAAiE;IACjE,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,QAAQ;IAIvD,0DAA0D;IAC1D,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,QAAQ;CAGvE;AAED,yEAAyE;AACzE,wBAAgB,UAAU,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,QAAQ,CAEpD"}
@@ -1,106 +0,0 @@
1
- // CliError taxonomy.
2
- //
3
- // SRP: a single error type carrying a stable `kind`, an optional HTTP `status` mapped from the host,
4
- // and a user-facing `hint`. The renderer prints `message` + `hint`; the agent/command layer matches
5
- // on `kind` to decide retry/refresh/reload behavior (see docs §14). Mapping host status codes lives
6
- // in `fromStatus` so transports stay dumb and consistent.
7
- export class CliError extends Error {
8
- kind;
9
- status;
10
- code;
11
- hint;
12
- constructor(kind, message, opts = {}) {
13
- super(message, opts.cause !== undefined ? { cause: opts.cause } : undefined);
14
- this.name = "CliError";
15
- this.kind = kind;
16
- this.status = opts.status;
17
- this.code = opts.code;
18
- this.hint = opts.hint;
19
- // Preserve a clean prototype chain for `instanceof` under transpilation.
20
- Object.setPrototypeOf(this, CliError.prototype);
21
- }
22
- /** Process exit code convention: 0 ok, 1 generic, 2 usage/config. */
23
- get exitCode() {
24
- return this.kind === "config" || this.kind === "bad_request" ? 2 : 1;
25
- }
26
- /**
27
- * Map a host HTTP status (+ optional contract error body) to a CliError with a default hint.
28
- * Centralizing this keeps the HttpTransport free of policy and guarantees uniform UX (docs §14).
29
- */
30
- static fromStatus(status, body) {
31
- const code = body?.error;
32
- const detail = body?.message;
33
- switch (status) {
34
- case 400:
35
- return new CliError("bad_request", detail ?? "Bad request.", { status, code });
36
- case 401:
37
- return new CliError("unauthorized", detail ?? "Unauthorized.", {
38
- status,
39
- code,
40
- hint: "Run `pocketdev login` to sign in.",
41
- });
42
- case 403:
43
- return new CliError("forbidden", detail ?? "Forbidden.", {
44
- status,
45
- code,
46
- hint: "You may not have access to this project. Run `pocketdev me` to check your account, or re-run `pocketdev push` to bind a project you own. (Premium features also require an active paid tier.)",
47
- });
48
- case 404:
49
- return new CliError("not_found", detail ?? "Not found.", {
50
- status,
51
- code,
52
- hint: "Check the path with `pocketdev tree`.",
53
- });
54
- case 409:
55
- return new CliError("conflict", detail ?? "File changed on the host since you read it.", {
56
- status,
57
- code,
58
- hint: "Reload, diff, or overwrite — never silently clobber a concurrent edit.",
59
- });
60
- case 422:
61
- return new CliError("agent_unavailable", detail ?? "Agent unavailable.", {
62
- status,
63
- code,
64
- hint: "List agents with `pocketdev agents` and pass a valid agentId.",
65
- });
66
- case 501:
67
- return new CliError("not_implemented", detail ?? "Not implemented on this host.", {
68
- status,
69
- code,
70
- hint: "Port exposure may require a tunnel (e.g. install `cloudflared`).",
71
- });
72
- case 502:
73
- return new CliError("bad_gateway", detail ?? "Upstream proxy error.", {
74
- status,
75
- code,
76
- hint: "The host could not reach the upstream target for `pocketdev request`.",
77
- });
78
- default:
79
- return new CliError("internal", detail ?? `Unexpected host status ${status}.`, {
80
- status,
81
- code,
82
- });
83
- }
84
- }
85
- /** Wrap a transport-level network failure (connection refused, DNS, WS drop). */
86
- static network(message, cause) {
87
- return new CliError("network", message, {
88
- cause,
89
- hint: "Is the host reachable at that URL and is the stack up? If it serves a self-signed " +
90
- "TLS cert, ensure NODE_EXTRA_CA_CERTS trusts it.",
91
- });
92
- }
93
- /** Configuration / usage failure (unknown profile, bad flag). */
94
- static config(message, hint) {
95
- return new CliError("config", message, { hint });
96
- }
97
- /** Authentication failure (login/refresh/device-flow). */
98
- static auth(message, hint, cause) {
99
- return new CliError("auth", message, { hint, cause });
100
- }
101
- }
102
- /** Narrowing helper used by the top-level handler and command router. */
103
- export function isCliError(e) {
104
- return e instanceof CliError;
105
- }
106
- //# sourceMappingURL=errors.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/core/errors.ts"],"names":[],"mappings":"AAAA,qBAAqB;AACrB,EAAE;AACF,qGAAqG;AACrG,oGAAoG;AACpG,oGAAoG;AACpG,0DAA0D;AA8B1D,MAAM,OAAO,QAAS,SAAQ,KAAK;IACxB,IAAI,CAAe;IACnB,MAAM,CAAU;IAChB,IAAI,CAAa;IACjB,IAAI,CAAU;IAEvB,YAAY,IAAkB,EAAE,OAAe,EAAE,OAAwB,EAAE;QACzE,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;QAC7E,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,C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I,QAAQ,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IACxD,CAAC;CACF;AAED,yEAAyE;AACzE,MAAM,UAAU,UAAU,CAAC,CAAU;IACnC,OAAO,CAAC,YAAY,QAAQ,CAAC;AAC/B,CAAC"}
@@ -1,16 +0,0 @@
1
- import type { HttpPort } from "../transport/ports.js";
2
- export type ProjectGuard = (commandName: string | undefined) => Promise<void>;
3
- export interface ProjectGuardDeps {
4
- http: HttpPort;
5
- /** Emit a one-line notice to the user. */
6
- log: (line: string) => void;
7
- /** The mutable resolved binding — the SAME object the transport factory reads per request. */
8
- binding: {
9
- projectId?: string;
10
- projectName?: string;
11
- };
12
- /** Persist the rebind to ./.pocketdev/config.json so it sticks across runs. */
13
- persist: (id: string, name: string) => void;
14
- }
15
- export declare function makeProjectGuard(d: ProjectGuardDeps): ProjectGuard;
16
- //# sourceMappingURL=preflight.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"preflight.d.ts","sourceRoot":"","sources":["../../src/core/preflight.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAMtD,MAAM,MAAM,YAAY,GAAG,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAE9E,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,QAAQ,CAAC;IACf,0CAA0C;IAC1C,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5B,8FAA8F;IAC9F,OAAO,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACtD,+EAA+E;IAC/E,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC7C;AAED,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,gBAAgB,GAAG,YAAY,CA8BlE"}