pi-lean-host 0.7.2 → 0.8.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.
- package/CHANGELOG.md +146 -0
- package/README.md +229 -235
- package/core/api-guide-types.ts +71 -3
- package/core/api-toggle.ts +6 -3
- package/core/auth.ts +16 -1
- package/core/guide-catalog.ts +9 -3
- package/core/helpers-command.ts +3 -1
- package/core/helpers.ts +458 -17
- package/core/oauth-command.ts +77 -6
- package/core/oauth-flow.ts +31 -18
- package/core/parse-api-guide.ts +198 -18
- package/core/resolve-op.ts +50 -6
- package/core/response-spill.ts +4 -1
- package/core/secrets-store.ts +3 -1
- package/core/staging.ts +3 -3
- package/core/status-hint.ts +2 -3
- package/core/transport.ts +803 -171
- package/core/verify-command.ts +117 -62
- package/docs/migration-v1.md +19 -20
- package/package.json +3 -2
- package/tools/api-fetch.ts +96 -22
- package/tools/api-guide.ts +10 -1
- package/tools/api-learn.ts +6 -2
- package/tools/api-probe.ts +26 -10
- package/tools/api-scaffold.ts +21 -5
- package/tools/api-store.ts +3 -3
- package/tools/oauth-mint.ts +22 -4
package/core/staging.ts
CHANGED
|
@@ -12,18 +12,18 @@ let _stagingRoot = join(tmpdir(), "pi-lean-host");
|
|
|
12
12
|
/** Test override — mirrors `setUserGuidesDir` so tests keep drafts out of
|
|
13
13
|
* the real /tmp root. */
|
|
14
14
|
export function setStagingRoot(dir: string): void {
|
|
15
|
-
|
|
15
|
+
_stagingRoot = dir;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
/** Deterministic staged dir: `<root>/<key>/`. The key is the requested
|
|
19
19
|
* `domain` for templates (placeholder shortName) and `slug(shortName)` for
|
|
20
20
|
* fetched recipes (which is the on-disk dirName). */
|
|
21
21
|
export function stagingDirFor(key: string): string {
|
|
22
|
-
|
|
22
|
+
return join(_stagingRoot, key);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
/** True when `p` is a staged dir under the staging root (the root itself
|
|
26
26
|
* excluded — save must never try to rename the whole root). */
|
|
27
27
|
export function isUnderStagingRoot(p: string): boolean {
|
|
28
|
-
|
|
28
|
+
return p !== _stagingRoot && p.startsWith(`${_stagingRoot}${sep}`);
|
|
29
29
|
}
|
package/core/status-hint.ts
CHANGED
|
@@ -3,9 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Both api-probe and api-fetch (/api verify) hit the same real-world 403
|
|
5
5
|
* reality: an authenticated-but-forbidden response whose body carries the
|
|
6
|
-
* server's own reason. One classifier keeps the two paths from drifting
|
|
7
|
-
*
|
|
8
|
-
* which made plan-gated 403s read as recipe bugs.
|
|
6
|
+
* server's own reason. One classifier keeps the two paths from drifting
|
|
7
|
+
* and keeps plan-gated 403s from reading as recipe bugs.
|
|
9
8
|
*/
|
|
10
9
|
|
|
11
10
|
/** Structured "plan not authorized" signal — a 403 whose extracted reason
|