@bluestep-systems/b6p-core 0.9.0 → 1.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 (142) hide show
  1. package/README.md +274 -24
  2. package/dist/B6PCore.d.ts +13 -0
  3. package/dist/B6PCore.js +61 -1
  4. package/dist/B6PCore.js.map +1 -1
  5. package/dist/B6PUri.d.ts +6 -8
  6. package/dist/B6PUri.js +6 -8
  7. package/dist/B6PUri.js.map +1 -1
  8. package/dist/Err.d.ts +434 -0
  9. package/dist/Err.js +582 -0
  10. package/dist/Err.js.map +1 -1
  11. package/dist/auth/BearerAuthProvider.d.ts +32 -0
  12. package/dist/auth/BearerAuthProvider.js +49 -0
  13. package/dist/auth/BearerAuthProvider.js.map +1 -1
  14. package/dist/cache/OrgCache.js.map +1 -1
  15. package/dist/cache/ScriptMetaDataStore.js.map +1 -1
  16. package/dist/constants/ApiEndpoints.d.ts +1 -0
  17. package/dist/constants/ApiEndpoints.js +1 -0
  18. package/dist/constants/ApiEndpoints.js.map +1 -1
  19. package/dist/constants/AuthTypes.js.map +1 -1
  20. package/dist/constants/BlueHQ.js.map +1 -1
  21. package/dist/constants/CryptoAlgorithms.js.map +1 -1
  22. package/dist/constants/ExtensionConfig.js.map +1 -1
  23. package/dist/constants/FileExtensions.js.map +1 -1
  24. package/dist/constants/FolderNames.js.map +1 -1
  25. package/dist/constants/Gateway.d.ts +71 -0
  26. package/dist/constants/Gateway.js +79 -0
  27. package/dist/constants/Gateway.js.map +1 -0
  28. package/dist/constants/GitHubUrls.js.map +1 -1
  29. package/dist/constants/Http.js.map +1 -1
  30. package/dist/constants/MimeTypes.js.map +1 -1
  31. package/dist/constants/Numerical.js.map +1 -1
  32. package/dist/constants/OutputChannels.js.map +1 -1
  33. package/dist/constants/SettingsKeys.d.ts +5 -0
  34. package/dist/constants/SettingsKeys.js +5 -0
  35. package/dist/constants/SettingsKeys.js.map +1 -1
  36. package/dist/constants/SpecialFiles.js.map +1 -1
  37. package/dist/constants/WebDAVElements.js.map +1 -1
  38. package/dist/constants/index.d.ts +1 -0
  39. package/dist/constants/index.js +3 -1
  40. package/dist/constants/index.js.map +1 -1
  41. package/dist/data/DownstairsPathParser.js.map +1 -1
  42. package/dist/data/GlobMatcher.js.map +1 -1
  43. package/dist/data/IdUtility.js.map +1 -1
  44. package/dist/data/OrgWorker.js.map +1 -1
  45. package/dist/data/ScriptKey.js.map +1 -1
  46. package/dist/data/ScriptUrlParser.js.map +1 -1
  47. package/dist/data/ServerVersion.d.ts +76 -0
  48. package/dist/data/ServerVersion.js +111 -0
  49. package/dist/data/ServerVersion.js.map +1 -0
  50. package/dist/data/index.d.ts +2 -0
  51. package/dist/data/index.js +7 -1
  52. package/dist/data/index.js.map +1 -1
  53. package/dist/gateway/GatewayClient.d.ts +147 -0
  54. package/dist/gateway/GatewayClient.js +395 -0
  55. package/dist/gateway/GatewayClient.js.map +1 -0
  56. package/dist/gateway/GatewayContext.d.ts +43 -0
  57. package/dist/gateway/GatewayContext.js +3 -0
  58. package/dist/gateway/GatewayContext.js.map +1 -0
  59. package/dist/gateway/GatewayGit.d.ts +291 -0
  60. package/dist/gateway/GatewayGit.js +731 -0
  61. package/dist/gateway/GatewayGit.js.map +1 -0
  62. package/dist/gateway/GatewayKb.d.ts +173 -0
  63. package/dist/gateway/GatewayKb.js +354 -0
  64. package/dist/gateway/GatewayKb.js.map +1 -0
  65. package/dist/gateway/GatewayMarketplace.d.ts +116 -0
  66. package/dist/gateway/GatewayMarketplace.js +278 -0
  67. package/dist/gateway/GatewayMarketplace.js.map +1 -0
  68. package/dist/gateway/GatewayService.d.ts +47 -0
  69. package/dist/gateway/GatewayService.js +54 -0
  70. package/dist/gateway/GatewayService.js.map +1 -0
  71. package/dist/gateway/GatewayToken.d.ts +18 -0
  72. package/dist/gateway/GatewayToken.js +43 -0
  73. package/dist/gateway/GatewayToken.js.map +1 -0
  74. package/dist/gateway/GatewayTokenService.d.ts +101 -0
  75. package/dist/gateway/GatewayTokenService.js +465 -0
  76. package/dist/gateway/GatewayTokenService.js.map +1 -0
  77. package/dist/index.d.ts +27 -9
  78. package/dist/index.js +36 -7
  79. package/dist/index.js.map +1 -1
  80. package/dist/network/HttpClient.js.map +1 -1
  81. package/dist/network/HttpClientProvider.js.map +1 -1
  82. package/dist/network/StatusCodes.js.map +1 -1
  83. package/dist/persistence/PersistablePseudoMap.js.map +1 -1
  84. package/dist/persistence/PersistenceKeys.js.map +1 -1
  85. package/dist/persistence/PrivatePersistanceMap.js.map +1 -1
  86. package/dist/persistence/PseudoMap.js.map +1 -1
  87. package/dist/persistence/PublicPersistanceMap.js.map +1 -1
  88. package/dist/persistence/Serializable.js.map +1 -1
  89. package/dist/persistence/SharedFilePersistence.d.ts +22 -0
  90. package/dist/persistence/SharedFilePersistence.js +65 -14
  91. package/dist/persistence/SharedFilePersistence.js.map +1 -1
  92. package/dist/persistence/TypedMap.js.map +1 -1
  93. package/dist/persistence/TypedPersistable.js.map +1 -1
  94. package/dist/persistence/TypedPrivatePersistable.js.map +1 -1
  95. package/dist/persistence/dirLockdown.js.map +1 -1
  96. package/dist/providers.d.ts +36 -19
  97. package/dist/schema/SchemaContext.d.ts +10 -0
  98. package/dist/schema/SchemaContext.js +3 -0
  99. package/dist/schema/SchemaContext.js.map +1 -0
  100. package/dist/schema/SchemaService.d.ts +99 -0
  101. package/dist/schema/SchemaService.js +225 -0
  102. package/dist/schema/SchemaService.js.map +1 -0
  103. package/dist/script/GitIdentity.js.map +1 -1
  104. package/dist/script/GitSync.d.ts +78 -11
  105. package/dist/script/GitSync.js +84 -17
  106. package/dist/script/GitSync.js.map +1 -1
  107. package/dist/script/ScriptContext.d.ts +1 -8
  108. package/dist/script/ScriptFactory.d.ts +1 -2
  109. package/dist/script/ScriptFactory.js +1 -2
  110. package/dist/script/ScriptFactory.js.map +1 -1
  111. package/dist/script/ScriptFile.js.map +1 -1
  112. package/dist/script/ScriptFolder.js.map +1 -1
  113. package/dist/script/ScriptNode.js.map +1 -1
  114. package/dist/script/ScriptRoot.d.ts +0 -63
  115. package/dist/script/ScriptRoot.js +0 -178
  116. package/dist/script/ScriptRoot.js.map +1 -1
  117. package/dist/script/ScriptService.d.ts +45 -11
  118. package/dist/script/ScriptService.js +44 -6
  119. package/dist/script/ScriptService.js.map +1 -1
  120. package/dist/script/ServerCompile.d.ts +35 -0
  121. package/dist/script/ServerCompile.js +40 -0
  122. package/dist/script/ServerCompile.js.map +1 -0
  123. package/dist/script/TsConfig.d.ts +2 -2
  124. package/dist/script/TsConfig.js +3 -3
  125. package/dist/script/TsConfig.js.map +1 -1
  126. package/dist/script/push.d.ts +117 -77
  127. package/dist/script/push.js +151 -170
  128. package/dist/script/push.js.map +1 -1
  129. package/dist/session/SessionManager.js.map +1 -1
  130. package/dist/testing/FakeGateway.d.ts +280 -0
  131. package/dist/testing/FakeGateway.js +627 -0
  132. package/dist/testing/FakeGateway.js.map +1 -0
  133. package/dist/testing/MockFileSystem.js.map +1 -1
  134. package/dist/types.d.ts +534 -0
  135. package/dist/update/UpdateService.js.map +1 -1
  136. package/package.json +8 -7
  137. package/dist/script/ScriptTranspiler.d.ts +0 -183
  138. package/dist/script/ScriptTranspiler.js +0 -425
  139. package/dist/script/ScriptTranspiler.js.map +0 -1
  140. package/dist/script/TsLibResolver.d.ts +0 -60
  141. package/dist/script/TsLibResolver.js +0 -134
  142. package/dist/script/TsLibResolver.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"TsConfig.js","sourceRoot":"","sources":["../../src/script/TsConfig.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA6B;AAC7B,gCAA6B;AAC7B,4CAA2C;AAM3C;;;;;;;;GAQG;AACH,MAAa,QAAQ;IAME;IALrB,MAAM,CAAC,IAAI,GAAG,eAAe,CAAC;IACtB,EAAE,CAAa;IACN,UAAU,CAAa;IAExC,YACqB,MAAc,EACjC,UAAsB;QADH,WAAM,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CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;QACvE,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;QACtE,IAAI,MAAM,KAAK,MAAM,CAAC,eAAe,EAAE,MAAM,EAAE,CAAC;YAC9C,yEAAyE;YACzE,uEAAuE;YACvE,sEAAsE;YACtE,8EAA8E;YAC9E,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAC7B,eAAe,IAAI,CAAC,IAAI,EAAE,sDAAsD,MAAM,IAAI,CAC3F,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IACrG,CAAC;IAED;;;;;;;;;;OAUG;IACH,MAAM,CAAC,aAAa,CAAC,SAAkB;QACrC,IAAI,OAAO,SAAS,KAAK,QAAQ,IAAI,SAAS,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACjE,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,OAAO,uBAAW,CAAC,SAAS,CAAC;IAC/B,CAAC;IAEM,KAAK,CAAC,yBAAyB;QACpC,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;QAChD,MAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,MAAM,EAAE,WAAW,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,CAAC;QAChF,OAAO,YAAY,CAAC;IACtB,CAAC;CACF"}
