@walkeros/cli 4.8.1-next-1792019907609 → 4.8.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/dist/index.d.ts CHANGED
@@ -230,9 +230,9 @@ declare function buildDataPayload(flowSettings: Flow): Record<string, unknown>;
230
230
  */
231
231
  /**
232
232
  * Preview activation wiring. When present and enabled, the generated entry
233
- * imports the activator from core and lets it decide whether a preview bundle
234
- * boots in place of this flow. The bundle carries only PUBLIC values: a keyring,
235
- * an issuer, and opaque bindings. Never a project id, never a secret.
233
+ * imports the activator from web-core and lets it decide whether a preview
234
+ * bundle boots in place of this flow. The bundle carries only PUBLIC values: a
235
+ * keyring, an issuer, and opaque bindings. Never a project id, never a secret.
236
236
  */
237
237
  interface WrapEntryPreview {
238
238
  enabled: boolean;
@@ -341,31 +341,8 @@ declare function bundle(configOrPath: unknown, options?: {
341
341
  */
342
342
  type Platform = 'web' | 'server';
343
343
 
344
- /**
345
- * Resolve a bearer for an API call, refreshing the stored session when needed.
346
- *
347
- * Priority: `WALKEROS_TOKEN`, then a legacy static token, then the OAuth
348
- * session. Returns null when nothing can be resolved, which callers render as
349
- * "run `walkeros auth login`".
350
- *
351
- * Throws when a refresh was needed but could not be carried out, which is a
352
- * different problem from having no session and must not be reported as one.
353
- */
354
- declare function resolveAccessToken(opts?: {
355
- fetch?: typeof fetch;
356
- now?: () => number;
357
- }): Promise<string | null>;
358
- /**
359
- * Authorization header for the resolved credential, or an empty object when
360
- * there is none. Async because resolving may have to refresh the session.
361
- */
362
- declare function getAuthHeaders(): Promise<Record<string, string>>;
363
- /**
364
- * Where a credential would come from, without resolving or refreshing it.
365
- * For commands that want to send someone to `walkeros auth login` before spending
366
- * a network round trip.
367
- */
368
- declare function credentialSource(): 'env' | 'config' | null;
344
+ /** The one credential the CLI sends: WALKEROS_TOKEN, a token from Account > Automation tokens. */
345
+ declare function resolveAccessToken(): string | null;
369
346
 
370
347
  /** A network call a web run (push or simulate) recorded instead of sending (fetch, sendBeacon, XHR) */
371
348
  interface NetworkCall {
@@ -700,7 +677,7 @@ type ValidateOptions = z.infer<typeof ValidateOptionsSchema>;
700
677
  * Every code an error, warning or skip of `validate` can carry. Agents and
701
678
  * tests branch on these, never on message text.
702
679
  */
703
- 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"];
680
+ 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", "WEB_LOGGER_FORMAT", "FLOW_CYCLE", "VAR_CYCLE", "INVALID_COMPONENT_NAME", "INVALID_REFERENCE", "STORE_REFERENCE_NOT_FOUND", "STATE_STORE_UNKNOWN", "STATE_STORE_FILE", "MAPPING_NO_OP", "MAPPING_VALUE_NO_OPERATOR", "MAPPING_VALUE_PRODUCERS", "BATCH_WITHOUT_PUSH_BATCH", "MALFORMED_REFERENCE", "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_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"];
704
681
  type ValidateCode = (typeof VALIDATE_CODES)[number];
705
682
  /**
706
683
  * Named checks a run includes (`details.scope.checks`). `file:` checks run
@@ -802,95 +779,6 @@ interface GlobalOptions {
802
779
  silent?: boolean;
803
780
  }
804
781
 
805
- interface LoginCommandOptions extends GlobalOptions {
806
- url?: string;
807
- json?: boolean;
808
- }
809
- interface LoginResult {
810
- success: boolean;
811
- email?: string;
812
- configPath?: string;
813
- error?: string;
814
- }
815
- interface LoginOptions {
816
- url?: string;
817
- /** Override browser opener for testing */
818
- openUrl?: (url: string) => Promise<void>;
819
- /** Override fetch for testing */
820
- fetch?: typeof globalThis.fetch;
821
- /** Max poll attempts before giving up (for testing) */
822
- maxPollAttempts?: number;
823
- /** Poll interval, replacing the server's stated one (for testing) */
824
- pollIntervalMs?: number;
825
- }
826
- /**
827
- * The outcome of finishing a device authorization.
828
- *
829
- * It carries no token material. `completeDeviceLogin` stores the session
830
- * itself, so the credential file keeps exactly one writer and a caller can
831
- * neither persist nor leak what came back.
832
- *
833
- * `pending` and `slow_down` both mean the window closed with the approval
834
- * still outstanding: the device code is untouched, so the same code can be
835
- * handed back in. `slow_down` is that same situation with the server asking
836
- * for a wider gap before the next attempt.
837
- */
838
- type DeviceLoginResult = {
839
- status: 'ok';
840
- } | {
841
- status: 'pending';
842
- } | {
843
- status: 'slow_down';
844
- } | {
845
- status: 'denied';
846
- } | {
847
- status: 'expired';
848
- } | {
849
- status: 'error';
850
- error: string;
851
- };
852
- interface CompleteDeviceLoginOptions {
853
- /** App to poll. Defaults to the resolved app URL. */
854
- url?: string;
855
- /** Stop polling after this long. */
856
- timeoutMs?: number;
857
- /** Wait between polls, before any `slow_down` widens it. */
858
- intervalMs?: number;
859
- /** Override fetch for testing */
860
- fetch?: typeof globalThis.fetch;
861
- /** Max poll attempts before giving up (for testing) */
862
- maxPollAttempts?: number;
863
- }
864
- declare function loginCommand(options: LoginCommandOptions): Promise<void>;
865
- /**
866
- * Poll a device authorization to its end and store the session it yields.
867
- *
868
- * Split out from `login` so a caller holding only a device code can finish an
869
- * authorization that is already under way. `login` cannot serve that: it
870
- * starts a fresh authorization on every call, which would strand the code the
871
- * person is looking at.
872
- */
873
- declare function completeDeviceLogin(deviceCode: string, options?: CompleteDeviceLoginOptions): Promise<DeviceLoginResult>;
874
- declare function login(options?: LoginOptions): Promise<LoginResult>;
875
-
876
- interface LogoutCommandOptions extends GlobalOptions {
877
- json?: boolean;
878
- }
879
- declare function logoutCommand(options: LogoutCommandOptions): Promise<void>;
880
- interface LogoutResult {
881
- deleted: boolean;
882
- /** A different session reached the config while the revocation was in flight. */
883
- superseded: boolean;
884
- }
885
- /**
886
- * Revoke the stored refresh token, then drop the local config.
887
- *
888
- * Revocation first, because deleting the file alone would leave a credential
889
- * alive on the server that nothing can ever reach to retire. It is best
890
- * effort: a logout on a plane still has to clear the machine.
891
- */
892
- declare function logout(): Promise<LogoutResult>;
893
-
894
782
  /** Who the current credential belongs to, as the app answers it. */
895
783
  declare function whoami(): Promise<unknown>;
896
784
  interface WhoamiCommandOptions extends GlobalOptions {
@@ -1057,10 +945,10 @@ declare const BuildBundleArtifactSchema: z.ZodObject<{
1057
945
  contentType: z.ZodOptional<z.ZodString>;
1058
946
  headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1059
947
  target: z.ZodEnum<{
1060
- runner: "runner";
1061
948
  push: "push";
1062
949
  cdn: "cdn";
1063
950
  "cdn-skeleton": "cdn-skeleton";
951
+ runner: "runner";
1064
952
  simulate: "simulate";
1065
953
  }>;
1066
954
  }, z.core.$strict>;
@@ -1180,10 +1068,10 @@ declare const BuildArtifactSchema: z.ZodUnion<readonly [z.ZodObject<{
1180
1068
  contentType: z.ZodOptional<z.ZodString>;
1181
1069
  headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1182
1070
  target: z.ZodEnum<{
1183
- runner: "runner";
1184
1071
  push: "push";
1185
1072
  cdn: "cdn";
1186
1073
  "cdn-skeleton": "cdn-skeleton";
1074
+ runner: "runner";
1187
1075
  simulate: "simulate";
1188
1076
  }>;
1189
1077
  }, z.core.$strict>, z.ZodObject<{
@@ -1261,10 +1149,10 @@ declare const BuildManifestSchema: z.ZodObject<{
1261
1149
  contentType: z.ZodOptional<z.ZodString>;
1262
1150
  headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1263
1151
  target: z.ZodEnum<{
1264
- runner: "runner";
1265
1152
  push: "push";
1266
1153
  cdn: "cdn";
1267
1154
  "cdn-skeleton": "cdn-skeleton";
1155
+ runner: "runner";
1268
1156
  simulate: "simulate";
1269
1157
  }>;
1270
1158
  }, z.core.$strict>, z.ZodObject<{
@@ -1420,20 +1308,6 @@ declare function runBuildManifest(source: string, retry?: BuildRetryOptions): Pr
1420
1308
  /** Resolve the `--manifest` value, falling back to the env for a bare flag. */
1421
1309
  declare function resolveManifestSource(manifest: string | true, env?: Record<string, string | undefined>): string;
1422
1310
 
1423
- interface DeviceAuthorization {
1424
- deviceCode: string;
1425
- userCode: string;
1426
- verificationUri: string;
1427
- verificationUriComplete: string;
1428
- expiresIn: number;
1429
- interval: number;
1430
- }
1431
- /**
1432
- * RFC 8628 section 3.1. Ask for a device code and the URL to send the person
1433
- * to. Unauthenticated: the code is worth nothing until somebody approves it.
1434
- */
1435
- declare function startDeviceAuthorization(appUrl: string, fetchFn?: typeof fetch): Promise<DeviceAuthorization>;
1436
-
1437
1311
  interface ApiErrorDetail {
1438
1312
  path: string;
1439
1313
  message: string;
@@ -1511,35 +1385,24 @@ declare function appErrorMessage(body: unknown): string | undefined;
1511
1385
  declare function appFetch(path: string, init?: AppFetchInit): Promise<Response>;
1512
1386
 
1513
1387
  /**
1514
- * The app operations the CLI itself calls: the OAuth device flow, identity,
1515
- * health, telemetry and the public API document. The app keeps every one in
1516
- * its public API set, so its change rule protects them. The only file in the
1517
- * CLI that names an app path; `walkeros api` takes its path from the person.
1388
+ * The app operations the CLI itself calls: identity, health, telemetry and
1389
+ * the public API document. The app keeps every one in its public API set, so
1390
+ * its change rule protects them. The only file in the CLI that names an app
1391
+ * path; `walkeros api` takes its path from the person.
1518
1392
  */
1519
1393
  declare const APP_PATHS: {
1520
- readonly deviceAuthorization: "/api/oauth/device_authorization";
1521
- readonly token: "/api/oauth/token";
1522
- readonly revoke: "/api/oauth/revoke";
1523
1394
  readonly whoami: "/api/auth/whoami";
1524
1395
  readonly health: "/api/health";
1525
1396
  readonly telemetry: "/api/telemetry";
1526
1397
  readonly openapi: "/api/openapi.json";
1527
1398
  };
1528
1399
 
1400
+ /**
1401
+ * The CLI's own settings. It holds no credential: the CLI authenticates with
1402
+ * WALKEROS_TOKEN only, and sign-in fields an older CLI left in the file are
1403
+ * never read.
1404
+ */
1529
1405
  interface WalkerOSConfig {
1530
- /**
1531
- * Static bearer written by the pre-OAuth CLI. Honored until it expires, and
1532
- * the first use in a process prints a one-line notice naming
1533
- * `walkeros auth login`, which replaces it with a refreshable session.
1534
- */
1535
- token?: string;
1536
- /** Short-lived bearer from the device authorization grant. */
1537
- accessToken?: string;
1538
- /** ISO 8601 instant at which `accessToken` stops being accepted. */
1539
- accessTokenExpiresAt?: string;
1540
- /** Single-use credential that buys a new `accessToken`. */
1541
- refreshToken?: string;
1542
- email?: string;
1543
1406
  appUrl?: string;
1544
1407
  anonymousFeedback?: boolean;
1545
1408
  defaultProjectId?: string;
@@ -1564,35 +1427,12 @@ declare function readConfig(): WalkerOSConfig | null;
1564
1427
  * Merge `config` into the stored config and write the result.
1565
1428
  *
1566
1429
  * Merging rather than replacing, because the file holds fields owned by
1567
- * unrelated commands: a writer that knows only about tokens would otherwise
1568
- * drop `defaultProjectId`, `installationId`, `telemetryEnabled` and
1569
- * `anonymousFeedback` every time somebody logs in.
1430
+ * unrelated commands: a writer that knows only about telemetry would otherwise
1431
+ * drop `appUrl`, `defaultProjectId` and `anonymousFeedback`.
1570
1432
  *
1571
- * A key passed explicitly as `undefined` is removed from the written file,
1572
- * which is how login drops the legacy static token it replaces.
1433
+ * A key passed explicitly as `undefined` is removed from the written file.
1573
1434
  */
1574
1435
  declare function writeConfig(config: WalkerOSConfig): void;
1575
- /**
1576
- * Remove every credential field, keeping the rest of the config.
1577
- *
1578
- * Used when the stored session is known to be dead, so the next command can
1579
- * say "run `walkeros auth login`" instead of failing against the API.
1580
- */
1581
- declare function clearAuthFields(): void;
1582
- /**
1583
- * Delete the config file (logout)
1584
- */
1585
- declare function deleteConfig(): boolean;
1586
- /**
1587
- * Resolve the API token using priority order:
1588
- * 1. WALKEROS_TOKEN env var
1589
- * 2. Config file (~/.config/walkeros/config.json)
1590
- * 3. null (not authenticated)
1591
- */
1592
- declare function resolveToken(): {
1593
- token: string;
1594
- source: 'env' | 'config';
1595
- } | null;
1596
1436
  /**
1597
1437
  * Resolve the app URL.
1598
1438
  * WALKEROS_APP_URL env var > config file > default.
@@ -1887,4 +1727,4 @@ declare module '@walkeros/core' {
1887
1727
  }
1888
1728
  }
1889
1729
 
1890
- export { APP_PATHS, ApiError, type ApiErrorDetail, type AppFetchInit, 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 ClientType, type CompleteDeviceLoginOptions, type DeviceAuthorization, type DeviceLoginResult, type GlobalOptions, type LoginOptions, type LoginResult, type MinifyOptions, type PrepareInput, type PreparedFlow, type PushResult, type RunBuildManifestResult, type SimulateCollectorOptions, type SimulateDataOptions, type SimulateDestinationOptions, type SimulateSourceOptions, type SimulateTransformerOptions, VALIDATE_CODES, VERSION, type ValidateCheck, type ValidateCode, type ValidateDeferred, type ValidateResult, type ValidateScope, type ValidateSkip, type ValidationError, type ValidationWarning, type WalkerOSConfig, type WrapSkeletonOptions, appErrorMessage, appFetch, buildDataPayload, bundle, bundleCommand, classifyStepProperties, clearAuthFields, clientContextHeaders, collectKnownSecrets, completeDeviceLogin, containsCodeMarkers, credentialSource, deleteConfig, formatPushResult, getAuthHeaders, getClientContext, loadConfig, loadJsonConfig, login, loginCommand, logout, logoutCommand, push, pushCommand, readConfig, resetClientContext, resolveAccessToken, resolveAppUrl, resolveExportName, resolveManifestSource, resolveToken, runBuildManifest, selectDevExamples, setClientContext, simulateCollector, simulateDestination, simulateSource, simulateTransformer, startDeviceAuthorization, index as telemetry, telemetryDisableCommand, telemetryEnableCommand, telemetryStatusCommand, validate, validateCommand, whoami, whoamiCommand, wrapSkeleton, writeConfig };
1730
+ export { APP_PATHS, ApiError, type ApiErrorDetail, type AppFetchInit, 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 ClientType, type GlobalOptions, type MinifyOptions, type PrepareInput, type PreparedFlow, type PushResult, type RunBuildManifestResult, type SimulateCollectorOptions, type SimulateDataOptions, type SimulateDestinationOptions, type SimulateSourceOptions, type SimulateTransformerOptions, VALIDATE_CODES, VERSION, type ValidateCheck, type ValidateCode, type ValidateDeferred, type ValidateResult, type ValidateScope, type ValidateSkip, type ValidationError, type ValidationWarning, type WalkerOSConfig, type WrapSkeletonOptions, appErrorMessage, appFetch, buildDataPayload, bundle, bundleCommand, classifyStepProperties, clientContextHeaders, collectKnownSecrets, containsCodeMarkers, formatPushResult, getClientContext, loadConfig, loadJsonConfig, push, pushCommand, readConfig, resetClientContext, resolveAccessToken, resolveAppUrl, resolveExportName, resolveManifestSource, runBuildManifest, selectDevExamples, setClientContext, simulateCollector, simulateDestination, simulateSource, simulateTransformer, index as telemetry, telemetryDisableCommand, telemetryEnableCommand, telemetryStatusCommand, validate, validateCommand, whoami, whoamiCommand, wrapSkeleton, writeConfig };