@lukoweb/apitogo 0.1.85 → 0.1.87
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/cli/cli.js +11660 -2924
- package/dist/declarations/cli/platform/apply/index.d.ts +3 -0
- package/dist/declarations/cli/platform/client/deploy-server.d.ts +16 -0
- package/dist/declarations/cli/platform/client/platform-api.d.ts +397 -0
- package/dist/declarations/cli/platform/config.d.ts +20 -0
- package/dist/declarations/cli/platform/errors.d.ts +16 -0
- package/dist/declarations/cli/platform/helpers/backend-packaging.d.ts +11 -0
- package/dist/declarations/cli/platform/helpers/deploy-artifact-hash.d.ts +14 -0
- package/dist/declarations/cli/platform/helpers/dev-portal-backend-job.d.ts +25 -0
- package/dist/declarations/cli/platform/helpers/dev-portal-backend.d.ts +11 -0
- package/dist/declarations/cli/platform/helpers/dev-portal-landing.d.ts +99 -0
- package/dist/declarations/cli/platform/helpers/dev-portal-manifest.d.ts +167 -0
- package/dist/declarations/cli/platform/helpers/dev-portal-plan-sync.d.ts +20 -0
- package/dist/declarations/cli/platform/helpers/dev-portal-secrets.d.ts +61 -0
- package/dist/declarations/cli/platform/helpers/dev-portal-settings-kinds.d.ts +8 -0
- package/dist/declarations/cli/platform/helpers/dev-portal-site-api-url.d.ts +12 -0
- package/dist/declarations/cli/platform/helpers/dev-portal-site-validation.d.ts +22 -0
- package/dist/declarations/cli/platform/helpers/dev-portal-urls.d.ts +17 -0
- package/dist/declarations/cli/platform/helpers/fetch-retry.d.ts +17 -0
- package/dist/declarations/cli/platform/helpers/free-projects-quota.d.ts +14 -0
- package/dist/declarations/cli/platform/helpers/gateway-plan-sync.d.ts +26 -0
- package/dist/declarations/cli/platform/helpers/gateway-readiness.d.ts +11 -0
- package/dist/declarations/cli/platform/helpers/job-status.d.ts +12 -0
- package/dist/declarations/cli/platform/helpers/merge-dev-portal-settings.d.ts +26 -0
- package/dist/declarations/cli/platform/helpers/npm-build.d.ts +34 -0
- package/dist/declarations/cli/platform/helpers/openapi-gateway-servers.d.ts +23 -0
- package/dist/declarations/cli/platform/helpers/openapi.d.ts +24 -0
- package/dist/declarations/cli/platform/helpers/package-files.d.ts +1 -0
- package/dist/declarations/cli/platform/helpers/paid-gateway-platform-compat.d.ts +22 -0
- package/dist/declarations/cli/platform/helpers/platform-plan-catalog.d.ts +27 -0
- package/dist/declarations/cli/platform/helpers/platform-plan.d.ts +17 -0
- package/dist/declarations/cli/platform/helpers/poll.d.ts +21 -0
- package/dist/declarations/cli/platform/helpers/progress.d.ts +45 -0
- package/dist/declarations/cli/platform/helpers/project-name.d.ts +8 -0
- package/dist/declarations/cli/platform/helpers/public-routes.d.ts +4 -0
- package/dist/declarations/cli/platform/helpers/publish-ledger.d.ts +30 -0
- package/dist/declarations/cli/platform/helpers/publish-preflight.d.ts +60 -0
- package/dist/declarations/cli/platform/helpers/status.d.ts +7 -0
- package/dist/declarations/cli/platform/helpers/stripe-webhook.d.ts +3 -0
- package/dist/declarations/cli/platform/helpers/tarball.d.ts +11 -0
- package/dist/declarations/cli/platform/helpers/validate-dev-portal-readiness.d.ts +48 -0
- package/dist/declarations/cli/platform/helpers/wait-for-gateway-actions.d.ts +9 -0
- package/dist/declarations/cli/platform/helpers/warm-pool.d.ts +35 -0
- package/dist/declarations/cli/platform/helpers/zip.d.ts +6 -0
- package/dist/declarations/cli/platform/tools/backend.d.ts +45 -0
- package/dist/declarations/cli/platform/tools/dev-portal-bootstrap-shared.d.ts +25 -0
- package/dist/declarations/cli/platform/tools/dev-portal-publish.d.ts +45 -0
- package/dist/declarations/cli/platform/tools/dev-portal-site-build.d.ts +12 -0
- package/dist/declarations/cli/platform/tools/dev-portal.d.ts +84 -0
- package/dist/declarations/cli/platform/tools/gateway.d.ts +140 -0
- package/dist/declarations/cli/platform/tools/infrastructure.d.ts +47 -0
- package/dist/declarations/cli/platform/tools/lifecycle.d.ts +40 -0
- package/dist/declarations/cli/platform/tools/platform-plan.d.ts +43 -0
- package/dist/declarations/cli/platform/tools/projects.d.ts +27 -0
- package/dist/declarations/cli/platform/tools/subscription.d.ts +13 -0
- package/docs/cli/commands.md +14 -9
- package/docs/cli/go-live.md +2 -2
- package/docs/cli/setup.md +1 -1
- package/docs/guides/environment-variables.md +1 -1
- package/package.json +14 -2
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { type LandingManifestInput } from "./dev-portal-landing.js";
|
|
2
|
+
export declare const APITOGO_CONFIG_FILENAME = "apitogo.config.json";
|
|
3
|
+
export declare const DEV_PORTAL_MANIFEST_FILENAME = "apitogo.local.json";
|
|
4
|
+
export declare const PLACEHOLDER_DEV_PORTAL_API_URL = "https://dp-example.azurecontainerapps.io";
|
|
5
|
+
export interface ManifestPlanInput {
|
|
6
|
+
sku: string;
|
|
7
|
+
displayName: string;
|
|
8
|
+
priceAmount?: number;
|
|
9
|
+
priceCurrency?: string;
|
|
10
|
+
billingPeriod?: "month" | "year" | "monthly" | "annual";
|
|
11
|
+
limitsJson?: string;
|
|
12
|
+
includedActionKeys?: string[];
|
|
13
|
+
}
|
|
14
|
+
export declare function isPlanFree(plan: {
|
|
15
|
+
priceAmount?: number;
|
|
16
|
+
}): boolean;
|
|
17
|
+
export interface DevPortalLocalManifest {
|
|
18
|
+
siteName?: string;
|
|
19
|
+
branding?: {
|
|
20
|
+
title?: string;
|
|
21
|
+
logoUrl?: string;
|
|
22
|
+
};
|
|
23
|
+
pricing?: {
|
|
24
|
+
enabled?: boolean;
|
|
25
|
+
};
|
|
26
|
+
authentication?: {
|
|
27
|
+
enabled?: boolean;
|
|
28
|
+
apiBaseUrl?: string;
|
|
29
|
+
native?: {
|
|
30
|
+
enabled?: boolean;
|
|
31
|
+
};
|
|
32
|
+
email?: {
|
|
33
|
+
provider?: string;
|
|
34
|
+
from?: string;
|
|
35
|
+
};
|
|
36
|
+
providers?: Array<{
|
|
37
|
+
id: string;
|
|
38
|
+
displayName?: string;
|
|
39
|
+
authority?: string;
|
|
40
|
+
clientId?: string;
|
|
41
|
+
scopes?: string;
|
|
42
|
+
}>;
|
|
43
|
+
};
|
|
44
|
+
plans?: ManifestPlanInput[];
|
|
45
|
+
backend?: {
|
|
46
|
+
sourceDirectory?: string;
|
|
47
|
+
publishDirectory?: string;
|
|
48
|
+
openApiPath?: string;
|
|
49
|
+
runtime?: string;
|
|
50
|
+
runtimeVersion?: string;
|
|
51
|
+
deployed?: boolean;
|
|
52
|
+
};
|
|
53
|
+
gateway?: {
|
|
54
|
+
authMode?: "platformManagedEntra" | "bringYourOwnOidc";
|
|
55
|
+
oidcMetadataUrl?: string;
|
|
56
|
+
oidcAllowedIssuers?: string[];
|
|
57
|
+
oidcAudiences?: string[];
|
|
58
|
+
limitsJson?: string;
|
|
59
|
+
publicHealthActionKey?: string;
|
|
60
|
+
publicRoutes?: string[];
|
|
61
|
+
};
|
|
62
|
+
projectId?: string;
|
|
63
|
+
landing?: LandingManifestInput;
|
|
64
|
+
}
|
|
65
|
+
export declare function manifestFilePath(siteDirectory: string): string;
|
|
66
|
+
export declare function pathExists(filePath: string): Promise<boolean>;
|
|
67
|
+
export declare function normalizeBillingPeriod(period?: string): string;
|
|
68
|
+
export declare const DEFAULT_PLANS: ManifestPlanInput[];
|
|
69
|
+
export type DevPortalJourneyPhaseId = "shape" | "publish" | "postPublish";
|
|
70
|
+
export interface DevPortalSuggestedNextStep {
|
|
71
|
+
id: string;
|
|
72
|
+
phase: DevPortalJourneyPhaseId;
|
|
73
|
+
prompt: string;
|
|
74
|
+
tool: string;
|
|
75
|
+
optional?: boolean;
|
|
76
|
+
note?: string;
|
|
77
|
+
}
|
|
78
|
+
export interface DevPortalLocalCapability {
|
|
79
|
+
id: string;
|
|
80
|
+
label: string;
|
|
81
|
+
availableLocally: boolean;
|
|
82
|
+
requiresPublish?: boolean;
|
|
83
|
+
}
|
|
84
|
+
export interface DevPortalPublishPrerequisites {
|
|
85
|
+
nativeAuthRequired: boolean;
|
|
86
|
+
stripeRequired: boolean;
|
|
87
|
+
missingFields: string[];
|
|
88
|
+
manifestFieldIssues?: string[];
|
|
89
|
+
readyToPublish: boolean;
|
|
90
|
+
}
|
|
91
|
+
export interface DevPortalJourneyPhase {
|
|
92
|
+
id: DevPortalJourneyPhaseId;
|
|
93
|
+
title: string;
|
|
94
|
+
steps: DevPortalSuggestedNextStep[];
|
|
95
|
+
}
|
|
96
|
+
export declare const SCAFFOLD_LOCAL_CAPABILITIES: DevPortalLocalCapability[];
|
|
97
|
+
export interface DevPortalShapeGuideEntry {
|
|
98
|
+
target: string;
|
|
99
|
+
purpose: string;
|
|
100
|
+
tool?: string;
|
|
101
|
+
}
|
|
102
|
+
export declare const SCAFFOLD_SHAPE_GUIDE: DevPortalShapeGuideEntry[];
|
|
103
|
+
export declare const SCAFFOLD_OPENAPI_MISSING_NEXT_STEP: DevPortalSuggestedNextStep;
|
|
104
|
+
export declare const SCAFFOLD_SUGGESTED_NEXT_STEPS: DevPortalSuggestedNextStep[];
|
|
105
|
+
export declare function buildScaffoldJourneyPhases(steps?: DevPortalSuggestedNextStep[]): DevPortalJourneyPhase[];
|
|
106
|
+
export declare const SCAFFOLD_JOURNEY_PHASES: DevPortalJourneyPhase[];
|
|
107
|
+
export declare const SCAFFOLD_AGENT_INSTRUCTION = "Scaffold only \u2014 dependencies are installed but the dev server is not started. Tell the user the site is ready and to run npm run dev in outputDirectory. The home page lives in landing/LandingPage.tsx (starter hero + features). After npm run dev, ask if they want to customize the home page. When they do, always ask for their real content first (what the API does, key endpoints, audience, tone, desired sections) before editing \u2014 never invent placeholder copy unless they explicitly ask for placeholders \u2014 then edit that TSX file directly or call get_dev_portal_landing_guide for the component catalog. Do not write home page content to apitogo.config.json. Then ask what else they want (OpenAPI, plans, bootstrap API ToGo, or go live). Do not mention missing plans, null projectId, skipped bootstrap, publishPrerequisites, or other absent setup unless the user asks about publish or platform provisioning. One user intent \u2192 one MCP tool. When preview is running, shape-phase file edits hot-reload. Never pass restartPreview: true on update_dev_portal_manifest or set_dev_portal_theme (ignored; used to time out against npm run dev). For publish, the user saves OIDC (+ Stripe if paid) in .env using APITOGO_CONFIG_AUTHENTICATION__* keys \u2014 never collect secrets in chat. Call check_dev_portal_publish_readiness after they confirm, then publish_dev_portal. Do not call sync_gateway_plans_from_manifest before publish.";
|
|
108
|
+
export declare function manifestRequiresStripe(plans: ManifestPlanInput[] | undefined): boolean;
|
|
109
|
+
export declare function isNativeAuthEnabledInManifest(manifest: DevPortalLocalManifest): boolean;
|
|
110
|
+
export declare function readManifestAuthProviders(manifest: DevPortalLocalManifest): NonNullable<DevPortalLocalManifest["authentication"]>["providers"];
|
|
111
|
+
export declare function getPublishPrerequisites(manifest: DevPortalLocalManifest, secrets?: {
|
|
112
|
+
email?: {
|
|
113
|
+
connectionString?: string;
|
|
114
|
+
};
|
|
115
|
+
providers?: Record<string, {
|
|
116
|
+
clientSecret?: string;
|
|
117
|
+
}>;
|
|
118
|
+
stripe?: {
|
|
119
|
+
secretKey?: string;
|
|
120
|
+
webhookSecret?: string;
|
|
121
|
+
};
|
|
122
|
+
}, emailOptions?: {
|
|
123
|
+
platformManagedEmail?: boolean;
|
|
124
|
+
emailDomainStatus?: string;
|
|
125
|
+
}): DevPortalPublishPrerequisites;
|
|
126
|
+
export declare function resolveManifestNextStep(manifest: DevPortalLocalManifest, secrets?: {
|
|
127
|
+
email?: {
|
|
128
|
+
connectionString?: string;
|
|
129
|
+
};
|
|
130
|
+
providers?: Record<string, {
|
|
131
|
+
clientSecret?: string;
|
|
132
|
+
}>;
|
|
133
|
+
stripe?: {
|
|
134
|
+
secretKey?: string;
|
|
135
|
+
webhookSecret?: string;
|
|
136
|
+
};
|
|
137
|
+
}): string;
|
|
138
|
+
export declare function createScaffoldManifest(siteName?: string): DevPortalLocalManifest;
|
|
139
|
+
export declare function resolveProjectDisplayName(manifest: DevPortalLocalManifest, config?: Record<string, unknown>): string;
|
|
140
|
+
export declare function createDefaultManifest(siteName?: string): DevPortalLocalManifest;
|
|
141
|
+
export declare function applyScaffoldManifestPolicy(manifest: DevPortalLocalManifest, options: {
|
|
142
|
+
siteName?: string;
|
|
143
|
+
includeDefaultPlans?: boolean;
|
|
144
|
+
}): DevPortalLocalManifest;
|
|
145
|
+
export declare function mergePlansBySku(existing: ManifestPlanInput[] | undefined, patch: ManifestPlanInput[]): ManifestPlanInput[];
|
|
146
|
+
export declare function resolveBackendOpenApiPath(openApiPath: string | undefined, options: {
|
|
147
|
+
siteDirectory: string;
|
|
148
|
+
backendSourceDirectory?: string;
|
|
149
|
+
}): string | undefined;
|
|
150
|
+
export declare function toSiteRelativeOpenApiInput(siteDirectory: string, openApiAbsolutePath: string): string;
|
|
151
|
+
export declare function formatIgnoredManifestPatchWarning(ignoredKeys: string[]): string | undefined;
|
|
152
|
+
export interface NormalizedManifestPatch {
|
|
153
|
+
patch: Partial<DevPortalLocalManifest>;
|
|
154
|
+
ignoredKeys: string[];
|
|
155
|
+
}
|
|
156
|
+
export declare function normalizeManifestPatch(raw: Record<string, unknown>): NormalizedManifestPatch;
|
|
157
|
+
export declare function mergePublishPrerequisitesWithPlatformValidation(prerequisites: DevPortalPublishPrerequisites, manifestFieldIssues: string[]): DevPortalPublishPrerequisites;
|
|
158
|
+
export declare function mergeManifest(existing: DevPortalLocalManifest, patch: Partial<DevPortalLocalManifest>): DevPortalLocalManifest;
|
|
159
|
+
export declare function applyOpenApiToSiteConfig(config: Record<string, unknown>, options: {
|
|
160
|
+
input: string;
|
|
161
|
+
apiPath: string;
|
|
162
|
+
navLabel?: string;
|
|
163
|
+
}): Record<string, unknown>;
|
|
164
|
+
export declare function readManifest(siteDirectory: string): Promise<DevPortalLocalManifest | null>;
|
|
165
|
+
export declare function writeManifest(siteDirectory: string, manifest: DevPortalLocalManifest): Promise<string>;
|
|
166
|
+
export declare function plansToMockEnvValue(plans: ManifestPlanInput[] | undefined): string | null;
|
|
167
|
+
export declare function mockPlansPreviewChanged(before: ManifestPlanInput[] | undefined, after: ManifestPlanInput[] | undefined): boolean;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface DevPortalPlanCatalogItem {
|
|
2
|
+
sku: string;
|
|
3
|
+
displayName: string;
|
|
4
|
+
priceAmount?: number;
|
|
5
|
+
priceCurrency?: string;
|
|
6
|
+
billingPeriod?: string;
|
|
7
|
+
syncedAtUtc?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface DevPortalPlanCatalogResponse {
|
|
10
|
+
plans: DevPortalPlanCatalogItem[];
|
|
11
|
+
lastSyncedAtUtc?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface SyncDevPortalPlanCatalogOptions {
|
|
14
|
+
backendApiBaseUrl: string;
|
|
15
|
+
expectedPlanCount?: number;
|
|
16
|
+
retries?: number;
|
|
17
|
+
retryDelayMs?: number;
|
|
18
|
+
fetchImpl?: typeof fetch;
|
|
19
|
+
}
|
|
20
|
+
export declare function syncDevPortalPlanCatalog(options: SyncDevPortalPlanCatalogOptions): Promise<DevPortalPlanCatalogResponse>;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { type DevPortalLocalManifest, type DevPortalPublishPrerequisites } from "./dev-portal-manifest.js";
|
|
2
|
+
export declare const ENV_FILENAME = ".env";
|
|
3
|
+
export declare const ENV_EXAMPLE_FILENAME = ".env";
|
|
4
|
+
declare const AUTHENTICATION_SECRET_ENV_KEYS: readonly ["APITOGO_CONFIG_AUTHENTICATION__PROVIDERS__{providerId}__CLIENT_SECRET", "APITOGO_CONFIG_AUTHENTICATION__STRIPE__SECRET_KEY", "APITOGO_CONFIG_AUTHENTICATION__STRIPE__WEBHOOK_SECRET"];
|
|
5
|
+
export interface DevPortalLocalSecrets {
|
|
6
|
+
email?: {
|
|
7
|
+
connectionString?: string;
|
|
8
|
+
};
|
|
9
|
+
providers?: Record<string, {
|
|
10
|
+
clientSecret?: string;
|
|
11
|
+
}>;
|
|
12
|
+
stripe?: {
|
|
13
|
+
secretKey?: string;
|
|
14
|
+
webhookSecret?: string;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export interface DevPortalSecretsStatus {
|
|
18
|
+
envPath: string;
|
|
19
|
+
envExamplePath: string;
|
|
20
|
+
envExists: boolean;
|
|
21
|
+
envLocalExists: boolean;
|
|
22
|
+
hasEmailConnectionString: boolean;
|
|
23
|
+
providerSecretStatus: Record<string, boolean>;
|
|
24
|
+
hasStripeSecretKey: boolean;
|
|
25
|
+
hasStripeWebhookSecret: boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface DevPortalPublishConfig {
|
|
28
|
+
manifest: DevPortalLocalManifest;
|
|
29
|
+
secrets: DevPortalLocalSecrets;
|
|
30
|
+
publishPrerequisites: DevPortalPublishPrerequisites;
|
|
31
|
+
secretsStatus: DevPortalSecretsStatus;
|
|
32
|
+
}
|
|
33
|
+
export declare function normalizeEnvPathSegment(segment: string): string;
|
|
34
|
+
export declare function readSecretsFile(siteDirectory: string): Promise<DevPortalLocalSecrets | null>;
|
|
35
|
+
export declare function loadSiteEnv(siteDirectory: string): Promise<NodeJS.ProcessEnv>;
|
|
36
|
+
export declare function readAuthenticationSecretsFromEnv(env: NodeJS.ProcessEnv): DevPortalLocalSecrets;
|
|
37
|
+
export declare function buildAuthConfigJson(manifest: DevPortalLocalManifest): Record<string, unknown>;
|
|
38
|
+
export declare function buildAuthSecretsJson(secrets: DevPortalLocalSecrets, options?: {
|
|
39
|
+
platformManagedEmail?: boolean;
|
|
40
|
+
}): Record<string, unknown>;
|
|
41
|
+
export declare function envFilePath(siteDirectory: string): string;
|
|
42
|
+
export declare function envExampleFilePath(siteDirectory: string): string;
|
|
43
|
+
export declare function createEnvContent(): string;
|
|
44
|
+
export declare const createEnvExampleContent: typeof createEnvContent;
|
|
45
|
+
export declare function getSecretsStatus(siteDirectory: string, manifest: DevPortalLocalManifest, secrets: DevPortalLocalSecrets | null, envExists: boolean): DevPortalSecretsStatus;
|
|
46
|
+
export declare function patchContainsSecrets(patch: Record<string, unknown>): boolean;
|
|
47
|
+
export declare function assertPatchHasNoSecrets(patch: Record<string, unknown>): void;
|
|
48
|
+
export declare function validateSecretsForPublish(manifest: DevPortalLocalManifest, secrets: DevPortalLocalSecrets, emailOptions?: {
|
|
49
|
+
platformManagedEmail?: boolean;
|
|
50
|
+
emailDomainStatus?: string;
|
|
51
|
+
}): void;
|
|
52
|
+
export declare function resolvePublishConfig(siteDirectory: string, emailOptions?: {
|
|
53
|
+
platformManagedEmail?: boolean;
|
|
54
|
+
emailDomainStatus?: string;
|
|
55
|
+
}): Promise<DevPortalPublishConfig>;
|
|
56
|
+
export declare function writeScaffoldEnv(siteDirectory: string): Promise<string[]>;
|
|
57
|
+
export declare const writeScaffoldEnvExample: typeof writeScaffoldEnv;
|
|
58
|
+
export declare const writeScaffoldSecretsArtifacts: typeof writeScaffoldEnv;
|
|
59
|
+
export declare const SECRETS_COLLECTION_INSTRUCTION: string;
|
|
60
|
+
export declare const PAID_PLAN_SETUP_INSTRUCTION: string;
|
|
61
|
+
export { AUTHENTICATION_SECRET_ENV_KEYS };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { PlatformApiClient } from "../client/platform-api.js";
|
|
2
|
+
import type { ApitogoConfig } from "../config.js";
|
|
3
|
+
export declare const SITE_API_BASE_URL_ENV_KEY = "VITE_APITOGO_AUTHENTICATION_API_BASE_URL";
|
|
4
|
+
export declare function isPlaceholderDevPortalApiUrl(apiBaseUrl: string | undefined | null): boolean;
|
|
5
|
+
export declare function readSiteApiBaseUrl(sourceDirectory: string): Promise<string | null>;
|
|
6
|
+
export declare function patchSiteApiBaseUrl(sourceDirectory: string, apiBaseUrl: string): Promise<void>;
|
|
7
|
+
export declare function ensureLiveSiteApiBaseUrlForBuild(_client: PlatformApiClient, config: ApitogoConfig, args: {
|
|
8
|
+
sourceDirectory: string;
|
|
9
|
+
projectId?: string;
|
|
10
|
+
apiBaseUrl?: string;
|
|
11
|
+
}, resolveFromProject: (projectId: string, apiBaseUrl?: string) => Promise<string>): Promise<string>;
|
|
12
|
+
export declare function assertDeployableDistHasLiveApiBaseUrl(distDirectory: string, expectedApiBaseUrl?: string | null): Promise<void>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type * as TS from "typescript";
|
|
2
|
+
export interface SiteValidationIssue {
|
|
3
|
+
file: string;
|
|
4
|
+
message: string;
|
|
5
|
+
}
|
|
6
|
+
export interface SiteValidationResult {
|
|
7
|
+
valid: boolean;
|
|
8
|
+
checkedFiles: string[];
|
|
9
|
+
issues: SiteValidationIssue[];
|
|
10
|
+
skippedChecks: string[];
|
|
11
|
+
}
|
|
12
|
+
type TypeScriptModule = typeof TS;
|
|
13
|
+
export declare function loadTypeScriptForSite(sourceDirectory: string): Promise<TypeScriptModule | null>;
|
|
14
|
+
export declare function checkTsxSyntax(ts: TypeScriptModule, fileName: string, content: string): string[];
|
|
15
|
+
export declare function validateSiteConfigStructure(config: unknown, sourceDirectory: string): Promise<string[]>;
|
|
16
|
+
export interface ValidateSiteOptions {
|
|
17
|
+
extraTsxFiles?: string[];
|
|
18
|
+
}
|
|
19
|
+
export declare function validateDevPortalSiteConfig(sourceDirectory: string, options?: ValidateSiteOptions): Promise<SiteValidationResult>;
|
|
20
|
+
export declare function formatSiteValidationErrors(result: SiteValidationResult): string;
|
|
21
|
+
export declare function buildSiteValidationResponseFields(result: SiteValidationResult): Record<string, unknown>;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ProjectDto } from "../client/platform-api.js";
|
|
2
|
+
export interface DevPortalUrls {
|
|
3
|
+
swaUrl: string;
|
|
4
|
+
swaOrigin: string;
|
|
5
|
+
stripeSuccessUrl: string;
|
|
6
|
+
stripeCancelUrl: string;
|
|
7
|
+
oidcRedirectUris: Array<{
|
|
8
|
+
providerId: string;
|
|
9
|
+
redirectUri: string;
|
|
10
|
+
}>;
|
|
11
|
+
stripeWebhookUrl: string;
|
|
12
|
+
backendApiBaseUrl: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function resolveSwaHostname(project: ProjectDto): string | null;
|
|
15
|
+
export declare function resolveSwaHostnameWithFallback(project: ProjectDto, platformSiteUrl?: string | null): string | null;
|
|
16
|
+
export declare function resolveSwaUrl(project: ProjectDto): string | null;
|
|
17
|
+
export declare function resolveDevPortalUrls(project: ProjectDto, backendFqdn: string, providerIds?: string[], platformSiteUrl?: string | null): DevPortalUrls;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const RETRIABLE_HTTP_STATUSES: Set<number>;
|
|
2
|
+
export interface FetchRetryOptions {
|
|
3
|
+
maxRetries?: number;
|
|
4
|
+
baseDelayMs?: number;
|
|
5
|
+
maxDelayMs?: number;
|
|
6
|
+
retryMutatingOnServerError?: boolean;
|
|
7
|
+
method?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function isRetriableHttpStatus(status: number): boolean;
|
|
10
|
+
export declare function isNetworkError(error: unknown): boolean;
|
|
11
|
+
export declare function withFetchRetry<T>(operation: () => Promise<T>, options?: FetchRetryOptions & {
|
|
12
|
+
shouldRetryResult?: (result: T) => {
|
|
13
|
+
retry: boolean;
|
|
14
|
+
retryAfterMs?: number;
|
|
15
|
+
};
|
|
16
|
+
}): Promise<T>;
|
|
17
|
+
export declare function fetchWithRetry(input: string | URL, init?: RequestInit, options?: FetchRetryOptions): Promise<Response>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface FreeProjectsQuota {
|
|
2
|
+
allowance: number;
|
|
3
|
+
used: number;
|
|
4
|
+
remaining: number;
|
|
5
|
+
}
|
|
6
|
+
export declare function freeProjectsQuotaFromTenant(tenant: {
|
|
7
|
+
freeProjectsAllowance?: number;
|
|
8
|
+
freeProjectsUsed?: number;
|
|
9
|
+
freeProjectsRemaining?: number;
|
|
10
|
+
}): FreeProjectsQuota | null;
|
|
11
|
+
export declare function isFreeProjectQuotaError(message: string): boolean;
|
|
12
|
+
export declare function parseToolJsonResult(result: string): {
|
|
13
|
+
status?: string;
|
|
14
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { GatewayPlanDto, PlatformApiClient } from "../client/platform-api.js";
|
|
2
|
+
import type { ApitogoConfig } from "../config.js";
|
|
3
|
+
import { type ManifestPlanInput } from "./dev-portal-manifest.js";
|
|
4
|
+
export declare function mergeActionKeys(existing: string[], additions: string[]): string[];
|
|
5
|
+
export declare function subtractActionKeys(existing: string[], removals: string[]): string[];
|
|
6
|
+
export interface GatewayPlanSortTarget {
|
|
7
|
+
planId: string;
|
|
8
|
+
sku: string;
|
|
9
|
+
sortOrder: number;
|
|
10
|
+
}
|
|
11
|
+
export interface UpsertGatewayPlansOptions {
|
|
12
|
+
syncActionsOnly?: boolean;
|
|
13
|
+
deferActionKeys?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare function resolveSiteLinkedProjectId(manifestProjectId?: string | null, explicitProjectId?: string | null): string | undefined;
|
|
16
|
+
export declare function skippedNoProjectIdPlanSync(tool: string): {
|
|
17
|
+
status: "skipped";
|
|
18
|
+
reason: "no_project_id";
|
|
19
|
+
tool: string;
|
|
20
|
+
message: string;
|
|
21
|
+
};
|
|
22
|
+
export declare const GATEWAY_PLAN_SORT_TEMP_OFFSET = 1000;
|
|
23
|
+
export declare function buildGatewayPlanSortTargets(manifestPlans: ManifestPlanInput[], existingPlans: GatewayPlanDto[]): GatewayPlanSortTarget[];
|
|
24
|
+
export declare function buildGatewayPlanSortTargetsFromIds(manifestPlans: ManifestPlanInput[], planIdsBySku: Map<string, string>, skuById?: Map<string, GatewayPlanDto>): GatewayPlanSortTarget[];
|
|
25
|
+
export declare function applyGatewayPlanSortOrders(client: PlatformApiClient, config: ApitogoConfig, projectId: string, targets: GatewayPlanSortTarget[]): Promise<unknown[]>;
|
|
26
|
+
export declare function upsertGatewayPlansFromManifest(client: PlatformApiClient, config: ApitogoConfig, projectId: string, plans: ManifestPlanInput[], options?: UpsertGatewayPlansOptions): Promise<unknown[]>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { BackendSummaryDto } from "../client/platform-api.js";
|
|
2
|
+
export type GatewayRecommendedAction = "deploy_backend" | "sync_plan_actions" | "ready";
|
|
3
|
+
export declare function resolveApimDirectGatewayUrl(projectId: string, backendSummary: Pick<BackendSummaryDto, "backendUrl">): string;
|
|
4
|
+
export declare function buildApimDirectGatewayUrl(projectId: string): string;
|
|
5
|
+
export declare function probeCustomDomainTls(url: string): Promise<boolean>;
|
|
6
|
+
export declare function resolveGatewayRecommendedAction(options: {
|
|
7
|
+
backendSummary: BackendSummaryDto;
|
|
8
|
+
actionCount: number;
|
|
9
|
+
hasBackendSource?: boolean;
|
|
10
|
+
}): GatewayRecommendedAction;
|
|
11
|
+
export declare function buildGatewayReadinessRecoveryHint(action: GatewayRecommendedAction, customDomainTlsReady: boolean): string | undefined;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type JobLogMessage } from "./progress.js";
|
|
2
|
+
import { type AgentStatus } from "./status.js";
|
|
3
|
+
export declare function formatJobStatusResponse(options: {
|
|
4
|
+
agentStatus: AgentStatus;
|
|
5
|
+
platformStatus: string;
|
|
6
|
+
messages: JobLogMessage[];
|
|
7
|
+
stepLabel?: string;
|
|
8
|
+
resourceType?: string | null;
|
|
9
|
+
terminal: boolean;
|
|
10
|
+
message?: string;
|
|
11
|
+
extra?: Record<string, unknown>;
|
|
12
|
+
}): Record<string, unknown>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { DevPortalSettingsDto, UpsertDevPortalSettingsRequest } from "../client/platform-api.js";
|
|
2
|
+
export declare const LOCAL_DEV_PORTAL_SETTINGS_DEFAULTS: {
|
|
3
|
+
readonly gitHubOwner: "local";
|
|
4
|
+
readonly gitHubRepo: "dev-portal-site";
|
|
5
|
+
readonly pagesPath: "pages";
|
|
6
|
+
readonly logoKind: "RepoRelative";
|
|
7
|
+
readonly openApiSourceKind: "RepoRelative";
|
|
8
|
+
};
|
|
9
|
+
export type PatchDevPortalSettingsInput = {
|
|
10
|
+
gitHubOwner?: string;
|
|
11
|
+
gitHubRepo?: string;
|
|
12
|
+
defaultBranch?: string;
|
|
13
|
+
pagesPath?: string;
|
|
14
|
+
logoValue?: string;
|
|
15
|
+
logoDarkValue?: string;
|
|
16
|
+
logoKind?: string;
|
|
17
|
+
openApiSourceKind?: string;
|
|
18
|
+
openApiValue?: string;
|
|
19
|
+
authConfigJson?: string;
|
|
20
|
+
authSecretsJson?: string;
|
|
21
|
+
stripeSecretKey?: string;
|
|
22
|
+
stripeWebhookSecret?: string;
|
|
23
|
+
stripeSuccessUrl?: string;
|
|
24
|
+
stripeCancelUrl?: string;
|
|
25
|
+
};
|
|
26
|
+
export declare function mergeDevPortalSettingsPatch(current: DevPortalSettingsDto | null, patch: PatchDevPortalSettingsInput): UpsertDevPortalSettingsRequest;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export declare class NpmBuildError extends Error {
|
|
2
|
+
readonly buildLog: string;
|
|
3
|
+
readonly exitCode: number | null;
|
|
4
|
+
constructor(message: string, buildLog: string, exitCode: number | null);
|
|
5
|
+
}
|
|
6
|
+
export interface NpmBuildResult {
|
|
7
|
+
distPath: string;
|
|
8
|
+
durationMs: number;
|
|
9
|
+
buildLog: string;
|
|
10
|
+
}
|
|
11
|
+
export interface NpmInstallResult {
|
|
12
|
+
durationMs: number;
|
|
13
|
+
installLog: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function runNpmInstall(sourceDirectory: string, options?: {
|
|
16
|
+
nodeVersion?: string;
|
|
17
|
+
}): Promise<NpmInstallResult>;
|
|
18
|
+
export declare function runNpmBuild(sourceDirectory: string, options?: {
|
|
19
|
+
nodeVersion?: string;
|
|
20
|
+
env?: Record<string, string>;
|
|
21
|
+
}): Promise<NpmBuildResult>;
|
|
22
|
+
export declare function readPackageName(sourceDirectory: string): Promise<string | null>;
|
|
23
|
+
export interface NpmDevResult {
|
|
24
|
+
localUrl: string;
|
|
25
|
+
pid: number;
|
|
26
|
+
durationMs: number;
|
|
27
|
+
devLog: string;
|
|
28
|
+
}
|
|
29
|
+
export declare function runNpmDev(sourceDirectory: string, options?: {
|
|
30
|
+
nodeVersion?: string;
|
|
31
|
+
port?: number;
|
|
32
|
+
host?: boolean;
|
|
33
|
+
skipInstall?: boolean;
|
|
34
|
+
}): Promise<NpmDevResult>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { PlatformApiClient } from "../client/platform-api.js";
|
|
2
|
+
import { type DevPortalLocalManifest } from "./dev-portal-manifest.js";
|
|
3
|
+
export declare const GATEWAY_URL_ENV_KEY = "APITOGO_GATEWAY_URL";
|
|
4
|
+
export declare const PUBLISH_OPENAPI_RELATIVE = ".apitogo/openapi-publish.json";
|
|
5
|
+
export declare function normalizeGatewayUrl(gatewayUrl: string): string;
|
|
6
|
+
export declare function withGatewayServers(doc: Record<string, unknown>, gatewayUrl: string): Record<string, unknown>;
|
|
7
|
+
export declare function resolveProjectGatewayUrl(client: PlatformApiClient, projectId: string): Promise<string | null>;
|
|
8
|
+
export declare function materializePublishOpenApiWithGateway(siteDirectory: string, sourceOpenApiPath: string, gatewayUrl: string): Promise<{
|
|
9
|
+
outputPath: string;
|
|
10
|
+
relativeInput: string;
|
|
11
|
+
}>;
|
|
12
|
+
export declare function pointSiteApisAtPublishOpenApi(siteDirectory: string, relativeInput: string): Promise<{
|
|
13
|
+
restore: () => Promise<void>;
|
|
14
|
+
}>;
|
|
15
|
+
export declare function prepareOpenApiServersForGatewayBuild(options: {
|
|
16
|
+
siteDirectory: string;
|
|
17
|
+
manifest: DevPortalLocalManifest | null;
|
|
18
|
+
gatewayUrl: string;
|
|
19
|
+
}): Promise<{
|
|
20
|
+
relativeInput: string;
|
|
21
|
+
outputPath: string;
|
|
22
|
+
restore: () => Promise<void>;
|
|
23
|
+
} | null>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface ValidateOpenApiResult {
|
|
2
|
+
valid: boolean;
|
|
3
|
+
errors: string[];
|
|
4
|
+
version?: string;
|
|
5
|
+
title?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const OPENAPI_BASENAMES: readonly ["openapi.yaml", "openapi.yml", "openapi.json", "swagger.yaml", "swagger.yml", "swagger.json"];
|
|
8
|
+
export interface NearbyOpenApiDiscovery {
|
|
9
|
+
status: "found" | "not_found" | "invalid";
|
|
10
|
+
selectedPath?: string;
|
|
11
|
+
version?: string;
|
|
12
|
+
title?: string;
|
|
13
|
+
candidates: string[];
|
|
14
|
+
searchedDirectories: string[];
|
|
15
|
+
invalidCandidates?: Array<{
|
|
16
|
+
path: string;
|
|
17
|
+
errors: string[];
|
|
18
|
+
}>;
|
|
19
|
+
}
|
|
20
|
+
export declare function discoverNearbyOpenApi(siteDirectory: string): Promise<NearbyOpenApiDiscovery>;
|
|
21
|
+
export declare const OPENAPI_NOT_FOUND_SUGGESTION = "No OpenAPI file found near the site (checked parent, sibling folders, and the site directory for openapi.yaml|yml|json / swagger.yaml|yml|json). Ask the user for a path, or offer to draft a starter OpenAPI 3 spec from their API description, write it next to the site (e.g. ../openapi.yaml), then call set_dev_portal_openapi.";
|
|
22
|
+
export declare const OPENAPI_NOT_FOUND_AGENT_INSTRUCTION = "No OpenAPI was auto-discovered. Ask if they already have a spec path; if not, offer to create a starter OpenAPI 3 file for them from a short description of their API (paths/operations), write it beside the site, then call set_dev_portal_openapi. Do not invent a large fake API unless they ask for placeholders.";
|
|
23
|
+
export declare const OPENAPI_WIRED_AGENT_INSTRUCTION = "OpenAPI was auto-discovered and wired to /api. Do not ask to add OpenAPI unless the user wants a different spec. Restart local preview after create so /api registers.";
|
|
24
|
+
export declare function validateOpenApiFile(filePath: string): Promise<ValidateOpenApiResult>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function collectPackageableFiles(sourceDirectory: string): Promise<string[]>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type ManifestPlanInput } from "./dev-portal-manifest.js";
|
|
2
|
+
export interface PaidManifestPlanSummary {
|
|
3
|
+
sku: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
priceAmount: number;
|
|
6
|
+
priceCurrency?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function listPaidManifestPlans(plans: ManifestPlanInput[] | undefined): PaidManifestPlanSummary[];
|
|
9
|
+
export declare function isFreePlatformTier(planTier: string | undefined | null): boolean;
|
|
10
|
+
export declare function formatPaidPlanList(plans: PaidManifestPlanSummary[]): string;
|
|
11
|
+
export interface PaidGatewayOnFreeConflict {
|
|
12
|
+
reason: "paid_gateway_plans_require_starter";
|
|
13
|
+
paidPlans: PaidManifestPlanSummary[];
|
|
14
|
+
userMessage: string;
|
|
15
|
+
agentInstruction: string;
|
|
16
|
+
options: Array<{
|
|
17
|
+
id: "upgrade_platform_plan" | "remove_paid_gateway_plans";
|
|
18
|
+
label: string;
|
|
19
|
+
nextStep: string;
|
|
20
|
+
}>;
|
|
21
|
+
}
|
|
22
|
+
export declare function buildPaidGatewayOnFreeConflict(plans: ManifestPlanInput[] | undefined): PaidGatewayOnFreeConflict | null;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { FreeProjectsQuota } from "./free-projects-quota.js";
|
|
2
|
+
export type PlatformPlanId = "free" | "starter" | "professional";
|
|
3
|
+
export interface PlatformPlanOption {
|
|
4
|
+
id: PlatformPlanId;
|
|
5
|
+
displayName: string;
|
|
6
|
+
priceLabel: string;
|
|
7
|
+
priceAmountUsd: number | null;
|
|
8
|
+
billingPeriod: "month";
|
|
9
|
+
summary: string;
|
|
10
|
+
infrastructure: string;
|
|
11
|
+
features: string[];
|
|
12
|
+
limitations: string[];
|
|
13
|
+
}
|
|
14
|
+
export declare const PLATFORM_PLAN_CATALOG: PlatformPlanOption[];
|
|
15
|
+
export declare const PLATFORM_PLAN_USER_PROMPT = "Which API ToGo platform plan do you want for this project \u2014 Free, Starter, or Professional?";
|
|
16
|
+
export declare function formatFreeProjectsQuotaHint(quota: FreeProjectsQuota): string;
|
|
17
|
+
export declare function buildPlatformPlanSelectionAgentInstruction(quota?: FreeProjectsQuota | null): string;
|
|
18
|
+
export declare const PLATFORM_PLAN_SELECTION_AGENT_INSTRUCTION: string;
|
|
19
|
+
export declare function getPlatformPlanCatalogPayload(quota?: FreeProjectsQuota | null): {
|
|
20
|
+
note: string;
|
|
21
|
+
freeProjectsQuota?: FreeProjectsQuota | undefined;
|
|
22
|
+
freeProjectsQuotaHint?: string | undefined;
|
|
23
|
+
freePlanAvailable?: boolean | undefined;
|
|
24
|
+
platformPlanCatalog: PlatformPlanOption[];
|
|
25
|
+
platformPlanUserPrompt: string;
|
|
26
|
+
platformPlanSelectionAgentInstruction: string;
|
|
27
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { PlatformApiClient, ProjectSubscriptionDto } from "../client/platform-api.js";
|
|
2
|
+
import type { ProgressReporter } from "./progress.js";
|
|
3
|
+
export declare function isPlatformPlanUnselected(planTier: string | undefined | null): boolean;
|
|
4
|
+
export declare function isPlatformPlanSelected(subscription: ProjectSubscriptionDto): boolean;
|
|
5
|
+
export declare function isPaidPlanTier(planTier: string): boolean;
|
|
6
|
+
export declare function isPaidPlanActive(subscription: ProjectSubscriptionDto): boolean;
|
|
7
|
+
export declare function isPlatformPlanReady(subscription: ProjectSubscriptionDto): boolean;
|
|
8
|
+
export interface PlatformPlanWaitResult {
|
|
9
|
+
status: "succeeded" | "timeout" | "failed";
|
|
10
|
+
subscription: ProjectSubscriptionDto;
|
|
11
|
+
timedOut: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare function waitForPlatformPlan(client: PlatformApiClient, projectId: string, options?: {
|
|
14
|
+
timeoutMs?: number;
|
|
15
|
+
pollIntervalMs?: number;
|
|
16
|
+
progress?: ProgressReporter;
|
|
17
|
+
}): Promise<PlatformPlanWaitResult>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type ProgressReporter } from "./progress.js";
|
|
2
|
+
import { type AgentStatus } from "./status.js";
|
|
3
|
+
export interface PollOptions<T> {
|
|
4
|
+
poll: () => Promise<T>;
|
|
5
|
+
isTerminal: (value: T) => boolean;
|
|
6
|
+
getStatus: (value: T) => AgentStatus;
|
|
7
|
+
timeoutMs?: number;
|
|
8
|
+
intervalMs?: number;
|
|
9
|
+
onPoll?: (value: T) => void;
|
|
10
|
+
onPollError?: (error: unknown, last: T | undefined) => PollResult<T> | undefined;
|
|
11
|
+
progress?: ProgressReporter;
|
|
12
|
+
stepLabel?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface PollResult<T> {
|
|
15
|
+
status: AgentStatus;
|
|
16
|
+
value: T;
|
|
17
|
+
timedOut: boolean;
|
|
18
|
+
cancelled?: boolean;
|
|
19
|
+
completedViaNotFound?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export declare function pollUntilTerminal<T>(options: PollOptions<T>): Promise<PollResult<T>>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export interface JobLogMessage {
|
|
2
|
+
timestamp: string;
|
|
3
|
+
level: string;
|
|
4
|
+
message: string;
|
|
5
|
+
}
|
|
6
|
+
export interface ProgressReporter {
|
|
7
|
+
onStep(step: string, detail?: {
|
|
8
|
+
platformStatus?: string;
|
|
9
|
+
message?: string;
|
|
10
|
+
}): Promise<void>;
|
|
11
|
+
onNewMessages(messages: JobLogMessage[]): Promise<void>;
|
|
12
|
+
isCancelled(): boolean;
|
|
13
|
+
child(stepLabel: string): ProgressReporter;
|
|
14
|
+
}
|
|
15
|
+
export interface McpToolExtra {
|
|
16
|
+
_meta?: {
|
|
17
|
+
progressToken?: string | number;
|
|
18
|
+
};
|
|
19
|
+
sendNotification?: (notification: {
|
|
20
|
+
method: string;
|
|
21
|
+
params: Record<string, unknown>;
|
|
22
|
+
}) => Promise<void>;
|
|
23
|
+
signal?: AbortSignal;
|
|
24
|
+
}
|
|
25
|
+
export declare const RECENT_JOB_MESSAGE_LIMIT = 5;
|
|
26
|
+
export declare function recentJobMessages(messages: JobLogMessage[] | undefined): JobLogMessage[];
|
|
27
|
+
export declare function newMessagesSince(previousCount: number, messages: JobLogMessage[] | undefined): JobLogMessage[];
|
|
28
|
+
export declare function deriveCurrentStep(platformStatus: string, messages: JobLogMessage[] | undefined, stepLabel?: string): string;
|
|
29
|
+
export declare function buildProgressSummary(options: {
|
|
30
|
+
stepLabel: string;
|
|
31
|
+
messages: JobLogMessage[] | undefined;
|
|
32
|
+
startedAtMs: number;
|
|
33
|
+
terminalStatus: string;
|
|
34
|
+
}): {
|
|
35
|
+
stepsCompleted: string;
|
|
36
|
+
lastMessage: string | null;
|
|
37
|
+
elapsedMs: number;
|
|
38
|
+
terminalStatus: string;
|
|
39
|
+
};
|
|
40
|
+
export declare function createMcpProgressReporter(extra?: McpToolExtra): ProgressReporter;
|
|
41
|
+
export interface PollableJobValue {
|
|
42
|
+
status: string;
|
|
43
|
+
messages?: JobLogMessage[];
|
|
44
|
+
}
|
|
45
|
+
export declare function reportPollProgress(progress: ProgressReporter | undefined, stepLabel: string, value: PollableJobValue): Promise<void>;
|