@@ -1,9 +1,9 @@
1
- import { type GitIdentity } from "@bluestep-systems/b6p-core-bsjs-git";
1
+ import { type BuildFastForward, type DraftBuildRefusalReason, type DraftCompileOutcome, type DraftCompileStatus, type GitIdentity } from "@bluestep-systems/b6p-core-bsjs-git";
2
+ import { type PushRoute, type SnapshotRefusal } from "../data/ServerVersion";
2
3
  import type { ScriptContext } from "./ScriptContext";
3
- import type { TypeCheckError } from "./ScriptTranspiler";
4
- import type { FileSystem } from "../providers";
5
4
  import { type LastSyncedLookup, type PublishRefusal } from "./GitSync";
6
5
  import type { ScriptRoot } from "./ScriptRoot";
6
+ import { type TypeCheckError } from "./ServerCompile";
7
7
  /**
8
8
  * The hashes a pre-git push or pull recorded for the files of a draft folder, as the lookup the git side uses to tell a
9
9
  * local edit from a platform change in a folder that has no repository yet.
@@ -12,6 +12,26 @@ import type { ScriptRoot } from "./ScriptRoot";
12
12
  * @lastreviewed null
13
13
  */
14
14
  export declare function legacySyncRecords(scriptRoot: ScriptRoot, draftPath: string): Promise<LastSyncedLookup>;
