@danypops/pi-packed 0.27.12 → 0.27.13

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 (38) hide show
  1. package/dist/adoption/check.d.ts +54 -0
  2. package/dist/adoption/check.d.ts.map +1 -0
  3. package/dist/adoption/duplicate-dependency-doctor.d.ts +17 -0
  4. package/dist/adoption/duplicate-dependency-doctor.d.ts.map +1 -0
  5. package/dist/adoption/install-validation.d.ts +63 -0
  6. package/dist/adoption/install-validation.d.ts.map +1 -0
  7. package/dist/adoption/module-freshness.d.ts +39 -0
  8. package/dist/adoption/module-freshness.d.ts.map +1 -0
  9. package/dist/adoption/service-doctor.d.ts +21 -0
  10. package/dist/adoption/service-doctor.d.ts.map +1 -0
  11. package/dist/adoption/smoke.d.ts +39 -0
  12. package/dist/adoption/smoke.d.ts.map +1 -0
  13. package/dist/daemon/daemon-service.d.ts +281 -0
  14. package/dist/daemon/daemon-service.d.ts.map +1 -0
  15. package/dist/doctor-format.js +16 -0
  16. package/dist/packages/installed.d.ts +32 -0
  17. package/dist/packages/installed.d.ts.map +1 -0
  18. package/dist/packages/package.d.ts +272 -0
  19. package/dist/packages/package.d.ts.map +1 -0
  20. package/dist/public/client.d.ts.map +1 -0
  21. package/dist/public/doctor-format.d.ts +57 -0
  22. package/dist/public/doctor-format.d.ts.map +1 -0
  23. package/dist/public/protocol.d.ts.map +1 -0
  24. package/dist/publish/publish.d.ts +120 -0
  25. package/dist/publish/publish.d.ts.map +1 -0
  26. package/dist/shared/constants.d.ts +51 -0
  27. package/dist/shared/constants.d.ts.map +1 -0
  28. package/extension/src/doctor-render.ts +32 -0
  29. package/extension/src/vehicle-tools.ts +16 -0
  30. package/package.json +8 -4
  31. package/service/src/adoption/doctor.ts +12 -77
  32. package/service/src/public/doctor-format.ts +89 -0
  33. package/service/test/public-boundary.test.ts +5 -1
  34. package/service/tsconfig.public.json +11 -2
  35. package/dist/client.d.ts.map +0 -1
  36. package/dist/protocol.d.ts.map +0 -1
  37. /package/dist/{client.d.ts → public/client.d.ts} +0 -0
  38. /package/dist/{protocol.d.ts → public/protocol.d.ts} +0 -0
