@jini-ai/devops 0.3.0 → 0.3.1

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.
@@ -102,7 +102,7 @@ function normalizeHostname(raw) {
102
102
  * "raw URL/hostname → bare hostname" normalizer (the same shape
103
103
  * `reachability.ts`'s own `normalizeDeploymentUrl` is, and that one earns its
104
104
  * keep across many callers) that only happens to have a single, narrowly-shaped
105
- * caller today. See packages/deploy/source-map.md's 2026-07-22 addition.
105
+ * caller today. See packages/devops/source-map.md's 2026-07-22 addition.
106
106
  */
107
107
  function normalizeDeploymentUrlToHostname(raw) {
108
108
  const trimmed = String(raw || '').trim();
@@ -225,7 +225,7 @@ function isCloudflareCommentError(value) {
225
225
  * the same field) before `config` is ever constructed. Kept as
226
226
  * belt-and-suspenders for this URL-builder helper (which has no way to know,
227
227
  * from its own signature, that every caller happens to pre-validate) — see
228
- * packages/deploy/source-map.md's 2026-07-22 addition.
228
+ * packages/devops/source-map.md's 2026-07-22 addition.
229
229
  */
230
230
  function cloudflareAccountPagesProjectsUrl(config) {
231
231
  if (!config.accountId)
@@ -238,7 +238,7 @@ function cloudflareAccountPagesProjectsUrl(config) {
238
238
  * doc comment and `publish()`'s own (also-unreachable) guard establish:
239
239
  * `config.projectName` is always `deriveCloudflarePagesProjectName(...)`'s
240
240
  * result, which can never be empty. Kept as belt-and-suspenders for this
241
- * shared URL-builder — see packages/deploy/source-map.md's 2026-07-22
241
+ * shared URL-builder — see packages/devops/source-map.md's 2026-07-22
242
242
  * addition.
243
243
  */
244
244
  function cloudflarePagesProjectUrl(config, suffix = '') {
@@ -260,7 +260,7 @@ function cloudflarePagesProjectDomainUrl(config, hostname) {
260
260
  * `publish()` also independently guards `if (!projectName) throw ...` right
261
261
  * after deriving it, belt-and-suspenders. Kept for the same
262
262
  * general-purpose-helper reasoning documented throughout this file — see
263
- * packages/deploy/source-map.md's 2026-07-22 addition.
263
+ * packages/devops/source-map.md's 2026-07-22 addition.
264
264
  */
265
265
  function cloudflarePagesProductionUrl(config) {
266
266
  return config?.projectName ? `https://${config.projectName}.pages.dev` : '';
@@ -555,7 +555,7 @@ async function ensureCloudflarePagesCnameRecord(input) {
555
555
  // `conflicting` object. If `canPatchCloudflarePagesCname` returned `true`, `conflicting.id`
556
556
  // is already known-truthy. Kept as belt-and-suspenders since `conflicting.id`'s static type
557
557
  // (`unknown`, from `CloudflareDnsRecord`'s index signature) doesn't let TypeScript narrow
558
- // that for us. See packages/deploy/source-map.md's 2026-07-22 addition.
558
+ // that for us. See packages/devops/source-map.md's 2026-07-22 addition.
559
559
  if (!conflictingId)
560
560
  throw new DeployError('Cloudflare DNS record id is missing.', 502);
561
561
  const patched = await patchCloudflareDnsRecord(config, selection.zoneId, conflictingId, {
@@ -614,7 +614,7 @@ async function ensureCloudflarePagesCnameRecord(input) {
614
614
  * `domainPrefix` and a validated non-empty, regex-confirmed-DNS-safe
615
615
  * `zoneName` — a value `normalizeHostname`'s trim/lowercase/protocol-strip
616
616
  * transforms can never reduce to `''`. See
617
- * packages/deploy/source-map.md's 2026-07-22 addition.
617
+ * packages/devops/source-map.md's 2026-07-22 addition.
618
618
  */
619
619
  async function findCloudflarePagesDomain(config, hostname) {
620
620
  const normalizedHostname = normalizeHostname(hostname);
@@ -669,7 +669,7 @@ async function setupCloudflarePagesCustomDomain(input) {
669
669
  // `https://${projectName}.pages.dev` string, so `pagesDevUrl` is never `link.url`. A non-empty,
670
670
  // well-formed `https://` URL always yields a real hostname from `hostnameFromUrl`, so its own
671
671
  // `|| default` inside `normalizeDeploymentUrlToHostname` is never needed here either. See
672
- // packages/deploy/source-map.md's 2026-07-22 addition.
672
+ // packages/devops/source-map.md's 2026-07-22 addition.
673
673
  const pagesTarget = normalizeHostname(hostnameFromUrl(pagesDevUrl) || `${config.projectName}.pages.dev`);
674
674
  const marker = cloudflarePagesDnsMarker(config.projectName, pagesTarget);
675
675
  const base = {
@@ -692,7 +692,7 @@ async function setupCloudflarePagesCustomDomain(input) {
692
692
  // reachable from `ensureCloudflarePagesCnameRecord`'s own call graph (`cloudflareError(...)`,
693
693
  // `new DeployError(...)`, or a rethrow of one of those) is a real `Error`/`DeployError`
694
694
  // instance — this file never throws a bare string/object anywhere. See
695
- // packages/deploy/source-map.md's 2026-07-22 addition.
695
+ // packages/devops/source-map.md's 2026-07-22 addition.
696
696
  statusMessage: err instanceof Error ? err.message : 'Cloudflare DNS record setup failed.',
697
697
  errorCode: details.errorCode || 'cloudflare_dns_record_failed',
698
698
  dnsOwnership: details.dnsOwnership || 'external',
@@ -709,7 +709,7 @@ async function setupCloudflarePagesCustomDomain(input) {
709
709
  ...base,
710
710
  status: details.errorCode === 'cloudflare_domain_already_bound' ? 'conflict' : 'failed',
711
711
  // Same "every real throw site in this file is a genuine Error/DeployError" reasoning as the
712
- // DNS-setup catch above — unreachable fallback, see packages/deploy/source-map.md.
712
+ // DNS-setup catch above — unreachable fallback, see packages/devops/source-map.md.
713
713
  statusMessage: err instanceof Error ? err.message : 'Cloudflare Pages custom domain setup failed.',
714
714
  errorCode: details.errorCode || 'cloudflare_domain_setup_failed',
715
715
  dnsStatus: dns.dnsStatus,
@@ -757,7 +757,7 @@ function hostnameFromUrl(raw) {
757
757
  * `new URL(...).hostname`, so `hostnameFromUrl(pagesDevUrl)` never falls
758
758
  * through to its own `|| ...pages.dev` default, and `normalizeHostname` of a
759
759
  * real hostname never produces `''`. So `pagesTarget` is always truthy by
760
- * the time it reaches here. See packages/deploy/source-map.md's 2026-07-22
760
+ * the time it reaches here. See packages/devops/source-map.md's 2026-07-22
761
761
  * addition for the full chain.
762
762
  */
763
763
  function cloudflarePagesDnsMarker(projectName, pagesTarget) {
@@ -778,7 +778,7 @@ function aggregateCloudflarePagesStatus(pagesDev, customDomain) {
778
778
  // fallbacks below are unreachable because `customDomain` only ever comes from this file's own
779
779
  // `setupCloudflarePagesCustomDomain`, whose every return shape sets a real, non-empty
780
780
  // `statusMessage` (main flow) or `errorCode` (catch-block flows) — see that function's own return
781
- // sites. See packages/deploy/source-map.md's 2026-07-22 addition for the exhaustive case-by-case
781
+ // sites. See packages/devops/source-map.md's 2026-07-22 addition for the exhaustive case-by-case
782
782
  // trace backing all of this.
783
783
  if (!customDomain) {
784
784
  return { status: pagesDev.status, ...(pagesDev.statusMessage !== undefined ? { statusMessage: pagesDev.statusMessage } : {}) };
@@ -848,7 +848,7 @@ export class CloudflarePagesDeployTarget {
848
848
  // always returns a non-empty string (see its own doc comment) — kept as
849
849
  // belt-and-suspenders in case that helper's contract ever changes, same
850
850
  // reasoning as `cloudflarePagesProjectUrl`'s identical guard. See
851
- // packages/deploy/source-map.md's 2026-07-22 addition.
851
+ // packages/devops/source-map.md's 2026-07-22 addition.
852
852
  if (!projectName)
853
853
  throw new DeployError('Cloudflare Pages project name could not be generated.', 400);
854
854
  const config = { ...this.config, projectName };
@@ -878,7 +878,7 @@ export class CloudflarePagesDeployTarget {
878
878
  // `cloudflarePagesProductionUrl(config)`, which — per its own doc comment — is always the
879
879
  // non-empty `https://${projectName}.pages.dev` string, since `config.projectName` is validated
880
880
  // non-empty before `config` is ever constructed above. See
881
- // packages/deploy/source-map.md's 2026-07-22 addition.
881
+ // packages/devops/source-map.md's 2026-07-22 addition.
882
882
  const productionUrl = cloudflarePagesProductionUrl(config);
883
883
  const link = await waitForReachableDeploymentUrl(productionUrl ? [productionUrl] : [deployment?.url], {
884
884
  providerLabel: 'Cloudflare Pages',
@@ -903,7 +903,7 @@ export class CloudflarePagesDeployTarget {
903
903
  // is unreachable: every one of `aggregateCloudflarePagesStatus`'s own return paths sets a
904
904
  // real, non-empty `statusMessage` — either a literal, or spread from `pagesDev.statusMessage`,
905
905
  // which (per that function's own doc comment) is always defined. See
906
- // packages/deploy/source-map.md's 2026-07-22 addition.
906
+ // packages/devops/source-map.md's 2026-07-22 addition.
907
907
  ...(aggregate.statusMessage !== undefined ? { statusMessage: aggregate.statusMessage } : {}),
908
908
  ...(link.reachableAt !== undefined ? { reachableAt: link.reachableAt } : {}),
909
909
  providerMetadata: {
@@ -14,7 +14,7 @@ export interface GitHubPagesDeployConfig {
14
14
  * blobs → a tree → a commit → create/update a branch ref) rather than the
15
15
  * newer artifact-based "Pages deployments" API
16
16
  * (`POST /repos/{owner}/{repo}/pages/deployments`). See
17
- * `packages/deploy/source-map.md`'s 2026-07-21 addition for the full
17
+ * `packages/devops/source-map.md`'s 2026-07-21 addition for the full
18
18
  * research trail; in short: that endpoint requires an `oidc_token` "issued
19
19
  * by GitHub Actions certifying the origin of the deployment" — a token this
20
20
  * package (running outside an Actions runner, authenticating with a plain
@@ -28,7 +28,7 @@ const GITHUB_PAGES_BUILD_FAILURE = 'errored';
28
28
  * blobs → a tree → a commit → create/update a branch ref) rather than the
29
29
  * newer artifact-based "Pages deployments" API
30
30
  * (`POST /repos/{owner}/{repo}/pages/deployments`). See
31
- * `packages/deploy/source-map.md`'s 2026-07-21 addition for the full
31
+ * `packages/devops/source-map.md`'s 2026-07-21 addition for the full
32
32
  * research trail; in short: that endpoint requires an `oidc_token` "issued
33
33
  * by GitHub Actions certifying the origin of the deployment" — a token this
34
34
  * package (running outside an Actions runner, authenticating with a plain
@@ -82,7 +82,7 @@ async function requestDeploymentUrl(url, method, timeoutMs, options) {
82
82
  // `err.message`) because `err` is typed `unknown`, and a future edit to
83
83
  // this function's own throw sites, or to `assertSafePublicUrl`'s, could
84
84
  // reintroduce a non-Error throw without this file changing at all — see
85
- // packages/deploy/source-map.md's 2026-07-22 addition for the full
85
+ // packages/devops/source-map.md's 2026-07-22 addition for the full
86
86
  // re-derivation.
87
87
  return {
88
88
  reachable: false,
@@ -93,7 +93,7 @@ async function requestDeploymentUrl(url, method, timeoutMs, options) {
93
93
  const timer = setTimeout(() => controller.abort(), timeoutMs);
94
94
  // Real refactor, not a padded test: this used to be `try { ... } catch {
95
95
  // ... } finally { clearTimeout(timer); }`. A throwaway local repro (see
96
- // packages/deploy/source-map.md's 2026-07-22 addition) proved that V8's own
96
+ // packages/devops/source-map.md's 2026-07-22 addition) proved that V8's own
97
97
  // coverage instrumentation for a `try/catch/finally` where the `catch`
98
98
  // always returns (never rethrows) emits a synthetic branch, at the
99
99
  // `finally` keyword's own position, that no test can ever satisfy — a
@@ -177,7 +177,7 @@ export async function checkDeploymentUrl(url, options = {}) {
177
177
  // remaining `reachable: false` shape (`status: 'protected'`) is already
178
178
  // excluded by the `get.status === 'protected'` check just above. So the
179
179
  // `: head` fallback branch could never actually be selected — see
180
- // packages/deploy/source-map.md's 2026-07-22 addition for the exhaustive
180
+ // packages/devops/source-map.md's 2026-07-22 addition for the exhaustive
181
181
  // case-by-case proof this was re-derived from.
182
182
  return get;
183
183
  }
@@ -240,7 +240,7 @@ export async function waitForReachableDeploymentUrl(urls, options = {}) {
240
240
  // handled by the two `return`s directly above this line, so neither
241
241
  // can reach here. `|| lastMessage` (falling back to the *previous*
242
242
  // sweep's message) could therefore never actually be selected — see
243
- // packages/deploy/source-map.md's 2026-07-22 addition for the proof.
243
+ // packages/devops/source-map.md's 2026-07-22 addition for the proof.
244
244
  // Non-null assertion (not `||`/`??`, which would just reintroduce the
245
245
  // same dead branch): the type is `string | undefined` because
246
246
  // `DeploymentUrlCheck.statusMessage` is optional in general, but this
@@ -3,7 +3,7 @@
3
3
  * target (Vercel, Cloudflare Pages, and future adapters). None of these
4
4
  * types know what a "project" is — the caller (a pack, a tool handler, a
5
5
  * CLI command) resolves its own file set and hands over plain
6
- * `DeployFile[]`. See `packages/deploy/source-map.md` for what was dropped
6
+ * `DeployFile[]`. See `packages/devops/source-map.md` for what was dropped
7
7
  * from the OD origin file to get here.
8
8
  */
9
9
  /** Generic JSON-shaped object; mirrors the loose bag used by provider APIs. */
@@ -3,7 +3,7 @@
3
3
  * target (Vercel, Cloudflare Pages, and future adapters). None of these
4
4
  * types know what a "project" is — the caller (a pack, a tool handler, a
5
5
  * CLI command) resolves its own file set and hands over plain
6
- * `DeployFile[]`. See `packages/deploy/source-map.md` for what was dropped
6
+ * `DeployFile[]`. See `packages/devops/source-map.md` for what was dropped
7
7
  * from the OD origin file to get here.
8
8
  */
9
9
  /**
@@ -102,7 +102,7 @@ export class VercelDeployTarget {
102
102
  // `JsonObject | string | undefined` — not `null` — so this coalesce is
103
103
  // a compile-time-required null-to-undefined conversion that TypeScript's
104
104
  // control-flow analysis cannot narrow away just from the optional-chained
105
- // comparison above. See packages/deploy/source-map.md's 2026-07-22
105
+ // comparison above. See packages/devops/source-map.md's 2026-07-22
106
106
  // addition for the full re-derivation.
107
107
  throw new DeployError(readyError?.message || 'Vercel deployment failed.', 502, ready ?? undefined);
108
108
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jini-ai/devops",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "DevOps capabilities for deployment, source control, and CI/CD, exposed through independent subpaths.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -47,12 +47,12 @@
47
47
  },
48
48
  "dependencies": {
49
49
  "undici": "^7.25.0",
50
- "@jini-ai/core": "0.3.0",
50
+ "@jini-ai/core": "0.3.1",
51
51
  "@jini-ai/platform": "0.3.0"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@vitest/coverage-v8": "^2.1.9",
55
- "@jini-ai/daemon": "0.3.0"
55
+ "@jini-ai/daemon": "0.3.1"
56
56
  },
57
57
  "scripts": {
58
58
  "build": "tsc -p tsconfig.json",