@walkeros/cli 4.7.2-next-1791147139360 → 4.7.2
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 +24 -6
- package/dist/cli.js +1457 -1374
- package/dist/examples/flow-complete.json +52 -37
- package/dist/examples/flow-complete.md +19 -8
- package/dist/examples/index.d.ts +27 -8
- package/dist/examples/index.js +73 -47
- package/dist/examples/index.js.map +1 -1
- package/dist/index.d.ts +13 -3
- package/dist/index.js +22 -7
- package/dist/index.js.map +1 -1
- package/examples/flow-complete.json +52 -37
- package/examples/flow-complete.md +19 -8
- package/package.json +29 -29
package/dist/index.d.ts
CHANGED
|
@@ -738,7 +738,7 @@ type ValidateOptions = z.infer<typeof ValidateOptionsSchema>;
|
|
|
738
738
|
* Every code an error, warning or skip of `validate` can carry. Agents and
|
|
739
739
|
* tests branch on these, never on message text.
|
|
740
740
|
*/
|
|
741
|
-
declare const VALIDATE_CODES: readonly ["INPUT_ERROR", "SERIALIZATION_ERROR", "OPTION_NOT_APPLICABLE", "FLOW_NOT_FOUND", "ENTRY_NOT_FOUND", "AMBIGUOUS_ENTRY", "UNSUPPORTED_SECTION", "INVALID_PATH", "SCHEMA_VALIDATION", "CONFIG_WARNING", "EMPTY_FLOWS", "UNKNOWN_KEY", "CONFLICT", "MISSING_PACKAGE", "OBSOLETE_CODE_STRING", "INVALID_IMPORT", "INVALID_CODE_SHAPE", "PACKAGE_VERSION_MISSING", "DEPRECATED_PACKAGE", "UNKNOWN_ROUTE_TARGET", "ROUTE_DEAD_CODE", "ROUTE_EMPTY_MANY", "ROUTE_SINGLE_MANY", "ROUTE_FIRST_MATCH", "INCOMPATIBLE_EXAMPLES", "EXAMPLES_INCOMPLETE", "CONTRACT_VIOLATION", "MAPPING_DOT_KEY", "FLOW_REF_WARNING", "FLOW_CYCLE", "VAR_CYCLE", "INVALID_COMPONENT_NAME", "INVALID_REFERENCE", "STORE_REFERENCE_NOT_FOUND", "UNRESOLVED_REFERENCE", "MISSING_ENV", "WEB_SECRET_REF", "UNRESOLVED_CONTRACT", "ENTRY_SCHEMA", "NO_CONTRACT_SECTION", "INVALID_CONTRACT", "FLAT_CONTRACT_SHAPE", "INVALID_CONTRACT_ENTRY", "UNKNOWN_CONTRACT_KEY", "INVALID_TAGGING", "INVALID_SCHEMA", "INVALID_EXTENDS", "INVALID_SECTION", "INVALID_EVENTS", "CIRCULAR_EXTENDS", "INVALID_ENTITY_KEY", "INVALID_ENTITY", "INVALID_ACTION_KEY", "INVALID_SCHEMA_ENTRY", "NOT_AN_OBJECT", "MISSING_EVENT_NAME", "EMPTY_EVENT_NAME", "INVALID_EVENT_NAME", "INVALID_MAPPING_TYPE", "INVALID_EVENT_PATTERN", "INVALID_RULE_TYPE", "CATCH_ALL_NOT_LAST", "GATED_BY_ERRORS", "CONTRACT_NOT_STATIC", "NO_PACKAGE", "NO_SETTINGS_SCHEMA", "SCHEMA_UNAVAILABLE"];
|
|
741
|
+
declare const VALIDATE_CODES: readonly ["INPUT_ERROR", "SERIALIZATION_ERROR", "OPTION_NOT_APPLICABLE", "FLOW_NOT_FOUND", "ENTRY_NOT_FOUND", "AMBIGUOUS_ENTRY", "UNSUPPORTED_SECTION", "INVALID_PATH", "SCHEMA_VALIDATION", "CONFIG_WARNING", "EMPTY_FLOWS", "UNKNOWN_KEY", "CONFLICT", "MISSING_PACKAGE", "OBSOLETE_CODE_STRING", "INVALID_IMPORT", "INVALID_CODE_SHAPE", "PACKAGE_VERSION_MISSING", "DEPRECATED_PACKAGE", "UNKNOWN_ROUTE_TARGET", "ROUTE_DEAD_CODE", "ROUTE_EMPTY_MANY", "ROUTE_SINGLE_MANY", "ROUTE_FIRST_MATCH", "INCOMPATIBLE_EXAMPLES", "EXAMPLES_INCOMPLETE", "CONTRACT_VIOLATION", "MAPPING_DOT_KEY", "FLOW_REF_WARNING", "FLOW_CYCLE", "VAR_CYCLE", "INVALID_COMPONENT_NAME", "INVALID_REFERENCE", "STORE_REFERENCE_NOT_FOUND", "STATE_STORE_UNKNOWN", "STATE_STORE_FILE", "TRANSFORMER_MAPPING_NO_OP", "UNRESOLVED_REFERENCE", "MISSING_ENV", "WEB_SECRET_REF", "UNRESOLVED_CONTRACT", "ENTRY_SCHEMA", "NO_CONTRACT_SECTION", "INVALID_CONTRACT", "FLAT_CONTRACT_SHAPE", "INVALID_CONTRACT_ENTRY", "UNKNOWN_CONTRACT_KEY", "INVALID_TAGGING", "INVALID_SCHEMA", "INVALID_EXTENDS", "INVALID_SECTION", "INVALID_EVENTS", "CIRCULAR_EXTENDS", "INVALID_ENTITY_KEY", "INVALID_ENTITY", "INVALID_ACTION_KEY", "INVALID_SCHEMA_ENTRY", "NOT_AN_OBJECT", "MISSING_EVENT_NAME", "EMPTY_EVENT_NAME", "INVALID_EVENT_NAME", "INVALID_MAPPING_TYPE", "INVALID_EVENT_PATTERN", "INVALID_RULE_TYPE", "CATCH_ALL_NOT_LAST", "GATED_BY_ERRORS", "CONTRACT_NOT_STATIC", "NO_PACKAGE", "NO_SETTINGS_SCHEMA", "SCHEMA_UNAVAILABLE"];
|
|
742
742
|
type ValidateCode = (typeof VALIDATE_CODES)[number];
|
|
743
743
|
/**
|
|
744
744
|
* Named checks a run includes (`details.scope.checks`). `file:` checks run
|
|
@@ -7104,13 +7104,23 @@ declare function setFeedbackPreference(anonymous: boolean): void;
|
|
|
7104
7104
|
declare function getFeedbackPreference(): boolean | undefined;
|
|
7105
7105
|
/**
|
|
7106
7106
|
* Set the default project ID in the config.
|
|
7107
|
-
*
|
|
7107
|
+
*
|
|
7108
|
+
* Needs a credential: `WALKEROS_TOKEN`, or a stored login. An env-only setup
|
|
7109
|
+
* gets a config file that holds just the default. Refuses while
|
|
7110
|
+
* `WALKEROS_PROJECT_ID` names another project, because the variable takes
|
|
7111
|
+
* precedence (see `resolveProjectId`) and the write would change nothing.
|
|
7108
7112
|
*/
|
|
7109
7113
|
declare function setDefaultProject(projectId: string): void;
|
|
7110
7114
|
/**
|
|
7111
7115
|
* Get the default project ID from the config, or null if not set.
|
|
7112
7116
|
*/
|
|
7113
7117
|
declare function getDefaultProject(): string | null;
|
|
7118
|
+
/**
|
|
7119
|
+
* The project a call without a `projectId` works on: `WALKEROS_PROJECT_ID`,
|
|
7120
|
+
* then the config's default, or null when neither names one. The one
|
|
7121
|
+
* resolution `requireProjectId()` and the local MCP door share.
|
|
7122
|
+
*/
|
|
7123
|
+
declare function resolveProjectId(): string | null;
|
|
7114
7124
|
/**
|
|
7115
7125
|
* Resolve the API token using priority order:
|
|
7116
7126
|
* 1. WALKEROS_TOKEN env var
|
|
@@ -7415,4 +7425,4 @@ declare module '@walkeros/core' {
|
|
|
7415
7425
|
}
|
|
7416
7426
|
}
|
|
7417
7427
|
|
|
7418
|
-
export { type AddThreadMessageOptions, type ApiAuth, ApiError, type ApiErrorDetail, type ApiRequestInit, type ApiTransport, BUILD_ERROR_CODES, BUILD_MANIFEST_ENV, BUILD_MANIFEST_VERSION, type BuildArtifact, BuildArtifactSchema, BuildBundleArtifactSchema, type BuildErrorCode, type BuildManifest, BuildManifestSchema, type BuildOptions, type BuildResult, BuildResultSchema, BuildWrapArtifactSchema, type BuildWrapOptions, BuildWrapOptionsSchema, type BundleStats, type CLIBuildOptions, type ClientContext, type ClientOperation, type ClientType, type CompareContractInput, type CompleteDeviceLoginOptions, type ContractClient, type ContractComparison, type ContractVerdict, type CreatePreviewOptions, type CreateSecretOptions, type CreateThreadOptions, DEPLOYMENT_STATUSES, DEPLOYMENT_TYPES, type DeletePreviewOptions, type DeleteSecretOptions, type DeployOptions, DeploymentAmbiguityError, type DeploymentStatus, type DeploymentSummaryForFlow, type DeploymentType, type DeviceAuthorization, type DeviceLoginResult, type EndObserveSessionOptions, type FeedbackOptions, type GetFrameOptions, type GetObserveSessionOptions, type GetPreviewOptions, type GetReleaseOptions, type GlobalOptions, type HealthResult, type ListDeploymentsOptions, type ListFlowsOptions, type ListFramesOptions, type ListJourneysOptions, type ListKnowledgeOptions, type ListPageFramesOptions, type ListPreviewsOptions, type ListProjectsOptions, type ListReleasesOptions, type ListSecretsOptions, type ListStepHistoryOptions, type ListThreadsOptions, type LoginOptions, type LoginResult, type MinifyOptions, type MissingOperation, type OpenApiResult, type OperationKey, type PrepareInput, type PreparedFlow, type ProjectFlows, type PushResult, type RegrantPreviewOptions, type ReleaseDetailResponse, type ReleaseDiffResponse, type ReleaseIndexResponse, type ReleaseRationaleSummary, type ReleaseRef, type ResponseJson, type RunBuildManifestResult, type SSEEvent, type SSEParseResult, type SetReleaseRationaleOptions, type SimulateCollectorOptions, type SimulateDataOptions, type SimulateDestinationOptions, type SimulateSourceOptions, type SimulateTransformerOptions, type StartObserveSessionOptions, type ThreadAnchorType, type ThreadStatus, type UpdateSecretOptions, VALIDATE_CODES, VERSION, type ValidateCheck, type ValidateCode, type ValidateDeferred, type ValidateResult, type ValidateScope, type ValidateSkip, type ValidationError, type ValidationWarning, type WalkerOSConfig, type WrapSkeletonOptions, addThreadMessage, apiFetch, apiRequest, bakedClientOperations, bakedContractHash, bakedContractVersion, buildDataPayload, bundle, bundleCommand, canonicalContractHash, classifyStepProperties, clearAuthFields, clientContextHeaders, collectKnownSecrets, compareContract, completeDeviceLogin, containsCodeMarkers, createApiClient, createDeployCommand, createDeployment, createDeploymentCommand, createFlow, createFlowCommand, createPreview, createProject, createProjectCommand, createSecret, createThread, credentialSource, deleteConfig, deleteDeployment, deleteDeploymentByFlowId, deleteDeploymentCommand, deleteFlow, deleteFlowCommand, deletePreview, deleteProject, deleteProjectCommand, deleteSecret, deploy, deployCommand, deployFetch, duplicateFlow, duplicateFlowCommand, endObserveSession, feedback, feedbackCommand, fetchHealth, fetchOpenApi, formatContract, formatPushResult, getAuthHeaders, getClientContext, getDefaultProject, getDeployment, getDeploymentBySlug, getDeploymentBySlugCommand, getDeploymentCommand, getFeedbackPreference, getFlow, getFlowCommand, getFrame, getObserveSession, getPreview, getProject, getProjectCommand, getRelease, isDeploymentStatus, listAllFlows, listDeployments, listDeploymentsCommand, listFlows, listFlowsCommand, listFrames, listJourneys, listKnowledge, listPageFrames, listPreviews, listProjects, listProjectsCommand, listReleases, listSecrets, listStepHistory, listThreads, loadConfig, loadJsonConfig, login, loginCommand, logout, logoutCommand, mergeAuthHeaders, operationUrl, parseSSEEvents, publicFetch, push, pushCommand, readConfig, regrantPreview, requireProjectId, resetClientContext, resolveAccessToken, resolveAppUrl, resolveExportName, resolveManifestSource, resolveToken, runBuildManifest, selectDevExamples, setClientContext, setDefaultProject, setFeedbackPreference, setReleaseRationale, simulateCollector, simulateDestination, simulateSource, simulateTransformer, startDeviceAuthorization, startObserveSession, index as telemetry, telemetryDisableCommand, telemetryEnableCommand, telemetryStatusCommand, throwApiError, updateFlow, updateFlowCommand, updateProject, updateProjectCommand, updateSecret, validate, validateCommand, whoami, whoamiCommand, wrapSkeleton, writeConfig };
|
|
7428
|
+
export { type AddThreadMessageOptions, type ApiAuth, ApiError, type ApiErrorDetail, type ApiRequestInit, type ApiTransport, BUILD_ERROR_CODES, BUILD_MANIFEST_ENV, BUILD_MANIFEST_VERSION, type BuildArtifact, BuildArtifactSchema, BuildBundleArtifactSchema, type BuildErrorCode, type BuildManifest, BuildManifestSchema, type BuildOptions, type BuildResult, BuildResultSchema, BuildWrapArtifactSchema, type BuildWrapOptions, BuildWrapOptionsSchema, type BundleStats, type CLIBuildOptions, type ClientContext, type ClientOperation, type ClientType, type CompareContractInput, type CompleteDeviceLoginOptions, type ContractClient, type ContractComparison, type ContractVerdict, type CreatePreviewOptions, type CreateSecretOptions, type CreateThreadOptions, DEPLOYMENT_STATUSES, DEPLOYMENT_TYPES, type DeletePreviewOptions, type DeleteSecretOptions, type DeployOptions, DeploymentAmbiguityError, type DeploymentStatus, type DeploymentSummaryForFlow, type DeploymentType, type DeviceAuthorization, type DeviceLoginResult, type EndObserveSessionOptions, type FeedbackOptions, type GetFrameOptions, type GetObserveSessionOptions, type GetPreviewOptions, type GetReleaseOptions, type GlobalOptions, type HealthResult, type ListDeploymentsOptions, type ListFlowsOptions, type ListFramesOptions, type ListJourneysOptions, type ListKnowledgeOptions, type ListPageFramesOptions, type ListPreviewsOptions, type ListProjectsOptions, type ListReleasesOptions, type ListSecretsOptions, type ListStepHistoryOptions, type ListThreadsOptions, type LoginOptions, type LoginResult, type MinifyOptions, type MissingOperation, type OpenApiResult, type OperationKey, type PrepareInput, type PreparedFlow, type ProjectFlows, type PushResult, type RegrantPreviewOptions, type ReleaseDetailResponse, type ReleaseDiffResponse, type ReleaseIndexResponse, type ReleaseRationaleSummary, type ReleaseRef, type ResponseJson, type RunBuildManifestResult, type SSEEvent, type SSEParseResult, type SetReleaseRationaleOptions, type SimulateCollectorOptions, type SimulateDataOptions, type SimulateDestinationOptions, type SimulateSourceOptions, type SimulateTransformerOptions, type StartObserveSessionOptions, type ThreadAnchorType, type ThreadStatus, type UpdateSecretOptions, VALIDATE_CODES, VERSION, type ValidateCheck, type ValidateCode, type ValidateDeferred, type ValidateResult, type ValidateScope, type ValidateSkip, type ValidationError, type ValidationWarning, type WalkerOSConfig, type WrapSkeletonOptions, addThreadMessage, apiFetch, apiRequest, bakedClientOperations, bakedContractHash, bakedContractVersion, buildDataPayload, bundle, bundleCommand, canonicalContractHash, classifyStepProperties, clearAuthFields, clientContextHeaders, collectKnownSecrets, compareContract, completeDeviceLogin, containsCodeMarkers, createApiClient, createDeployCommand, createDeployment, createDeploymentCommand, createFlow, createFlowCommand, createPreview, createProject, createProjectCommand, createSecret, createThread, credentialSource, deleteConfig, deleteDeployment, deleteDeploymentByFlowId, deleteDeploymentCommand, deleteFlow, deleteFlowCommand, deletePreview, deleteProject, deleteProjectCommand, deleteSecret, deploy, deployCommand, deployFetch, duplicateFlow, duplicateFlowCommand, endObserveSession, feedback, feedbackCommand, fetchHealth, fetchOpenApi, formatContract, formatPushResult, getAuthHeaders, getClientContext, getDefaultProject, getDeployment, getDeploymentBySlug, getDeploymentBySlugCommand, getDeploymentCommand, getFeedbackPreference, getFlow, getFlowCommand, getFrame, getObserveSession, getPreview, getProject, getProjectCommand, getRelease, isDeploymentStatus, listAllFlows, listDeployments, listDeploymentsCommand, listFlows, listFlowsCommand, listFrames, listJourneys, listKnowledge, listPageFrames, listPreviews, listProjects, listProjectsCommand, listReleases, listSecrets, listStepHistory, listThreads, loadConfig, loadJsonConfig, login, loginCommand, logout, logoutCommand, mergeAuthHeaders, operationUrl, parseSSEEvents, publicFetch, push, pushCommand, readConfig, regrantPreview, requireProjectId, resetClientContext, resolveAccessToken, resolveAppUrl, resolveExportName, resolveManifestSource, resolveProjectId, resolveToken, runBuildManifest, selectDevExamples, setClientContext, setDefaultProject, setFeedbackPreference, setReleaseRationale, simulateCollector, simulateDestination, simulateSource, simulateTransformer, startDeviceAuthorization, startObserveSession, index as telemetry, telemetryDisableCommand, telemetryEnableCommand, telemetryStatusCommand, throwApiError, updateFlow, updateFlowCommand, updateProject, updateProjectCommand, updateSecret, validate, validateCommand, whoami, whoamiCommand, wrapSkeleton, writeConfig };
|
package/dist/index.js
CHANGED
|
@@ -266,15 +266,26 @@ function getFeedbackPreference() {
|
|
|
266
266
|
const config = readConfig();
|
|
267
267
|
return config?.anonymousFeedback;
|
|
268
268
|
}
|
|
269
|
+
function hasStoredCredential(config) {
|
|
270
|
+
return Boolean(config?.token || config?.accessToken);
|
|
271
|
+
}
|
|
269
272
|
function setDefaultProject(projectId) {
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
+
if (!process.env.WALKEROS_TOKEN && !hasStoredCredential(readConfig()))
|
|
274
|
+
throw notAuthenticatedError();
|
|
275
|
+
const envProjectId = process.env.WALKEROS_PROJECT_ID;
|
|
276
|
+
if (envProjectId && envProjectId !== projectId)
|
|
277
|
+
throw new Error(
|
|
278
|
+
`WALKEROS_PROJECT_ID is set to ${envProjectId} and takes precedence over the default project, so ${projectId} would not be used. Pass projectId on each call, or unset WALKEROS_PROJECT_ID to change the default.`
|
|
279
|
+
);
|
|
280
|
+
writeConfig({ defaultProjectId: projectId });
|
|
273
281
|
}
|
|
274
282
|
function getDefaultProject() {
|
|
275
283
|
const config = readConfig();
|
|
276
284
|
return config?.defaultProjectId ?? null;
|
|
277
285
|
}
|
|
286
|
+
function resolveProjectId() {
|
|
287
|
+
return process.env.WALKEROS_PROJECT_ID || getDefaultProject();
|
|
288
|
+
}
|
|
278
289
|
function clearDefaultProject() {
|
|
279
290
|
const config = readConfig();
|
|
280
291
|
if (!config) return;
|
|
@@ -1025,12 +1036,11 @@ async function getAuthHeaders() {
|
|
|
1025
1036
|
}
|
|
1026
1037
|
function credentialSource() {
|
|
1027
1038
|
if (process.env.WALKEROS_TOKEN) return "env";
|
|
1028
|
-
|
|
1029
|
-
if (config?.token || config?.accessToken) return "config";
|
|
1039
|
+
if (hasStoredCredential(readConfig())) return "config";
|
|
1030
1040
|
return null;
|
|
1031
1041
|
}
|
|
1032
1042
|
function requireProjectId() {
|
|
1033
|
-
const projectId =
|
|
1043
|
+
const projectId = resolveProjectId();
|
|
1034
1044
|
if (!projectId)
|
|
1035
1045
|
throw new Error(
|
|
1036
1046
|
"No project selected. Set WALKEROS_PROJECT_ID or configure a default project."
|
|
@@ -7364,7 +7374,7 @@ import {
|
|
|
7364
7374
|
REF_STORE,
|
|
7365
7375
|
SECRET_MARKER_PREFIX as SECRET_MARKER_PREFIX3
|
|
7366
7376
|
} from "@walkeros/core";
|
|
7367
|
-
var CLIENT_HEADER = "walkeros-cli/4.7.2
|
|
7377
|
+
var CLIENT_HEADER = "walkeros-cli/4.7.2";
|
|
7368
7378
|
function createSettingsContext(configDir) {
|
|
7369
7379
|
return { configDir, cache: /* @__PURE__ */ new Map(), compiled: /* @__PURE__ */ new Map() };
|
|
7370
7380
|
}
|
|
@@ -7921,6 +7931,7 @@ function runFlowChecks(input, options) {
|
|
|
7921
7931
|
flows: { [name]: flow }
|
|
7922
7932
|
});
|
|
7923
7933
|
errors.push(...structure.errors);
|
|
7934
|
+
warnings.push(...structure.warnings);
|
|
7924
7935
|
});
|
|
7925
7936
|
perFlow(["flow:routes"], (name, flow) => {
|
|
7926
7937
|
lintFlowRoutes(name, flow, errors, warnings);
|
|
@@ -8542,6 +8553,9 @@ var VALIDATE_CODES = [
|
|
|
8542
8553
|
"INVALID_COMPONENT_NAME",
|
|
8543
8554
|
"INVALID_REFERENCE",
|
|
8544
8555
|
"STORE_REFERENCE_NOT_FOUND",
|
|
8556
|
+
"STATE_STORE_UNKNOWN",
|
|
8557
|
+
"STATE_STORE_FILE",
|
|
8558
|
+
"TRANSFORMER_MAPPING_NO_OP",
|
|
8545
8559
|
// Resolution (getFlowSettings, as the bundler resolves the flow)
|
|
8546
8560
|
"UNRESOLVED_REFERENCE",
|
|
8547
8561
|
"MISSING_ENV",
|
|
@@ -11548,6 +11562,7 @@ export {
|
|
|
11548
11562
|
resolveAppUrl,
|
|
11549
11563
|
resolveExportName,
|
|
11550
11564
|
resolveManifestSource,
|
|
11565
|
+
resolveProjectId,
|
|
11551
11566
|
resolveToken,
|
|
11552
11567
|
runBuildManifest,
|
|
11553
11568
|
selectDevExamples,
|