@@ -0,0 +1,272 @@
1
+ /**
2
+ * package.ts — the Pkg entity and its two driven ports (Registry, Installer)
3
+ * that decouple callers (the HTTP service, the CLI, the watcher, tests) from
4
+ * concrete implementations (registry/registry.ts talks to npm; install.ts
5
+ * shells out to pi).
6
+ */
7
+ import type { InstallValidationResult } from "../adoption/install-validation.ts";
8
+ /**
9
+ * True drift only: `latest` is a real semver step *ahead* of `have`, never
10
+ * merely different from it. A plain !== check cannot distinguish "have is
11
+ * behind latest" from "have is already ahead of a stale/wrong latest" --
12
+ * confirmed live via the watcher's own version of this bug: an installed
13
+ * package whose version had already passed the daemon's mirrored
14
+ * dist-tags.latest kept showing a permanent, un-clearable "update
15
+ * available" badge pointing at an *older* version. Falls back to the old
16
+ * inequality only when either side isn't parseable semver (a git ref, a
17
+ * literal "latest" tag, etc.) -- those aren't comparable at all, so
18
+ * "different" is the only signal left. Lives here (not watcher.ts, its
19
+ * original home) so both the daemon's watcher and ExecInstaller.update()'s
20
+ * own out-of-range check share one implementation without packages/
21
+ * reaching into daemon/ (the dependency already runs the other way).
22
+ */
23
+ export declare function isNewer(latest: string, have: string): boolean;
24
+ export type PackageVerification = "keyword-only" | "manifest" | "conventional";
25
+ export interface PackageEvidence {
26
+ shape: PackageVerification;
27
+ verified: boolean;
28
+ evidence: string[];
29
+ }
30
+ export interface PublicationEvidence {
31
+ integrity?: string;
32
+ provenanceUrl?: string;
33
+ trustedPublisher: "verified" | "not-verified" | "unknown";
34
+ }
35
+ export interface DownloadObservations {
36
+ weekly?: number;
37
+ monthly?: number;
38
+ observedAt: string;
39
+ }
40
+ export interface Pkg {
41
+ name: string;
42
+ version: string;
43
+ description?: string;
44
+ date?: string;
45
+ /** From npm's own search API response (each hit already carries this inline -- no extra
46
+ * request per result, unlike PkgInfo.downloads, which needs its own dedicated fetch for a
47
+ * single already-known package). See HttpRegistry.searchPage(). */
48
+ downloads?: DownloadObservations;
49
+ packageEvidence?: PackageEvidence;
50
+ publication?: PublicationEvidence;
51
+ }
52
+ export interface PkgInfo {
53
+ name: string;
54
+ version: string;
55
+ description?: string;
56
+ homepage?: string;
57
+ repository?: string;
58
+ /** Monorepo subdirectory the package lives in, from repository.directory
59
+ * -- scopes a real commit-history lookup to the package's own path. */
60
+ repositoryDirectory?: string;
61
+ license?: string;
62
+ keywords?: string[];
63
+ pi?: Record<string, unknown>;
64
+ /** Declared npm lifecycle scripts (preinstall/install/postinstall/etc.) --
65
+ * these execute on install, a top supply-chain attack vector. Presence is
66
+ * surfaced as trust-dimension evidence, never treated as a failure. */
67
+ scripts?: Record<string, string>;
68
+ modified?: string;
69
+ unpackedSize?: number;
70
+ readme?: string;
71
+ readmeAvailable?: boolean;
72
+ bugs?: string;
73
+ peerDependencies?: Record<string, string>;
74
+ packageEvidence?: PackageEvidence;
75
+ publication?: PublicationEvidence;
76
+ downloads?: DownloadObservations;
77
+ }
78
+ export interface SearchPage {
79
+ results: Pkg[];
80
+ total: number;
81
+ }
82
+ /** Driven port: package metadata source (npm registry, or the daemon proxy). */
83
+ export interface Registry {
84
+ search(query: string, limit: number): Promise<SearchPage>;
85
+ searchPage(query: string, from: number, size: number): Promise<SearchPage>;
86
+ searchAll(query: string): Promise<Pkg[]>;
87
+ info(name: string): Promise<PkgInfo>;
88
+ downloads?(name: string): Promise<DownloadObservations>;
89
+ /** Last npm publish date across any version, from the abbreviated
90
+ * multi-version doc -- the `/latest` endpoint `info()` uses carries no
91
+ * `time`/`modified` field at all. Optional, like `downloads`; undefined
92
+ * on any failure, never thrown. */
93
+ modifiedAt?(name: string): Promise<string | undefined>;
94
+ }
95
+ /**
96
+ * `pi update --extension <source>` exits 0 and prints "Updated <source>"
97
+ * whether or not anything actually changed -- verified empirically against
98
+ * both a pinned, already-current source and an unpinned, already-latest
99
+ * one. reloadRequired/alreadyUpToDate are ground truth (on-disk resolved
100
+ * version, before vs. after), not that text. previousVersion/currentVersion
101
+ * are omitted when unknown (git:/https: sources, or no node_modules entry
102
+ * to read) -- reloadRequired then conservatively stays true rather than
103
+ * guessing.
104
+ */
105
+ export interface UpdateOutcome {
106
+ output: string;
107
+ reloadRequired: boolean;
108
+ alreadyUpToDate: boolean;
109
+ pinned: boolean;
110
+ previousVersion?: string;
111
+ currentVersion?: string;
112
+ /**
113
+ * Set only when alreadyUpToDate is true AND a real registry version
114
+ * newer than currentVersion exists outside the source's own declared
115
+ * caret/range -- confirmed live: a 0.x package (e.g. ^0.9.8) that
116
+ * crossed its own minor boundary (0.10.0 published) reported a bare
117
+ * "already up to date" with no clue a newer version existed at all.
118
+ * `pi update --extension` is itself bound by the declared range, so
119
+ * "nothing changed" alone can't distinguish "genuinely current" from
120
+ * "current within a range that's now stale" -- this cross-checks
121
+ * against the same registry-mirror source of truth checkUpdates()
122
+ * already uses, independent of the declared range.
123
+ */
124
+ outOfRangeUpdateAvailable?: string;
125
+ /**
126
+ * True only when update() was called on an exact npm pin with no
127
+ * options.target -- `pi update --extension` intentionally leaves an
128
+ * exact pin unchanged (npm's own documented behavior for a versioned
129
+ * spec), so alreadyUpToDate/pinned above are already an honest,
130
+ * non-"false success" result. This is an additional stable,
131
+ * unambiguous machine-readable signal (kept alongside those existing
132
+ * fields for back-compat) that a caller wanting to actually MOVE the
133
+ * pin should retry with options.target set -- see replaced/before/
134
+ * after/rollback below.
135
+ */
136
+ pinnedSourceRequiresTarget?: boolean;
137
+ /**
138
+ * True when options.target was given and update() routed to the
139
+ * supervised replace workflow (remove the old exact source, install
140
+ * the new one, verify both configured and installed postconditions,
141
+ * attempt rollback on failure) instead of `pi update --extension`.
142
+ */
143
+ replaced?: boolean;
144
+ before?: {
145
+ source: string;
146
+ version?: string;
147
+ };
148
+ after?: {
149
+ source: string;
150
+ version?: string;
151
+ };
152
+ /** Present only on a replace failure -- whether restoring the original
153
+ * source was attempted and whether that restoration itself succeeded. */
154
+ rollback?: {
155
+ attempted: boolean;
156
+ ok: boolean;
157
+ message?: string;
158
+ };
159
+ }
160
+ /** Driven port: pi CLI mutations. */
161
+ export interface Installer {
162
+ install(source: string, options?: {
163
+ approved?: boolean;
164
+ local?: boolean;
165
+ }): Promise<string>;
166
+ remove(source: string, options?: {
167
+ approved?: boolean;
168
+ local?: boolean;
169
+ }): Promise<string>;
170
+ /**
171
+ * `options.target`, when given, replaces `source` (an exact pin or not)
172
+ * with `target` through a supervised remove+install workflow instead of
173
+ * `pi update --extension` -- see ExecInstaller.update()'s own doc
174
+ * comment and the linked research doc
175
+ * (pinned-package-update-behavior-and-safe-replacement-research) for
176
+ * why a plain `pi update` can never move an exact pin by itself.
177
+ */
178
+ update(source: string, options?: {
179
+ approved?: boolean;
180
+ local?: boolean;
181
+ target?: string;
182
+ }): Promise<UpdateOutcome>;
183
+ /**
184
+ * Updates a package that is genuinely installed and npm-resolvable but is
185
+ * NOT itself a pi:-configured extension -- `pi update --extension` can
186
+ * never find it (pi-core's own "configured packages" notion IS exactly
187
+ * settings.json's packages[]), confirmed via a real failing-test repro
188
+ * (service/test/install.test.ts) of pi's own "No matching package found".
189
+ * `daemon-service.ts`'s `classifyUpdateSource()` decides when this path
190
+ * applies instead of `update()` -- a real Vehicle-shaped daemon dependency
191
+ * with no `pi:` manifest of its own (e.g. @danypops/lector, pinned
192
+ * independently of its pi-lector wrapper). Optional because only a real
193
+ * npm-backed Installer (ExecInstaller) can perform it; a caller checks for
194
+ * its presence before using this path, exactly like validate()/
195
+ * installOnly()/reresolveDependencyTree() below.
196
+ */
197
+ updateDaemonDependency?(name: string, options?: {
198
+ approved?: boolean;
199
+ version?: string;
200
+ }): Promise<UpdateOutcome>;
201
+ /**
202
+ * Optional batch-oriented split of install(), for a caller installing several packages
203
+ * together (see SetupManager.apply()) -- a single ad hoc install() still does all three
204
+ * steps itself and needs none of this; every existing Installer implementation that omits
205
+ * these three keeps compiling and behaving exactly as before.
206
+ *
207
+ * validate() is safe to run CONCURRENTLY across many sources: each call stages into its own
208
+ * throwaway temp directory (see HeadlessInstallValidator) with zero shared state between
209
+ * packages. installOnly() does the real `pi install` mutation WITHOUT install()'s own
210
+ * trailing full-tree reresolve, so a batch caller can defer that to
211
+ * reresolveDependencyTree(), called ONCE after every package in the batch instead of once
212
+ * per package.
213
+ *
214
+ * installOnly() itself must stay SEQUENTIAL across a batch, never fanned out the way
215
+ * validate() can be: `pi install` does its own non-atomic read-modify-write of both
216
+ * settings.json and the npm project's package.json/package-lock.json in the single shared
217
+ * piHome, with no locking on either side (confirmed empirically -- three concurrent `pi
218
+ * install` calls against one piHome silently lost two of three entries from settings.json
219
+ * and npm/package.json, while all three packages' node_modules ended up physically present
220
+ * but untracked, exactly the state a later reresolveDependencyTree() would then prune).
221
+ */
222
+ validate?(source: string): Promise<InstallValidationResult>;
223
+ installOnly?(source: string, options?: {
224
+ approved?: boolean;
225
+ local?: boolean;
226
+ }): Promise<string>;
227
+ /**
228
+ * updateOnly() is update()'s own equivalent split: the real `pi update --extension` mutation
229
+ * (or replace(), when options.target is given) WITHOUT the trailing reresolveDependencyTree(),
230
+ * returning the same UpdateOutcome update() itself returns -- a single package's own before/
231
+ * after version diff is already correct right after its own mutation, reresolveDependencyTree()
232
+ * exists to fix a DIFFERENT sibling's drift. See updateManyPackages() (install.ts) for the
233
+ * batch caller. Same SEQUENTIAL-only constraint as installOnly() above.
234
+ */
235
+ updateOnly?(source: string, options?: {
236
+ approved?: boolean;
237
+ local?: boolean;
238
+ target?: string;
239
+ }): Promise<UpdateOutcome>;
240
+ reresolveDependencyTree?(): Promise<string>;
241
+ }
242
+ export interface InstalledPkg {
243
+ name: string;
244
+ pinned?: string;
245
+ installed?: string;
246
+ scope?: "global" | "project";
247
+ /**
248
+ * "extension" (a real pi:-manifested package, settings.json's own
249
+ * packages[]) vs. "daemon-dependency" (a Vehicle-shaped daemon Packed
250
+ * independently detects at piHome/npm's own top level -- e.g.
251
+ * @danypops/lector -- that is NOT itself pi:-configured). Undefined from
252
+ * every pre-existing reader (readInstalledPackages/
253
+ * readInstalledPackagesAcrossScopes); only daemon-service.ts's
254
+ * listManagedPackages() sets this on every row it returns. See
255
+ * packed-package-update-restart-service-cant-manage.
256
+ */
257
+ kind?: "extension" | "daemon-dependency";
258
+ }
259
+ export interface UpdateEntry {
260
+ name: string;
261
+ installed: string;
262
+ latest: string;
263
+ detectedAt?: string;
264
+ scope?: "global" | "project";
265
+ }
266
+ export interface UpdatesSnapshot {
267
+ checkedAt: string;
268
+ updates: UpdateEntry[];
269
+ }
270
+ export declare function buildSearchQuery(q: string): string;
271
+ export declare function clampLimit(v: number, def: number, max: number): number;
272
+ //# sourceMappingURL=package.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"package.d.ts","sourceRoot":"","sources":["../../service/src/packages/package.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAGjF;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAG7D;AAED,MAAM,MAAM,mBAAmB,GAAG,cAAc,GAAG,UAAU,GAAG,cAAc,CAAC;AAE/E,MAAM,WAAW,eAAe;IAC/B,KAAK,EAAE,mBAAmB,CAAC;IAC3B,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,mBAAmB;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,EAAE,UAAU,GAAG,cAAc,GAAG,SAAS,CAAC;CAC1D;AAED,MAAM,WAAW,oBAAoB;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,GAAG;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C,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE,QAAQ,UAAQ;IAKjI,QAAQ;CAGR;AAED,wBAAsB,mBAAmB,CAAC,KAAK,oBAA6B,EAAE,SAAS,GAAE,cAAsB,GAAG,OAAO,CAAC,YAAY,CAAC,CAatI;AAED,MAAM,WAAW,gBAAgB;IAChC,OAAO,IAAI,OAAO,CAAC,YAAY,CAAC,CAAC;IACjC;;mCAE+B;IAC/B,kBAAkB,IAAI,OAAO,CAAC;IAC9B;yDACqD;IACrD,KAAK,IAAI,IAAI,CAAC;IACd,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACjC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,YAAY,CAAC,CAoBhF;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,GAAG,SAAS,CAgB7F;AAED,wBAAsB,kBAAkB,CAAC,KAAK,oBAA6B,EAAE,SAAS,GAAE,cAAsB,GAAG,OAAO,CAAC,YAAY,CAAC,CAuBrI"}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * doctor.run's report shape and its own human-readable formatter (the CLI's `packed doctor`
3
+ * non-JSON path) -- kept as its own leaf module, imported back by adoption/doctor.ts rather than
4
+ * defined there and re-exported, specifically so this file's only real (non-type) dependency is
5
+ * its own formatDoctorReport/formatClaimant bodies. Every field type below crosses module
6
+ * boundaries as `import type` only (fully erased at compile time), so a consumer needing just the
7
+ * formatter -- e.g. pi-packed's own extension, rendering a Pi tool result -- never pulls in
8
+ * runDoctor's own real runtime dependencies (subprocess-based extension smoke-testing, npm-tree
9
+ * scanning, systemd status shell-outs, ...) just to format a report it already has.
10
+ */
11
+ import type { DuplicateDependencyDiagnostic } from "../adoption/duplicate-dependency-doctor.ts";
12
+ import type { ModuleFreshnessDiagnostic } from "../adoption/module-freshness.ts";
13
+ import type { ServiceUnitDiagnostic } from "../adoption/service-doctor.ts";
14
+ import type { SmokeRegistrations } from "../adoption/smoke.ts";
15
+ export interface DoctorClaim {
16
+ name: string;
17
+ source: string;
18
+ scope: "global" | "project";
19
+ extension: string;
20
+ }
21
+ export interface DoctorConflict {
22
+ kind: "tool" | "command" | "shortcut" | "flag";
23
+ name: string;
24
+ claimants: DoctorClaim[];
25
+ }
26
+ export interface DoctorExtensionResult {
27
+ name: string;
28
+ source: string;
29
+ scope: "global" | "project";
30
+ extension: string;
31
+ status: string;
32
+ registrations: SmokeRegistrations;
33
+ message?: string;
34
+ }
35
+ export interface DoctorReport {
36
+ ok: boolean;
37
+ conflicts: DoctorConflict[];
38
+ extensions: DoctorExtensionResult[];
39
+ scanned: number;
40
+ truncated: boolean;
41
+ /** A daemon-backed package's systemd --user unit referencing a path that no longer exists on disk -- see service-doctor.ts. Empty (not omitted) on a platform without systemd --user coverage. */
42
+ serviceUnits: ServiceUnitDiagnostic[];
43
+ /** Any @danypops/* package resolved to more than one distinct version anywhere in piHome's own npm tree -- see duplicate-dependency-doctor.ts's own doc comment for why this stays out of `ok`. */
44
+ duplicateDependencies: DuplicateDependencyDiagnostic[];
45
+ /**
46
+ * Whether THIS running process still holds a stale in-memory copy of one
47
+ * of its own runtime dependencies, loaded once at startup -- see
48
+ * module-freshness.ts. Only meaningful for a long-running daemon process
49
+ * (the one thing that can actually go stale); omitted entirely for a
50
+ * standalone `packed doctor` invocation (a fresh CLI process has nothing
51
+ * of its own to compare against). Populated by the daemon's own
52
+ * doctor.run route, never by runDoctor() itself.
53
+ */
54
+ moduleFreshness?: ModuleFreshnessDiagnostic[];
55
+ }
56
+ export declare function formatDoctorReport(report: DoctorReport, json: boolean): string;
57
+ //# sourceMappingURL=doctor-format.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor-format.d.ts","sourceRoot":"","sources":["../../service/src/public/doctor-format.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,4CAA4C,CAAC;AAChG,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AACjF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE/D,MAAM,WAAW,WAAW;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,cAAc;IAC9B,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,GAAG,MAAM,CAAC;IAC/C,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,WAAW,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,qBAAqB;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,kBAAkB,CAAC;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,YAAY;IAC5B,EAAE,EAAE,OAAO,CAAC;IACZ,SAAS,EAAE,cAAc,EAAE,CAAC;IAC5B,UAAU,EAAE,qBAAqB,EAAE,CAAC;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;IACnB,kMAAkM;IAClM,YAAY,EAAE,qBAAqB,EA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AQ,CAAC,EAAE,OAAO,CAAC;QACnB,MAAM,CAAC,EAAE;YAAE,MAAM,EAAE,MAAM,CAAC;YAAC,OAAO,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;QAC9C,KAAK,CAAC,EAAE;YAAE,MAAM,EAAE,MAAM,CAAC;YAAC,OAAO,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;QAC7C,QAAQ,CAAC,EAAE;YAAE,SAAS,EAAE,OAAO,CAAC;YAAC,EAAE,EAAE,OAAO,CAAC;YAAC,OAAO,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;KACjE,CAAC;IACF,YAAY,EAAE,SAAS,CAAC;IACxB,aAAa,EAAE,gBAAgB,CAAC;IAChC,gBAAgB,EAAE;QAAE,MAAM,EAAE,gBAAgB,EAAE,CAAC;QAAC,OAAO,EAAE,gBAAgB,EAAE,CAAA;KAAE,CAAC;IAC9E,kBAAkB,EAAE;QAAE,EAAE,EAAE,OAAO,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IACpD,WAAW,EAAE,QAAQ,CAAC;CACtB"}
@@ -0,0 +1,120 @@
1
+ import type { Diagnostic } from "../adoption/check.ts";
2
+ import type { Registry } from "../packages/package.ts";
3
+ export declare const TRUST_NPM_VERSION = "11.15.0";
4
+ /** Derives the per-package staged-publish workflow filename from a package
5
+ * name, so sibling packages in one workspace never collide on one file. */
6
+ export declare function stageWorkflowSlug(packageName: string): string;
7
+ export declare function stageWorkflowFile(packageName: string): string;
8
+ export interface PackageManagerSelection {
9
+ name: "bun" | "npm" | "pnpm" | "yarn";
10
+ version?: string;
11
+ }
12
+ export interface WorkflowInput {
13
+ packageManager: PackageManagerSelection;
14
+ scripts: string[];
15
+ /** Relative package directory to build/test from, when the workflow lives
16
+ * at a monorepo root rather than the package root itself. */
17
+ packageDir?: string;
18
+ /** Sibling workspace packages (name -> declared range) that must already
19
+ * be published on npm before this package's own stage can succeed. */
20
+ coreFirst?: Record<string, string>;
21
+ /** Package name slug used to scope this package's own release tag
22
+ * ($tagPrefix-v*), so two workspace siblings never share one trigger. */
23
+ tagPrefix?: string;
24
+ }
25
+ export interface VersionCommandResult {
26
+ code: number;
27
+ stdout: string;
28
+ stderr: string;
29
+ }
30
+ export type VersionCommand = () => Promise<VersionCommandResult>;
31
+ export type TrustStatusCommand = (packageName: string) => Promise<VersionCommandResult>;
32
+ export interface PublishSetupReport {
33
+ root: string;
34
+ ok: boolean;
35
+ wrote: boolean;
36
+ workflowPath: string;
37
+ packageName?: string;
38
+ repository?: string;
39
+ trustCommand?: string;
40
+ statusCommand?: string;
41
+ webUrl?: string;
42
+ diagnostics: Diagnostic[];
43
+ }
44
+ export interface PublishStatusReport {
45
+ root: string;
46
+ ready: boolean;
47
+ packageName?: string;
48
+ repository?: string;
49
+ workflowPath: string;
50
+ checks: {
51
+ packageExists: boolean;
52
+ repository: boolean;
53
+ workflow: boolean;
54
+ lockfile: boolean;
55
+ node: boolean;
56
+ npm: boolean;
57
+ trustedPublisher: "verified" | "not-verified" | "unknown";
58
+ /** true when every internal (workspace-sibling) dependency this package
59
+ * declares is already published on npm at a satisfying version. */
60
+ coreFirst: boolean;
61
+ /** Local machine login state (npm whoami) -- informative only, never
62
+ * blocks ready: CI publishes over OIDC trusted-publisher config, not
63
+ * local login. Surfaced so an interactive caller knows what to offer. */
64
+ loggedIn: boolean;
65
+ };
66
+ diagnostics: Diagnostic[];
67
+ nextSteps: string[];
68
+ }
69
+ export declare function renderStageWorkflow(input: WorkflowInput): string;
70
+ export declare function versionAtLeast(actual: string, minimum: string): boolean;
71
+ /** Supports the two range shapes this workspace actually uses (exact, ^, ~);
72
+ * returns undefined rather than guessing for anything broader. */
73
+ export declare function satisfiesRange(version: string, range: string): boolean | undefined;
74
+ export declare function runBounded(command: string[]): Promise<VersionCommandResult>;
75
+ export declare const readNpmVersion: VersionCommand;
76
+ export declare const readTrustStatus: TrustStatusCommand;
77
+ export declare const readNpmWhoami: VersionCommand;
78
+ export interface InteractiveRunResult {
79
+ ok: boolean;
80
+ code: number;
81
+ }
82
+ export declare function runInherited(command: string[]): Promise<InteractiveRunResult>;
83
+ /** Runs the real, interactive `npm login --auth-type=web`. npm's own
84
+ * process polls for completion and writes ~/.npmrc itself -- no token ever
85
+ * passes through Packed. Headless by default (`--no-browser`, npm's own
86
+ * documented config: print the URL, never auto-launch anything); pass
87
+ * `openBrowserAuto: true` only when a human on their own desktop terminal
88
+ * explicitly opted in. Only ever invoked after the caller's own explicit
89
+ * confirmation; never from a non-TTY or scripted context. */
90
+ export declare function runNpmLoginWeb(openBrowserAuto?: boolean): Promise<InteractiveRunResult>;
91
+ /** Pure command construction, kept separate from the actual spawn so tests
92
+ * never risk invoking a real browser. */
93
+ export declare function browserOpenCommand(url: string): string[];
94
+ /** Best-effort browser open for a human-driven web handoff (npm's own
95
+ * Trusted Publisher configuration UI, not a CLI command Packed constructs
96
+ * itself). Only ever called when a human explicitly opted in -- the default
97
+ * interactive path never spawns this, it only prints the URL. Failure is
98
+ * silent and non-fatal -- the caller always prints the URL too, so a
99
+ * missing/unknown opener never blocks the human. */
100
+ export declare function openBrowser(url: string): Promise<InteractiveRunResult>;
101
+ export declare function githubRepository(value: unknown): string | undefined;
102
+ export declare function npmWebUrl(packageName: string): string;
103
+ export declare class PublishManager {
104
+ private readonly registry;
105
+ private readonly versionCommand;
106
+ private readonly trustStatusCommand;
107
+ private readonly whoamiCommand;
108
+ constructor(registry: Registry, versionCommand?: VersionCommand, trustStatusCommand?: TrustStatusCommand, whoamiCommand?: VersionCommand);
109
+ setup(projectPath: string, options?: {
110
+ force?: boolean;
111
+ }): Promise<PublishSetupReport>;
112
+ status(projectPath: string): Promise<PublishStatusReport>;
113
+ /** Local, informative mirror of the CI-side ordering guard: every internal
114
+ * (workspace-sibling) dependency must already be published on npm at a
115
+ * version its declared range accepts. Empty when there are none. */
116
+ private coreFirstStatus;
117
+ private trustedPublisherStatus;
118
+ }
119
+ export declare function formatPublishReport(report: PublishSetupReport | PublishStatusReport, json?: boolean): string;
120
+ //# sourceMappingURL=publish.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"publish.d.ts","sourceRoot":"","sources":["../../service/src/publish/publish.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAEvD,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAS3C;2EAC2E;AAC3E,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAO7D;AAED,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAE7D;AAED,MAAM,WAAW,uBAAuB;IACvC,IAAI,EAAE,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;IACtC,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,aAAa;IAC7B,cAAc,EAAE,uBAAuB,CAAC;IACxC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB;iEAC6D;IAC7D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;0EACsE;IACtE,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC;6EACyE;IACzE,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,oBAAoB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CACf;AACD,MAAM,MAAM,cAAc,GAAG,MAAM,OAAO,CAAC,oBAAoB,CAAC,CAAC;AACjE,MAAM,MAAM,kBAAkB,GAAG,CAAC,WAAW,EAAE,MAAM,KAAK,OAAO,CAAC,oBAAoB,CAAC,CAAC;AAExF,MAAM,WAAW,kBAAkB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,OAAO,CAAC;IACZ,KAA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AAmB,CAAC;IAgJ/D;;wEAEoE;YACtD,eAAe;YA8Cf,sBAAsB;CA6BpC;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,kBAAkB,GAAG,mBAAmB,EAAE,IAAI,UAAQ,GAAG,MAAM,CAgB1G"}
@@ -0,0 +1,51 @@
1
+ /**
2
+ * constants.ts — every magic value in one place, named.
3
+ * (lexicon: replace-magic-number-with-symbolic-constant)
4
+ */
5
+ export declare const NPM_REGISTRY_BASE = "https://registry.npmjs.org";
6
+ export declare const SEARCH_DEFAULT_LIMIT = 10;
7
+ export declare const SEARCH_MAX_LIMIT = 50;
8
+ export declare const SEARCH_PAGE_SIZE = 250;
9
+ export declare const PI_PACKAGE_KEYWORD = "keywords:pi-package";
10
+ export declare const TOOL_MODEL_CONTENT_MAX_CHARACTERS = 2000;
11
+ export declare const TOOL_DETAILS_MAX_SERIALIZED_CHARACTERS = 32000;
12
+ export declare const TOOL_DETAILS_MAX_PACKAGES = 50;
13
+ export declare const TOOL_DETAILS_MAX_DESCRIPTION_CHARACTERS = 240;
14
+ export declare const TOOL_DETAILS_MAX_OUTPUT_CHARACTERS = 1000;
15
+ export declare const TOOL_DETAILS_MAX_KEYWORDS = 20;
16
+ export declare const TOOL_DETAILS_MAX_CAPABILITIES = 12;
17
+ export declare const TOOL_COLLAPSED_PACKAGE_PREVIEW = 3;
18
+ export declare const RETRY_MAX_ATTEMPTS = 6;
19
+ export declare const RETRY_BASE_DELAY_MS = 2000;
20
+ export declare const PAGE_DELAY_MS = 100;
21
+ export declare const MIRROR_PAGE_DELAY_MS = 400;
22
+ export declare const GITHUB_RETRY_MAX_ATTEMPTS = 4;
23
+ export declare const GITHUB_MAX_TOTAL_BACKOFF_MS = 60000;
24
+ export declare const GITHUB_SECONDARY_RATE_LIMIT_FALLBACK_MS = 60000;
25
+ export declare const GITHUB_TRANSIENT_BASE_DELAY_MS = 1000;
26
+ export declare const CACHE_TTL_MS: number;
27
+ export declare const PROBE_TIMEOUT_MS = 800;
28
+ export declare const REGISTRY_FETCH_TIMEOUT_MS = 15000;
29
+ export declare const MIRROR_OPERATION_TIMEOUT_MS: number;
30
+ export declare const INDEX_OPERATION_TIMEOUT_MS: number;
31
+ export declare const WATCH_INTERVAL_DEFAULT_MS: number;
32
+ export declare const CATALOG_INTERVAL_DEFAULT_MS: number;
33
+ export declare const INDEX_INTERVAL_DEFAULT_MS: number;
34
+ export declare const RECONCILE_INTERVAL_DEFAULT_MS: number;
35
+ export declare const IDLE_BUDGET_DEFAULT_MS: number;
36
+ export declare const WATCHDOG_TICK_MS = 15000;
37
+ export declare const UPDATES_FILE = "updates.json";
38
+ export declare const DB_FILE = "packed.db";
39
+ export declare const INDEX_FILE = "index.json";
40
+ export declare const SETTINGS_FILE = "settings.json";
41
+ export declare const SECURITY_FILE = "security.json";
42
+ export declare const ENV: {
43
+ readonly HOME: "PI_PACKED_HOME";
44
+ readonly PI_HOME: "PI_PACKED_PI_HOME";
45
+ readonly WATCH_SECS: "PI_PACKED_WATCH_SECS";
46
+ readonly CATALOG_SECS: "PI_PACKED_CATALOG_SECS";
47
+ readonly INDEX_SECS: "PI_PACKED_INDEX_SECS";
48
+ readonly RECONCILE_SECS: "PI_PACKED_RECONCILE_SECS";
49
+ readonly IDLE_SECS: "PI_PACKED_IDLE_SECS";
50
+ };
51
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../service/src/shared/constants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,eAAO,MAAM,iBAAiB,+BAA+B,CAAC;AAG9D,eAAO,MAAM,oBAAoB,KAAK,CAAC;AACvC,eAAO,MAAM,gBAAgB,KAAK,CAAC;AACnC,eAAO,MAAM,gBAAgB,MAAM,CAAC;AACpC,eAAO,MAAM,kBAAkB,wBAAwB,CAAC;AAGxD,eAAO,MAAM,iCAAiC,OAAQ,CAAC;AACvD,eAAO,MAAM,sCAAsC,QAAS,CAAC;A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@
1
+ /**
2
+ * doctor.run's own curated presenter -- its DoctorReport output shape (five array fields, several
3
+ * with nested arrays/objects per row: duplicateDependencies' own locations array, extensions'
4
+ * own registrations object) defeats every heuristic in vehicle-render's generic shape-probing
5
+ * chain, so without this it fell all the way through to a raw JSON.stringify dump -- a real, live
6
+ * incident, not a hypothetical. Reuses formatDoctorReport, the exact same human-readable text the
7
+ * CLI's own `packed doctor` (non-JSON) path already renders, so the tool and the CLI never drift
8
+ * into two different descriptions of the same report.
9
+ */
10
+ import { type DoctorReport, formatDoctorReport } from "@danypops/pi-packed/doctor-format";
11
+ import type { VehiclePresenter } from "@danypops/vehicle-client-pi/vehicle-render";
12
+ import { asciiTextMeasure, CollapsibleText } from "malevich-tui-components";
13
+
14
+ const DOCTOR_REPORT_COLLAPSED_LINES = 12;
15
+
16
+ function isDoctorReport(value: unknown): value is DoctorReport {
17
+ if (typeof value !== "object" || value === null) return false;
18
+ const candidate = value as Partial<DoctorReport>;
19
+ return typeof candidate.ok === "boolean" && Array.isArray(candidate.conflicts) && Array.isArray(candidate.extensions);
20
+ }
21
+
22
+ export const renderDoctorRunResult: VehiclePresenter = (output, options, theme) => {
23
+ if (!isDoctorReport(output)) return undefined;
24
+ const collapsible = new CollapsibleText({
25
+ text: theme.fg("text", formatDoctorReport(output, false)),
26
+ collapsedLines: DOCTOR_REPORT_COLLAPSED_LINES,
27
+ headerStyle: (s) => theme.fg("dim", s),
28
+ measure: asciiTextMeasure,
29
+ });
30
+ if (options.expanded) collapsible.expand();
31
+ return collapsible;
32
+ };
@@ -35,6 +35,7 @@ import { RemoteVehicleClient } from "@danypops/vehicle-client/http";
35
35
  import { registerVehicleTools } from "@danypops/vehicle-client-pi";
