@eloxiv/cli 0.0.0-stage → 0.1.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 (294) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +12 -2
  3. package/dist/AgentSkills.d.ts +51 -0
  4. package/dist/AgentSkills.d.ts.map +1 -0
  5. package/dist/AgentSkills.js +264 -0
  6. package/dist/AgentSkills.js.map +1 -0
  7. package/dist/AgentWeb.d.ts +83 -0
  8. package/dist/AgentWeb.d.ts.map +1 -0
  9. package/dist/AgentWeb.js +436 -0
  10. package/dist/AgentWeb.js.map +1 -0
  11. package/dist/App.d.ts +213 -0
  12. package/dist/App.d.ts.map +1 -0
  13. package/dist/App.js +357 -0
  14. package/dist/App.js.map +1 -0
  15. package/dist/Blueprint.d.ts +47 -0
  16. package/dist/Blueprint.d.ts.map +1 -0
  17. package/dist/Blueprint.js +241 -0
  18. package/dist/Blueprint.js.map +1 -0
  19. package/dist/Brand.d.ts +42 -0
  20. package/dist/Brand.d.ts.map +1 -0
  21. package/dist/Brand.js +370 -0
  22. package/dist/Brand.js.map +1 -0
  23. package/dist/Changelog.d.ts +22 -0
  24. package/dist/Changelog.d.ts.map +1 -0
  25. package/dist/Changelog.js +117 -0
  26. package/dist/Changelog.js.map +1 -0
  27. package/dist/Cli.d.ts +17 -0
  28. package/dist/Cli.d.ts.map +1 -0
  29. package/dist/Cli.js +810 -0
  30. package/dist/Cli.js.map +1 -0
  31. package/dist/DbAdmin.d.ts +18 -0
  32. package/dist/DbAdmin.d.ts.map +1 -0
  33. package/dist/DbAdmin.js +91 -0
  34. package/dist/DbAdmin.js.map +1 -0
  35. package/dist/Dependencies.d.ts +53 -0
  36. package/dist/Dependencies.d.ts.map +1 -0
  37. package/dist/Dependencies.js +132 -0
  38. package/dist/Dependencies.js.map +1 -0
  39. package/dist/Deploy.d.ts +39 -0
  40. package/dist/Deploy.d.ts.map +1 -0
  41. package/dist/Deploy.js +458 -0
  42. package/dist/Deploy.js.map +1 -0
  43. package/dist/Docs.d.ts +71 -0
  44. package/dist/Docs.d.ts.map +1 -0
  45. package/dist/Docs.js +240 -0
  46. package/dist/Docs.js.map +1 -0
  47. package/dist/Doctor.d.ts +56 -0
  48. package/dist/Doctor.d.ts.map +1 -0
  49. package/dist/Doctor.js +368 -0
  50. package/dist/Doctor.js.map +1 -0
  51. package/dist/Dossier.d.ts +23 -0
  52. package/dist/Dossier.d.ts.map +1 -0
  53. package/dist/Dossier.js +92 -0
  54. package/dist/Dossier.js.map +1 -0
  55. package/dist/Emit.d.ts +26 -0
  56. package/dist/Emit.d.ts.map +1 -0
  57. package/dist/Emit.js +51 -0
  58. package/dist/Emit.js.map +1 -0
  59. package/dist/Errors.d.ts +26 -0
  60. package/dist/Errors.d.ts.map +1 -0
  61. package/dist/Errors.js +17 -0
  62. package/dist/Errors.js.map +1 -0
  63. package/dist/Evals.d.ts +52 -0
  64. package/dist/Evals.d.ts.map +1 -0
  65. package/dist/Evals.js +126 -0
  66. package/dist/Evals.js.map +1 -0
  67. package/dist/Files.d.ts +47 -0
  68. package/dist/Files.d.ts.map +1 -0
  69. package/dist/Files.js +145 -0
  70. package/dist/Files.js.map +1 -0
  71. package/dist/Generate.d.ts +80 -0
  72. package/dist/Generate.d.ts.map +1 -0
  73. package/dist/Generate.js +310 -0
  74. package/dist/Generate.js.map +1 -0
  75. package/dist/Guards.d.ts +45 -0
  76. package/dist/Guards.d.ts.map +1 -0
  77. package/dist/Guards.js +530 -0
  78. package/dist/Guards.js.map +1 -0
  79. package/dist/Inspect.d.ts +125 -0
  80. package/dist/Inspect.d.ts.map +1 -0
  81. package/dist/Inspect.js +270 -0
  82. package/dist/Inspect.js.map +1 -0
  83. package/dist/Keychain.d.ts +57 -0
  84. package/dist/Keychain.d.ts.map +1 -0
  85. package/dist/Keychain.js +73 -0
  86. package/dist/Keychain.js.map +1 -0
  87. package/dist/Lock.d.ts +13 -0
  88. package/dist/Lock.d.ts.map +1 -0
  89. package/dist/Lock.js +145 -0
  90. package/dist/Lock.js.map +1 -0
  91. package/dist/Mcp.d.ts +91 -0
  92. package/dist/Mcp.d.ts.map +1 -0
  93. package/dist/Mcp.js +128 -0
  94. package/dist/Mcp.js.map +1 -0
  95. package/dist/Merge.d.ts +18 -0
  96. package/dist/Merge.d.ts.map +1 -0
  97. package/dist/Merge.js +43 -0
  98. package/dist/Merge.js.map +1 -0
  99. package/dist/Migrate.d.ts +78 -0
  100. package/dist/Migrate.d.ts.map +1 -0
  101. package/dist/Migrate.js +288 -0
  102. package/dist/Migrate.js.map +1 -0
  103. package/dist/Plugins.d.ts +36 -0
  104. package/dist/Plugins.d.ts.map +1 -0
  105. package/dist/Plugins.js +304 -0
  106. package/dist/Plugins.js.map +1 -0
  107. package/dist/Postgres.d.ts +73 -0
  108. package/dist/Postgres.d.ts.map +1 -0
  109. package/dist/Postgres.js +294 -0
  110. package/dist/Postgres.js.map +1 -0
  111. package/dist/Publish.d.ts +23 -0
  112. package/dist/Publish.d.ts.map +1 -0
  113. package/dist/Publish.js +59 -0
  114. package/dist/Publish.js.map +1 -0
  115. package/dist/Registry.d.ts +539 -0
  116. package/dist/Registry.d.ts.map +1 -0
  117. package/dist/Registry.js +340 -0
  118. package/dist/Registry.js.map +1 -0
  119. package/dist/Remote.d.ts +90 -0
  120. package/dist/Remote.d.ts.map +1 -0
  121. package/dist/Remote.js +1006 -0
  122. package/dist/Remote.js.map +1 -0
  123. package/dist/Run.d.ts +120 -0
  124. package/dist/Run.d.ts.map +1 -0
  125. package/dist/Run.js +477 -0
  126. package/dist/Run.js.map +1 -0
  127. package/dist/SyncGen.d.ts +118 -0
  128. package/dist/SyncGen.d.ts.map +1 -0
  129. package/dist/SyncGen.js +392 -0
  130. package/dist/SyncGen.js.map +1 -0
  131. package/dist/Update.d.ts +301 -0
  132. package/dist/Update.d.ts.map +1 -0
  133. package/dist/Update.js +627 -0
  134. package/dist/Update.js.map +1 -0
  135. package/dist/bin.d.ts +3 -0
  136. package/dist/bin.d.ts.map +1 -0
  137. package/dist/bin.js +42 -0
  138. package/dist/bin.js.map +1 -0
  139. package/dist/docs/backlog.md +56 -0
  140. package/dist/docs/ci.md +277 -0
  141. package/dist/docs/cli.md +696 -0
  142. package/dist/docs/connectors/google.md +115 -0
  143. package/dist/docs/connectors/http-openapi.md +7 -0
  144. package/dist/docs/connectors/mcp.md +8 -0
  145. package/dist/docs/connectors/microsoft-graph.md +75 -0
  146. package/dist/docs/connectors/openai.md +25 -0
  147. package/dist/docs/connectors/slack.md +162 -0
  148. package/dist/docs/connectors/workos.md +39 -0
  149. package/dist/docs/contracts/README.md +173 -0
  150. package/dist/docs/contracts/action-consent.md +92 -0
  151. package/dist/docs/contracts/action-registry.md +85 -0
  152. package/dist/docs/contracts/actor.md +100 -0
  153. package/dist/docs/contracts/agent-resources.md +90 -0
  154. package/dist/docs/contracts/agent-runtime.md +257 -0
  155. package/dist/docs/contracts/approvals.md +126 -0
  156. package/dist/docs/contracts/audit.md +75 -0
  157. package/dist/docs/contracts/auth-provider.md +74 -0
  158. package/dist/docs/contracts/calendar-provider.md +46 -0
  159. package/dist/docs/contracts/client-sdk.md +245 -0
  160. package/dist/docs/contracts/collab-document.md +151 -0
  161. package/dist/docs/contracts/command.md +44 -0
  162. package/dist/docs/contracts/connections.md +235 -0
  163. package/dist/docs/contracts/context-accounting.md +50 -0
  164. package/dist/docs/contracts/daemon.md +243 -0
  165. package/dist/docs/contracts/db-tx.md +53 -0
  166. package/dist/docs/contracts/delegation.md +68 -0
  167. package/dist/docs/contracts/device-control.md +103 -0
  168. package/dist/docs/contracts/directory-provider.md +36 -0
  169. package/dist/docs/contracts/directory.md +161 -0
  170. package/dist/docs/contracts/document-source.md +33 -0
  171. package/dist/docs/contracts/files.md +115 -0
  172. package/dist/docs/contracts/flags.md +83 -0
  173. package/dist/docs/contracts/host.md +68 -0
  174. package/dist/docs/contracts/http-api.md +43 -0
  175. package/dist/docs/contracts/ingestion.md +130 -0
  176. package/dist/docs/contracts/ingress.md +141 -0
  177. package/dist/docs/contracts/invocation.md +260 -0
  178. package/dist/docs/contracts/local-client.md +108 -0
  179. package/dist/docs/contracts/locale.md +56 -0
  180. package/dist/docs/contracts/machine-identity.md +117 -0
  181. package/dist/docs/contracts/mail-provider.md +49 -0
  182. package/dist/docs/contracts/memory.md +53 -0
  183. package/dist/docs/contracts/messaging.md +40 -0
  184. package/dist/docs/contracts/metering.md +139 -0
  185. package/dist/docs/contracts/model-provider.md +84 -0
  186. package/dist/docs/contracts/module-manifest.md +213 -0
  187. package/dist/docs/contracts/notification-channel.md +90 -0
  188. package/dist/docs/contracts/notifications.md +123 -0
  189. package/dist/docs/contracts/outbox.md +80 -0
  190. package/dist/docs/contracts/privacy.md +110 -0
  191. package/dist/docs/contracts/progress.md +52 -0
  192. package/dist/docs/contracts/query-surface.md +108 -0
  193. package/dist/docs/contracts/readiness.md +63 -0
  194. package/dist/docs/contracts/release.md +142 -0
  195. package/dist/docs/contracts/result-rendering.md +61 -0
  196. package/dist/docs/contracts/sandbox.md +186 -0
  197. package/dist/docs/contracts/scheduler.md +148 -0
  198. package/dist/docs/contracts/screen-context.md +81 -0
  199. package/dist/docs/contracts/search.md +120 -0
  200. package/dist/docs/contracts/secrets.md +74 -0
  201. package/dist/docs/contracts/settings.md +109 -0
  202. package/dist/docs/contracts/sharing.md +77 -0
  203. package/dist/docs/contracts/slot.md +48 -0
  204. package/dist/docs/contracts/space.md +67 -0
  205. package/dist/docs/contracts/storage-adapter.md +45 -0
  206. package/dist/docs/contracts/storage-backend.md +56 -0
  207. package/dist/docs/contracts/sync.md +213 -0
  208. package/dist/docs/contracts/telemetry.md +80 -0
  209. package/dist/docs/contracts/theme-tokens.md +50 -0
  210. package/dist/docs/contracts/tool-source.md +58 -0
  211. package/dist/docs/contracts/versioning.md +99 -0
  212. package/dist/docs/contracts/view.md +65 -0
  213. package/dist/docs/contracts/work-items.md +99 -0
  214. package/dist/docs/contracts/workflow.md +82 -0
  215. package/dist/docs/decisions.md +163 -0
  216. package/dist/docs/example-app.md +192 -0
  217. package/dist/docs/getting-started.md +927 -0
  218. package/dist/docs/goal.md +54 -0
  219. package/dist/docs/parity.md +29 -0
  220. package/dist/docs/performance.md +129 -0
  221. package/dist/docs/registry/README.md +74 -0
  222. package/dist/docs/registry/app.md +38 -0
  223. package/dist/docs/registry/approvals-ui-foldkit.md +28 -0
  224. package/dist/docs/registry/calendar-ui-foldkit.md +27 -0
  225. package/dist/docs/registry/calendar.md +35 -0
  226. package/dist/docs/registry/chat-ui-foldkit.md +30 -0
  227. package/dist/docs/registry/desktop-rune.md +49 -0
  228. package/dist/docs/registry/desktop.md +32 -0
  229. package/dist/docs/registry/eloxiv-action.md +25 -0
  230. package/dist/docs/registry/eloxiv-connector.md +25 -0
  231. package/dist/docs/registry/eloxiv-module.md +25 -0
  232. package/dist/docs/registry/eloxiv-policy.md +25 -0
  233. package/dist/docs/registry/eloxiv-view.md +25 -0
  234. package/dist/docs/registry/hello-ui-foldkit.md +29 -0
  235. package/dist/docs/registry/hello.md +39 -0
  236. package/dist/docs/registry/home-ui-foldkit.md +27 -0
  237. package/dist/docs/registry/home.md +29 -0
  238. package/dist/docs/registry/inbox-ui-foldkit.md +27 -0
  239. package/dist/docs/registry/mail-ui-foldkit.md +27 -0
  240. package/dist/docs/registry/mail.md +34 -0
  241. package/dist/docs/registry/meeting-prep.md +26 -0
  242. package/dist/docs/registry/members-ui-foldkit.md +28 -0
  243. package/dist/docs/registry/mobile.md +37 -0
  244. package/dist/docs/registry/notes-ui-foldkit.md +27 -0
  245. package/dist/docs/registry/notes.md +26 -0
  246. package/dist/docs/registry/people-ui-foldkit.md +28 -0
  247. package/dist/docs/registry/people.md +38 -0
  248. package/dist/docs/registry/shell-foldkit.md +34 -0
  249. package/dist/docs/registry/theme.md +25 -0
  250. package/dist/docs/registry/ui-conformance.md +30 -0
  251. package/dist/docs/release.md +100 -0
  252. package/dist/docs/scaffold.md +826 -0
  253. package/dist/docs/security/threat-model.md +299 -0
  254. package/dist/docs/upstream/zero-cache-socket-handoff.md +105 -0
  255. package/dist/index.d.ts +8 -0
  256. package/dist/index.d.ts.map +1 -0
  257. package/dist/index.js +8 -0
  258. package/dist/index.js.map +1 -0
  259. package/package.json +48 -3
  260. package/src/AgentSkills.ts +329 -0
  261. package/src/AgentWeb.ts +507 -0
  262. package/src/App.ts +435 -0
  263. package/src/Blueprint.ts +276 -0
  264. package/src/Brand.ts +415 -0
  265. package/src/Changelog.ts +136 -0
  266. package/src/Cli.ts +1458 -0
  267. package/src/DbAdmin.ts +115 -0
  268. package/src/Dependencies.ts +170 -0
  269. package/src/Deploy.ts +563 -0
  270. package/src/Docs.ts +309 -0
  271. package/src/Doctor.ts +424 -0
  272. package/src/Dossier.ts +148 -0
  273. package/src/Emit.ts +68 -0
  274. package/src/Errors.ts +18 -0
  275. package/src/Evals.ts +153 -0
  276. package/src/Files.ts +152 -0
  277. package/src/Generate.ts +402 -0
  278. package/src/Guards.ts +541 -0
  279. package/src/Inspect.ts +358 -0
  280. package/src/Keychain.ts +107 -0
  281. package/src/Lock.ts +174 -0
  282. package/src/Mcp.ts +159 -0
  283. package/src/Merge.ts +70 -0
  284. package/src/Migrate.ts +331 -0
  285. package/src/Plugins.ts +347 -0
  286. package/src/Postgres.ts +353 -0
  287. package/src/Publish.ts +64 -0
  288. package/src/Registry.ts +405 -0
  289. package/src/Remote.ts +1158 -0
  290. package/src/Run.ts +541 -0
  291. package/src/SyncGen.ts +570 -0
  292. package/src/Update.ts +873 -0
  293. package/src/bin.ts +46 -0
  294. package/src/index.ts +7 -0