15
+ /**
16
+ * A platform build that ended in a status after which the draft does not publish: anything but `COMPILED`,
17
+ * `NOTHING_TO_COMPILE` and `SKIPPED_EXTERNALLY_BUILT` (for example `BUSY` or `INPUT_INCOMPLETE` once the retries ran
18
+ * out, `COMPILER_UNAVAILABLE`, `NOT_PERMITTED`, `WRITE_FAILED`, `OUTPUT_UPLOAD`, `SKIPPED_GIT_MANAGED`, `GATE_TRIPPED`,
19
+ * `EMIT_WITHHELD`, `UNKNOWN`).
20
+ * @lastreviewed null
21
+ */
22
+ export interface BuildIncomplete {
23
+ /** The status, `UNKNOWN` for one this version does not know. @lastreviewed null */
24
+ readonly status: DraftCompileStatus;
25
+ /** The status exactly as the platform sent it. @lastreviewed null */
26
+ readonly rawStatus: string;
27
+ /** What the status means, in words. @lastreviewed null */
28
+ readonly description: string;
29
+ }
30
+ /**
31
+ * What a build status that does not publish means, for {@link BuildIncomplete.description}.
32
+ * @lastreviewed null
33
+ */
34
+ export declare function describeBuildStatus(status: DraftCompileStatus, rawStatus: string): string;
15
35
  /**
16
36
  * Outcome of a push, for callers that need more signal than the human-facing
17
37
  * messages — e.g. a CLI that must exit non-zero or emit `--json` when nothing
@@ -23,20 +43,21 @@ export declare function legacySyncRecords(scriptRoot: ScriptRoot, draftPath: str
23
43
  export interface PushResult {
24
44
  /**
25
45
  * True when the draft is on the platform: the draft branch was pushed, or already matched. False when the push
26
- * aborted before that (draft folder missing, or empty; or, on a snapshot push, the compiled `scripts/app.js`
27
- * missing or blank) — a state a machine consumer must not read as success.
46
+ * aborted before that (draft folder missing, or empty) — a state a machine consumer must not read as success.
28
47
  * @lastreviewed null
29
48
  */