36
36
  import type { VehicleClient, VehicleManifest } from "@danypops/vehicle-core";
37
37
  import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
38
+ import { renderDoctorRunResult } from "./doctor-render.js";
38
39
  import { currentVehicleClientTarget } from "./vehicle-target.js";
39
40
 
40
41
  /** Already covered by their own dedicated, approval-aware tools in tools.ts -- see this file's own doc comment. */
@@ -60,6 +61,19 @@ function withoutExcludedOperations(client: VehicleClient): VehicleClient {
60
61
  */
61
62
  const CORE_OPERATIONS = ["package.installed", "package.updates", "pi.status"];
62
63
 
64
+ /**
65
+ * Operations whose rendering has actually been reviewed and found acceptable -- either via a
66
+ * dedicated renderPresenters entry (doctor.run) or by eyeballing the generic Vehicle renderer's
67
+ * own shape-probing output for a real result and confirming it reads cleanly. Everything NOT
68
+ * listed here logs a renderCoverage gap warning naming exactly which operations still need that
69
+ * review, rather than a human discovering an unreviewed one only by stumbling on a raw JSON dump
70
+ * in the TUI (the live incident doctor.run itself was, before renderDoctorRunResult existed).
71
+ * Deliberately starts narrow and honest rather than pre-declaring the other ~27 operations
72
+ * reviewed when they haven't been -- add an operation here only once its own rendering has
73
+ * actually been checked.
74
+ */
75
+ const REVIEWED_OPERATIONS = ["doctor.run"];
76
+
63
77
  export async function registerPackedVehicle(pi: ExtensionAPI): Promise<void> {
64
78
  const target = currentVehicleClientTarget();
65
79
  if (!target) return;
@@ -84,6 +98,8 @@ export async function registerPackedVehicle(pi: ExtensionAPI): Promise<void> {
84
98
  // ensureVehicleShellHandle) -- no ownVehicleName/broker option needed here anymore; every
85
99
  // vehicle in the process (including packed's own) is discovered and namespaced uniformly.
86
100
  shell: { coreOperations: CORE_OPERATIONS },
101
+ renderPresenters: { "doctor.run": renderDoctorRunResult },
102
+ renderCoverage: { operations: REVIEWED_OPERATIONS },
87
103
  });
88
104
  } catch {
89
105
  // Daemon state is stale/unreachable -- degrade silently, matching