@keystrokehq/hosting 0.1.8 → 0.1.9

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/dist/index.cjs CHANGED
@@ -34,6 +34,10 @@ const PROJECT_SERVER_HEALTH = {
34
34
  path: "/health",
35
35
  port: PROJECT_SERVER_PORT
36
36
  };
37
+ const PROJECT_SERVER_DEPLOY_STATUS = {
38
+ path: "/deploy-status",
39
+ port: PROJECT_SERVER_PORT
40
+ };
37
41
  //#endregion
38
42
  //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/core.js
39
43
  var _a$1;
@@ -5780,6 +5784,8 @@ const nullableOptionalTimestamp = string().nullable().optional();
5780
5784
  object({
5781
5785
  id: string().min(1),
5782
5786
  appId: string().min(1),
5787
+ /** Stable per-scope identifier; pass to `--credential` to pin a specific instance. */
5788
+ slug: string().min(1),
5783
5789
  label: string().min(1),
5784
5790
  scope: AppCredentialScopeSchema,
5785
5791
  lastRefreshedAt: string().nullable(),
@@ -5936,7 +5942,11 @@ object({
5936
5942
  /** When set, platform MCP resolve checks credential assignments before scope defaults. */
5937
5943
  assignmentTarget: McpCredentialAssignmentTargetSchema.optional(),
5938
5944
  /** Tool/step consumer id for assignment lookup (action slug or workflow step correlation id). */
5939
- consumerId: string().trim().min(1).optional()
5945
+ consumerId: string().trim().min(1).optional(),
5946
+ /** Explicit credential instance slug; overrides default resolution to pick that instance. */
5947
+ credentialSlug: string().trim().min(1).optional(),
5948
+ /** Project slug (CLI --project); the platform resolves it to a project and binds that scope. */
5949
+ projectSlug: string().trim().min(1).optional()
5940
5950
  });
5941
5951
  object({
5942
5952
  error: _enum([
@@ -7755,8 +7765,29 @@ async function pingProjectTarget(target, options = {}) {
7755
7765
  });
7756
7766
  }
7757
7767
  //#endregion
7768
+ //#region src/deploy-status.ts
7769
+ /**
7770
+ * Ask a running org machine which projects bootstrapped and which failed.
7771
+ * Best-effort: returns undefined on any error so callers can fall back to
7772
+ * treating every project as healthy (preserving pre-existing behavior).
7773
+ */
7774
+ async function fetchDeployStatus(baseUrl, options = {}) {
7775
+ const timeoutMs = options.timeoutMs ?? 15e3;
7776
+ try {
7777
+ const response = await (options.fetchImpl ?? fetch)(new URL(PROJECT_SERVER_DEPLOY_STATUS.path, baseUrl), { signal: AbortSignal.timeout(timeoutMs) });
7778
+ if (!response.ok) return;
7779
+ const data = await response.json();
7780
+ if (!data || !Array.isArray(data.projects)) return;
7781
+ return data;
7782
+ } catch (error) {
7783
+ console.warn(`[deploy-status] failed to fetch from ${baseUrl}:`, error);
7784
+ return;
7785
+ }
7786
+ }
7787
+ //#endregion
7758
7788
  exports.DEV_PLATFORM_WORKER_TOKEN = DEV_PLATFORM_WORKER_TOKEN;
7759
7789
  exports.PROJECT_DATABASE_ENV_KEYS = PROJECT_DATABASE_ENV_KEYS;
7790
+ exports.PROJECT_SERVER_DEPLOY_STATUS = PROJECT_SERVER_DEPLOY_STATUS;
7760
7791
  exports.PROJECT_SERVER_FRAMEWORK_NODE_MODULES = PROJECT_SERVER_FRAMEWORK_NODE_MODULES;
7761
7792
  exports.PROJECT_SERVER_FRAMEWORK_ROOT = PROJECT_SERVER_FRAMEWORK_ROOT;
7762
7793
  exports.PROJECT_SERVER_HEALTH = PROJECT_SERVER_HEALTH;
@@ -7770,6 +7801,7 @@ exports.canPingProjectTarget = canPingProjectTarget;
7770
7801
  exports.defaultHostingPlugin = defaultHostingPlugin;
7771
7802
  exports.dockerPlugin = dockerPlugin;
7772
7803
  exports.encodeOrgArtifacts = encodeOrgArtifacts;
7804
+ exports.fetchDeployStatus = fetchDeployStatus;
7773
7805
  exports.formatDockerEnv = formatDockerEnv;
7774
7806
  exports.parseOrgArtifactsFromEnv = parseOrgArtifactsFromEnv;
7775
7807
  exports.pingProject = pingProject;