30
49
  pushed: boolean;
31
50
  /**
32
- * The draft branch's head commit on the platform after the push: the commit this push made, or the one already
33
- * there when nothing changed. `null` when `pushed` is false.
51
+ * The draft commit this push made, or the one already on the platform when nothing changed; the platform's build
52
+ * commit, when it makes one, follows it (`buildCommitSha`). `null` when `pushed` is false.
34
53
  * @lastreviewed null
35
54
  */
36
55
  commitSha: string | null;
37
56
  /**
38
- * The commit the platform published, on a snapshot push. `null` on a plain push, when the push aborted, and when the
39
- * publish failed (`publishError` says why); a consumer asking for a snapshot must treat `null` as a failure.
57
+ * The commit the platform published, on a snapshot push: the build commit, or the pushed commit when the build made
58
+ * none. `null` on a plain push, when the push aborted, when nothing was published (`snapshotRefused`, a build that
59
+ * failed or does not publish) and when the publish failed (`publishError` says why); a consumer asking for a
60
+ * snapshot must treat `null` as a failure.
40
61
  * @lastreviewed null
41
62
  */
42
63
  publishedSha: string | null;
@@ -59,25 +80,84 @@ export interface PushResult {
59
80
  */
60
81
  switchedToGit: boolean;
61
82
  /**
62
- * Type-check outcome of the pre-publish transpile:
63
- * - `null` — no platform-code type-check ran. A plain (non-snapshot) push
64
- * does not compile; a push that aborted before compiling never got there;
65
- * and a snapshot whose TS all lives under nested client bundles (nothing
66
- * governed by the draft-root tsconfig) has no draft-root code to check.
67
- * - `0` — the draft-root code compiled with zero diagnostics: genuinely
68
- * type-checked.
69
- * - `> 0` — compiled, but N diagnostics were reported. The JavaScript was
70
- * emitted and published anyway (the platform runs the emitted JS on
71
- * GraalVM regardless of type errors, and local declarations may be
72
- * incomplete), so this is a loud warning, not a failure. A machine consumer
73
- * should treat `> 0` as "published without a passing type-check".
83
+ * Which route the push took: `server-build` (the platform builds every push, and a snapshot publishes the build) or
84
+ * `push-only` (the server predates the git build: the draft was pushed and nothing else happened), with why and the
85
+ * versions compared. `null` when the push stopped before the server's version was asked.
86
+ * @lastreviewed null
87
+ */
88
+ route: PushRoute | null;
89
+ /**
90
+ * Set when a snapshot push was asked for but the server does not build git drafts: the draft was pushed, nothing was
91
+ * built or published. A result, not an error. `null` for a plain push and on the build route.
92
+ * @lastreviewed null
93
+ */
94
+ snapshotRefused: SnapshotRefusal | null;
95
+ /**
96
+ * What the platform's build of the pushed draft came to (`compileDraft`): status, counts, diagnostics and the save
97
+ * gate's findings. `null` when no build ran (push-only route, aborted push) or the build request failed
98
+ * (`buildError`).
99
+ * @lastreviewed null
100
+ */
101
+ build: DraftCompileOutcome | null;
102
+ /**
103
+ * The build commit the platform made on the draft branch (the output, and the build manifest when it vouched for the
104
+ * build). The local draft folder was moved to it unless `buildFastForward` says otherwise. `null` when it made none: already built, nothing to build,
105
+ * no build ran, or the request failed.
106
+ * @lastreviewed null
107
+ */
108
+ buildCommitSha: string | null;
109
+ /**
110
+ * Whether the draft passes the platform's build check: the build is clean (every project's output written, no
111
+ * blocking error) and its manifest committed, or the draft needs none (externally built, nothing to build). `false`
112
+ * after an unclean build: the output is committed without a manifest
113
+ * and a publish is refused (`BUILD_STALE` or `BUILD_MANIFEST_MISSING`). `null` when no build ran.
114
+ * @lastreviewed null
115
+ */
116
+ buildVouched: boolean | null;
117
+ /**
118
+ * Why no build answer came after a successful push (the draft is pushed; nothing was published). `null` otherwise.
119
+ * @lastreviewed null
120
+ */
121
+ buildError: string | null;
122
+ /**
123
+ * What `buildError` is: `not-requested` (no build was asked for: the platform's draft was no longer the pushed
124
+ * commit), `refused` (the platform refused the build, see `buildErrorReason`; nothing was built) or
125
+ * `request-failed` (any other failure; it may have run). `null` with no `buildError`.
126
+ * @lastreviewed null
127
+ */
128
+ buildErrorKind: "not-requested" | "refused" | "request-failed" | null;
129
+ /**
130
+ * The platform's refusal reason when `buildErrorKind` is `refused`: `DRAFT_MOVED`, `DRAFT_TOO_LARGE` (the draft is
131
+ * over the build's size limit), `REPO_MISSING` or `DRAFT_BRANCH_MISSING`. `null` otherwise.
132
+ * @lastreviewed null
133
+ */
134
+ buildErrorReason: DraftBuildRefusalReason | null;
135
+ /**
136
+ * Set when the build answered with a status after which the draft does not publish (see {@link BuildIncomplete}):
137
+ * a snapshot push then publishes nothing, and neither push reports itself complete. `null` otherwise.
138
+ * @lastreviewed null
139
+ */
140
+ buildIncomplete: BuildIncomplete | null;
141
+ /**
142
+ * How the local draft folder was moved to `buildCommitSha`: `fast-forwarded`, `unchanged` (no build commit),
143
+ * `blocked` (local files the build changes are in the way, `blockedPaths`; the folder was left as it was, and a
144
+ * snapshot published nothing) or `failed` (`error`; the folder's draft branch did not move). `null` when no build
145
+ * answer came.
146
+ * @lastreviewed null
147
+ */
148
+ buildFastForward: BuildFastForward | null;
149
+ /**
150
+ * How many `ERROR` and `WARNING` diagnostics the platform's build reported in all (its `errors` + `warnings`):
151
+ * `null` when no build ran. {@link typeCheckErrors} lists fewer when the platform capped its list (at most 20) or
152
+ * some were outside the script's own sources. The platform builds and type-checks; a type-checker finding is a
153
+ * warning and does not stop the publish, so `> 0` is "built with findings", not a failure.
74
154
  * @lastreviewed null
75
155
  */
76
156
  typeCheckDiagnostics: number | null;
77
157
  /**
78
- * The diagnostics `typeCheckDiagnostics` counts, located: `{ file, line, column, code, message }` for each, with `file`
79
- * relative to the draft folder. Only the script's own sources are counted, never a `.d.ts`. Empty when none, and when
80
- * no type-check ran.
158
+ * The platform build's diagnostics in the script's own sources (never a `.d.ts`, never outside the tree), located:
159
+ * `{ file, line, column, code, message, severity }`, `file` relative to the draft folder. The platform lists at most
160
+ * 20 diagnostics (`build.diagnosticsOmitted` counts the rest). Empty when none, and when no build ran.
81
161
  * @lastreviewed null
82
162
  */
83
163
  typeCheckErrors: TypeCheckError[];
@@ -105,56 +185,18 @@ export interface PushResult {
105
185
  */
106
186
  keptPlatformOnly: string[];
107
187
  }
108
- /**
109
- * Outcome of {@link checkEmittedEntrypoint}.
110
- * @lastreviewed null
111
- */
112
- export interface EmittedEntrypointCheck {
113
- /**
114
- * - `"no-source"` — the draft has no `scripts/app.ts` (a JS-only draft): nothing to check.
115
- * - `"ok"` — the compiled entrypoint exists and has content.
116
- * - `"missing"` — `scripts/app.ts` exists but the compile wrote no `scripts/app.js`.
117
- * - `"empty"` — the compiled entrypoint has no code: only comments (the inline source map
118
- * included) and the compiler's empty-module lines, e.g. from a blank `app.ts` or one holding
119
- * only types. The platform serves such a file as an empty `200`.
120
- * @lastreviewed null
121
- */
122
- status: "no-source" | "ok" | "missing" | "empty";
123
- /**
124
- * Absolute path of the compiled entrypoint the check looked for.
125
- * @lastreviewed null
126
- */
127
- emittedPath: string;
128
- }
129
- /**
130
- * Pre-publish check for a snapshot push: after the compile, the entrypoint the platform runtime
131
- * loads must be there. The runtime resolves `scripts/app` to `<build folder>/scripts/app.js`; if
132
- * that file is missing or has no code, publishing it breaks the live version (a missing one fails
133
- * with `NoSuchFileException .../scripts/app`, one with no code answers an empty `200`), so the push
134
- * must stop before any upload (ClickUp 86bbqnrtp).
135
- *
136
- * Only the entrypoint is checked. A helper module may legitimately compile to almost nothing, so
137
- * checking every emitted file would stop good pushes. The transpiler sets `rootDir` to the
138
- * tsconfig's folder, which is why `scripts/app.ts` always maps to `<build folder>/scripts/app.js`.
139
- * @param opts.draftPath The draft folder
140
- * @param opts.buildFolderPath The draft-root tsconfig's build folder ({@link ScriptRoot.getDraftBuildFolder})
141
- * @param opts.fs The file system to read
142
- * @returns What was found, and the path it looked at
143
- * @lastreviewed null
144
- */
145
- export declare function checkEmittedEntrypoint(opts: {
146
- draftPath: string;
147
- buildFolderPath: string;
148
- fs: FileSystem;
149
- }): Promise<EmittedEntrypointCheck>;
150
188
  /**
151
189
  * Core push implementation, on git: the draft folder is the script's git working tree, a push commits it and pushes the
152
- * draft branch, and a snapshot then publishes it (see {@link pushDraft}).
190
+ * draft branch (see {@link pushDraft}), the platform then builds the pushed commit, and a snapshot publishes the build.
153
191
  *
154
- * A snapshot push compiles first and stops before pushing anything if the compiled entrypoint is missing or blank. It
155
- * is published as pushed: the compiled output is part of the commit. If the platform refuses the publish the draft
156
- * stays pushed and the result carries `publishError`. A snapshot that compiled with diagnostics is published anyway and
157
- * warned about loudly.
192
+ * Nothing compiles here. The server's version picks the route once per push ({@link resolvePushRoute}): a `dev` server
193
+ * or one at or above `MIN_SERVER_VERSION` builds every push (GraphQL `compileDraft` pinned to the pushed commit), which
194
+ * commits the output, and the build manifest when it vouches for the build, as one build commit; the draft folder is
195
+ * fast-forwarded to it. A snapshot push then publishes that commit, unless the build failed or ended in a status that
196
+ * does not publish (a tripped gate, a withheld emit). An unclean build is published-or-refused by the platform's
197
+ * manifest check, never by core. On any other server the push is a git push alone, and a snapshot push takes no
198
+ * snapshot (`snapshotRefused`). If the platform refuses the publish the draft stays pushed and the result carries
199
+ * `publishError`.
158
200
  *
159
201
  * Before anything is pushed, one confirmation covers every platform file the push would overwrite; declining stops the
160
202
  * push with nothing sent.
@@ -164,6 +206,8 @@ export declare function checkEmittedEntrypoint(opts: {
164
206
  * @param opts.author Who the commit is by. When absent: the folder's `git config`, then the environment.
165
207
  * @param opts.adoptUnbound `false` for a deploy to a script the folder isn't the working copy of: the folder is then
166
208
  * never bound to the target's repo. Default `true`.
209
+ * @param opts.floor Overrides `MIN_SERVER_VERSION` (`null` means unset); for tests
210
+ * @param opts.sleep Waits between the build's retries; for tests
167
211
  * @throws an {@link Err.OverwriteDeclinedError} when an overwrite is not confirmed
168
212
  * @throws {GitIdentityError} when no commit author can be found
169
213
  * @lastreviewed null
@@ -177,11 +221,7 @@ export declare function executePush(opts: {
177
221
  overwrite?: string[];
178
222
  author?: GitIdentity;
179
223
  adoptUnbound?: boolean;
180
- /**
181
- * The script is built by a bundler outside this tool (its `externallyBuilt` config flag): no build manifest is
182
- * written for it.
183
- * @lastreviewed null
184
- */
185
- externallyBuilt?: boolean;
186
224
  enableGit?: boolean;
225
+ floor?: string | null;
226
+ sleep?: (ms: number) => Promise<void>;
187
227
  }): Promise<PushResult>;