@@ -0,0 +1,301 @@
1
+ /**
2
+ * `eloxiv diff`, `eloxiv update`, `eloxiv update --continue` and `eloxiv eject`.
3
+ *
4
+ * Every installed item has a base: the exact version the app installed, which the registry keeps
5
+ * immutably at `<name>/<version>.json` and the lock records (version, content hash, a sha256 per file as
6
+ * published). A working file whose hash differs from the lock's is a local edit; a registry whose latest
7
+ * content hash differs from the lock's has upstream changes. `update` merges the two per file (base,
8
+ * ours = the app's file, theirs = the new version).
9
+ *
10
+ * The app's files are read as bytes. A file is merged line by line only when it is valid UTF-8 without NUL
11
+ * on every side; otherwise it is binary and compared byte for byte.
12
+ */
13
+ import type { ProvenanceConflict, ProvenanceEntry } from "@eloxiv/contracts";
14
+ import { type MigrationChange } from "./Migrate.ts";
15
+ import { Effect } from "effect";
16
+ import { CliError, type MutableLock } from "./App.ts";
17
+ import { type NpmChange, type PackageField } from "./Dependencies.ts";
18
+ import { type ItemKind } from "./Registry.ts";
19
+ export type { NpmChange } from "./Dependencies.ts";
20
+ export interface VersionRef {
21
+ readonly version: string;
22
+ readonly contentHash: string;
23
+ }
24
+ /** The entries for `names` (every installed item when empty), refusing names that are not installed. */
25
+ export declare const selectEntries: (lock: MutableLock, names: ReadonlyArray<string>) => Effect.Effect<{
26
+ readonly name: string;
27
+ readonly type: string;
28
+ readonly registry: string;
29
+ readonly registryVersion: string;
30
+ readonly contentHash: string;
31
+ readonly installedAt: string;
32
+ readonly files: readonly {
33
+ readonly path: string;
34
+ readonly sha256: string;
35
+ }[];
36
+ readonly meta?: {
37
+ readonly [x: string]: unknown;
38
+ };
39
+ readonly item?: string;
40
+ readonly owner?: "app" | "registry";
41
+ readonly conflicts?: readonly {
42
+ readonly path: string;
43
+ readonly reason: "binary" | "content" | "deleted-locally";
44
+ }[];
45
+ readonly updatedFrom?: {
46
+ readonly registryVersion: string;
47
+ readonly contentHash: string;
48
+ };
49
+ readonly updatedAt?: string;
50
+ }[], CliError, never>;
51
+ export declare const kindOf: (entry: ProvenanceEntry) => ItemKind;
52
+ /** Fetch the exact version the app installed, and check it is what the lock says was installed. */
53
+ export declare const fetchBase: (registry: string, entry: {
54
+ readonly name: string;
55
+ readonly type: string;
56
+ readonly registry: string;
57
+ readonly registryVersion: string;
58
+ readonly contentHash: string;
59
+ readonly installedAt: string;
60
+ readonly files: readonly {
61
+ readonly path: string;
62
+ readonly sha256: string;
63
+ }[];
64
+ readonly meta?: {
65
+ readonly [x: string]: unknown;
66
+ };
67
+ readonly item?: string;
68
+ readonly owner?: "app" | "registry";
69
+ readonly conflicts?: readonly {
70
+ readonly path: string;
71
+ readonly reason: "binary" | "content" | "deleted-locally";
72
+ }[];
73
+ readonly updatedFrom?: {
74
+ readonly registryVersion: string;
75
+ readonly contentHash: string;
76
+ };
77
+ readonly updatedAt?: string;
78
+ }) => Effect.Effect<{
79
+ name: string;
80
+ type: string;
81
+ description?: string | undefined;
82
+ registryDependencies?: readonly string[] | undefined;
83
+ dependencies?: readonly string[] | undefined;
84
+ devDependencies?: readonly string[] | undefined;
85
+ meta: {
86
+ readonly eloxiv: {
87
+ readonly kind: "app" | "connector" | "desktop" | "mobile" | "module" | "shell" | "skill" | "space" | "theme" | "ui";
88
+ readonly version: string;
89
+ readonly module?: string | undefined;
90
+ readonly contract?: {
91
+ readonly file: string;
92
+ readonly export: string;
93
+ } | undefined;
94
+ readonly server?: {
95
+ readonly file: string;
96
+ readonly export: string;
97
+ } | undefined;
98
+ readonly sync?: {
99
+ readonly file: string;
100
+ readonly tables?: string | undefined;
101
+ readonly mutators?: string | undefined;
102
+ } | undefined;
103
+ readonly kernelModules?: readonly ("agent" | "connections" | "devices" | "inbox" | "search" | "sharing" | "spaces")[] | undefined;
104
+ readonly provides?: readonly string[] | undefined;
105
+ readonly skill?: string | undefined;
106
+ readonly patchedDependencies?: {
107
+ readonly [x: string]: string;
108
+ } | undefined;
109
+ readonly next?: readonly string[] | undefined;
110
+ readonly migrations?: readonly {
111
+ readonly since: string;
112
+ readonly moves?: readonly {
113
+ readonly from: string;
114
+ readonly symbol?: string | undefined;
115
+ readonly to: string;
116
+ readonly as?: string | undefined;
117
+ }[] | undefined;
118
+ readonly note?: string | undefined;
119
+ }[] | undefined;
120
+ };
121
+ };
122
+ files: {
123
+ readonly path: string;
124
+ readonly type: string;
125
+ readonly target?: string | undefined;
126
+ readonly content: string;
127
+ }[];
128
+ } | undefined, CliError, import("effect/FileSystem").FileSystem | import("effect/Path").Path>;
129
+ /** Where the new version of a binary file changed on both sides is written, beside the app's file. */
130
+ export declare const upstreamCopy: (path: string) => string;
131
+ export interface LocalChange {
132
+ readonly path: string;
133
+ readonly change: "modified" | "deleted";
134
+ /** Unified diff from the installed base to the app's file (absent when the base is not available or the file is binary). */
135
+ readonly diff?: string;
136
+ /** The app's file is not UTF-8 text. */
137
+ readonly binary?: true;
138
+ }
139
+ export interface UpstreamChange {
140
+ readonly path: string;
141
+ readonly change: "added" | "removed" | "modified";
142
+ readonly diff: string;
143
+ }
144
+ export interface DependencyChange {
145
+ readonly field: PackageField;
146
+ readonly name: string;
147
+ readonly from?: string;
148
+ readonly to?: string;
149
+ }
150
+ export interface ItemDiff {
151
+ readonly name: string;
152
+ readonly kind: ItemKind;
153
+ readonly owner: "registry" | "app";
154
+ readonly installed: VersionRef;
155
+ /** The registry's latest version, or `null` when the registry no longer has the item. */
156
+ readonly latest: VersionRef | null;
157
+ readonly conflicts: ReadonlyArray<ProvenanceConflict>;
158
+ readonly local: ReadonlyArray<LocalChange>;
159
+ readonly upstream: ReadonlyArray<UpstreamChange>;
160
+ readonly dependencies: ReadonlyArray<DependencyChange>;
161
+ readonly registryDependencies: {
162
+ readonly added: ReadonlyArray<string>;
163
+ readonly removed: ReadonlyArray<string>;
164
+ };
165
+ /** Whether the installed version could be fetched again (unified diffs of local edits need it). */
166
+ readonly baseAvailable: boolean;
167
+ /** Why the registry retired the item, and what to use instead, when it has. */
168
+ readonly deprecated?: string;
169
+ }
170
+ export interface DiffReport {
171
+ readonly items: ReadonlyArray<ItemDiff>;
172
+ /**
173
+ * Whether anything differs: local edits, upstream changes (files, dependencies or metadata) or unresolved
174
+ * conflicts (app-owned items aside).
175
+ */
176
+ readonly differences: boolean;
177
+ }
178
+ /** Compare installed items with their installed base (local edits) and the registry's latest (upstream). */
179
+ export declare const diff: (dir: string, names: readonly string[]) => Effect.Effect<{
180
+ items: ItemDiff[];
181
+ differences: boolean;
182
+ }, CliError | import("effect/PlatformError").PlatformError, import("effect/FileSystem").FileSystem | import("effect/Path").Path>;
183
+ export declare const formatDiff: (report: DiffReport, options: {
184
+ readonly patches: boolean;
185
+ }) => string;
186
+ export type FileOutcome =
187
+ /** Unchanged locally, changed upstream: replaced with the new version. */
188
+ "updated"
189
+ /** Changed locally, unchanged upstream: the app's file is kept. */
190
+ | "kept"
191
+ /** Changed on both sides, merged cleanly: the merge is written. */
192
+ | "merged"
193
+ /** Changed on both sides, overlapping: written with conflict markers. */
194
+ | "conflict"
195
+ /** A binary file changed on both sides: the app's file is kept, the new version written beside it. */
196
+ | "conflict-binary"
197
+ /** Changed locally to exactly the new version. */
198
+ | "already-updated"
199
+ /** New upstream: written. */
200
+ | "added"
201
+ /** Removed upstream, unchanged locally: deleted. */
202
+ | "removed"
203
+ /** Removed upstream, changed locally: kept and no longer part of the item (the app owns it). */
204
+ | "kept-removed-upstream"
205
+ /** Deleted locally, unchanged upstream: stays deleted. */
206
+ | "deleted-locally"
207
+ /** Deleted locally, changed upstream: nothing written; a conflict for the developer to decide. */
208
+ | "conflict-deleted-locally"
209
+ /** New upstream, but an unrelated file of the same path is in the way: the item is not updated. */
210
+ | "blocked";
211
+ export interface FilePlan {
212
+ readonly path: string;
213
+ readonly outcome: FileOutcome;
214
+ /** What is written (updated, merged, conflict, conflict-binary, added). */
215
+ readonly content?: string;
216
+ /** For conflict-binary: where `content` (the new version) is written, beside the app's file. */
217
+ readonly upstream?: string;
218
+ /** For blocked files: whose file is in the way. */
219
+ readonly detail?: string;
220
+ }
221
+ export interface ItemUpdate {
222
+ readonly name: string;
223
+ readonly kind: ItemKind;
224
+ readonly status: "up-to-date" | "updated" | "conflicts" | "blocked" | "app-owned" | "unresolved-conflicts";
225
+ readonly from: VersionRef;
226
+ readonly to?: VersionRef;
227
+ readonly files: ReadonlyArray<FilePlan>;
228
+ /** Registry items the new version depends on that the app did not have: installed with it. */
229
+ readonly installs: ReadonlyArray<string>;
230
+ /** The item's npm dependency changes, then those of the registry items installed with it (`item` set). */
231
+ readonly npm: ReadonlyArray<NpmChange>;
232
+ /** The patch files its installed or new version names (`meta.eloxiv.patchedDependencies`). */
233
+ readonly patches?: ReadonlyArray<string>;
234
+ /** For unresolved-conflicts: files still holding conflict markers. */
235
+ readonly markers?: ReadonlyArray<string>;
236
+ /** Why the registry retired the item, and what to use instead, when it has. */
237
+ readonly deprecated?: string;
238
+ }
239
+ export interface UpdateReport {
240
+ readonly dryRun: boolean;
241
+ readonly items: ReadonlyArray<ItemUpdate>;
242
+ /** What the updated items' compatibility migrations changed (or would) in the app's own files. */
243
+ readonly migrations: ReadonlyArray<MigrationChange>;
244
+ /** The migrations' notes: what a person or agent must still do. */
245
+ readonly notes: ReadonlyArray<string>;
246
+ /** Whether the update left anything for the developer: conflicts, blocked items or earlier conflicts. */
247
+ readonly needsAttention: boolean;
248
+ }
249
+ /**
250
+ * Whether the package manager must run after an update: an item installed with it, an npm dependency added or
251
+ * changed, or a pnpm patch whose entry or file changed or went (pnpm applies a patch only when it installs).
252
+ */
253
+ export declare const needsInstall: (report: UpdateReport) => boolean;
254
+ export interface UpdateOptions {
255
+ readonly dryRun: boolean;
256
+ }
257
+ /**
258
+ * Merge the registry's latest version of `names` (every installed item when empty) into the app. Nothing is
259
+ * written with `dryRun`. An item with a blocked file is not touched at all.
260
+ *
261
+ * Writes are not transactional. An item's conflicts are recorded in the lock before any of its files is
262
+ * written, so an update that stops half-way leaves the item waiting for `update --continue` rather than
263
+ * conflict markers nobody knows about; `--continue` also finds markers that were never recorded.
264
+ */
265
+ export declare const update: (dir: string, names: readonly string[], options: UpdateOptions) => Effect.Effect<{
266
+ dryRun: boolean;
267
+ items: ItemUpdate[];
268
+ migrations: readonly MigrationChange[];
269
+ notes: string[];
270
+ needsAttention: boolean;
271
+ }, CliError | import("effect/PlatformError").PlatformError, import("effect/FileSystem").FileSystem | import("effect/Path").Path>;
272
+ export declare const formatUpdate: (report: UpdateReport) => string;
273
+ export interface ContinueReport {
274
+ readonly resolved: ReadonlyArray<string>;
275
+ readonly unresolved: ReadonlyArray<{
276
+ readonly name: string;
277
+ readonly paths: ReadonlyArray<string>;
278
+ }>;
279
+ }
280
+ /**
281
+ * Record that the conflicts of the last update are resolved. A content conflict is resolved once its file
282
+ * no longer holds conflict markers, a binary one once `<file>.upstream` is gone, and a file deleted locally
283
+ * and changed upstream by whatever the developer chose (restored or still deleted). Any locally edited file
284
+ * of an item that holds conflict markers, recorded or not, keeps the item unresolved. The lock's per-file
285
+ * hashes already describe the new version as published, so a resolved file simply shows as a local edit.
286
+ */
287
+ export declare const continueUpdate: (dir: string, names: readonly string[]) => Effect.Effect<{
288
+ resolved: string[];
289
+ unresolved: {
290
+ name: string;
291
+ paths: Array<string>;
292
+ }[];
293
+ }, CliError | import("effect/PlatformError").PlatformError, import("effect/FileSystem").FileSystem | import("effect/Path").Path>;
294
+ export declare const formatContinue: (report: ContinueReport) => string;
295
+ /**
296
+ * Take items over (`owner: "app"`): diff and update leave them alone and report them as app-owned. The
297
+ * provenance stays in the lock, so `undo` hands an item back to the registry and the next update merges
298
+ * from the version it was ejected at.
299
+ */
300
+ export declare const eject: (dir: string, names: readonly string[], undo: boolean) => Effect.Effect<string[], CliError | import("effect/PlatformError").PlatformError, import("effect/FileSystem").FileSystem | import("effect/Path").Path>;
301
+ //# sourceMappingURL=Update.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Update.d.ts","sourceRoot":"","sources":["../src/Update.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAC5E,OAAO,EAKL,KAAK,eAAe,EACrB,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EACL,QAAQ,EAUR,KAAK,WAAW,EACjB,MAAM,UAAU,CAAA;AACjB,OAAO,EASL,KAAK,SAAS,EACd,K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