lua-cli 3.49.0 → 3.49.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.js CHANGED
@@ -950,6 +950,35 @@ function aiGenerateInputFromSimplified(prompt, content) {
950
950
  ]
951
951
  };
952
952
  }
953
+ function directProviderOfOpenRouterModel(model) {
954
+ return OPENROUTER_DIRECT_VENDORS.find((vendor) => vendor.pattern.test(model))?.provider;
955
+ }
956
+ function openRouterModelIssue(options) {
957
+ const model = typeof options.model === "string" && options.model ? options.model : void 0;
958
+ if (options.provider === "openrouter" && !model) return OPENROUTER_NEEDS_MODEL_MESSAGE;
959
+ if (!model || !model.includes("/")) return null;
960
+ const direct = directProviderOfOpenRouterModel(model);
961
+ if (!direct) return null;
962
+ return `model ${model} runs on provider '${direct}': set provider '${direct}' instead of a vendor/model id`;
963
+ }
964
+ function formatDecisionSandboxPrimitive(name, tool) {
965
+ return tool ? `${name}${DECISION_SANDBOX_TOOL_SEPARATOR}${tool}` : name;
966
+ }
967
+ function parseDecisionSandboxPrimitive(value3) {
968
+ const at = value3.indexOf(DECISION_SANDBOX_TOOL_SEPARATOR);
969
+ const name = at < 0 ? value3 : value3.slice(0, at);
970
+ const tool = at < 0 ? "" : value3.slice(at + DECISION_SANDBOX_TOOL_SEPARATOR.length);
971
+ if (name.length === 0) return void 0;
972
+ return tool.length > 0 ? {
973
+ name,
974
+ tool
975
+ } : {
976
+ name
977
+ };
978
+ }
979
+ function decisionPublishStampKey(agentId2) {
980
+ return `decisions:stamp:${agentId2}`;
981
+ }
953
982
  function isIntegrationPassthroughReadMethod(method) {
954
983
  return typeof method === "string" && INTEGRATION_PASSTHROUGH_READ_METHODS.includes(method.toUpperCase());
955
984
  }
@@ -4693,6 +4722,10 @@ function browserLogContextOfWorkerContext(context) {
4693
4722
  if (context?.primitiveId) out.primitiveId = context.primitiveId;
4694
4723
  if (context?.primitiveName) out.primitiveName = context.primitiveName;
4695
4724
  if (context?.channel) out.channel = context.channel;
4725
+ if (context?.environment && AGENT_LOG_ENVIRONMENTS.includes(context.environment)) {
4726
+ out.environment = context.environment;
4727
+ }
4728
+ if (context?.agentVersion) out.agentVersion = context.agentVersion;
4696
4729
  return out;
4697
4730
  }
4698
4731
  function browserLogEventOfWorkerEvent(event, mapping = {}) {
@@ -7496,7 +7529,7 @@ function maskMcpServerHeaders(server) {
7496
7529
  headersSet: headerNames.length > 0
7497
7530
  };
7498
7531
  }
7499
- var __defProp3, __name3, PLUMBING_THREAD_CHANNELS, CHANNEL_CONVERSATION_CHANNELS, HIDDEN_THREAD_CHANNELS, CHOICE_PERSON_TURN_CHANNELS, CHOICE_REPLAY_CLIENT_CAPABILITIES, CHOICE_REPLAY_CLIENT_SURFACES, DECISION_PROVIDERS, DECISION_QUESTION_TYPES, DECISION_NAME_PATTERN, DECISION_LIMITS, DECISION_ERROR_CODES, DECISION_INACTIVE_CODE, MAX_NAME_CHARS, InstructionsSchema, NameSchema, OddsQuestionSchema, ChoiceQuestionSchema, ScoreQuestionSchema, DecisionQuestionSchema, DecisionOptionsSchema, DecisionQuestionsSchema, DecisionDefinitionSchema, INTEGRATION_PASSTHROUGH_READ_METHODS, URL_REINTERPRETED_PATH_CHARACTERS, PERCENT_ENCODED_DOT, PERCENT_ESCAPE, DECODED_PATH_SEPARATORS, DECODED_LEADING_SEPARATOR, MAX_PERCENT_DECODE_ROUNDS, URL_RESOLUTION_PROBE_BASE, PLATFORM_INVOCATION_CALLERS, MESSAGING_CHANNELS, VOICE_CHANNELS, TURN_CATEGORIES, AGENT_TOOL_CATEGORIES, count, AnthropicSseUsageReader, SUPERVISION_OPS, SUPERVISION_OPS_WAVE2, SUPERVISION_WATCHDOG_OPS, SUPERVISION_WATCHDOG_ERRORS, SUPERVISION_ROLLBACK_REFUSAL_CODES, SUPERVISION_ROLLBACK_LINEAGE_MAX, SUPERVISION_UNTARGETED_OPS, SUPERVISED_WORKFLOW_VERSIONS_MAX, SUPERVISION_EVENT_KINDS, AGENT_PROVISIONING_LIMITS, AGENT_PROVISIONING_APPROVAL_PAYLOAD_KEY, AGENT_PROVISIONING_ERRORS, PROVISIONED_SUPERVISION_ACTIONS, isNonEmptyString, uniqueStrings, sameSet, AGENT_PROVISIONING_APPROVAL_CARD_MAX_CHARS, APPROVAL_PAYLOAD_MEMBERS, AGENT_CONNECTION_POLICIES, AGENT_CONNECTION_POLICY_DEFAULT, AGENT_CONNECTION_MOUNT_MODES, AGENT_CONNECTION_GOVERNANCE_ERRORS, AGENT_CONNECTION_OPERATION_RULES_MAX, AGENT_CONNECTION_OPERATION_PATTERN_MAX_LENGTH, OPERATION_RULE_METHODS, PATH_SEPARATOR, PATH_SINGLE_SEGMENT_WILDCARD, PATH_REST_WILDCARD, METHOD_OVERRIDE_HEADER_NAMES, METHOD_OVERRIDE_QUERY_NAMES, ODATA_BATCH_SEGMENT, GOOGLE_BATCH_FIRST_SEGMENT, CONNECTION_CHECK_RESULTS, CONNECTION_CHECK_CATALOGUE_V1, CONNECTION_CHECK_NAME_PATTERN, CONNECTION_CHECK_NAME_MAX, CONNECT_OUTCOME_STATUSES, SECRET_TEST_RESULTS, SECRET_DATADOG_REGIONS, SECRET_PROVIDER_CATALOGUE_V1, SECRET_TEST_MAX_RESPONSE_BYTES, SECRET_ENV_KEY_PATTERN, SECRET_REQUEST_ERRORS, SECRET_OUTCOME_STATUSES, CLIENT_OUTCOME_TURNS_MAX, SHORT_TEXT_MAX, SLUG_MAX, shortText, optionalShortText, CONNECTION_REQUEST_TERMINAL_STATES, CONNECTION_USE_ORIGINS, AGENT_CONNECTION_OPERATION_LIMITS_BOUNDS, CURRENCY_CODE, LIMITS_KEYS, CAPS_KEYS, EXCLUSIONS_KEYS, EMAIL_IN_TEXT, MAX_EXCLUSION_DEPTH, PROJECTION_PARAMETER_KEYS, CHANNEL_PARAMETER_KEYS, GMAIL_SYSTEM_LABEL_IDS, ZERO_DECIMAL_CURRENCIES, THREE_DECIMAL_CURRENCIES, DECIMAL_AMOUNT, REDACTED_PLACEHOLDER, PROVIDER_MESSAGE_MAX_CHARS, ERROR_MESSAGE_MAX_CHARS, SECRET_LITERAL_PATTERNS, SECRET_NAME, SECRET_PAIR_PATTERNS, GROUP_COUNT, WORKFLOW_SECRET_KEY_RE, WORKFLOW_RESERVED_SECRET_KEYS, SCRUB_INPUT_MAX_CHARS, SCRUB_CUT_BACKOFF_CHARS, TEST_SESSION_ID_PATTERN, TEST_SESSION_COLLECTION_PREFIX, TEST_EFFECT_BODY_MAX_BYTES, TEST_EFFECT_DROPPED_HEADERS, EVAL_CREDITS_PER_1K_TOKENS, EVAL_RESERVED_TOOL_ID_PREFIXES, CONNECTION_HANDOVER_APPROVAL_PAYLOAD_KEY, CONNECTION_HANDOVER_APPROVAL_CARD_MAX_CHARS, CONNECTION_HANDOVER_LIMITS, MEMBERS, FORMAT_CHARS, oneLine, boundedString, AGENT_METRIC_NAME_PATTERN, AGENT_METRIC_LIMITS, AGENT_OBJECTIVE_ERRORS, CHANGE_LEASE_TTL_MINUTES_MIN, CHANGE_LEASE_TTL_MINUTES_MAX, CHANGE_LEASE_REASON_MAX, CHANGE_LEASE_ERRORS, AGENT_CONFIG_SET_LIMITS, SECRET_ENV_KEY_SUFFIXES, DEFAULT_OWNER_DEPARTURE_POLICY, AGENT_LIFECYCLE_ERRORS, USER_COST_COUNTER_TTL_SECONDS, USER_COST_ATTRIBUTION_CHANNELS, CALLER_DEDUPE_KEY_MAX, FOLLOW_UP_IDEMPOTENCY_TTL_SECONDS, THREAD_FOLLOW_UP_LIMITS, THREAD_FOLLOW_UP_ERRORS, PROGRESS_UPDATE_LIMITS, PAUSABLE_CAPABILITY_KINDS, UNIFIED_CATCH_UP_MAX_WINDOW_HOURS, UNIFIED_CATCH_UP_EVENTS, UNIFIED_CATCH_UP_FILTERABLE_OBJECT_TYPES, AGENT_NEVER_RULES_MAX, AGENT_NEVER_RULE_FIELD_MAX, AGENT_NEVER_RULE_INPUT_MATCH_MAX, NEVER_RULE_ID_PATTERN, NEVER_RULE_HTTP_METHODS, TEMPLATE_DISTRIBUTION_MODES, TAKEOVER_MAX_IDLE_MINUTES, MINUTES_PER_DAY, DEFAULT_IDLE_RELEASE_MINUTES, FALLBACK_IDLE_RELEASE_MINUTES, VARIATION_SELECTORS, SLACK_EMOJI_NAMES, SLACK_SHORTCODE, PLAIN_EMAIL_ADDRESS, DOMAIN, UNSAFE_TEXT, SLACK_CONVERSATION_ID, CHANNEL_SETTING_GROUPS, THREAD_SCOPING_NOUN, TAKEOVER_CHANNEL_TYPES, EMAIL_SETTINGS, SLACK_SETTING_DEFAULTS, SLACK_REACTION_MAX, SLACK_INTRO_MAX, SLACK_EXAMPLE_PROMPTS_MAX, SLACK_EXAMPLE_PROMPT_MAX, SLACK_SUPPORT_CONTACT_MAX, SLACK_SETTINGS, CHANNEL_SETTINGS, REVIEWABLE_ACTION_EXECUTE_TOOL_ALLOWLIST, REVIEWABLE_STANDING_START_TOOLS, REVIEWABLE_MCP_SEND_TOOL_SUFFIX, MCP_TOOL_READ_VERB_RE, MCP_DRAFT_CREATE_VERBS, NON_INTERACTIVE_CHANNELS, RICH_PARTS_MESSAGE_ID_PREFIX, SCREENSHOT_MESSAGE_ID_PREFIX, WORK_ITEMS_KEY, MAX_WORK_ITEMS, LIMITS, BROWSER_COMMANDS, BROWSER_COMMAND_NAMES, SERVER_TRIGGERED_BROWSER_SOURCES, BROWSER_FALLBACKS, DEFAULT_BROWSER_FALLBACK, PROXY_COUNTRY_CODE, BROWSER_LOG_CONTENT_MODES, DEFAULT_BROWSER_LOG_CONTENT, BROWSER_SCREENSHOT_POLICIES, DEFAULT_BROWSER_SCREENSHOT_POLICY, BROWSER_ENGINES, BROWSER_PROFILE_NAME_PATTERN, BROWSER_LIMIT_KEYS, BROWSER_LIMIT_MAX, BROWSER_EXECUTE_METHOD, BROWSER_GLOBAL_METHODS, BROWSER_EXECUTE_DEFAULT_TIMEOUT_MS, BROWSER_EXECUTE_MAX_TIMEOUT_MS, LOG_FIELDS_MAX_KEYS, LOG_FIELD_MAX_VALUE_BYTES, LOG_FIELDS_MAX_BYTES, LOG_FIELD_KEY_PATTERN, LOG_FIELD_SECRET_SHAPED_KEY_PATTERNS, LOG_FIELDS_CLAMPED_KEY, LOG_FIELD_ARRAY_COUNT_SUFFIX, LuaLogFieldsError, DESKTOP_FILE_COMMANDS, DESKTOP_FILE_COMMAND_SET, BROWSER_READ_FORMATS, BROWSER_READ_DEFAULT_TIMEOUT_MS, BROWSER_READ_MIN_TIMEOUT_MS, BROWSER_READ_MAX_TIMEOUT_MS, BROWSER_READ_MAX_CONTENT_CHARS, BROWSER_READ_DEFAULT_SELECTOR, BROWSER_READ_MATCH_SEPARATOR, BROWSER_READ_LOGIN_BLOCKER, BROWSER_ERROR_NAME, HTTP_STATUS_FAILURE, LOGIN_PATH_SEGMENTS, LOGIN_HOST_LABELS, AGENT_LOG_SOURCES, AGENT_LOG_ENVIRONMENTS, AGENT_LOG_FIELDS_MAX_WIRE_KEYS, BROWSER_LOG_EVENT_KINDS, BROWSER_LOG_ENGINES, BROWSER_SESSION_OPEN_REASONS, BROWSER_BLOCK_KINDS, BROWSER_WALL_KINDS, BROWSER_WALL_NEXT_ACTIONS, BROWSER_CONFIRM_DECISIONS, BROWSER_SESSION_CLOSE_REASONS, BROWSER_LOG_CONTEXT_KEYS, BROWSER_LOG_ID_MAX_CHARS, BROWSER_LOG_TEXT_MAX_CHARS, isString, isBoolean, isCount, isPlainObject2, oneOf, isLimits, EVENT_SHAPES, BASE_KEYS, BROWSER_WORKER_SESSION_ID_SEPARATOR, BROWSER_WORKER_BLOCK_REASON_MAX_CHARS, WORKFLOW_RETRY_BACKOFFS, WORKFLOW_RETRY_MIN_ATTEMPTS, WORKFLOW_RETRY_POLICY_KEYS, WORKFLOW_RETRY_MAX_ATTEMPTS, WORKFLOW_RETRY_ENGINE_KEYS, WORKFLOW_JOB_RESOURCES, WORKFLOW_SIDE_EFFECTS, WORKFLOW_AGENT_EFFORTS, WORKFLOW_MODEL_CLASSES, WORKFLOW_TASK_CLASSES, WORKFLOW_MODEL_TRAITS, WORKFLOW_MODEL_REASON_MAX_LENGTH, WORKFLOW_MODELS_COMPOSE_MODES, WORKFLOW_MODELS_PIN_MODES, WORKFLOW_MODELS_FALLBACK_MODES, WORKFLOW_MODELS_CONSENT_ACTIONS_MIN, WORKFLOW_DEFAULT_TASK_CLASS_MAP, WORKFLOW_MODELS_MAX_CLASS_DEFAULT, WORKFLOW_AUTONOMY_FORMS, WORKFLOW_AUTONOMY_NUMERIC_KEYS, WORKFLOW_AUTONOMY_ENVELOPE_KEYS, WORKFLOW_AUTONOMY_ENABLED_DEFAULT, WORKFLOW_AUTONOMY_DEFAULTS, WORKFLOW_AUTONOMY_CEILINGS, WORKFLOW_AUTONOMY_MAX_RUNS_PER_HOUR_ENV, WORKFLOW_AUTONOMY_MAX_RUNS_PER_HOUR_CEILING, WORKFLOW_AUTONOMY_FORMS_DEFAULT, WORKFLOW_AUTONOMY_MIN_VALUE, WORKFLOW_JOB_RANGES, WORKFLOW_JOB_RANGE_MEMBERS, WORKFLOW_SINGLE_STEP_TYPES, WORKFLOW_HITL_ENTRY_TYPES, WORKFLOW_ARM_ENTRY_TYPES, WORKFLOW_HITL_ARM_CONTAINERS, WORKFLOW_GRAPH_ENTRY_STEP_KINDS, WORKFLOW_ARM_ENTRY_STEP_KINDS, WORKFLOW_BUDGET_MAX_DURATION_SECONDS, MODEL_ID_BYOK_PROVIDERS, MODEL_CLASS_REF_PREFIX, MODEL_SNAPSHOT_SUFFIX, REASONING_EFFORT_VALUES, IMPLICIT_MODEL_SELECTION_SOURCES, PLATFORM_FALLBACK_MODEL_SOURCE, AGENT_NAME_TOKEN, DEFAULT_PERSONA_GUIDE, PERSONAL_SPACE_STARTING_PERSONA, LOG_DRAIN_TYPES_PHASE1, LOG_DRAIN_TYPES_PHASE2, LOG_DRAIN_TYPES_IMPLEMENTED, LOG_DRAIN_FORMATS, LOG_DRAIN_SEVERITIES, LOG_DRAIN_SOURCES, LOG_DRAIN_CONTENT_SOURCES, LOG_DRAIN_DEFAULT_SOURCES, LOG_DRAIN_MAX_PER_ORG, LOG_DRAIN_MAX_PER_ORG_ENTERPRISE, LOG_DRAIN_DATADOG_SITES, LOG_DRAIN_NEWRELIC_SITES, LOG_DRAIN_ENDPOINT_TEMPLATES, LOG_DRAIN_PRESET_SITES, LOG_DRAIN_BUCKET_NAME_PATTERN, LOG_DRAIN_BUCKET_HOST_PATTERNS, LOG_DRAIN_PRESET_HOST_SUFFIXES, DRAIN_CONTENT_ACK_ERROR_CODE, DRAIN_CONTENT_ACK_FIELD, DrainContentAckRequiredError, LOG_DRAIN_PRESET_PATHS, PRESET_SEGMENT_RE, LOG_DRAIN_QUOTAS, LOG_DRAIN_QUOTA_WARN_RATIO, LOG_DRAIN_QUOTA_DROP_DEBUG_RATIO, LOG_DRAIN_QUOTA_DROP_INFO_RATIO, LOG_DRAIN_QUOTA_PAUSE_RATIO, LOG_EXPORT_SOURCES, LOG_EXPORT_MAX_WINDOW_DAYS, LOG_EXPORT_MAX_WINDOW_MS, LOG_EXPORT_URL_TTL_SECONDS, LOG_EXPORT_FILE_RETENTION_DAYS, LOG_EXPORT_FILE_RETENTION_MS, LOG_EXPORT_PART_MAX_BYTES, LOG_DRAIN_NOTICE_RATE_LIMIT_MS, LOG_DRAIN_VERIFICATION_STALE_MS, LOG_DRAIN_DIGEST_INTERVAL_MS, LOG_DRAIN_DIGEST_MAX_ENTRIES, LOG_DRAIN_NOTICE_ERROR_MAX_CHARS, LOG_DRAIN_USAGE_LINE_ITEM, LOG_DRAIN_BYTES_PER_GIB, DEFAULT_LOG_DRAIN_PLAN_CONFIG, TIERS, LOG_CURSOR_MAX_LENGTH, LOG_CURSOR_MAX_ID_LENGTH, LOG_RELATIVE_TIME_PATTERN, LOG_ISO_TIME_PATTERN, RELATIVE_UNIT_MS, CORE_DRAINING_CODE, CORE_DRAINING_DEFAULT_RETRY_MS, CORE_DRAINING_MAX_RETRY_MS, VoiceNameSchema, PluginProviderSchema, RealtimeProviderSchema, PluginClassSchema, ModelDescriptorSchema, InferenceModelSchema, PluginModelSchema, RealtimeModelSchema, LuaVoiceModelSchema, TurnDetectionSchema, InterruptionSchema, BuiltinAudioClipSchema, AudioConfigSchema, BackgroundAudioEntrySchema, BackgroundAudioSchema, LuaVoiceConfigInnerSchema, LuaVoiceConfigSchema, LuaVoiceRefSchema, EventType, LUA_JOB_DEFAULT_TIMEOUT_SECONDS, LUA_JOB_MIN_TIMEOUT_SECONDS, LUA_JOB_MAX_TIMEOUT_SECONDS, KEYS, MAX_BODY_BYTES, MAX_ID_LENGTH, UTC_ISO, TEMPLATE_TRIGGER_URL_ENV_PREFIX, TEMPLATE_INSTALL_POLICY_PER_WORKSPACE_VALUES, SUBJECT_TYPES, SubjectTypeSchema, CREDENTIAL_TYPES, CredentialTypeSchema, DEVICE_OPERATIONS, DeviceOperationSchema, DEVICE_SCOPE_BY_OPERATION, DeviceBindingSchema, TYPED_API_KEY, IdSchema, SESSION_AUTH_TIME_MAX_S, PrincipalDescriptorSchema, ActorDescriptorSchema, PrincipalOwnerSchema, CredentialLifecycleSchema, GeneralCredentialDescriptorSchema, DeviceCredentialDescriptorSchema, GeneralPrincipalContextSchema, DeviceCredentialPrincipalContextSchema, RawPrincipalContextSchema, PrincipalContextSchema, DeviceCredentialClaimSchema, LUA_CLIENT_HEADER, LUA_CLIENT_APPS, SEMVER_PATTERN, WEB_RELEASE_PATTERN, CLIENT_HEADER_PATTERN, LUA_SESSION_ID_CLAIM, SESSION_REVOKED_CODE, AUTHZ_PROJECTION_VERSION, ProjectedScopeSchema, DisplayRoleSchema, AuthorizationPrincipalSchema, CredentialContextSchema, ProjectionAnomalySchema, ProjectedOrgSchema, ProjectedResourceSchema, CapabilityProfilesSchema, RoleCatalogSchema, EffectiveAuthorizationSchema, ResourcePageSchema, SYSTEM_USER_PREFIX, WORKFLOW_RUN_IN_FLIGHT, WORKFLOW_RUN_IDLE, WORKFLOW_RUN_TERMINAL, WORKFLOW_RUN_STATUSES, WORKFLOW_RUN_GATE_KINDS, WORKFLOW_STEP_STATUSES, WORKFLOW_STEP_IN_FLIGHT, WORKFLOW_SIGNAL_EVENT_SITES, ARCHIVE_WINDOW_MARGIN_DAYS, WORKFLOW_ORG_PURGING_TTL_S, WORKFLOW_ORG_PURGE_FORCE_AFTER_MS, IDEMPOTENCY_HOLDING_STATUSES, WORKFLOW_SCHEDULED_RUN_ID_PREFIX, CLOUD_TASK_RUN_ID_PREFIX, WORKFLOW_SCHEDULE_KEY_MAX, WORKFLOW_SCHEDULE_IDEMPOTENCY_KEY_PREFIX, WORKFLOW_OPERATION_ID_PREFIX, WORKFLOW_JOURNAL_PROTOCOL_VERSION, WORKFLOW_CONNECTION_KEY_RE, WORKFLOW_AGENT_APP_CONNECTION_PREFIX, WORKFLOW_JOB_MODEL_SOURCE_LABELS, WORKFLOW_SUSPEND_KINDS, WORKFLOW_RUN_NOTIFICATION_SUSPENDED_KINDS, WORKFLOW_SIGNAL_PAYLOAD_MAX_BYTES, WORKFLOW_SIGNAL_NAME_RE, WORKFLOW_SUSPEND_DEFAULT_TIMEOUT_HOURS, WORKFLOW_RESOLVE_OUTPUT_MAX_BYTES, SCHEDULE_HEALTH_NOTIFY_CHANNELS, SCHEDULE_HEALTH_DEFAULT_NOTIFY, SCHEDULE_HEALTH_LIMITS, KNOWN_KEYS, WORKFLOW_GOAL_JUDGE_SELF, APPROVAL_ARGS_MAX_CHARS, APPROVAL_ARG_STRING_MAX_CHARS, APPROVAL_ARGS_SUMMARY_MAX_CHARS, MAX_DEPTH, MAX_KEYS, MAX_ITEMS, MAX_NODES, MAX_KEY_CHARS, KEY_SCRUB_INPUT_MAX_CHARS, STRING_SCRUB_INPUT_MAX_CHARS, ELLIPSIS, SKIP, SCRUB_SECRETS_BEFORE_PERSIST_ENV, PERSIST_SCRUB_MAX_CHARS, PERSIST_SCRUB_REF_MAX_CHARS, WORKFLOW_AUDIT_EVENTS, WORKFLOW_AUDIT_METADATA_MAX_BYTES, INDENT, WRAP_WIDTH, NOUNS, GET_TOOL_NAMES, PREAMBLE, WORKFLOW_APPROVAL_OUTPUT_DECISIONS, WORKFLOW_APPROVAL_OUTPUT_SCHEMA, JSON_FENCE_RE, DEFAULT_ON_AGENT_FEATURES, SUBAGENT_PER_KEY_FLAG_ENV, PER_KEY_FLAG_VALUES, ONBOARDING_FLOW_KEY, ONBOARDING_SCHEMA_VERSION, id, copy, onboardingHeadingSchema, onboardingRichTextInlineSchema, onboardingRichTextSchema, onboardingDestinationSchema, onboardingArtworkSchema, onboardingAnswerSchema, onboardingQuestionSchema, onboardingTemplateSectionSchema, onboardingInstallScreenSchema, onboardingResultScreenSchema, onboardingConnectScreenSchema, onboardingTemplateContentSchema, onboardingUnavailableOutcomeSchema, onboardingFlowSchema, onboardingActorSchema, onboardingEditorSchema, onboardingPublicationSummarySchema, onboardingValidationIssueSchema, onboardingValidationResponseSchema, onboardingAssetSchema, onboardingPublicAssetSchema, getOnboardingConfigResponseSchema, saveOnboardingDraftRequestSchema, validateOnboardingRequestSchema, publishOnboardingRequestSchema, rollbackOnboardingRequestSchema, onboardingTemplateCatalogItemSchema, getPublishedOnboardingResponseSchema, WEB_ROUTE_PROTOCOL_VERSION, WEB_ROUTE_METHODS, WEB_ROUTE_REQUEST_HEADER_ALLOWLIST, WEB_ROUTE_RESPONSE_HEADER_ALLOWLIST, WEB_ROUTE_MAX_WALL_MS, WEB_ROUTE_MAX_REQUEST_BODY_BYTES, WEB_ROUTE_MAX_RESPONSE_BYTES, WEB_APP_NAME_PATTERN, WEB_APP_ENTRY_HTML_MAX_CHARS, WEB_APP_MAX_ASSETS, WEB_APP_ASSET_PATH_PATTERN, WEB_APP_ASSET_PATH_MAX_CHARS, WEB_APP_MAX_ROUTES, WEB_APP_MAX_ASSET_BYTES, WEB_APP_CSP_NONCE_PLACEHOLDER, EVIDENCE_SESSION_IDLE_MS, EVIDENCE_MIN_CONVERSATIONS, EVIDENCE_LOW_CONFIDENCE_N, EVIDENCE_SNIPPET_MAX_CHARS, EVIDENCE_EXAMPLES_PER_ITEM, EVIDENCE_SHOWN_ITEMS, EVIDENCE_LATENCY_BOUNDS_MS, EVIDENCE_WORD_BOUNDS, BAD_CONVERSATION_REASONS, ATTACHMENT_LINES, REVIEW_VERDICT_REASON_ORDER, ENV_TEMPLATE_SECRET_KEY_RE, CONNECTION_SEND_NOT_ALLOWED, CONNECTION_RECIPIENT_NOT_ALLOWED, NOT_SEND, PLAIN_ADDRESS, RecipientSet, MCP_MESSAGING_CREATE, MCP_CALENDAR_EVENT_WRITE, REPLY_KEYS, DEDICATED_MAIL_SLUGS, FULL_SUITE_SLUGS, WELL_KNOWN_MAIL_FOLDERS, MEMBER_KEYS, CANONICAL_ORIGIN, CANONICAL_PREFIX, STRICT_BASE64, GMAIL_PREFIX, GMAIL_MESSAGES_SEND, GMAIL_DRAFTS_SEND, GOOGLE_BATCH, GRAPH_VERSION, GRAPH_PRINCIPAL, GRAPH_SEND_MAIL, GRAPH_MESSAGE_ACTION, GRAPH_OWNER, GRAPH_EVENTS, GRAPH_EVENT_COLLECTION, GRAPH_EVENT_ID, GRAPH_EVENT_ITEM, GRAPH_EVENT_ACTION, GRAPH_BATCH, GRAPH_TEAMS_MESSAGE, GRAPH_ACTIVITY_NOTIFICATION, GRAPH_GROUP_CONVERSATION, GCAL_EVENTS, GRAPH_READ_KEYS, MALFORMED_POLICY, BILLING_REJECTION_TEXT_CREDITS, BILLING_REJECTION_TEXT_SEAT, BILLING_REJECTION_TEXT_USER_QUOTA, CUSTOM_MCP_CONNECTION_ID_PREFIX, CUSTOM_MCP_SOURCE, CUSTOM_MCP_TRANSPORT, CUSTOM_MCP_CONNECTION_ID_PATTERN, customMcpConnectionIdSchema, CONNECTION_BACKED_MCP_SOURCES, CUSTOM_MCP_REFERENCE_ID_PATTERN, customMcpReferenceIdSchema, CUSTOM_MCP_AUTH_KINDS, customMcpAuthKindSchema, CUSTOM_MCP_OAUTH_REGISTRATIONS, customMcpOAuthRegistrationSchema, CUSTOM_MCP_HEALTH_STATES, customMcpHealthStateSchema, CUSTOM_MCP_FAILURE_STEPS, customMcpFailureStepSchema, CUSTOM_MCP_CONNECT_STEPS, customMcpConnectStepSchema, customMcpFailureCodeSchema, WORKFLOW_KEY_MAX_LENGTH, CUSTOM_MCP_URL_MAX_LENGTH, CUSTOM_MCP_DISPLAY_NAME_MAX_LENGTH, CUSTOM_MCP_MAX_HEADERS, CUSTOM_MCP_HEADER_NAME_MAX_LENGTH, CUSTOM_MCP_HEADER_VALUE_MAX_LENGTH, CUSTOM_MCP_MAX_TOOLS, CUSTOM_MCP_TOOL_NAME_MAX_LENGTH, CUSTOM_MCP_TOOL_TEXT_MAX_LENGTH, CUSTOM_MCP_MIN_TIMEOUT_MS, CUSTOM_MCP_MAX_TIMEOUT_MS, CUSTOM_MCP_OAUTH_PENDING_TTL_MS, isoDateTime, agentId, nonNegativeInt, customMcpUrlInputSchema, customMcpDisplayNameSchema, customMcpTimeoutSchema, CUSTOM_MCP_RESERVED_HEADER_NAMES, HEADER_NAME, HEADER_VALUE_FORBIDDEN, customMcpHeaderNameSchema, headerValue, customMcpHeadersSchema, customMcpHeadersPatchSchema, customMcpToolNameSchema, customMcpToolSchema, customMcpServerInfoSchema, customMcpToolSelectionSchema, customMcpToolsResponseSchema, customMcpFailureSchema, customMcpHealthSchema, customMcpErrorBodySchema, customMcpConnectionBlockSchema, customMcpConnectionViewSchema, customMcpConnectionResponseSchema, customMcpProbeBodySchema, customMcpOAuthDiscoverySchema, customMcpProbeResponseSchema, createFields, mountAgentField, customMcpCreateAgentBodySchema, customMcpCreateUserBodySchema, customMcpOAuthClientSchema, startFields, customMcpOAuthStartAgentBodySchema, customMcpOAuthStartUserBodySchema, customMcpOAuthStartResponseSchema, nonce, customMcpOAuthSuccessRedirectQuerySchema, CUSTOM_MCP_OAUTH_CALLBACK_ERRORS, customMcpOAuthFailureRedirectQuerySchema, customMcpOAuthFinalizeBodySchema, customMcpCimdDocumentSchema, customMcpPatchBodySchema, customMcpCredentialRequestSchema, customMcpCredentialAuthSchema, customMcpCredentialResponseSchema, CUSTOM_MCP_CREDENTIAL_ERRORS, customMcpCredentialErrorBodySchema, customMcpHealthReportSchema, customMcpProbeRequestSchema, customMcpProbeResultSchema, customMcpOriginUrlSchema, customMcpServerProjectionSchema, customMcpMountUpsertBodySchema;
7532
+ var __defProp3, __name3, PLUMBING_THREAD_CHANNELS, CHANNEL_CONVERSATION_CHANNELS, HIDDEN_THREAD_CHANNELS, CHOICE_PERSON_TURN_CHANNELS, CHOICE_REPLAY_CLIENT_CAPABILITIES, CHOICE_REPLAY_CLIENT_SURFACES, DECISION_PROVIDERS, DECISION_FALLBACK_PROVIDERS, OPENROUTER_DIRECT_VENDORS, OPENROUTER_NEEDS_MODEL_MESSAGE, DECISION_QUESTION_TYPES, DECISION_NAME_PATTERN, DECISION_SANDBOX_SITE_HEADER, DECISION_SANDBOX_PRIMITIVE_HEADER, DECISION_SANDBOX_TOOL_SEPARATOR, DECISION_LIMITS, DECISION_ERROR_CODES, DECISION_INACTIVE_CODE, MAX_NAME_CHARS, InstructionsSchema, NameSchema, OddsQuestionSchema, ChoiceQuestionSchema, ScoreQuestionSchema, DecisionQuestionSchema, DecisionOptionsSchema, DecisionQuestionsSchema, DecisionDefinitionSchema, DecisionDefinitionWriteSchema, INTEGRATION_PASSTHROUGH_READ_METHODS, URL_REINTERPRETED_PATH_CHARACTERS, PERCENT_ENCODED_DOT, PERCENT_ESCAPE, DECODED_PATH_SEPARATORS, DECODED_LEADING_SEPARATOR, MAX_PERCENT_DECODE_ROUNDS, URL_RESOLUTION_PROBE_BASE, PLATFORM_INVOCATION_CALLERS, MESSAGING_CHANNELS, VOICE_CHANNELS, TURN_CATEGORIES, AGENT_TOOL_CATEGORIES, count, AnthropicSseUsageReader, SUPERVISION_OPS, SUPERVISION_OPS_WAVE2, SUPERVISION_WATCHDOG_OPS, SUPERVISION_WATCHDOG_ERRORS, SUPERVISION_ROLLBACK_REFUSAL_CODES, SUPERVISION_ROLLBACK_LINEAGE_MAX, SUPERVISION_UNTARGETED_OPS, SUPERVISED_WORKFLOW_VERSIONS_MAX, SUPERVISION_EVENT_KINDS, AGENT_PROVISIONING_LIMITS, AGENT_PROVISIONING_APPROVAL_PAYLOAD_KEY, AGENT_PROVISIONING_ERRORS, PROVISIONED_SUPERVISION_ACTIONS, isNonEmptyString, uniqueStrings, sameSet, AGENT_PROVISIONING_APPROVAL_CARD_MAX_CHARS, APPROVAL_PAYLOAD_MEMBERS, AGENT_CONNECTION_POLICIES, AGENT_CONNECTION_POLICY_DEFAULT, AGENT_CONNECTION_MOUNT_MODES, AGENT_CONNECTION_GOVERNANCE_ERRORS, AGENT_CONNECTION_OPERATION_RULES_MAX, AGENT_CONNECTION_OPERATION_PATTERN_MAX_LENGTH, OPERATION_RULE_METHODS, PATH_SEPARATOR, PATH_SINGLE_SEGMENT_WILDCARD, PATH_REST_WILDCARD, METHOD_OVERRIDE_HEADER_NAMES, METHOD_OVERRIDE_QUERY_NAMES, ODATA_BATCH_SEGMENT, GOOGLE_BATCH_FIRST_SEGMENT, CONNECTION_CHECK_RESULTS, CONNECTION_CHECK_CATALOGUE_V1, CONNECTION_CHECK_NAME_PATTERN, CONNECTION_CHECK_NAME_MAX, CONNECT_OUTCOME_STATUSES, SECRET_TEST_RESULTS, SECRET_DATADOG_REGIONS, SECRET_PROVIDER_CATALOGUE_V1, SECRET_TEST_MAX_RESPONSE_BYTES, SECRET_ENV_KEY_PATTERN, SECRET_REQUEST_ERRORS, SECRET_OUTCOME_STATUSES, CLIENT_OUTCOME_TURNS_MAX, SHORT_TEXT_MAX, SLUG_MAX, shortText, optionalShortText, CONNECTION_REQUEST_TERMINAL_STATES, CONNECTION_USE_ORIGINS, AGENT_CONNECTION_OPERATION_LIMITS_BOUNDS, CURRENCY_CODE, LIMITS_KEYS, CAPS_KEYS, EXCLUSIONS_KEYS, EMAIL_IN_TEXT, MAX_EXCLUSION_DEPTH, PROJECTION_PARAMETER_KEYS, CHANNEL_PARAMETER_KEYS, GMAIL_SYSTEM_LABEL_IDS, ZERO_DECIMAL_CURRENCIES, THREE_DECIMAL_CURRENCIES, DECIMAL_AMOUNT, REDACTED_PLACEHOLDER, PROVIDER_MESSAGE_MAX_CHARS, ERROR_MESSAGE_MAX_CHARS, SECRET_LITERAL_PATTERNS, SECRET_NAME, SECRET_PAIR_PATTERNS, GROUP_COUNT, WORKFLOW_SECRET_KEY_RE, WORKFLOW_RESERVED_SECRET_KEYS, SCRUB_INPUT_MAX_CHARS, SCRUB_CUT_BACKOFF_CHARS, TEST_SESSION_ID_PATTERN, TEST_SESSION_COLLECTION_PREFIX, TEST_EFFECT_BODY_MAX_BYTES, TEST_EFFECT_DROPPED_HEADERS, EVAL_CREDITS_PER_1K_TOKENS, EVAL_RESERVED_TOOL_ID_PREFIXES, CONNECTION_HANDOVER_APPROVAL_PAYLOAD_KEY, CONNECTION_HANDOVER_APPROVAL_CARD_MAX_CHARS, CONNECTION_HANDOVER_LIMITS, MEMBERS, FORMAT_CHARS, oneLine, boundedString, AGENT_METRIC_NAME_PATTERN, AGENT_METRIC_LIMITS, AGENT_OBJECTIVE_ERRORS, CHANGE_LEASE_TTL_MINUTES_MIN, CHANGE_LEASE_TTL_MINUTES_MAX, CHANGE_LEASE_REASON_MAX, CHANGE_LEASE_ERRORS, AGENT_CONFIG_SET_LIMITS, SECRET_ENV_KEY_SUFFIXES, DEFAULT_OWNER_DEPARTURE_POLICY, AGENT_LIFECYCLE_ERRORS, USER_COST_COUNTER_TTL_SECONDS, USER_COST_ATTRIBUTION_CHANNELS, CALLER_DEDUPE_KEY_MAX, FOLLOW_UP_IDEMPOTENCY_TTL_SECONDS, THREAD_FOLLOW_UP_LIMITS, THREAD_FOLLOW_UP_ERRORS, PROGRESS_UPDATE_LIMITS, PAUSABLE_CAPABILITY_KINDS, UNIFIED_CATCH_UP_MAX_WINDOW_HOURS, UNIFIED_CATCH_UP_EVENTS, UNIFIED_CATCH_UP_FILTERABLE_OBJECT_TYPES, AGENT_NEVER_RULES_MAX, AGENT_NEVER_RULE_FIELD_MAX, AGENT_NEVER_RULE_INPUT_MATCH_MAX, NEVER_RULE_ID_PATTERN, NEVER_RULE_HTTP_METHODS, TEMPLATE_DISTRIBUTION_MODES, TAKEOVER_MAX_IDLE_MINUTES, MINUTES_PER_DAY, DEFAULT_IDLE_RELEASE_MINUTES, FALLBACK_IDLE_RELEASE_MINUTES, VARIATION_SELECTORS, SLACK_EMOJI_NAMES, SLACK_SHORTCODE, PLAIN_EMAIL_ADDRESS, DOMAIN, UNSAFE_TEXT, SLACK_CONVERSATION_ID, CHANNEL_SETTING_GROUPS, THREAD_SCOPING_NOUN, TAKEOVER_CHANNEL_TYPES, EMAIL_SETTINGS, SLACK_SETTING_DEFAULTS, SLACK_REACTION_MAX, SLACK_INTRO_MAX, SLACK_EXAMPLE_PROMPTS_MAX, SLACK_EXAMPLE_PROMPT_MAX, SLACK_SUPPORT_CONTACT_MAX, SLACK_SETTINGS, CHANNEL_SETTINGS, REVIEWABLE_ACTION_EXECUTE_TOOL_ALLOWLIST, REVIEWABLE_STANDING_START_TOOLS, REVIEWABLE_MCP_SEND_TOOL_SUFFIX, MCP_TOOL_READ_VERB_RE, MCP_DRAFT_CREATE_VERBS, NON_INTERACTIVE_CHANNELS, RICH_PARTS_MESSAGE_ID_PREFIX, SCREENSHOT_MESSAGE_ID_PREFIX, WORK_ITEMS_KEY, MAX_WORK_ITEMS, LIMITS, BROWSER_COMMANDS, BROWSER_COMMAND_NAMES, SERVER_TRIGGERED_BROWSER_SOURCES, BROWSER_FALLBACKS, DEFAULT_BROWSER_FALLBACK, PROXY_COUNTRY_CODE, BROWSER_LOG_CONTENT_MODES, DEFAULT_BROWSER_LOG_CONTENT, BROWSER_SCREENSHOT_POLICIES, DEFAULT_BROWSER_SCREENSHOT_POLICY, BROWSER_ENGINES, BROWSER_PROFILE_NAME_PATTERN, BROWSER_LIMIT_KEYS, BROWSER_LIMIT_MAX, BROWSER_EXECUTE_METHOD, BROWSER_GLOBAL_METHODS, BROWSER_EXECUTE_DEFAULT_TIMEOUT_MS, BROWSER_EXECUTE_MAX_TIMEOUT_MS, LOG_FIELDS_MAX_KEYS, LOG_FIELD_MAX_VALUE_BYTES, LOG_FIELDS_MAX_BYTES, LOG_FIELD_KEY_PATTERN, LOG_FIELD_SECRET_SHAPED_KEY_PATTERNS, LOG_FIELDS_CLAMPED_KEY, LOG_FIELD_ARRAY_COUNT_SUFFIX, LuaLogFieldsError, DESKTOP_FILE_COMMANDS, DESKTOP_FILE_COMMAND_SET, BROWSER_READ_FORMATS, BROWSER_READ_DEFAULT_TIMEOUT_MS, BROWSER_READ_MIN_TIMEOUT_MS, BROWSER_READ_MAX_TIMEOUT_MS, BROWSER_READ_MAX_CONTENT_CHARS, BROWSER_READ_DEFAULT_SELECTOR, BROWSER_READ_MATCH_SEPARATOR, BROWSER_READ_LOGIN_BLOCKER, BROWSER_ERROR_NAME, HTTP_STATUS_FAILURE, LOGIN_PATH_SEGMENTS, LOGIN_HOST_LABELS, AGENT_LOG_SOURCES, AGENT_LOG_ENVIRONMENTS, AGENT_LOG_FIELDS_MAX_WIRE_KEYS, BROWSER_LOG_EVENT_KINDS, BROWSER_LOG_ENGINES, BROWSER_SESSION_OPEN_REASONS, BROWSER_BLOCK_KINDS, BROWSER_WALL_KINDS, BROWSER_WALL_NEXT_ACTIONS, BROWSER_CONFIRM_DECISIONS, BROWSER_SESSION_CLOSE_REASONS, BROWSER_LOG_CONTEXT_KEYS, BROWSER_LOG_ID_MAX_CHARS, BROWSER_LOG_TEXT_MAX_CHARS, isString, isBoolean, isCount, isPlainObject2, oneOf, isLimits, EVENT_SHAPES, BASE_KEYS, BROWSER_WORKER_SESSION_ID_SEPARATOR, BROWSER_WORKER_BLOCK_REASON_MAX_CHARS, WORKFLOW_RETRY_BACKOFFS, WORKFLOW_RETRY_MIN_ATTEMPTS, WORKFLOW_RETRY_POLICY_KEYS, WORKFLOW_RETRY_MAX_ATTEMPTS, WORKFLOW_RETRY_ENGINE_KEYS, WORKFLOW_JOB_RESOURCES, WORKFLOW_SIDE_EFFECTS, WORKFLOW_AGENT_EFFORTS, WORKFLOW_MODEL_CLASSES, WORKFLOW_TASK_CLASSES, WORKFLOW_MODEL_TRAITS, WORKFLOW_MODEL_REASON_MAX_LENGTH, WORKFLOW_MODELS_COMPOSE_MODES, WORKFLOW_MODELS_PIN_MODES, WORKFLOW_MODELS_FALLBACK_MODES, WORKFLOW_MODELS_CONSENT_ACTIONS_MIN, WORKFLOW_DEFAULT_TASK_CLASS_MAP, WORKFLOW_MODELS_MAX_CLASS_DEFAULT, WORKFLOW_AUTONOMY_FORMS, WORKFLOW_AUTONOMY_NUMERIC_KEYS, WORKFLOW_AUTONOMY_ENVELOPE_KEYS, WORKFLOW_AUTONOMY_ENABLED_DEFAULT, WORKFLOW_AUTONOMY_DEFAULTS, WORKFLOW_AUTONOMY_CEILINGS, WORKFLOW_AUTONOMY_MAX_RUNS_PER_HOUR_ENV, WORKFLOW_AUTONOMY_MAX_RUNS_PER_HOUR_CEILING, WORKFLOW_AUTONOMY_FORMS_DEFAULT, WORKFLOW_AUTONOMY_MIN_VALUE, WORKFLOW_JOB_RANGES, WORKFLOW_JOB_RANGE_MEMBERS, WORKFLOW_SINGLE_STEP_TYPES, WORKFLOW_HITL_ENTRY_TYPES, WORKFLOW_ARM_ENTRY_TYPES, WORKFLOW_HITL_ARM_CONTAINERS, WORKFLOW_GRAPH_ENTRY_STEP_KINDS, WORKFLOW_ARM_ENTRY_STEP_KINDS, WORKFLOW_BUDGET_MAX_DURATION_SECONDS, MODEL_ID_BYOK_PROVIDERS, MODEL_CLASS_REF_PREFIX, MODEL_SNAPSHOT_SUFFIX, REASONING_EFFORT_VALUES, IMPLICIT_MODEL_SELECTION_SOURCES, PLATFORM_FALLBACK_MODEL_SOURCE, AGENT_NAME_TOKEN, DEFAULT_PERSONA_GUIDE, PERSONAL_SPACE_STARTING_PERSONA, LOG_DRAIN_TYPES_PHASE1, LOG_DRAIN_TYPES_PHASE2, LOG_DRAIN_TYPES_IMPLEMENTED, LOG_DRAIN_FORMATS, LOG_DRAIN_SEVERITIES, LOG_DRAIN_SOURCES, LOG_DRAIN_CONTENT_SOURCES, LOG_DRAIN_DEFAULT_SOURCES, LOG_DRAIN_MAX_PER_ORG, LOG_DRAIN_MAX_PER_ORG_ENTERPRISE, LOG_DRAIN_DATADOG_SITES, LOG_DRAIN_NEWRELIC_SITES, LOG_DRAIN_ENDPOINT_TEMPLATES, LOG_DRAIN_PRESET_SITES, LOG_DRAIN_BUCKET_NAME_PATTERN, LOG_DRAIN_BUCKET_HOST_PATTERNS, LOG_DRAIN_PRESET_HOST_SUFFIXES, DRAIN_CONTENT_ACK_ERROR_CODE, DRAIN_CONTENT_ACK_FIELD, DrainContentAckRequiredError, LOG_DRAIN_PRESET_PATHS, PRESET_SEGMENT_RE, LOG_DRAIN_QUOTAS, LOG_DRAIN_QUOTA_WARN_RATIO, LOG_DRAIN_QUOTA_DROP_DEBUG_RATIO, LOG_DRAIN_QUOTA_DROP_INFO_RATIO, LOG_DRAIN_QUOTA_PAUSE_RATIO, LOG_EXPORT_SOURCES, LOG_EXPORT_MAX_WINDOW_DAYS, LOG_EXPORT_MAX_WINDOW_MS, LOG_EXPORT_URL_TTL_SECONDS, LOG_EXPORT_FILE_RETENTION_DAYS, LOG_EXPORT_FILE_RETENTION_MS, LOG_EXPORT_PART_MAX_BYTES, LOG_DRAIN_NOTICE_RATE_LIMIT_MS, LOG_DRAIN_VERIFICATION_STALE_MS, LOG_DRAIN_DIGEST_INTERVAL_MS, LOG_DRAIN_DIGEST_MAX_ENTRIES, LOG_DRAIN_NOTICE_ERROR_MAX_CHARS, LOG_DRAIN_USAGE_LINE_ITEM, LOG_DRAIN_BYTES_PER_GIB, DEFAULT_LOG_DRAIN_PLAN_CONFIG, TIERS, LOG_CURSOR_MAX_LENGTH, LOG_CURSOR_MAX_ID_LENGTH, LOG_RELATIVE_TIME_PATTERN, LOG_ISO_TIME_PATTERN, RELATIVE_UNIT_MS, CORE_DRAINING_CODE, CORE_DRAINING_DEFAULT_RETRY_MS, CORE_DRAINING_MAX_RETRY_MS, VoiceNameSchema, PluginProviderSchema, RealtimeProviderSchema, PluginClassSchema, ModelDescriptorSchema, InferenceModelSchema, PluginModelSchema, RealtimeModelSchema, LuaVoiceModelSchema, TurnDetectionSchema, InterruptionSchema, BuiltinAudioClipSchema, AudioConfigSchema, BackgroundAudioEntrySchema, BackgroundAudioSchema, LuaVoiceConfigInnerSchema, LuaVoiceConfigSchema, LuaVoiceRefSchema, EventType, LUA_JOB_DEFAULT_TIMEOUT_SECONDS, LUA_JOB_MIN_TIMEOUT_SECONDS, LUA_JOB_MAX_TIMEOUT_SECONDS, KEYS, MAX_BODY_BYTES, MAX_ID_LENGTH, UTC_ISO, TEMPLATE_TRIGGER_URL_ENV_PREFIX, TEMPLATE_INSTALL_POLICY_PER_WORKSPACE_VALUES, SUBJECT_TYPES, SubjectTypeSchema, CREDENTIAL_TYPES, CredentialTypeSchema, DEVICE_OPERATIONS, DeviceOperationSchema, DEVICE_SCOPE_BY_OPERATION, DeviceBindingSchema, TYPED_API_KEY, IdSchema, SESSION_AUTH_TIME_MAX_S, PrincipalDescriptorSchema, ActorDescriptorSchema, PrincipalOwnerSchema, CredentialLifecycleSchema, GeneralCredentialDescriptorSchema, DeviceCredentialDescriptorSchema, GeneralPrincipalContextSchema, DeviceCredentialPrincipalContextSchema, RawPrincipalContextSchema, PrincipalContextSchema, DeviceCredentialClaimSchema, LUA_CLIENT_HEADER, LUA_CLIENT_APPS, SEMVER_PATTERN, WEB_RELEASE_PATTERN, CLIENT_HEADER_PATTERN, LUA_SESSION_ID_CLAIM, SESSION_REVOKED_CODE, AUTHZ_PROJECTION_VERSION, ProjectedScopeSchema, DisplayRoleSchema, AuthorizationPrincipalSchema, CredentialContextSchema, ProjectionAnomalySchema, ProjectedOrgSchema, ProjectedResourceSchema, CapabilityProfilesSchema, RoleCatalogSchema, EffectiveAuthorizationSchema, ResourcePageSchema, SYSTEM_USER_PREFIX, WORKFLOW_RUN_IN_FLIGHT, WORKFLOW_RUN_IDLE, WORKFLOW_RUN_TERMINAL, WORKFLOW_RUN_STATUSES, WORKFLOW_RUN_GATE_KINDS, WORKFLOW_STEP_STATUSES, WORKFLOW_STEP_IN_FLIGHT, WORKFLOW_SIGNAL_EVENT_SITES, ARCHIVE_WINDOW_MARGIN_DAYS, WORKFLOW_ORG_PURGING_TTL_S, WORKFLOW_ORG_PURGE_FORCE_AFTER_MS, IDEMPOTENCY_HOLDING_STATUSES, WORKFLOW_SCHEDULED_RUN_ID_PREFIX, CLOUD_TASK_RUN_ID_PREFIX, WORKFLOW_SCHEDULE_KEY_MAX, WORKFLOW_SCHEDULE_IDEMPOTENCY_KEY_PREFIX, WORKFLOW_OPERATION_ID_PREFIX, WORKFLOW_JOURNAL_PROTOCOL_VERSION, WORKFLOW_CONNECTION_KEY_RE, WORKFLOW_AGENT_APP_CONNECTION_PREFIX, WORKFLOW_JOB_MODEL_SOURCE_LABELS, WORKFLOW_SUSPEND_KINDS, WORKFLOW_RUN_NOTIFICATION_SUSPENDED_KINDS, WORKFLOW_SIGNAL_PAYLOAD_MAX_BYTES, WORKFLOW_SIGNAL_NAME_RE, WORKFLOW_SUSPEND_DEFAULT_TIMEOUT_HOURS, WORKFLOW_RESOLVE_OUTPUT_MAX_BYTES, SCHEDULE_HEALTH_NOTIFY_CHANNELS, SCHEDULE_HEALTH_DEFAULT_NOTIFY, SCHEDULE_HEALTH_LIMITS, KNOWN_KEYS, WORKFLOW_GOAL_JUDGE_SELF, APPROVAL_ARGS_MAX_CHARS, APPROVAL_ARG_STRING_MAX_CHARS, APPROVAL_ARGS_SUMMARY_MAX_CHARS, MAX_DEPTH, MAX_KEYS, MAX_ITEMS, MAX_NODES, MAX_KEY_CHARS, KEY_SCRUB_INPUT_MAX_CHARS, STRING_SCRUB_INPUT_MAX_CHARS, ELLIPSIS, SKIP, SCRUB_SECRETS_BEFORE_PERSIST_ENV, PERSIST_SCRUB_MAX_CHARS, PERSIST_SCRUB_REF_MAX_CHARS, WORKFLOW_AUDIT_EVENTS, WORKFLOW_AUDIT_METADATA_MAX_BYTES, INDENT, WRAP_WIDTH, NOUNS, GET_TOOL_NAMES, PREAMBLE, WORKFLOW_APPROVAL_OUTPUT_DECISIONS, WORKFLOW_APPROVAL_OUTPUT_SCHEMA, JSON_FENCE_RE, DEFAULT_ON_AGENT_FEATURES, SUBAGENT_PER_KEY_FLAG_ENV, PER_KEY_FLAG_VALUES, ONBOARDING_FLOW_KEY, ONBOARDING_SCHEMA_VERSION, id, copy, onboardingHeadingSchema, onboardingRichTextInlineSchema, onboardingRichTextSchema, onboardingDestinationSchema, onboardingArtworkSchema, onboardingAnswerSchema, onboardingQuestionSchema, onboardingTemplateSectionSchema, onboardingInstallScreenSchema, onboardingResultScreenSchema, onboardingConnectScreenSchema, onboardingTemplateContentSchema, onboardingUnavailableOutcomeSchema, onboardingFlowSchema, onboardingActorSchema, onboardingEditorSchema, onboardingPublicationSummarySchema, onboardingValidationIssueSchema, onboardingValidationResponseSchema, onboardingAssetSchema, onboardingPublicAssetSchema, getOnboardingConfigResponseSchema, saveOnboardingDraftRequestSchema, validateOnboardingRequestSchema, publishOnboardingRequestSchema, rollbackOnboardingRequestSchema, onboardingTemplateCatalogItemSchema, getPublishedOnboardingResponseSchema, WEB_ROUTE_PROTOCOL_VERSION, WEB_ROUTE_METHODS, WEB_ROUTE_REQUEST_HEADER_ALLOWLIST, WEB_ROUTE_RESPONSE_HEADER_ALLOWLIST, WEB_ROUTE_MAX_WALL_MS, WEB_ROUTE_MAX_REQUEST_BODY_BYTES, WEB_ROUTE_MAX_RESPONSE_BYTES, WEB_APP_NAME_PATTERN, WEB_APP_ENTRY_HTML_MAX_CHARS, WEB_APP_MAX_ASSETS, WEB_APP_ASSET_PATH_PATTERN, WEB_APP_ASSET_PATH_MAX_CHARS, WEB_APP_MAX_ROUTES, WEB_APP_MAX_ASSET_BYTES, WEB_APP_CSP_NONCE_PLACEHOLDER, EVIDENCE_SESSION_IDLE_MS, EVIDENCE_MIN_CONVERSATIONS, EVIDENCE_LOW_CONFIDENCE_N, EVIDENCE_SNIPPET_MAX_CHARS, EVIDENCE_EXAMPLES_PER_ITEM, EVIDENCE_SHOWN_ITEMS, EVIDENCE_LATENCY_BOUNDS_MS, EVIDENCE_WORD_BOUNDS, BAD_CONVERSATION_REASONS, ATTACHMENT_LINES, REVIEW_VERDICT_REASON_ORDER, ENV_TEMPLATE_SECRET_KEY_RE, CONNECTION_SEND_NOT_ALLOWED, CONNECTION_RECIPIENT_NOT_ALLOWED, NOT_SEND, PLAIN_ADDRESS, RecipientSet, MCP_MESSAGING_CREATE, MCP_CALENDAR_EVENT_WRITE, REPLY_KEYS, DEDICATED_MAIL_SLUGS, FULL_SUITE_SLUGS, WELL_KNOWN_MAIL_FOLDERS, MEMBER_KEYS, CANONICAL_ORIGIN, CANONICAL_PREFIX, STRICT_BASE64, GMAIL_PREFIX, GMAIL_MESSAGES_SEND, GMAIL_DRAFTS_SEND, GOOGLE_BATCH, GRAPH_VERSION, GRAPH_PRINCIPAL, GRAPH_SEND_MAIL, GRAPH_MESSAGE_ACTION, GRAPH_OWNER, GRAPH_EVENTS, GRAPH_EVENT_COLLECTION, GRAPH_EVENT_ID, GRAPH_EVENT_ITEM, GRAPH_EVENT_ACTION, GRAPH_BATCH, GRAPH_TEAMS_MESSAGE, GRAPH_ACTIVITY_NOTIFICATION, GRAPH_GROUP_CONVERSATION, GCAL_EVENTS, GRAPH_READ_KEYS, MALFORMED_POLICY, BILLING_REJECTION_TEXT_CREDITS, BILLING_REJECTION_TEXT_SEAT, BILLING_REJECTION_TEXT_USER_QUOTA, CUSTOM_MCP_CONNECTION_ID_PREFIX, CUSTOM_MCP_SOURCE, CUSTOM_MCP_TRANSPORT, CUSTOM_MCP_CONNECTION_ID_PATTERN, customMcpConnectionIdSchema, CONNECTION_BACKED_MCP_SOURCES, CUSTOM_MCP_REFERENCE_ID_PATTERN, customMcpReferenceIdSchema, CUSTOM_MCP_AUTH_KINDS, customMcpAuthKindSchema, CUSTOM_MCP_OAUTH_REGISTRATIONS, customMcpOAuthRegistrationSchema, CUSTOM_MCP_HEALTH_STATES, customMcpHealthStateSchema, CUSTOM_MCP_FAILURE_STEPS, customMcpFailureStepSchema, CUSTOM_MCP_CONNECT_STEPS, customMcpConnectStepSchema, customMcpFailureCodeSchema, WORKFLOW_KEY_MAX_LENGTH, CUSTOM_MCP_URL_MAX_LENGTH, CUSTOM_MCP_DISPLAY_NAME_MAX_LENGTH, CUSTOM_MCP_MAX_HEADERS, CUSTOM_MCP_HEADER_NAME_MAX_LENGTH, CUSTOM_MCP_HEADER_VALUE_MAX_LENGTH, CUSTOM_MCP_MAX_TOOLS, CUSTOM_MCP_TOOL_NAME_MAX_LENGTH, CUSTOM_MCP_TOOL_TEXT_MAX_LENGTH, CUSTOM_MCP_MIN_TIMEOUT_MS, CUSTOM_MCP_MAX_TIMEOUT_MS, CUSTOM_MCP_OAUTH_PENDING_TTL_MS, isoDateTime, agentId, nonNegativeInt, customMcpUrlInputSchema, customMcpDisplayNameSchema, customMcpTimeoutSchema, CUSTOM_MCP_RESERVED_HEADER_NAMES, HEADER_NAME, HEADER_VALUE_FORBIDDEN, customMcpHeaderNameSchema, headerValue, customMcpHeadersSchema, customMcpHeadersPatchSchema, customMcpToolNameSchema, customMcpToolSchema, customMcpServerInfoSchema, customMcpToolSelectionSchema, customMcpToolsResponseSchema, customMcpFailureSchema, customMcpHealthSchema, customMcpErrorBodySchema, customMcpConnectionBlockSchema, customMcpConnectionViewSchema, customMcpConnectionResponseSchema, customMcpProbeBodySchema, customMcpOAuthDiscoverySchema, customMcpProbeResponseSchema, createFields, mountAgentField, customMcpCreateAgentBodySchema, customMcpCreateUserBodySchema, customMcpOAuthClientSchema, startFields, customMcpOAuthStartAgentBodySchema, customMcpOAuthStartUserBodySchema, customMcpOAuthStartResponseSchema, nonce, customMcpOAuthSuccessRedirectQuerySchema, CUSTOM_MCP_OAUTH_CALLBACK_ERRORS, customMcpOAuthFailureRedirectQuerySchema, customMcpOAuthFinalizeBodySchema, customMcpCimdDocumentSchema, customMcpPatchBodySchema, customMcpCredentialRequestSchema, customMcpCredentialAuthSchema, customMcpCredentialResponseSchema, CUSTOM_MCP_CREDENTIAL_ERRORS, customMcpCredentialErrorBodySchema, customMcpHealthReportSchema, customMcpProbeRequestSchema, customMcpProbeResultSchema, customMcpOriginUrlSchema, customMcpServerProjectionSchema, customMcpMountUpsertBodySchema;
7500
7533
  var init_dist = __esm({
7501
7534
  "../shared-types/dist/index.mjs"() {
7502
7535
  "use strict";
@@ -7569,15 +7602,44 @@ var init_dist = __esm({
7569
7602
  __name(aiGenerateInputFromSimplified, "aiGenerateInputFromSimplified");
7570
7603
  __name3(aiGenerateInputFromSimplified, "aiGenerateInputFromSimplified");
7571
7604
  DECISION_PROVIDERS = [
7605
+ "jev",
7606
+ "openai",
7607
+ "openrouter"
7608
+ ];
7609
+ DECISION_FALLBACK_PROVIDERS = [
7572
7610
  "jev",
7573
7611
  "openai"
7574
7612
  ];
7613
+ OPENROUTER_DIRECT_VENDORS = [
7614
+ {
7615
+ pattern: /^~?typesafe\//,
7616
+ provider: "jev"
7617
+ },
7618
+ {
7619
+ pattern: /^openai\//,
7620
+ provider: "openai"
7621
+ }
7622
+ ];
7623
+ __name(directProviderOfOpenRouterModel, "directProviderOfOpenRouterModel");
7624
+ __name3(directProviderOfOpenRouterModel, "directProviderOfOpenRouterModel");
7625
+ OPENROUTER_NEEDS_MODEL_MESSAGE = "provider openrouter needs a model id, such as liquid/d1";
7626
+ __name(openRouterModelIssue, "openRouterModelIssue");
7627
+ __name3(openRouterModelIssue, "openRouterModelIssue");
7575
7628
  DECISION_QUESTION_TYPES = [
7576
7629
  "odds",
7577
7630
  "choice",
7578
7631
  "score"
7579
7632
  ];
7580
7633
  DECISION_NAME_PATTERN = /^[a-zA-Z0-9_-]{1,64}$/;
7634
+ DECISION_SANDBOX_SITE_HEADER = "x-lua-sandbox-site";
7635
+ DECISION_SANDBOX_PRIMITIVE_HEADER = "x-lua-sandbox-primitive";
7636
+ DECISION_SANDBOX_TOOL_SEPARATOR = "#";
7637
+ __name(formatDecisionSandboxPrimitive, "formatDecisionSandboxPrimitive");
7638
+ __name3(formatDecisionSandboxPrimitive, "formatDecisionSandboxPrimitive");
7639
+ __name(parseDecisionSandboxPrimitive, "parseDecisionSandboxPrimitive");
7640
+ __name3(parseDecisionSandboxPrimitive, "parseDecisionSandboxPrimitive");
7641
+ __name(decisionPublishStampKey, "decisionPublishStampKey");
7642
+ __name3(decisionPublishStampKey, "decisionPublishStampKey");
7581
7643
  DECISION_LIMITS = {
7582
7644
  maxQuestions: 64,
7583
7645
  minOptions: 2,
@@ -7603,7 +7665,8 @@ var init_dist = __esm({
7603
7665
  UNAVAILABLE: "decision_unavailable",
7604
7666
  DISABLED: "decision_disabled",
7605
7667
  INSUFFICIENT_CREDITS: "decision_insufficient_credits",
7606
- NOT_FOUND: "decision_not_found"
7668
+ NOT_FOUND: "decision_not_found",
7669
+ CANCELLED: "decision_cancelled"
7607
7670
  };
7608
7671
  DECISION_INACTIVE_CODE = "decision_inactive";
7609
7672
  MAX_NAME_CHARS = 64;
@@ -7645,7 +7708,7 @@ var init_dist = __esm({
7645
7708
  ]).optional(),
7646
7709
  model: z.string().min(1).optional(),
7647
7710
  fallback: z.union([
7648
- z.enum(DECISION_PROVIDERS),
7711
+ z.enum(DECISION_FALLBACK_PROVIDERS),
7649
7712
  z.literal("none")
7650
7713
  ]).optional(),
7651
7714
  region: z.literal("eu").optional(),
@@ -7674,6 +7737,16 @@ var init_dist = __esm({
7674
7737
  description: z.string().max(DECISION_LIMITS.maxInstructionChars).optional(),
7675
7738
  questions: DecisionQuestionsSchema
7676
7739
  }).strict();
7740
+ DecisionDefinitionWriteSchema = DecisionDefinitionSchema.superRefine((definition, ctx) => {
7741
+ const issue = openRouterModelIssue(definition);
7742
+ if (issue) ctx.addIssue({
7743
+ code: z.ZodIssueCode.custom,
7744
+ path: [
7745
+ "model"
7746
+ ],
7747
+ message: issue
7748
+ });
7749
+ });
7677
7750
  INTEGRATION_PASSTHROUGH_READ_METHODS = [
7678
7751
  "GET",
7679
7752
  "HEAD"
@@ -10224,7 +10297,11 @@ var init_dist = __esm({
10224
10297
  "max-steps",
10225
10298
  "cost-cap",
10226
10299
  "error",
10227
- "reaped"
10300
+ "reaped",
10301
+ "cancelled",
10302
+ "confirmation",
10303
+ "blocked",
10304
+ "stopped"
10228
10305
  ];
10229
10306
  BROWSER_LOG_CONTEXT_KEYS = [
10230
10307
  "runId",
@@ -10252,7 +10329,8 @@ var init_dist = __esm({
10252
10329
  optional: {
10253
10330
  limits: isLimits,
10254
10331
  region: isString,
10255
- liveUrl: isString
10332
+ liveUrl: isString,
10333
+ browser: isString
10256
10334
  }
10257
10335
  },
10258
10336
  command: {
@@ -13329,6 +13407,218 @@ var init_auth_error = __esm({
13329
13407
  }
13330
13408
  });
13331
13409
 
13410
+ // ../sandbox-runtime/dist/decisions-api.mjs
13411
+ function isRecord3(value3) {
13412
+ return typeof value3 === "object" && value3 !== null && !Array.isArray(value3);
13413
+ }
13414
+ function isProvider(value3) {
13415
+ return DECISION_PROVIDERS.includes(value3);
13416
+ }
13417
+ function invalid(message) {
13418
+ return new DecisionError(message, {
13419
+ code: DECISION_ERROR_CODES.INVALID
13420
+ });
13421
+ }
13422
+ function assertInstructions(builder, instructions) {
13423
+ if (typeof instructions !== "string" || instructions.trim().length === 0) {
13424
+ throw invalid(`Decisions.${builder} needs non-empty instructions`);
13425
+ }
13426
+ if (instructions.length > DECISION_LIMITS.maxInstructionChars) {
13427
+ throw invalid(`Decisions.${builder} instructions must be at most ${DECISION_LIMITS.maxInstructionChars} characters`);
13428
+ }
13429
+ }
13430
+ function assertCount(what, count2, min, max) {
13431
+ if (count2 < min || count2 > max) {
13432
+ throw invalid(`${what} must hold ${min} to ${max} entries, got ${count2}`);
13433
+ }
13434
+ }
13435
+ function odds(instructions, criteria) {
13436
+ assertInstructions("odds", instructions);
13437
+ if (criteria === void 0) return {
13438
+ type: "odds",
13439
+ instructions
13440
+ };
13441
+ if (!isRecord3(criteria)) throw invalid("Decisions.odds criteria must be an object like { yes, no }");
13442
+ return {
13443
+ type: "odds",
13444
+ instructions,
13445
+ criteria
13446
+ };
13447
+ }
13448
+ function choice(instructions, options) {
13449
+ assertInstructions("choice", instructions);
13450
+ if (!isRecord3(options)) throw invalid("Decisions.choice options must be an object of label to description");
13451
+ assertCount("Decisions.choice options", Object.keys(options).length, DECISION_LIMITS.minOptions, DECISION_LIMITS.maxOptions);
13452
+ return {
13453
+ type: "choice",
13454
+ instructions,
13455
+ options
13456
+ };
13457
+ }
13458
+ function score(instructions, levels) {
13459
+ assertInstructions("score", instructions);
13460
+ if (!Array.isArray(levels)) throw invalid("Decisions.score levels must be an array");
13461
+ assertCount("Decisions.score levels", levels.length, DECISION_LIMITS.minLevels, DECISION_LIMITS.maxLevels);
13462
+ return {
13463
+ type: "score",
13464
+ instructions,
13465
+ levels
13466
+ };
13467
+ }
13468
+ function assertDecisionQuestion(name, question) {
13469
+ if (!isRecord3(question) || !DECISION_QUESTION_TYPES.includes(question.type)) {
13470
+ throw invalid(`questions.${name} must be built with Decisions.odds, Decisions.choice or Decisions.score`);
13471
+ }
13472
+ if (typeof question.instructions !== "string" || question.instructions.trim().length === 0) {
13473
+ throw invalid(`questions.${name}.instructions must be a non-empty string`);
13474
+ }
13475
+ }
13476
+ function checkDecisionRequest(request2) {
13477
+ if (!isRecord3(request2)) {
13478
+ throw invalid("Decisions.ask needs { state, questions } or (state, question)");
13479
+ }
13480
+ if (request2.state === void 0 || request2.state === null) {
13481
+ throw invalid("Decisions.ask needs a state");
13482
+ }
13483
+ if (!isRecord3(request2.questions) || Object.keys(request2.questions).length === 0) {
13484
+ throw invalid("Decisions.ask needs at least one question in questions");
13485
+ }
13486
+ for (const [name, question] of Object.entries(request2.questions)) assertDecisionQuestion(name, question);
13487
+ return request2;
13488
+ }
13489
+ function checkDecisionRunRequest(request2) {
13490
+ if (typeof request2.name !== "string" || !DECISION_NAME_PATTERN.test(request2.name)) {
13491
+ throw invalid("Decisions.run needs the name of a decision declared on the agent");
13492
+ }
13493
+ if (request2.state === void 0 || request2.state === null) {
13494
+ throw invalid("Decisions.run needs a state");
13495
+ }
13496
+ return request2;
13497
+ }
13498
+ function toDecisionError(caught) {
13499
+ if (caught instanceof DecisionError) return caught;
13500
+ const raw = isRecord3(caught) ? caught : {};
13501
+ const detail = typeof raw.message === "string" && raw.message.length > 0 ? raw.message : "Decision failed";
13502
+ const code = typeof raw.code === "string" && raw.code.length > 0 ? raw.code : DECISION_ERROR_CODES.UNAVAILABLE;
13503
+ const message = detail.startsWith(`${code}: `) ? detail : `${code}: ${detail}`;
13504
+ return new DecisionError(message, {
13505
+ code,
13506
+ ...isProvider(raw.provider) && {
13507
+ provider: raw.provider
13508
+ },
13509
+ ...typeof raw.upstreamStatus === "number" && {
13510
+ upstreamStatus: raw.upstreamStatus
13511
+ },
13512
+ ...typeof raw.decisionId === "string" && {
13513
+ decisionId: raw.decisionId
13514
+ }
13515
+ });
13516
+ }
13517
+ function buildDecisionsApi(transport) {
13518
+ async function relay2(send) {
13519
+ if (!transport) {
13520
+ throw new DecisionError("Decisions is not available in this runtime", {
13521
+ code: DECISION_ERROR_CODES.UNAVAILABLE
13522
+ });
13523
+ }
13524
+ try {
13525
+ return await send(transport);
13526
+ } catch (caught) {
13527
+ throw toDecisionError(caught);
13528
+ }
13529
+ }
13530
+ __name(relay2, "relay");
13531
+ __name4(relay2, "relay");
13532
+ async function ask(requestOrState, question, options) {
13533
+ if (question === void 0) {
13534
+ const request22 = checkDecisionRequest(requestOrState);
13535
+ return relay2((t) => t.ask(request22));
13536
+ }
13537
+ const request2 = checkDecisionRequest({
13538
+ ...options,
13539
+ state: requestOrState,
13540
+ questions: {
13541
+ [SINGLE_DECISION_KEY]: question
13542
+ }
13543
+ });
13544
+ const result = await relay2((t) => t.ask(request2));
13545
+ return result.answers[SINGLE_DECISION_KEY];
13546
+ }
13547
+ __name(ask, "ask");
13548
+ __name4(ask, "ask");
13549
+ async function run(name, state3, options) {
13550
+ const request2 = checkDecisionRunRequest({
13551
+ ...options,
13552
+ name,
13553
+ state: state3
13554
+ });
13555
+ return await relay2((t) => t.run(request2));
13556
+ }
13557
+ __name(run, "run");
13558
+ __name4(run, "run");
13559
+ return {
13560
+ ask,
13561
+ run,
13562
+ odds,
13563
+ choice,
13564
+ score
13565
+ };
13566
+ }
13567
+ var __defProp4, __name4, DECISION_ERROR_NAME, SINGLE_DECISION_KEY, DecisionError;
13568
+ var init_decisions_api = __esm({
13569
+ "../sandbox-runtime/dist/decisions-api.mjs"() {
13570
+ "use strict";
13571
+ init_dist();
13572
+ __defProp4 = Object.defineProperty;
13573
+ __name4 = /* @__PURE__ */ __name((target, value3) => __defProp4(target, "name", { value: value3, configurable: true }), "__name");
13574
+ DECISION_ERROR_NAME = "DecisionError";
13575
+ SINGLE_DECISION_KEY = "answer";
13576
+ DecisionError = class extends Error {
13577
+ static {
13578
+ __name(this, "DecisionError");
13579
+ }
13580
+ static {
13581
+ __name4(this, "DecisionError");
13582
+ }
13583
+ code;
13584
+ constructor(message, fields) {
13585
+ super(message);
13586
+ this.name = DECISION_ERROR_NAME;
13587
+ this.code = fields.code;
13588
+ if (fields.provider !== void 0) this.provider = fields.provider;
13589
+ if (fields.upstreamStatus !== void 0) this.upstreamStatus = fields.upstreamStatus;
13590
+ if (fields.decisionId !== void 0) this.decisionId = fields.decisionId;
13591
+ }
13592
+ };
13593
+ __name(isRecord3, "isRecord");
13594
+ __name4(isRecord3, "isRecord");
13595
+ __name(isProvider, "isProvider");
13596
+ __name4(isProvider, "isProvider");
13597
+ __name(invalid, "invalid");
13598
+ __name4(invalid, "invalid");
13599
+ __name(assertInstructions, "assertInstructions");
13600
+ __name4(assertInstructions, "assertInstructions");
13601
+ __name(assertCount, "assertCount");
13602
+ __name4(assertCount, "assertCount");
13603
+ __name(odds, "odds");
13604
+ __name4(odds, "odds");
13605
+ __name(choice, "choice");
13606
+ __name4(choice, "choice");
13607
+ __name(score, "score");
13608
+ __name4(score, "score");
13609
+ __name(assertDecisionQuestion, "assertDecisionQuestion");
13610
+ __name4(assertDecisionQuestion, "assertDecisionQuestion");
13611
+ __name(checkDecisionRequest, "checkDecisionRequest");
13612
+ __name4(checkDecisionRequest, "checkDecisionRequest");
13613
+ __name(checkDecisionRunRequest, "checkDecisionRunRequest");
13614
+ __name4(checkDecisionRunRequest, "checkDecisionRunRequest");
13615
+ __name(toDecisionError, "toDecisionError");
13616
+ __name4(toDecisionError, "toDecisionError");
13617
+ __name(buildDecisionsApi, "buildDecisionsApi");
13618
+ __name4(buildDecisionsApi, "buildDecisionsApi");
13619
+ }
13620
+ });
13621
+
13332
13622
  // src/errors/cli.error.ts
13333
13623
  function apiErrorDetail(error) {
13334
13624
  return {
@@ -13357,6 +13647,12 @@ function joinHint(...parts) {
13357
13647
  const lines = parts.filter((part) => typeof part === "string" && part.length > 0);
13358
13648
  return lines.length > 0 ? lines.join("\n") : void 0;
13359
13649
  }
13650
+ function isLuaErrorBody(body) {
13651
+ return typeof body.message === "string" || typeof body.statusCode === "number" || typeof body.code === "string";
13652
+ }
13653
+ function isEdgeBlockedError(error) {
13654
+ return CliError.isCliError(error) && error.serverCode === EDGE_BLOCKED_CODE;
13655
+ }
13360
13656
  function isAccessDeniedError(error) {
13361
13657
  if (CliError.isCliError(error)) return error.statusCode === 403;
13362
13658
  return error instanceof Error && error.message.startsWith("Access denied (403)");
@@ -13459,6 +13755,41 @@ function numericStatus(error) {
13459
13755
  const candidate = error.statusCode ?? error.status;
13460
13756
  return typeof candidate === "number" && Number.isFinite(candidate) ? candidate : void 0;
13461
13757
  }
13758
+ function statusClass(status) {
13759
+ if (status === 401) return {
13760
+ code: "auth",
13761
+ exitCode: CLI_EXIT.AUTH
13762
+ };
13763
+ if (status === 403) return {
13764
+ code: "forbidden",
13765
+ exitCode: CLI_EXIT.FORBIDDEN
13766
+ };
13767
+ if (status === 404) return {
13768
+ code: "not_found",
13769
+ exitCode: CLI_EXIT.NOT_FOUND
13770
+ };
13771
+ if (status >= 400 && status < 500) return {
13772
+ code: `http_${status}`,
13773
+ exitCode: CLI_EXIT.FORBIDDEN
13774
+ };
13775
+ if (status >= 500 || status === 0) return {
13776
+ code: "unavailable",
13777
+ exitCode: CLI_EXIT.UNAVAILABLE
13778
+ };
13779
+ return void 0;
13780
+ }
13781
+ function decisionErrorClass(error, message) {
13782
+ if (error.name !== DECISION_ERROR_NAME || typeof error.code !== "string" || error.code.length === 0) return void 0;
13783
+ const status = Object.hasOwn(DECISION_STATUS, error.code) ? DECISION_STATUS[error.code] : void 0;
13784
+ return {
13785
+ code: error.code,
13786
+ exitCode: (status === void 0 ? void 0 : statusClass(status)?.exitCode) ?? CLI_EXIT.ERROR,
13787
+ message,
13788
+ ...typeof error.decisionId === "string" && error.decisionId.length > 0 ? {
13789
+ decisionId: error.decisionId
13790
+ } : {}
13791
+ };
13792
+ }
13462
13793
  function classifyCliError(error) {
13463
13794
  if (CliError.isCliError(error)) {
13464
13795
  return {
@@ -13488,40 +13819,15 @@ function classifyCliError(error) {
13488
13819
  message
13489
13820
  };
13490
13821
  }
13822
+ const decision = decisionErrorClass(e, message);
13823
+ if (decision) return decision;
13491
13824
  const status = numericStatus(e);
13492
- if (status !== void 0) {
13493
- const statusCode = status;
13494
- if (status === 401) return {
13495
- code: "auth",
13496
- exitCode: CLI_EXIT.AUTH,
13497
- message,
13498
- statusCode
13499
- };
13500
- if (status === 403) return {
13501
- code: "forbidden",
13502
- exitCode: CLI_EXIT.FORBIDDEN,
13503
- message,
13504
- statusCode
13505
- };
13506
- if (status === 404) return {
13507
- code: "not_found",
13508
- exitCode: CLI_EXIT.NOT_FOUND,
13509
- message,
13510
- statusCode
13511
- };
13512
- if (status >= 400 && status < 500) return {
13513
- code: `http_${status}`,
13514
- exitCode: CLI_EXIT.FORBIDDEN,
13515
- message,
13516
- statusCode
13517
- };
13518
- if (status >= 500 || status === 0) return {
13519
- code: "unavailable",
13520
- exitCode: CLI_EXIT.UNAVAILABLE,
13521
- message,
13522
- statusCode
13523
- };
13524
- }
13825
+ const byStatus = status === void 0 ? void 0 : statusClass(status);
13826
+ if (byStatus) return {
13827
+ ...byStatus,
13828
+ message,
13829
+ statusCode: status
13830
+ };
13525
13831
  const causeCode = e.cause?.code;
13526
13832
  if (typeof e.code === "string" && NETWORK_ERRNO.has(e.code) || typeof causeCode === "string" && NETWORK_ERRNO.has(causeCode) || e.name === "AbortError" || e.name === "TimeoutError" || NETWORK_MESSAGE.test(message)) {
13527
13833
  return {
@@ -13560,20 +13866,26 @@ function renderCliError(reported, options = {}) {
13560
13866
  if (options.stack) lines.push("", options.stack);
13561
13867
  return lines;
13562
13868
  }
13563
- function cliErrorEnvelope(error) {
13869
+ function cliErrorDetail(error) {
13564
13870
  const reported = classifyCliError(error);
13871
+ return {
13872
+ code: reported.serverCode ?? reported.code,
13873
+ ...reported.statusCode !== void 0 ? {
13874
+ statusCode: reported.statusCode
13875
+ } : {},
13876
+ message: reported.message,
13877
+ ...reported.issues?.length ? {
13878
+ issues: reported.issues
13879
+ } : {},
13880
+ ...reported.decisionId ? {
13881
+ decisionId: reported.decisionId
13882
+ } : {}
13883
+ };
13884
+ }
13885
+ function cliErrorEnvelope(error) {
13565
13886
  return {
13566
13887
  success: false,
13567
- error: {
13568
- code: reported.serverCode ?? reported.code,
13569
- ...reported.statusCode !== void 0 ? {
13570
- statusCode: reported.statusCode
13571
- } : {},
13572
- message: reported.message,
13573
- ...reported.issues?.length ? {
13574
- issues: reported.issues
13575
- } : {}
13576
- }
13888
+ error: cliErrorDetail(error)
13577
13889
  };
13578
13890
  }
13579
13891
  function reportCliError(error, options = {}) {
@@ -13612,10 +13924,12 @@ function reportUnhandledCliError(error) {
13612
13924
  process.exitCode = reported.exitCode;
13613
13925
  return reported.exitCode;
13614
13926
  }
13615
- var CLI_EXIT, CliError, HandledCliError, debugFlag, NETWORK_ERRNO, NETWORK_MESSAGE, UNAVAILABLE_HINT, VENDOR_RETRY_SOON_SECONDS, VENDOR_LABELS, PROVIDER_REJECTED_SERVER_CODE, PROVIDER_REJECTED_HTTP_STATUS, PROVIDER_REJECTION_REASONS, PROVIDER_REJECTED_NO_RETRY, PROVIDER_REJECTED_LUA_SIDE, MODEL_SETTINGS_URL, CLI_EXIT_CODE_HELP;
13927
+ var CLI_EXIT, CliError, EDGE_BLOCKED_CODE, HandledCliError, debugFlag, NETWORK_ERRNO, NETWORK_MESSAGE, UNAVAILABLE_HINT, VENDOR_RETRY_SOON_SECONDS, VENDOR_LABELS, PROVIDER_REJECTED_SERVER_CODE, PROVIDER_REJECTED_HTTP_STATUS, PROVIDER_REJECTION_REASONS, PROVIDER_REJECTED_NO_RETRY, PROVIDER_REJECTED_LUA_SIDE, MODEL_SETTINGS_URL, DECISION_STATUS, CLI_EXIT_CODE_HELP;
13616
13928
  var init_cli_error = __esm({
13617
13929
  "src/errors/cli.error.ts"() {
13618
13930
  "use strict";
13931
+ init_dist();
13932
+ init_decisions_api();
13619
13933
  init_auth_error();
13620
13934
  CLI_EXIT = {
13621
13935
  OK: 0,
@@ -13726,6 +14040,9 @@ var init_cli_error = __esm({
13726
14040
  __name(isTypedCliError, "isTypedCliError");
13727
14041
  __name(listHint, "listHint");
13728
14042
  __name(joinHint, "joinHint");
14043
+ EDGE_BLOCKED_CODE = "EDGE_BLOCKED";
14044
+ __name(isLuaErrorBody, "isLuaErrorBody");
14045
+ __name(isEdgeBlockedError, "isEdgeBlockedError");
13729
14046
  __name(isAccessDeniedError, "isAccessDeniedError");
13730
14047
  HandledCliError = class extends Error {
13731
14048
  static {
@@ -13792,9 +14109,22 @@ var init_cli_error = __esm({
13792
14109
  __name(providerRejectedHint, "providerRejectedHint");
13793
14110
  __name(authHint, "authHint");
13794
14111
  __name(numericStatus, "numericStatus");
14112
+ __name(statusClass, "statusClass");
14113
+ DECISION_STATUS = {
14114
+ [DECISION_ERROR_CODES.INVALID]: 400,
14115
+ [DECISION_ERROR_CODES.INSUFFICIENT_CREDITS]: 402,
14116
+ [DECISION_ERROR_CODES.NOT_FOUND]: 404,
14117
+ [DECISION_ERROR_CODES.REJECTED]: 422,
14118
+ [DECISION_ERROR_CODES.TIMEOUT]: 503,
14119
+ [DECISION_ERROR_CODES.UNAVAILABLE]: 503,
14120
+ [DECISION_ERROR_CODES.DISABLED]: 503,
14121
+ [DECISION_ERROR_CODES.CANCELLED]: 400
14122
+ };
14123
+ __name(decisionErrorClass, "decisionErrorClass");
13795
14124
  __name(classifyCliError, "classifyCliError");
13796
14125
  __name(issueLines, "issueLines");
13797
14126
  __name(renderCliError, "renderCliError");
14127
+ __name(cliErrorDetail, "cliErrorDetail");
13798
14128
  __name(cliErrorEnvelope, "cliErrorEnvelope");
13799
14129
  __name(reportCliError, "reportCliError");
13800
14130
  __name(commanderExitCode, "commanderExitCode");
@@ -14832,12 +15162,12 @@ function renderWorkflowJobTarget(target, initData) {
14832
15162
  templated: true
14833
15163
  };
14834
15164
  }
14835
- var __defProp4, __name4, WORKFLOW_JOB_TOOLS, WORKFLOW_JOB_READ_ONLY_DROPPED, WORKFLOW_JOB_DEFAULT_TOOLS, WORKFLOW_JOB_PLUGINS, WORKFLOW_JOB_PLUGIN_ROOT, WORKFLOW_JOB_PLUGINS_MAX, WORKFLOW_JOB_TARGET_TEMPLATE_RE, TARGET_PATH_SEGMENT_RE;
15165
+ var __defProp5, __name5, WORKFLOW_JOB_TOOLS, WORKFLOW_JOB_READ_ONLY_DROPPED, WORKFLOW_JOB_DEFAULT_TOOLS, WORKFLOW_JOB_PLUGINS, WORKFLOW_JOB_PLUGIN_ROOT, WORKFLOW_JOB_PLUGINS_MAX, WORKFLOW_JOB_TARGET_TEMPLATE_RE, TARGET_PATH_SEGMENT_RE;
14836
15166
  var init_workflow_job_tools = __esm({
14837
15167
  "../shared-types/dist/workflow-job-tools.mjs"() {
14838
15168
  "use strict";
14839
- __defProp4 = Object.defineProperty;
14840
- __name4 = /* @__PURE__ */ __name((target, value3) => __defProp4(target, "name", { value: value3, configurable: true }), "__name");
15169
+ __defProp5 = Object.defineProperty;
15170
+ __name5 = /* @__PURE__ */ __name((target, value3) => __defProp5(target, "name", { value: value3, configurable: true }), "__name");
14841
15171
  WORKFLOW_JOB_TOOLS = [
14842
15172
  "shell",
14843
15173
  "read",
@@ -14866,34 +15196,34 @@ var init_workflow_job_tools = __esm({
14866
15196
  "git"
14867
15197
  ];
14868
15198
  __name(effectiveJobTools, "effectiveJobTools");
14869
- __name4(effectiveJobTools, "effectiveJobTools");
15199
+ __name5(effectiveJobTools, "effectiveJobTools");
14870
15200
  WORKFLOW_JOB_PLUGINS = [
14871
15201
  "lua-agent-builder"
14872
15202
  ];
14873
15203
  WORKFLOW_JOB_PLUGIN_ROOT = "/opt/lua/plugins";
14874
15204
  WORKFLOW_JOB_PLUGINS_MAX = 4;
14875
15205
  __name(isWorkflowJobPluginId, "isWorkflowJobPluginId");
14876
- __name4(isWorkflowJobPluginId, "isWorkflowJobPluginId");
15206
+ __name5(isWorkflowJobPluginId, "isWorkflowJobPluginId");
14877
15207
  __name(workflowJobPluginDir, "workflowJobPluginDir");
14878
- __name4(workflowJobPluginDir, "workflowJobPluginDir");
15208
+ __name5(workflowJobPluginDir, "workflowJobPluginDir");
14879
15209
  __name(workflowJobPluginsProblem, "workflowJobPluginsProblem");
14880
- __name4(workflowJobPluginsProblem, "workflowJobPluginsProblem");
15210
+ __name5(workflowJobPluginsProblem, "workflowJobPluginsProblem");
14881
15211
  WORKFLOW_JOB_TARGET_TEMPLATE_RE = /^\$\{\s*initData\.([A-Za-z0-9_.\-[\]]+)\s*\}$/;
14882
15212
  TARGET_PATH_SEGMENT_RE = /^[A-Za-z0-9_-]+(?:\[(?:0|[1-9]\d*)\])*$/;
14883
15213
  __name(workflowJobTargetTemplatePath, "workflowJobTargetTemplatePath");
14884
- __name4(workflowJobTargetTemplatePath, "workflowJobTargetTemplatePath");
15214
+ __name5(workflowJobTargetTemplatePath, "workflowJobTargetTemplatePath");
14885
15215
  __name(isWorkflowJobTargetTemplate, "isWorkflowJobTargetTemplate");
14886
- __name4(isWorkflowJobTargetTemplate, "isWorkflowJobTargetTemplate");
15216
+ __name5(isWorkflowJobTargetTemplate, "isWorkflowJobTargetTemplate");
14887
15217
  __name(workflowJobLuaApiProblem, "workflowJobLuaApiProblem");
14888
- __name4(workflowJobLuaApiProblem, "workflowJobLuaApiProblem");
15218
+ __name5(workflowJobLuaApiProblem, "workflowJobLuaApiProblem");
14889
15219
  __name(workflowJobUsesLuaApi, "workflowJobUsesLuaApi");
14890
- __name4(workflowJobUsesLuaApi, "workflowJobUsesLuaApi");
15220
+ __name5(workflowJobUsesLuaApi, "workflowJobUsesLuaApi");
14891
15221
  __name(workflowJobTargetProblem, "workflowJobTargetProblem");
14892
- __name4(workflowJobTargetProblem, "workflowJobTargetProblem");
15222
+ __name5(workflowJobTargetProblem, "workflowJobTargetProblem");
14893
15223
  __name(readInitDataPath, "readInitDataPath");
14894
- __name4(readInitDataPath, "readInitDataPath");
15224
+ __name5(readInitDataPath, "readInitDataPath");
14895
15225
  __name(renderWorkflowJobTarget, "renderWorkflowJobTarget");
14896
- __name4(renderWorkflowJobTarget, "renderWorkflowJobTarget");
15226
+ __name5(renderWorkflowJobTarget, "renderWorkflowJobTarget");
14897
15227
  }
14898
15228
  });
14899
15229
 
@@ -15001,7 +15331,7 @@ function isMapDescriptor(v) {
15001
15331
  if (v === null || typeof v !== "object" || Array.isArray(v)) return false;
15002
15332
  const d = v;
15003
15333
  const keys = Object.keys(d);
15004
- const only = /* @__PURE__ */ __name5((...allowed2) => keys.every((k) => allowed2.includes(k)), "only");
15334
+ const only = /* @__PURE__ */ __name6((...allowed2) => keys.every((k) => allowed2.includes(k)), "only");
15005
15335
  if ("value" in d) return keys.length === 1;
15006
15336
  if ("template" in d) return keys.length === 1 && typeof d.template === "string";
15007
15337
  if ("requestContextPath" in d) return keys.length === 1 && typeof d.requestContextPath === "string";
@@ -15280,13 +15610,13 @@ function validateApproverBlock(node, opts = {
15280
15610
  path: "approval"
15281
15611
  }) {
15282
15612
  const issues = [];
15283
- const push = /* @__PURE__ */ __name5((code, path32, message, severity = "error") => issues.push({
15613
+ const push = /* @__PURE__ */ __name6((code, path32, message, severity = "error") => issues.push({
15284
15614
  code,
15285
15615
  path: path32,
15286
15616
  severity,
15287
15617
  message
15288
15618
  }), "push");
15289
- const checkSpec = /* @__PURE__ */ __name5((spec, path32) => {
15619
+ const checkSpec = /* @__PURE__ */ __name6((spec, path32) => {
15290
15620
  const r = ApproverSpecSchema.safeParse(spec);
15291
15621
  if (!r.success) {
15292
15622
  const users = spec?.users;
@@ -15641,7 +15971,7 @@ function validateLuaExtensions(g, caps = WORKFLOW_CAPS_DEFAULT, opts = {
15641
15971
  static: true
15642
15972
  }) {
15643
15973
  const issues = [];
15644
- const err = /* @__PURE__ */ __name5((code, message, path32, stepId) => {
15974
+ const err = /* @__PURE__ */ __name6((code, message, path32, stepId) => {
15645
15975
  issues.push({
15646
15976
  code,
15647
15977
  message,
@@ -15650,7 +15980,7 @@ function validateLuaExtensions(g, caps = WORKFLOW_CAPS_DEFAULT, opts = {
15650
15980
  stepId
15651
15981
  });
15652
15982
  }, "err");
15653
- const warn = /* @__PURE__ */ __name5((code, message, path32, stepId) => {
15983
+ const warn = /* @__PURE__ */ __name6((code, message, path32, stepId) => {
15654
15984
  issues.push({
15655
15985
  code,
15656
15986
  message,
@@ -15717,7 +16047,7 @@ function validateLuaExtensions(g, caps = WORKFLOW_CAPS_DEFAULT, opts = {
15717
16047
  ownKeys.add(key);
15718
16048
  declaredKeys.add(key);
15719
16049
  });
15720
- const undeclaredKey = /* @__PURE__ */ __name5((ref) => typeof ref === "string" && !declaredKeys.has(ref) && isConnectionKeyShaped(ref) && opts.connectionIds?.has(ref) !== true, "undeclaredKey");
16050
+ const undeclaredKey = /* @__PURE__ */ __name6((ref) => typeof ref === "string" && !declaredKeys.has(ref) && isConnectionKeyShaped(ref) && opts.connectionIds?.has(ref) !== true, "undeclaredKey");
15721
16051
  const credentialsRef = envelopeWorkspace?.credentialsRef;
15722
16052
  if (undeclaredKey(credentialsRef)) {
15723
16053
  err("connection-key-undeclared", connectionKeyUndeclaredMessage("workspace.credentialsRef", credentialsRef), "workspace.credentialsRef");
@@ -15725,7 +16055,7 @@ function validateLuaExtensions(g, caps = WORKFLOW_CAPS_DEFAULT, opts = {
15725
16055
  const seen = /* @__PURE__ */ new Map();
15726
16056
  let nodeCount = 0;
15727
16057
  const upstream = /* @__PURE__ */ new Set();
15728
- const checkId = /* @__PURE__ */ __name5((id2, path32) => {
16058
+ const checkId = /* @__PURE__ */ __name6((id2, path32) => {
15729
16059
  nodeCount += 1;
15730
16060
  if (seen.has(id2)) {
15731
16061
  err("duplicate-step-id", `step id "${id2}" is declared twice (first at ${seen.get(id2)})`, path32, id2);
@@ -15733,9 +16063,9 @@ function validateLuaExtensions(g, caps = WORKFLOW_CAPS_DEFAULT, opts = {
15733
16063
  seen.set(id2, path32);
15734
16064
  }
15735
16065
  }, "checkId");
15736
- const checkPolicyEnums = /* @__PURE__ */ __name5((node, path32) => {
16066
+ const checkPolicyEnums = /* @__PURE__ */ __name6((node, path32) => {
15737
16067
  const id2 = singleId(node);
15738
- const check = /* @__PURE__ */ __name5((member, allowed2) => {
16068
+ const check = /* @__PURE__ */ __name6((member, allowed2) => {
15739
16069
  const value22 = node[member];
15740
16070
  if (value22 === void 0 || typeof value22 === "string" && allowed2.includes(value22)) return;
15741
16071
  err("invalid-envelope", `\`${member}\` must be ${allowed2.map((a) => `'${a}'`).join(" | ")} (got ${JSON.stringify(value22)})`, `${path32}.${member}`, id2);
@@ -15743,7 +16073,7 @@ function validateLuaExtensions(g, caps = WORKFLOW_CAPS_DEFAULT, opts = {
15743
16073
  check("sideEffects", WORKFLOW_SIDE_EFFECTS);
15744
16074
  check("jobResources", WORKFLOW_JOB_RESOURCES);
15745
16075
  }, "checkPolicyEnums");
15746
- const checkRetry = /* @__PURE__ */ __name5((node, path32) => {
16076
+ const checkRetry = /* @__PURE__ */ __name6((node, path32) => {
15747
16077
  const r = node.retry;
15748
16078
  if (!r) return;
15749
16079
  const id2 = singleId(node);
@@ -15769,7 +16099,7 @@ function validateLuaExtensions(g, caps = WORKFLOW_CAPS_DEFAULT, opts = {
15769
16099
  }
15770
16100
  }
15771
16101
  }, "checkRetry");
15772
- const checkTimeout = /* @__PURE__ */ __name5((node, path32) => {
16102
+ const checkTimeout = /* @__PURE__ */ __name6((node, path32) => {
15773
16103
  const t = node.timeoutSeconds;
15774
16104
  if (t === void 0) return;
15775
16105
  const id2 = singleId(node);
@@ -15788,7 +16118,7 @@ function validateLuaExtensions(g, caps = WORKFLOW_CAPS_DEFAULT, opts = {
15788
16118
  err("timeout-exceeds-tier", `timeoutSeconds ${t} exceeds the worker tier's ${caps.maxWorkerTimeoutSeconds} s \u2014 steps longer than 10 min run on the Job tier: add tier:'job' (up to ${caps.maxJobSegmentSeconds} s)`, `${path32}.timeoutSeconds`, id2);
15789
16119
  }
15790
16120
  }, "checkTimeout");
15791
- const checkSpecialistRole = /* @__PURE__ */ __name5((node, path32) => {
16121
+ const checkSpecialistRole = /* @__PURE__ */ __name6((node, path32) => {
15792
16122
  const role = node.role;
15793
16123
  const hasRef = typeof role.ref === "string";
15794
16124
  const hasInline = role.name !== void 0 || role.instructions !== void 0 || Array.isArray(role.tools) && role.tools.length > 0;
@@ -15820,7 +16150,7 @@ function validateLuaExtensions(g, caps = WORKFLOW_CAPS_DEFAULT, opts = {
15820
16150
  }
15821
16151
  }
15822
16152
  }, "checkSpecialistRole");
15823
- const checkRequiredConnections = /* @__PURE__ */ __name5((node, path32) => {
16153
+ const checkRequiredConnections = /* @__PURE__ */ __name6((node, path32) => {
15824
16154
  const required = node.requiredConnections;
15825
16155
  if (!Array.isArray(required)) return;
15826
16156
  const undeclared = required.filter(undeclaredKey);
@@ -15833,7 +16163,7 @@ function validateLuaExtensions(g, caps = WORKFLOW_CAPS_DEFAULT, opts = {
15833
16163
  err("required-connection-unknown", `requiredConnections ${JSON.stringify(unknown)} are neither declared connections[].key values nor connections the owner can mount`, `${path32}.requiredConnections`, singleId(node));
15834
16164
  }
15835
16165
  }, "checkRequiredConnections");
15836
- const jobClassifiablePin = /* @__PURE__ */ __name5((model) => {
16166
+ const jobClassifiablePin = /* @__PURE__ */ __name6((model) => {
15837
16167
  const pin = staticModelPin(model);
15838
16168
  const modelClass = modelClassOf(pin);
15839
16169
  if (modelClass === void 0) return pin;
@@ -15848,7 +16178,7 @@ function validateLuaExtensions(g, caps = WORKFLOW_CAPS_DEFAULT, opts = {
15848
16178
  }
15849
16179
  return void 0;
15850
16180
  }, "jobClassifiablePin");
15851
- const checkTier = /* @__PURE__ */ __name5((node, path32) => {
16181
+ const checkTier = /* @__PURE__ */ __name6((node, path32) => {
15852
16182
  const id2 = singleId(node);
15853
16183
  if (node.workspace && node.workspace !== "inherit" && node.tier !== void 0 && node.tier !== "job") {
15854
16184
  err("workspace-requires-job-tier", "a step mounting a workspace must be tier:'job'", `${path32}.workspace`, id2);
@@ -15864,7 +16194,7 @@ function validateLuaExtensions(g, caps = WORKFLOW_CAPS_DEFAULT, opts = {
15864
16194
  err("job-tier-provider-unsupported", `model provider '${provider}' is outside LUA_WF_JOB_PROVIDERS [${opts.policy.jobProviders.join(", ")}]`, `${path32}.model`, id2);
15865
16195
  }
15866
16196
  }, "checkTier");
15867
- const checkModel = /* @__PURE__ */ __name5((node, path32) => {
16197
+ const checkModel = /* @__PURE__ */ __name6((node, path32) => {
15868
16198
  if (node.type !== "agent" || typeof node.model !== "string") return;
15869
16199
  const id2 = singleId(node);
15870
16200
  const parsed = parseModelTemplate(node.model);
@@ -15881,7 +16211,7 @@ function validateLuaExtensions(g, caps = WORKFLOW_CAPS_DEFAULT, opts = {
15881
16211
  const pin = parsed.kind === "template" ? parsed.template.default : node.model;
15882
16212
  if (pin === void 0) return;
15883
16213
  if (isModelClassRef(pin)) return;
15884
- const inContext = /* @__PURE__ */ __name5((message) => parsed.kind === "template" ? `${message} (the default of ${parsed.template.placeholder})` : message, "inContext");
16214
+ const inContext = /* @__PURE__ */ __name6((message) => parsed.kind === "template" ? `${message} (the default of ${parsed.template.placeholder})` : message, "inContext");
15885
16215
  const registry = opts.approvedModels;
15886
16216
  if (registry === void 0) return;
15887
16217
  if (registry === "unavailable") {
@@ -15894,13 +16224,13 @@ function validateLuaExtensions(g, caps = WORKFLOW_CAPS_DEFAULT, opts = {
15894
16224
  const resolved2 = normalizeModelId(pin, registry);
15895
16225
  if (!resolved2.ok) err("model-unresolved", inContext(modelUnresolvedMessage(resolved2)), `${path32}.model`, id2);
15896
16226
  }, "checkModel");
15897
- const checkTaskClass = /* @__PURE__ */ __name5((node, path32) => {
16227
+ const checkTaskClass = /* @__PURE__ */ __name6((node, path32) => {
15898
16228
  if (node.type !== "agent" || node.taskClass === void 0) return;
15899
16229
  if (!opts.static) return;
15900
16230
  if (typeof node.model === "string" && node.model.trim()) return;
15901
16231
  err("task-class-without-model", `taskClass '${String(node.taskClass)}' needs a \`model\` on a pushed definition \u2014 write a class (model: 'class/fast' | 'class/balanced' | 'class/strong') or an approved provider/model code; nothing maps a task class to a model at dispatch, so a step with neither would run on the agent\u2019s own model`, `${path32}.taskClass`, singleId(node));
15902
16232
  }, "checkTaskClass");
15903
- const checkWorkspace = /* @__PURE__ */ __name5((node, path32) => {
16233
+ const checkWorkspace = /* @__PURE__ */ __name6((node, path32) => {
15904
16234
  const id2 = singleId(node);
15905
16235
  const ws = workspaceOf(node);
15906
16236
  if (isJobTier(node) && opts.policy && opts.policy.jobTier !== true) {
@@ -15970,16 +16300,16 @@ function validateLuaExtensions(g, caps = WORKFLOW_CAPS_DEFAULT, opts = {
15970
16300
  }
15971
16301
  }, "checkWorkspace");
15972
16302
  const outputSchemas = /* @__PURE__ */ new Map();
15973
- const recordOutputSchema = /* @__PURE__ */ __name5((node) => {
16303
+ const recordOutputSchema = /* @__PURE__ */ __name6((node) => {
15974
16304
  const schema = node.type === "step" ? node.step.outputSchema : node.type === "agent" ? node.outputSchema : void 0;
15975
16305
  if (schema !== void 0) outputSchemas.set(singleId(node), schema);
15976
16306
  }, "recordOutputSchema");
15977
- const checkMapMembers = /* @__PURE__ */ __name5((cfg, basePath, id2) => {
16307
+ const checkMapMembers = /* @__PURE__ */ __name6((cfg, basePath, id2) => {
15978
16308
  for (const m of malformedMapMembers(cfg)) {
15979
16309
  warn(MAP_MEMBER_MALFORMED_CODE, mapMemberMalformedMessage(id2, m), `${basePath}.${m.member}`, id2);
15980
16310
  }
15981
16311
  }, "checkMapMembers");
15982
- const checkInputShape = /* @__PURE__ */ __name5((node, path32) => {
16312
+ const checkInputShape = /* @__PURE__ */ __name6((node, path32) => {
15983
16313
  const input = node.input;
15984
16314
  if (input === void 0) return;
15985
16315
  const id2 = singleId(node);
@@ -15989,11 +16319,11 @@ function validateLuaExtensions(g, caps = WORKFLOW_CAPS_DEFAULT, opts = {
15989
16319
  }
15990
16320
  err("invalid-envelope", `\`input\` must be an object map \u2014 each member a binding descriptor ({initData:true, path} | {step, path} | {value} | {template} | {requestContextPath}) or a JSON literal (got ${JSON.stringify(input)})`, `${path32}.input`, id2);
15991
16321
  }, "checkInputShape");
15992
- const checkBodyInput = /* @__PURE__ */ __name5((body, path32, container) => {
16322
+ const checkBodyInput = /* @__PURE__ */ __name6((body, path32, container) => {
15993
16323
  if (body.type === "workflow" || body.input === void 0) return;
15994
16324
  err("arm-input-unsupported", container === "foreach" ? `a foreach body receives each item as its input \u2014 drop \`input\` on "${singleId(body)}" and map the items before the foreach instead` : `a loop body receives the previous output as its input \u2014 drop \`input\` on "${singleId(body)}" and put the map before the loop instead`, `${path32}.input`, singleId(body));
15995
16325
  }, "checkBodyInput");
15996
- const checkSingle = /* @__PURE__ */ __name5((node, path32, depth) => {
16326
+ const checkSingle = /* @__PURE__ */ __name6((node, path32, depth) => {
15997
16327
  recordOutputSchema(node);
15998
16328
  if (node.type === "workflow" && (typeof node.workflowId !== "string" || node.workflowId.length === 0)) {
15999
16329
  checkId(node.id, path32);
@@ -16043,7 +16373,7 @@ function validateLuaExtensions(g, caps = WORKFLOW_CAPS_DEFAULT, opts = {
16043
16373
  }
16044
16374
  }
16045
16375
  }, "checkSingle");
16046
- const checkHitl = /* @__PURE__ */ __name5((node, path32) => {
16376
+ const checkHitl = /* @__PURE__ */ __name6((node, path32) => {
16047
16377
  if (node.type === "waitForSignal") {
16048
16378
  const w = node;
16049
16379
  checkId(w.id, path32);
@@ -16089,7 +16419,7 @@ function validateLuaExtensions(g, caps = WORKFLOW_CAPS_DEFAULT, opts = {
16089
16419
  }
16090
16420
  }
16091
16421
  }, "checkHitl");
16092
- const checkHitlArm = /* @__PURE__ */ __name5((node, path32, container) => {
16422
+ const checkHitlArm = /* @__PURE__ */ __name6((node, path32, container) => {
16093
16423
  if (!workflowContainerRunsHitlArm(container)) {
16094
16424
  checkId(node.id, path32);
16095
16425
  err("node-type-unsupported-in-container", workflowHitlArmUnsupportedMessage(node.type, node.id, container), path32, node.id);
@@ -16097,7 +16427,7 @@ function validateLuaExtensions(g, caps = WORKFLOW_CAPS_DEFAULT, opts = {
16097
16427
  }
16098
16428
  checkHitl(node, path32);
16099
16429
  }, "checkHitlArm");
16100
- const checkArm = /* @__PURE__ */ __name5((arm, path32, depth, container) => {
16430
+ const checkArm = /* @__PURE__ */ __name6((arm, path32, depth, container) => {
16101
16431
  if (arm.type === "mapping") {
16102
16432
  checkId(arm.id, path32);
16103
16433
  checkMapMembers(readMapConfig(arm.mapConfig), `${path32}.mapConfig`, arm.id);
@@ -16333,7 +16663,7 @@ function isWellFormedPredicate(p) {
16333
16663
  }
16334
16664
  function canonicalJson(value22) {
16335
16665
  const seen = /* @__PURE__ */ new WeakSet();
16336
- const encode = /* @__PURE__ */ __name5((v) => {
16666
+ const encode = /* @__PURE__ */ __name6((v) => {
16337
16667
  if (v === null || typeof v === "number" || typeof v === "boolean") return JSON.stringify(v);
16338
16668
  if (typeof v === "string") return JSON.stringify(v);
16339
16669
  if (typeof v === "bigint") return JSON.stringify(`${v}n`);
@@ -16360,7 +16690,7 @@ function hashGraph(g) {
16360
16690
  function compilePlan(g) {
16361
16691
  const steps = {};
16362
16692
  const order = [];
16363
- const addNode = /* @__PURE__ */ __name5((id2, node) => {
16693
+ const addNode = /* @__PURE__ */ __name6((id2, node) => {
16364
16694
  if (id2 in steps) {
16365
16695
  throw new WorkflowPlanError("duplicate-step-id", `Duplicate step id "${id2}" in definition.graph`);
16366
16696
  }
@@ -16690,7 +17020,7 @@ function renderRef(ref) {
16690
17020
  function step(s) {
16691
17021
  const id2 = stepIdOf(s);
16692
17022
  return {
16693
- path: /* @__PURE__ */ __name5((p) => ({
17023
+ path: /* @__PURE__ */ __name6((p) => ({
16694
17024
  path: p === "" ? `stepResults.${id2}` : `stepResults.${id2}.${p}`
16695
17025
  }), "path")
16696
17026
  };
@@ -16778,7 +17108,7 @@ function resolvePlacements(calls) {
16778
17108
  const declared = /* @__PURE__ */ new Map();
16779
17109
  const placedBy = /* @__PURE__ */ new Map();
16780
17110
  const allIds = /* @__PURE__ */ new Map();
16781
- const claimId = /* @__PURE__ */ __name5((id2, callIndex) => {
17111
+ const claimId = /* @__PURE__ */ __name6((id2, callIndex) => {
16782
17112
  const first = allIds.get(id2);
16783
17113
  if (first !== void 0 && first !== callIndex) {
16784
17114
  issues.push({
@@ -16818,7 +17148,7 @@ function resolvePlacements(calls) {
16818
17148
  break;
16819
17149
  }
16820
17150
  });
16821
- const armMapPlacementIssue = /* @__PURE__ */ __name5((node, ref, i, container) => {
17151
+ const armMapPlacementIssue = /* @__PURE__ */ __name6((node, ref, i, container) => {
16822
17152
  if (!ref.armMap || node.type === "mapping" || isHitlNode2(node)) return void 0;
16823
17153
  const id2 = nodeIdOf(node);
16824
17154
  if ((container === "foreach" || container === "loop") && node.type !== "workflow") {
@@ -16839,7 +17169,7 @@ function resolvePlacements(calls) {
16839
17169
  }
16840
17170
  return void 0;
16841
17171
  }, "armMapPlacementIssue");
16842
- const hitlPlacementIssue = /* @__PURE__ */ __name5((node, ref, i, container) => {
17172
+ const hitlPlacementIssue = /* @__PURE__ */ __name6((node, ref, i, container) => {
16843
17173
  if (!isHitlNode2(node)) return void 0;
16844
17174
  const id2 = node.id;
16845
17175
  if (ref.armMap) {
@@ -16860,7 +17190,7 @@ function resolvePlacements(calls) {
16860
17190
  }
16861
17191
  return void 0;
16862
17192
  }, "hitlPlacementIssue");
16863
- const resolve7 = /* @__PURE__ */ __name5((ref, i, allowMapping, container) => {
17193
+ const resolve7 = /* @__PURE__ */ __name6((ref, i, allowMapping, container) => {
16864
17194
  if ("node" in ref) {
16865
17195
  if (ref.node.type === "mapping" && !allowMapping) {
16866
17196
  issues.push({
@@ -16915,7 +17245,7 @@ function resolvePlacements(calls) {
16915
17245
  placedBy.set(ref.ref, i);
16916
17246
  return d.node;
16917
17247
  }, "resolve");
16918
- const claim = /* @__PURE__ */ __name5((ref, i, allowMapping, container) => {
17248
+ const claim = /* @__PURE__ */ __name6((ref, i, allowMapping, container) => {
16919
17249
  if ("ref" in ref) {
16920
17250
  resolve7(ref, i, allowMapping, container);
16921
17251
  return;
@@ -16950,7 +17280,7 @@ function resolvePlacements(calls) {
16950
17280
  }
16951
17281
  });
16952
17282
  const graph = [];
16953
- const lookup = /* @__PURE__ */ __name5((ref) => {
17283
+ const lookup = /* @__PURE__ */ __name6((ref) => {
16954
17284
  const n2 = "node" in ref ? ref.node : declared.get(ref.ref)?.node;
16955
17285
  if (!n2 || !ref.armMap || n2.type === "mapping" || isHitlNode2(n2)) return n2;
16956
17286
  return inlineContainerArm(ref.armMap, n2);
@@ -17093,11 +17423,11 @@ function seedLedgerFromRun(run, steps, targetPlan, opts = {}) {
17093
17423
  const seeded = [];
17094
17424
  const unseeded = [];
17095
17425
  const known = new Set(Object.keys(targetPlan.steps));
17096
- const parentOf = /* @__PURE__ */ __name5((id2) => {
17426
+ const parentOf = /* @__PURE__ */ __name6((id2) => {
17097
17427
  const m = /^(.*)(\[\d+\]|#\d+)$/.exec(id2);
17098
17428
  return m ? m[1] : void 0;
17099
17429
  }, "parentOf");
17100
- const dependsOf = /* @__PURE__ */ __name5((id2) => {
17430
+ const dependsOf = /* @__PURE__ */ __name6((id2) => {
17101
17431
  const node = targetPlan.steps[id2];
17102
17432
  if (node) return node.dependsOn;
17103
17433
  const parent = parentOf(id2);
@@ -17184,7 +17514,7 @@ function replayLedger(g, ledger) {
17184
17514
  startedAt: 0,
17185
17515
  ...ledger.requestContext
17186
17516
  };
17187
- const ctxFor = /* @__PURE__ */ __name5((id2) => ({
17517
+ const ctxFor = /* @__PURE__ */ __name6((id2) => ({
17188
17518
  initData: ledger.initData,
17189
17519
  stepResults: ancestorResults(plan, id2, rows22),
17190
17520
  state: ledger.state ?? {},
@@ -17266,7 +17596,7 @@ function ancestorResults(plan, id2, rows22) {
17266
17596
  const out = {};
17267
17597
  const joinAliased = /* @__PURE__ */ new Set();
17268
17598
  const seen = /* @__PURE__ */ new Set();
17269
- const take = /* @__PURE__ */ __name5((rowId) => {
17599
+ const take = /* @__PURE__ */ __name6((rowId) => {
17270
17600
  const hit = replayResultOf(rows22.get(rowId), plan.steps[rowId]);
17271
17601
  if (!hit) return void 0;
17272
17602
  if (!joinAliased.has(rowId)) out[rowId] = hit.value;
@@ -17283,7 +17613,7 @@ function ancestorResults(plan, id2, rows22) {
17283
17613
  }
17284
17614
  return hit;
17285
17615
  }, "take");
17286
- const walk22 = /* @__PURE__ */ __name5((ids) => {
17616
+ const walk22 = /* @__PURE__ */ __name6((ids) => {
17287
17617
  for (const dep of ids) {
17288
17618
  if (seen.has(dep)) continue;
17289
17619
  seen.add(dep);
@@ -17509,8 +17839,8 @@ function runWorkspaceView(ws) {
17509
17839
  function runSuspendedForView(run) {
17510
17840
  const s = run.suspendedFor;
17511
17841
  if (!s || typeof s !== "object" || typeof s.kind !== "string" || isTerminalRunStatus(run.status)) return void 0;
17512
- const str3 = /* @__PURE__ */ __name5((v) => typeof v === "string" && v ? v : void 0, "str");
17513
- const num = /* @__PURE__ */ __name5((v) => typeof v === "number" && Number.isFinite(v) ? v : void 0, "num");
17842
+ const str3 = /* @__PURE__ */ __name6((v) => typeof v === "string" && v ? v : void 0, "str");
17843
+ const num = /* @__PURE__ */ __name6((v) => typeof v === "number" && Number.isFinite(v) ? v : void 0, "num");
17514
17844
  const dimension = str3(s.dimension);
17515
17845
  return pruneUndefined({
17516
17846
  kind: s.kind,
@@ -17665,7 +17995,7 @@ function timeZoneSupported(tz) {
17665
17995
  }
17666
17996
  function validateBusinessHours(cal, path32 = "businessHours") {
17667
17997
  const issues = [];
17668
- const issue = /* @__PURE__ */ __name5((p, message) => issues.push({
17998
+ const issue = /* @__PURE__ */ __name6((p, message) => issues.push({
17669
17999
  code: "business-hours-invalid",
17670
18000
  path: p,
17671
18001
  message
@@ -17734,7 +18064,7 @@ function formatter(tz) {
17734
18064
  }
17735
18065
  function localParts(ms, tz) {
17736
18066
  const parts = formatter(tz).formatToParts(new Date(ms));
17737
- const get = /* @__PURE__ */ __name5((t) => parts.find((p) => p.type === t)?.value ?? "", "get");
18067
+ const get = /* @__PURE__ */ __name6((t) => parts.find((p) => p.type === t)?.value ?? "", "get");
17738
18068
  const hour = Number(get("hour")) % 24;
17739
18069
  return {
17740
18070
  year: Number(get("year")),
@@ -17904,7 +18234,7 @@ function matchesEditablePath(pointer, editablePaths, op = "replace") {
17904
18234
  }
17905
18235
  function changedPointers(before, after, base = "") {
17906
18236
  if (before === after) return [];
17907
- const isObj = /* @__PURE__ */ __name5((v) => typeof v === "object" && v !== null && !Array.isArray(v), "isObj");
18237
+ const isObj = /* @__PURE__ */ __name6((v) => typeof v === "object" && v !== null && !Array.isArray(v), "isObj");
17908
18238
  if (Array.isArray(before) && Array.isArray(after)) {
17909
18239
  if (before.length !== after.length) return [
17910
18240
  base || "/"
@@ -18112,7 +18442,7 @@ function rebaseItemPointer(pointer, itemsPath, index) {
18112
18442
  }
18113
18443
  function validateWorkflowSchedule(schedule, path32 = "/schedule") {
18114
18444
  if (schedule === void 0 || schedule === null) return [];
18115
- const issue = /* @__PURE__ */ __name5((at, detail) => [
18445
+ const issue = /* @__PURE__ */ __name6((at, detail) => [
18116
18446
  {
18117
18447
  code: WORKFLOW_SCHEDULE_SHAPE_ISSUE,
18118
18448
  severity: "error",
@@ -18162,7 +18492,7 @@ function validateWorkflowSchedule(schedule, path32 = "/schedule") {
18162
18492
  }
18163
18493
  function collectEnvTemplateKeys(value22) {
18164
18494
  const keys = /* @__PURE__ */ new Set();
18165
- const walk22 = /* @__PURE__ */ __name5((v) => {
18495
+ const walk22 = /* @__PURE__ */ __name6((v) => {
18166
18496
  if (isEnvRef(v)) {
18167
18497
  keys.add(v.__envRef);
18168
18498
  return;
@@ -18189,7 +18519,7 @@ function collectEnvTemplateKeys(value22) {
18189
18519
  }
18190
18520
  function substituteEnvRefs(value22, overlay) {
18191
18521
  const missing = /* @__PURE__ */ new Set();
18192
- const walk22 = /* @__PURE__ */ __name5((v, slot = false) => {
18522
+ const walk22 = /* @__PURE__ */ __name6((v, slot = false) => {
18193
18523
  if (isEnvRef(v)) {
18194
18524
  if (Object.prototype.hasOwnProperty.call(overlay, v.__envRef)) {
18195
18525
  const s = overlay[v.__envRef];
@@ -18399,7 +18729,7 @@ function estimateGraph(envelopeOrGraph) {
18399
18729
  };
18400
18730
  }
18401
18731
  function* singleStepsOf(entry) {
18402
- if (!isRecord3(entry)) return;
18732
+ if (!isRecord4(entry)) return;
18403
18733
  switch (entry.type) {
18404
18734
  case "step":
18405
18735
  case "agent":
@@ -18423,8 +18753,8 @@ function* singleStepsOf(entry) {
18423
18753
  }
18424
18754
  }
18425
18755
  function entriesOf(graph) {
18426
- const definition = isRecord3(graph) ? graph.definition : void 0;
18427
- const entries = isRecord3(definition) ? definition.graph : void 0;
18756
+ const definition = isRecord4(graph) ? graph.definition : void 0;
18757
+ const entries = isRecord4(definition) ? definition.graph : void 0;
18428
18758
  return Array.isArray(entries) ? entries : [];
18429
18759
  }
18430
18760
  function inheritTargets(graphs) {
@@ -18441,7 +18771,7 @@ function inheritTargets(graphs) {
18441
18771
  return targets;
18442
18772
  }
18443
18773
  function needsInheritedWorkspace(graph) {
18444
- if (!isRecord3(graph) || graph.workspace !== void 0) return false;
18774
+ if (!isRecord4(graph) || graph.workspace !== void 0) return false;
18445
18775
  for (const entry of entriesOf(graph)) {
18446
18776
  for (const node of singleStepsOf(entry)) {
18447
18777
  if (node.workspace !== void 0 && node.workspace !== "inherit") return true;
@@ -18522,7 +18852,7 @@ function collectJobTierSteps(entry, out) {
18522
18852
  return;
18523
18853
  }
18524
18854
  }
18525
- var __defProp5, __name5, WorkflowTemplateError, TEMPLATE_PLACEHOLDER, TEMPLATE_NAMESPACES, MAP_DESCRIPTOR_KEYS, MAP_MEMBER_MALFORMED_CODE, fromInit, fromStep, value, template, fromRequest, rows, fromKnowledge, SideEffectsSchema, JobResourcesSchema, WORKFLOW_MODEL_TEMPLATE_ROOT, WORKFLOW_MODEL_TEMPLATE_RE, PATH_SEGMENT_RE, APPROVER_SPEC_MAX_USERS, ESCALATION_MAX_HOPS, TemplateBindingSchema, ApproverSpecSchema, FourEyesSchema, EscalationHopSchema, TerminalOutcomeSchema, ApprovalOnTimeoutSchema, APPROVER_SPEC_SHAPES, APPROVER_WRITTEN_MAX, USER_ID_SHAPED_RE, BINDING_ROOTS, APPROVAL_REMIND_AFTER_HOURS_MIN, APPROVAL_REMIND_AFTER_HOURS_MAX, APPROVAL_TIMEOUT_HOURS_MIN, APPROVAL_TIMEOUT_HOURS_MAX, WORKSPACE_TEMPLATE_EXPR_RE, SLEEP_UNTIL_REPLACEMENT, WORKFLOW_WORKSPACE_TTL_MAX_HOURS_DEFAULT, WORKFLOW_CAPS_DEFAULT, WORKFLOW_STEP_DEFAULT_TIMEOUT_SECONDS, WORKFLOW_AGENT_DEFAULT_TIMEOUT_SECONDS, WORKFLOW_JOB_DEFAULT_TIMEOUT_SECONDS, WORKFLOW_FOREACH_DEFAULT_CONCURRENCY, WORKFLOW_FOREACH_DEFAULT_MAX_ITEMS, WORKFLOW_LOOP_DEFAULT_MAX_ITERATIONS, WORKFLOW_SUSPEND_DEFAULT_TIMEOUT_HOURS2, WORKFLOW_SIGNAL_DEFAULT_SOURCES, clone, CONNECTION_ID_HEX_RE, WORKFLOW_JOB_MAX_WORKTREE_ARMS, workspaceOf, mountsWorkspace, isJobTier, jobToolsOf, schemaIsArray, isHitlNode, isSingleStep, singleId, armId, TEMPLATE_STEP_REF, EDITABLE_PATH_RE, PREDICATE_OPS, isPredicateScalar, GRAPH_HASH_PREFIX, WorkflowPlanError, isArmStep, armStepId, armStepKind, joinIdOf, containerIdOf, PATH_PLACEHOLDER, MISSING, stepIdOf, cmp, eq, ne, gt, gte, lt, lte, inSet, notIn, exists, notExists, truthy, falsy, and, or, not, CONTINUED_FAILURE_TAG, CONTINUED_FAILURE_DEFAULT_CODE, CONTINUED_FAILURE_OUTPUT_SCHEMA, CONTINUED_FAILURE_LEAF_PATHS, isHitlNode2, nodeIdOf, GOAL_JUDGE_STEP_ID, NON_LEAF_KINDS, CONDITIONAL_JOIN_ID, branchArmId, canonical, sortKeys, JOIN, entryOfJoin, FORCE_CANCEL_STALE_MS, TERMINAL, WORKFLOW_INLINE_RUN_TAG, RUN_ERROR_ISSUES_MAX, IN_FLIGHT, n, SUSPENDED_FOR_DIMENSIONS, STEP_ERROR_DETAIL_KEYS, STEP_ERROR_DETAIL_MAX_BYTES, DETAIL_MAX_DEPTH, DETAIL_MAX_ITEMS, MAX_HOLIDAYS, MAX_WALK_DAYS, HHMM, YMD, MS_PER_MIN, MS_PER_DAY, MON_FRI, supportedTz, fmtCache, WEEKDAYS, JSON_PATCH_OPS, JSON_PATCH_MAX_OPS, JSON_PATCH_MAX_VALUE_BYTES, JSON_PATCH_MAX_TOTAL_BYTES, SEGMENT_RE, WORKFLOW_SCHEDULE_TYPES, WORKFLOW_SCHEDULE_SHAPE_ISSUE, WORKFLOW_SCHEDULE_SHAPES_HINT, WORKFLOW_SCHEDULE_RUN_AS, isObject, WORKFLOW_ENV_OVERLAY_MAX_KEYS, WORKFLOW_ENV_OVERLAY_MAX_VALUE_BYTES, WORKFLOW_ENV_TEMPLATE_SECRET_KEY_RE, isEnvRef, looksLikeEmbeddedJson, ZERO, isRecord3;
18855
+ var __defProp6, __name6, WorkflowTemplateError, TEMPLATE_PLACEHOLDER, TEMPLATE_NAMESPACES, MAP_DESCRIPTOR_KEYS, MAP_MEMBER_MALFORMED_CODE, fromInit, fromStep, value, template, fromRequest, rows, fromKnowledge, SideEffectsSchema, JobResourcesSchema, WORKFLOW_MODEL_TEMPLATE_ROOT, WORKFLOW_MODEL_TEMPLATE_RE, PATH_SEGMENT_RE, APPROVER_SPEC_MAX_USERS, ESCALATION_MAX_HOPS, TemplateBindingSchema, ApproverSpecSchema, FourEyesSchema, EscalationHopSchema, TerminalOutcomeSchema, ApprovalOnTimeoutSchema, APPROVER_SPEC_SHAPES, APPROVER_WRITTEN_MAX, USER_ID_SHAPED_RE, BINDING_ROOTS, APPROVAL_REMIND_AFTER_HOURS_MIN, APPROVAL_REMIND_AFTER_HOURS_MAX, APPROVAL_TIMEOUT_HOURS_MIN, APPROVAL_TIMEOUT_HOURS_MAX, WORKSPACE_TEMPLATE_EXPR_RE, SLEEP_UNTIL_REPLACEMENT, WORKFLOW_WORKSPACE_TTL_MAX_HOURS_DEFAULT, WORKFLOW_CAPS_DEFAULT, WORKFLOW_STEP_DEFAULT_TIMEOUT_SECONDS, WORKFLOW_AGENT_DEFAULT_TIMEOUT_SECONDS, WORKFLOW_JOB_DEFAULT_TIMEOUT_SECONDS, WORKFLOW_FOREACH_DEFAULT_CONCURRENCY, WORKFLOW_FOREACH_DEFAULT_MAX_ITEMS, WORKFLOW_LOOP_DEFAULT_MAX_ITERATIONS, WORKFLOW_SUSPEND_DEFAULT_TIMEOUT_HOURS2, WORKFLOW_SIGNAL_DEFAULT_SOURCES, clone, CONNECTION_ID_HEX_RE, WORKFLOW_JOB_MAX_WORKTREE_ARMS, workspaceOf, mountsWorkspace, isJobTier, jobToolsOf, schemaIsArray, isHitlNode, isSingleStep, singleId, armId, TEMPLATE_STEP_REF, EDITABLE_PATH_RE, PREDICATE_OPS, isPredicateScalar, GRAPH_HASH_PREFIX, WorkflowPlanError, isArmStep, armStepId, armStepKind, joinIdOf, containerIdOf, PATH_PLACEHOLDER, MISSING, stepIdOf, cmp, eq, ne, gt, gte, lt, lte, inSet, notIn, exists, notExists, truthy, falsy, and, or, not, CONTINUED_FAILURE_TAG, CONTINUED_FAILURE_DEFAULT_CODE, CONTINUED_FAILURE_OUTPUT_SCHEMA, CONTINUED_FAILURE_LEAF_PATHS, isHitlNode2, nodeIdOf, GOAL_JUDGE_STEP_ID, NON_LEAF_KINDS, CONDITIONAL_JOIN_ID, branchArmId, canonical, sortKeys, JOIN, entryOfJoin, FORCE_CANCEL_STALE_MS, TERMINAL, WORKFLOW_INLINE_RUN_TAG, RUN_ERROR_ISSUES_MAX, IN_FLIGHT, n, SUSPENDED_FOR_DIMENSIONS, STEP_ERROR_DETAIL_KEYS, STEP_ERROR_DETAIL_MAX_BYTES, DETAIL_MAX_DEPTH, DETAIL_MAX_ITEMS, MAX_HOLIDAYS, MAX_WALK_DAYS, HHMM, YMD, MS_PER_MIN, MS_PER_DAY, MON_FRI, supportedTz, fmtCache, WEEKDAYS, JSON_PATCH_OPS, JSON_PATCH_MAX_OPS, JSON_PATCH_MAX_VALUE_BYTES, JSON_PATCH_MAX_TOTAL_BYTES, SEGMENT_RE, WORKFLOW_SCHEDULE_TYPES, WORKFLOW_SCHEDULE_SHAPE_ISSUE, WORKFLOW_SCHEDULE_SHAPES_HINT, WORKFLOW_SCHEDULE_RUN_AS, isObject, WORKFLOW_ENV_OVERLAY_MAX_KEYS, WORKFLOW_ENV_OVERLAY_MAX_VALUE_BYTES, WORKFLOW_ENV_TEMPLATE_SECRET_KEY_RE, isEnvRef, looksLikeEmbeddedJson, ZERO, isRecord4;
18526
18856
  var init_dist2 = __esm({
18527
18857
  "../workflow-graph/dist/index.mjs"() {
18528
18858
  "use strict";
@@ -18536,14 +18866,14 @@ var init_dist2 = __esm({
18536
18866
  init_dist();
18537
18867
  init_dist();
18538
18868
  init_dist();
18539
- __defProp5 = Object.defineProperty;
18540
- __name5 = /* @__PURE__ */ __name((target, value22) => __defProp5(target, "name", { value: value22, configurable: true }), "__name");
18869
+ __defProp6 = Object.defineProperty;
18870
+ __name6 = /* @__PURE__ */ __name((target, value22) => __defProp6(target, "name", { value: value22, configurable: true }), "__name");
18541
18871
  WorkflowTemplateError = class extends Error {
18542
18872
  static {
18543
18873
  __name(this, "WorkflowTemplateError");
18544
18874
  }
18545
18875
  static {
18546
- __name5(this, "WorkflowTemplateError");
18876
+ __name6(this, "WorkflowTemplateError");
18547
18877
  }
18548
18878
  placeholder;
18549
18879
  constructor(message, placeholder) {
@@ -18552,11 +18882,11 @@ var init_dist2 = __esm({
18552
18882
  }
18553
18883
  };
18554
18884
  __name(isMapConfigObject, "isMapConfigObject");
18555
- __name5(isMapConfigObject, "isMapConfigObject");
18885
+ __name6(isMapConfigObject, "isMapConfigObject");
18556
18886
  __name(parseMapConfig, "parseMapConfig");
18557
- __name5(parseMapConfig, "parseMapConfig");
18887
+ __name6(parseMapConfig, "parseMapConfig");
18558
18888
  __name(mapConfigWire, "mapConfigWire");
18559
- __name5(mapConfigWire, "mapConfigWire");
18889
+ __name6(mapConfigWire, "mapConfigWire");
18560
18890
  TEMPLATE_PLACEHOLDER = /\$\{([^}]*)\}/g;
18561
18891
  TEMPLATE_NAMESPACES = [
18562
18892
  "initData",
@@ -18565,21 +18895,21 @@ var init_dist2 = __esm({
18565
18895
  "stepResults"
18566
18896
  ];
18567
18897
  __name(describeBadPlaceholder, "describeBadPlaceholder");
18568
- __name5(describeBadPlaceholder, "describeBadPlaceholder");
18898
+ __name6(describeBadPlaceholder, "describeBadPlaceholder");
18569
18899
  __name(parseTemplatePlaceholder, "parseTemplatePlaceholder");
18570
- __name5(parseTemplatePlaceholder, "parseTemplatePlaceholder");
18900
+ __name6(parseTemplatePlaceholder, "parseTemplatePlaceholder");
18571
18901
  __name(traverseMappingPath, "traverseMappingPath");
18572
- __name5(traverseMappingPath, "traverseMappingPath");
18902
+ __name6(traverseMappingPath, "traverseMappingPath");
18573
18903
  __name(stringifyTemplateValue, "stringifyTemplateValue");
18574
- __name5(stringifyTemplateValue, "stringifyTemplateValue");
18904
+ __name6(stringifyTemplateValue, "stringifyTemplateValue");
18575
18905
  __name(escapeFence, "escapeFence");
18576
- __name5(escapeFence, "escapeFence");
18906
+ __name6(escapeFence, "escapeFence");
18577
18907
  __name(fenceBlock, "fenceBlock");
18578
- __name5(fenceBlock, "fenceBlock");
18908
+ __name6(fenceBlock, "fenceBlock");
18579
18909
  __name(renderTemplate, "renderTemplate");
18580
- __name5(renderTemplate, "renderTemplate");
18910
+ __name6(renderTemplate, "renderTemplate");
18581
18911
  __name(isMapDescriptor, "isMapDescriptor");
18582
- __name5(isMapDescriptor, "isMapDescriptor");
18912
+ __name6(isMapDescriptor, "isMapDescriptor");
18583
18913
  MAP_DESCRIPTOR_KEYS = [
18584
18914
  "step",
18585
18915
  "path",
@@ -18591,39 +18921,39 @@ var init_dist2 = __esm({
18591
18921
  ];
18592
18922
  MAP_MEMBER_MALFORMED_CODE = "map-member-malformed";
18593
18923
  __name(malformedMapMembers, "malformedMapMembers");
18594
- __name5(malformedMapMembers, "malformedMapMembers");
18924
+ __name6(malformedMapMembers, "malformedMapMembers");
18595
18925
  __name(mapMemberMalformedMessage, "mapMemberMalformedMessage");
18596
- __name5(mapMemberMalformedMessage, "mapMemberMalformedMessage");
18926
+ __name6(mapMemberMalformedMessage, "mapMemberMalformedMessage");
18597
18927
  __name(resolveDescriptor, "resolveDescriptor");
18598
- __name5(resolveDescriptor, "resolveDescriptor");
18928
+ __name6(resolveDescriptor, "resolveDescriptor");
18599
18929
  __name(resolveMapping, "resolveMapping");
18600
- __name5(resolveMapping, "resolveMapping");
18601
- fromInit = /* @__PURE__ */ __name5((path32) => ({
18930
+ __name6(resolveMapping, "resolveMapping");
18931
+ fromInit = /* @__PURE__ */ __name6((path32) => ({
18602
18932
  initData: true,
18603
18933
  path: path32
18604
18934
  }), "fromInit");
18605
- fromStep = /* @__PURE__ */ __name5((s, path32 = "") => {
18606
- const idOf = /* @__PURE__ */ __name5((x) => typeof x === "string" ? x : x.id, "idOf");
18935
+ fromStep = /* @__PURE__ */ __name6((s, path32 = "") => {
18936
+ const idOf = /* @__PURE__ */ __name6((x) => typeof x === "string" ? x : x.id, "idOf");
18607
18937
  return {
18608
18938
  step: Array.isArray(s) ? s.map(idOf) : idOf(s),
18609
18939
  path: path32
18610
18940
  };
18611
18941
  }, "fromStep");
18612
- value = /* @__PURE__ */ __name5((v) => ({
18942
+ value = /* @__PURE__ */ __name6((v) => ({
18613
18943
  value: v
18614
18944
  }), "value");
18615
- template = /* @__PURE__ */ __name5((s) => ({
18945
+ template = /* @__PURE__ */ __name6((s) => ({
18616
18946
  template: s
18617
18947
  }), "template");
18618
- fromRequest = /* @__PURE__ */ __name5((path32) => ({
18948
+ fromRequest = /* @__PURE__ */ __name6((path32) => ({
18619
18949
  requestContextPath: path32
18620
18950
  }), "fromRequest");
18621
- rows = /* @__PURE__ */ __name5((s, path32, page) => ({
18951
+ rows = /* @__PURE__ */ __name6((s, path32, page) => ({
18622
18952
  step: typeof s === "string" ? s : s.id,
18623
18953
  path: path32,
18624
18954
  rows: page
18625
18955
  }), "rows");
18626
- fromKnowledge = /* @__PURE__ */ __name5((k) => ({
18956
+ fromKnowledge = /* @__PURE__ */ __name6((k) => ({
18627
18957
  knowledge: k
18628
18958
  }), "fromKnowledge");
18629
18959
  SideEffectsSchema = z9.enum(WORKFLOW_SIDE_EFFECTS);
@@ -18632,23 +18962,23 @@ var init_dist2 = __esm({
18632
18962
  WORKFLOW_MODEL_TEMPLATE_RE = /^\$\{\s*initData\.([A-Za-z0-9_.\-[\]]+)\s*(?:\|([^}]*))?\}$/;
18633
18963
  PATH_SEGMENT_RE = /^[A-Za-z0-9_-]+(?:\[(?:0|[1-9]\d*)\])*$/;
18634
18964
  __name(looksLikeModelTemplate, "looksLikeModelTemplate");
18635
- __name5(looksLikeModelTemplate, "looksLikeModelTemplate");
18965
+ __name6(looksLikeModelTemplate, "looksLikeModelTemplate");
18636
18966
  __name(parseModelTemplate, "parseModelTemplate");
18637
- __name5(parseModelTemplate, "parseModelTemplate");
18967
+ __name6(parseModelTemplate, "parseModelTemplate");
18638
18968
  __name(modelTemplateInvalidMessage, "modelTemplateInvalidMessage");
18639
- __name5(modelTemplateInvalidMessage, "modelTemplateInvalidMessage");
18969
+ __name6(modelTemplateInvalidMessage, "modelTemplateInvalidMessage");
18640
18970
  __name(modelTemplateDefaultRequiredMessage, "modelTemplateDefaultRequiredMessage");
18641
- __name5(modelTemplateDefaultRequiredMessage, "modelTemplateDefaultRequiredMessage");
18971
+ __name6(modelTemplateDefaultRequiredMessage, "modelTemplateDefaultRequiredMessage");
18642
18972
  __name(staticModelPin, "staticModelPin");
18643
- __name5(staticModelPin, "staticModelPin");
18973
+ __name6(staticModelPin, "staticModelPin");
18644
18974
  __name(readPath2, "readPath");
18645
- __name5(readPath2, "readPath");
18975
+ __name6(readPath2, "readPath");
18646
18976
  __name(renderModelTemplate, "renderModelTemplate");
18647
- __name5(renderModelTemplate, "renderModelTemplate");
18977
+ __name6(renderModelTemplate, "renderModelTemplate");
18648
18978
  __name(modelTemplateUnboundMessage, "modelTemplateUnboundMessage");
18649
- __name5(modelTemplateUnboundMessage, "modelTemplateUnboundMessage");
18979
+ __name6(modelTemplateUnboundMessage, "modelTemplateUnboundMessage");
18650
18980
  __name(modelTemplateInputNotObjectMessage, "modelTemplateInputNotObjectMessage");
18651
- __name5(modelTemplateInputNotObjectMessage, "modelTemplateInputNotObjectMessage");
18981
+ __name6(modelTemplateInputNotObjectMessage, "modelTemplateInputNotObjectMessage");
18652
18982
  APPROVER_SPEC_MAX_USERS = 20;
18653
18983
  ESCALATION_MAX_HOPS = 3;
18654
18984
  TemplateBindingSchema = z22.object({
@@ -18714,7 +19044,7 @@ var init_dist2 = __esm({
18714
19044
  APPROVER_WRITTEN_MAX = 120;
18715
19045
  USER_ID_SHAPED_RE = /^[^\s@]{1,128}$/;
18716
19046
  __name(describeApproverSpecRefusal, "describeApproverSpecRefusal");
18717
- __name5(describeApproverSpecRefusal, "describeApproverSpecRefusal");
19047
+ __name6(describeApproverSpecRefusal, "describeApproverSpecRefusal");
18718
19048
  BINDING_ROOTS = [
18719
19049
  "initData",
18720
19050
  "stepResults",
@@ -18722,42 +19052,42 @@ var init_dist2 = __esm({
18722
19052
  "state"
18723
19053
  ];
18724
19054
  __name(bindingRootsOk, "bindingRootsOk");
18725
- __name5(bindingRootsOk, "bindingRootsOk");
19055
+ __name6(bindingRootsOk, "bindingRootsOk");
18726
19056
  __name(isTemplateBinding, "isTemplateBinding");
18727
- __name5(isTemplateBinding, "isTemplateBinding");
19057
+ __name6(isTemplateBinding, "isTemplateBinding");
18728
19058
  __name(approvalEditable, "approvalEditable");
18729
- __name5(approvalEditable, "approvalEditable");
19059
+ __name6(approvalEditable, "approvalEditable");
18730
19060
  __name(validateApproverBlock, "validateApproverBlock");
18731
- __name5(validateApproverBlock, "validateApproverBlock");
19061
+ __name6(validateApproverBlock, "validateApproverBlock");
18732
19062
  APPROVAL_REMIND_AFTER_HOURS_MIN = 1;
18733
19063
  APPROVAL_REMIND_AFTER_HOURS_MAX = 720;
18734
19064
  APPROVAL_TIMEOUT_HOURS_MIN = 1;
18735
19065
  APPROVAL_TIMEOUT_HOURS_MAX = 720;
18736
19066
  __name(validateApprovalReminder, "validateApprovalReminder");
18737
- __name5(validateApprovalReminder, "validateApprovalReminder");
19067
+ __name6(validateApprovalReminder, "validateApprovalReminder");
18738
19068
  __name(validateHitlTimeoutHours, "validateHitlTimeoutHours");
18739
- __name5(validateHitlTimeoutHours, "validateHitlTimeoutHours");
19069
+ __name6(validateHitlTimeoutHours, "validateHitlTimeoutHours");
18740
19070
  __name(firstAskDeadline, "firstAskDeadline");
18741
- __name5(firstAskDeadline, "firstAskDeadline");
19071
+ __name6(firstAskDeadline, "firstAskDeadline");
18742
19072
  __name(liftRenderedApprover, "liftRenderedApprover");
18743
- __name5(liftRenderedApprover, "liftRenderedApprover");
19073
+ __name6(liftRenderedApprover, "liftRenderedApprover");
18744
19074
  __name(approverUsersOf, "approverUsersOf");
18745
- __name5(approverUsersOf, "approverUsersOf");
19075
+ __name6(approverUsersOf, "approverUsersOf");
18746
19076
  WORKSPACE_TEMPLATE_EXPR_RE = /^\$\{\s*(?:initData|input)\.([^}]+?)\s*\}$/;
18747
19077
  __name(workspaceTemplatePath, "workspaceTemplatePath");
18748
- __name5(workspaceTemplatePath, "workspaceTemplatePath");
19078
+ __name6(workspaceTemplatePath, "workspaceTemplatePath");
18749
19079
  __name(retryBackoffs, "retryBackoffs");
18750
- __name5(retryBackoffs, "retryBackoffs");
19080
+ __name6(retryBackoffs, "retryBackoffs");
18751
19081
  SLEEP_UNTIL_REPLACEMENT = Object.freeze({
18752
19082
  type: "sleep",
18753
19083
  duration: 6e4
18754
19084
  });
18755
19085
  __name(sleepUntilUnsupportedMessage, "sleepUntilUnsupportedMessage");
18756
- __name5(sleepUntilUnsupportedMessage, "sleepUntilUnsupportedMessage");
19086
+ __name6(sleepUntilUnsupportedMessage, "sleepUntilUnsupportedMessage");
18757
19087
  __name(signalNameInvalidMessage, "signalNameInvalidMessage");
18758
- __name5(signalNameInvalidMessage, "signalNameInvalidMessage");
19088
+ __name6(signalNameInvalidMessage, "signalNameInvalidMessage");
18759
19089
  __name(armSubrunUnsupportedMessage, "armSubrunUnsupportedMessage");
18760
- __name5(armSubrunUnsupportedMessage, "armSubrunUnsupportedMessage");
19090
+ __name6(armSubrunUnsupportedMessage, "armSubrunUnsupportedMessage");
18761
19091
  WORKFLOW_WORKSPACE_TTL_MAX_HOURS_DEFAULT = 168;
18762
19092
  WORKFLOW_CAPS_DEFAULT = Object.freeze({
18763
19093
  maxParallelArms: 16,
@@ -18785,60 +19115,60 @@ var init_dist2 = __esm({
18785
19115
  "api",
18786
19116
  "user"
18787
19117
  ];
18788
- clone = /* @__PURE__ */ __name5((v) => JSON.parse(JSON.stringify(v)), "clone");
19118
+ clone = /* @__PURE__ */ __name6((v) => JSON.parse(JSON.stringify(v)), "clone");
18789
19119
  __name(fillPolicy, "fillPolicy");
18790
- __name5(fillPolicy, "fillPolicy");
19120
+ __name6(fillPolicy, "fillPolicy");
18791
19121
  __name(fillSingle, "fillSingle");
18792
- __name5(fillSingle, "fillSingle");
19122
+ __name6(fillSingle, "fillSingle");
18793
19123
  __name(fillHitl, "fillHitl");
18794
- __name5(fillHitl, "fillHitl");
19124
+ __name6(fillHitl, "fillHitl");
18795
19125
  __name(fillArm, "fillArm");
18796
- __name5(fillArm, "fillArm");
19126
+ __name6(fillArm, "fillArm");
18797
19127
  __name(fillEntry, "fillEntry");
18798
- __name5(fillEntry, "fillEntry");
19128
+ __name6(fillEntry, "fillEntry");
18799
19129
  __name(withDefaultsFilled, "withDefaultsFilled");
18800
- __name5(withDefaultsFilled, "withDefaultsFilled");
19130
+ __name6(withDefaultsFilled, "withDefaultsFilled");
18801
19131
  CONNECTION_ID_HEX_RE = /^[0-9a-f]{24}$/;
18802
19132
  __name(isConnectionKeyShaped, "isConnectionKeyShaped");
18803
- __name5(isConnectionKeyShaped, "isConnectionKeyShaped");
19133
+ __name6(isConnectionKeyShaped, "isConnectionKeyShaped");
18804
19134
  __name(connectionKeyUndeclaredMessage, "connectionKeyUndeclaredMessage");
18805
- __name5(connectionKeyUndeclaredMessage, "connectionKeyUndeclaredMessage");
19135
+ __name6(connectionKeyUndeclaredMessage, "connectionKeyUndeclaredMessage");
18806
19136
  WORKFLOW_JOB_MAX_WORKTREE_ARMS = 8;
18807
19137
  __name(classifyModelProvider, "classifyModelProvider");
18808
- __name5(classifyModelProvider, "classifyModelProvider");
18809
- workspaceOf = /* @__PURE__ */ __name5((node) => node.workspace, "workspaceOf");
18810
- mountsWorkspace = /* @__PURE__ */ __name5((node) => {
19138
+ __name6(classifyModelProvider, "classifyModelProvider");
19139
+ workspaceOf = /* @__PURE__ */ __name6((node) => node.workspace, "workspaceOf");
19140
+ mountsWorkspace = /* @__PURE__ */ __name6((node) => {
18811
19141
  const w = workspaceOf(node);
18812
19142
  return w !== void 0 && w !== "inherit";
18813
19143
  }, "mountsWorkspace");
18814
- isJobTier = /* @__PURE__ */ __name5((node) => node.tier === "job" || mountsWorkspace(node), "isJobTier");
18815
- jobToolsOf = /* @__PURE__ */ __name5((node) => {
19144
+ isJobTier = /* @__PURE__ */ __name6((node) => node.tier === "job" || mountsWorkspace(node), "isJobTier");
19145
+ jobToolsOf = /* @__PURE__ */ __name6((node) => {
18816
19146
  if (node.type === "agent") return node.toolScope?.jobTools;
18817
19147
  return node.jobTools;
18818
19148
  }, "jobToolsOf");
18819
19149
  __name(schemaAtPath, "schemaAtPath");
18820
- __name5(schemaAtPath, "schemaAtPath");
18821
- schemaIsArray = /* @__PURE__ */ __name5((schema) => {
19150
+ __name6(schemaAtPath, "schemaAtPath");
19151
+ schemaIsArray = /* @__PURE__ */ __name6((schema) => {
18822
19152
  if (!schema) return void 0;
18823
19153
  const t = schema.type;
18824
19154
  if (t === void 0) return void 0;
18825
19155
  return Array.isArray(t) ? t.includes("array") : t === "array";
18826
19156
  }, "schemaIsArray");
18827
- isHitlNode = /* @__PURE__ */ __name5((n2) => isWorkflowHitlEntryType(n2.type), "isHitlNode");
18828
- isSingleStep = /* @__PURE__ */ __name5((n2) => !isHitlNode(n2), "isSingleStep");
18829
- singleId = /* @__PURE__ */ __name5((s) => s.type === "step" ? s.step.id : s.id, "singleId");
18830
- armId = /* @__PURE__ */ __name5((a) => a.type === "mapping" ? a.id : singleId(a), "armId");
19157
+ isHitlNode = /* @__PURE__ */ __name6((n2) => isWorkflowHitlEntryType(n2.type), "isHitlNode");
19158
+ isSingleStep = /* @__PURE__ */ __name6((n2) => !isHitlNode(n2), "isSingleStep");
19159
+ singleId = /* @__PURE__ */ __name6((s) => s.type === "step" ? s.step.id : s.id, "singleId");
19160
+ armId = /* @__PURE__ */ __name6((a) => a.type === "mapping" ? a.id : singleId(a), "armId");
18831
19161
  TEMPLATE_STEP_REF = /\$\{\s*stepResults\.([A-Za-z0-9_\-]+)/g;
18832
19162
  __name(templateStepRefs, "templateStepRefs");
18833
- __name5(templateStepRefs, "templateStepRefs");
19163
+ __name6(templateStepRefs, "templateStepRefs");
18834
19164
  __name(readMapConfig, "readMapConfig");
18835
- __name5(readMapConfig, "readMapConfig");
19165
+ __name6(readMapConfig, "readMapConfig");
18836
19166
  __name(mapConfigStepRefs, "mapConfigStepRefs");
18837
- __name5(mapConfigStepRefs, "mapConfigStepRefs");
19167
+ __name6(mapConfigStepRefs, "mapConfigStepRefs");
18838
19168
  __name(nodeStepRefs, "nodeStepRefs");
18839
- __name5(nodeStepRefs, "nodeStepRefs");
19169
+ __name6(nodeStepRefs, "nodeStepRefs");
18840
19170
  __name(validateLuaExtensions, "validateLuaExtensions");
18841
- __name5(validateLuaExtensions, "validateLuaExtensions");
19171
+ __name6(validateLuaExtensions, "validateLuaExtensions");
18842
19172
  EDITABLE_PATH_RE = /^[A-Za-z_][A-Za-z0-9_]*(\[(\*|\d+)\])?(\.[A-Za-z_][A-Za-z0-9_]*(\[(\*|\d+)\])?)*$/;
18843
19173
  PREDICATE_OPS = /* @__PURE__ */ new Set([
18844
19174
  "eq",
@@ -18858,23 +19188,23 @@ var init_dist2 = __esm({
18858
19188
  "not"
18859
19189
  ]);
18860
19190
  __name(isPredicate, "isPredicate");
18861
- __name5(isPredicate, "isPredicate");
18862
- isPredicateScalar = /* @__PURE__ */ __name5((v) => v === null || typeof v === "string" || typeof v === "number" || typeof v === "boolean", "isPredicateScalar");
19191
+ __name6(isPredicate, "isPredicate");
19192
+ isPredicateScalar = /* @__PURE__ */ __name6((v) => v === null || typeof v === "string" || typeof v === "number" || typeof v === "boolean", "isPredicateScalar");
18863
19193
  __name(isPathOrLiteral, "isPathOrLiteral");
18864
- __name5(isPathOrLiteral, "isPathOrLiteral");
19194
+ __name6(isPathOrLiteral, "isPathOrLiteral");
18865
19195
  __name(isWellFormedPredicate, "isWellFormedPredicate");
18866
- __name5(isWellFormedPredicate, "isWellFormedPredicate");
19196
+ __name6(isWellFormedPredicate, "isWellFormedPredicate");
18867
19197
  GRAPH_HASH_PREFIX = "sha256-cj1:";
18868
19198
  __name(canonicalJson, "canonicalJson");
18869
- __name5(canonicalJson, "canonicalJson");
19199
+ __name6(canonicalJson, "canonicalJson");
18870
19200
  __name(hashGraph, "hashGraph");
18871
- __name5(hashGraph, "hashGraph");
19201
+ __name6(hashGraph, "hashGraph");
18872
19202
  WorkflowPlanError = class extends Error {
18873
19203
  static {
18874
19204
  __name(this, "WorkflowPlanError");
18875
19205
  }
18876
19206
  static {
18877
- __name5(this, "WorkflowPlanError");
19207
+ __name6(this, "WorkflowPlanError");
18878
19208
  }
18879
19209
  code;
18880
19210
  constructor(code, message) {
@@ -18882,47 +19212,47 @@ var init_dist2 = __esm({
18882
19212
  this.name = "WorkflowPlanError";
18883
19213
  }
18884
19214
  };
18885
- isArmStep = /* @__PURE__ */ __name5((e) => isWorkflowArmEntryType(e.type), "isArmStep");
18886
- armStepId = /* @__PURE__ */ __name5((e) => e.type === "step" ? e.step.id : e.id, "armStepId");
18887
- armStepKind = /* @__PURE__ */ __name5((e) => WORKFLOW_ARM_ENTRY_STEP_KINDS[e.type], "armStepKind");
18888
- joinIdOf = /* @__PURE__ */ __name5((entryId) => `${entryId}.join`, "joinIdOf");
18889
- containerIdOf = /* @__PURE__ */ __name5((type, entryIndex) => `${type}@${entryIndex}`, "containerIdOf");
19215
+ isArmStep = /* @__PURE__ */ __name6((e) => isWorkflowArmEntryType(e.type), "isArmStep");
19216
+ armStepId = /* @__PURE__ */ __name6((e) => e.type === "step" ? e.step.id : e.id, "armStepId");
19217
+ armStepKind = /* @__PURE__ */ __name6((e) => WORKFLOW_ARM_ENTRY_STEP_KINDS[e.type], "armStepKind");
19218
+ joinIdOf = /* @__PURE__ */ __name6((entryId) => `${entryId}.join`, "joinIdOf");
19219
+ containerIdOf = /* @__PURE__ */ __name6((type, entryIndex) => `${type}@${entryIndex}`, "containerIdOf");
18890
19220
  __name(compilePlan, "compilePlan");
18891
- __name5(compilePlan, "compilePlan");
19221
+ __name6(compilePlan, "compilePlan");
18892
19222
  PATH_PLACEHOLDER = /^\$\{([^}]+)\}$/;
18893
19223
  MISSING = /* @__PURE__ */ Symbol("predicate.missing");
18894
19224
  __name(resolvePath, "resolvePath");
18895
- __name5(resolvePath, "resolvePath");
19225
+ __name6(resolvePath, "resolvePath");
18896
19226
  __name(walk2, "walk");
18897
- __name5(walk2, "walk");
19227
+ __name6(walk2, "walk");
18898
19228
  __name(resolveValue, "resolveValue");
18899
- __name5(resolveValue, "resolveValue");
19229
+ __name6(resolveValue, "resolveValue");
18900
19230
  __name(evaluatePredicate, "evaluatePredicate");
18901
- __name5(evaluatePredicate, "evaluatePredicate");
19231
+ __name6(evaluatePredicate, "evaluatePredicate");
18902
19232
  __name(compare, "compare");
18903
- __name5(compare, "compare");
19233
+ __name6(compare, "compare");
18904
19234
  __name(derivePredicateLabel, "derivePredicateLabel");
18905
- __name5(derivePredicateLabel, "derivePredicateLabel");
19235
+ __name6(derivePredicateLabel, "derivePredicateLabel");
18906
19236
  __name(renderPredicate, "renderPredicate");
18907
- __name5(renderPredicate, "renderPredicate");
19237
+ __name6(renderPredicate, "renderPredicate");
18908
19238
  __name(wrapLabel, "wrapLabel");
18909
- __name5(wrapLabel, "wrapLabel");
19239
+ __name6(wrapLabel, "wrapLabel");
18910
19240
  __name(renderRef, "renderRef");
18911
- __name5(renderRef, "renderRef");
18912
- stepIdOf = /* @__PURE__ */ __name5((s) => typeof s === "string" ? s : s.id, "stepIdOf");
19241
+ __name6(renderRef, "renderRef");
19242
+ stepIdOf = /* @__PURE__ */ __name6((s) => typeof s === "string" ? s : s.id, "stepIdOf");
18913
19243
  __name(step, "step");
18914
- __name5(step, "step");
19244
+ __name6(step, "step");
18915
19245
  __name(stepOf, "stepOf");
18916
- __name5(stepOf, "stepOf");
19246
+ __name6(stepOf, "stepOf");
18917
19247
  __name(init, "init");
18918
- __name5(init, "init");
19248
+ __name6(init, "init");
18919
19249
  __name(state, "state");
18920
- __name5(state, "state");
19250
+ __name6(state, "state");
18921
19251
  __name(lit, "lit");
18922
- __name5(lit, "lit");
19252
+ __name6(lit, "lit");
18923
19253
  __name(toPathOrLiteral, "toPathOrLiteral");
18924
- __name5(toPathOrLiteral, "toPathOrLiteral");
18925
- cmp = /* @__PURE__ */ __name5((op) => (l, r) => ({
19254
+ __name6(toPathOrLiteral, "toPathOrLiteral");
19255
+ cmp = /* @__PURE__ */ __name6((op) => (l, r) => ({
18926
19256
  op,
18927
19257
  left: toPathOrLiteral(l),
18928
19258
  right: toPathOrLiteral(r)
@@ -18933,49 +19263,49 @@ var init_dist2 = __esm({
18933
19263
  gte = cmp("gte");
18934
19264
  lt = cmp("lt");
18935
19265
  lte = cmp("lte");
18936
- inSet = /* @__PURE__ */ __name5((v, set) => ({
19266
+ inSet = /* @__PURE__ */ __name6((v, set) => ({
18937
19267
  op: "in",
18938
19268
  value: {
18939
19269
  path: v.path
18940
19270
  },
18941
19271
  set
18942
19272
  }), "inSet");
18943
- notIn = /* @__PURE__ */ __name5((v, set) => ({
19273
+ notIn = /* @__PURE__ */ __name6((v, set) => ({
18944
19274
  op: "notIn",
18945
19275
  value: {
18946
19276
  path: v.path
18947
19277
  },
18948
19278
  set
18949
19279
  }), "notIn");
18950
- exists = /* @__PURE__ */ __name5((ref) => ({
19280
+ exists = /* @__PURE__ */ __name6((ref) => ({
18951
19281
  op: "exists",
18952
19282
  path: ref.path
18953
19283
  }), "exists");
18954
- notExists = /* @__PURE__ */ __name5((ref) => ({
19284
+ notExists = /* @__PURE__ */ __name6((ref) => ({
18955
19285
  op: "notExists",
18956
19286
  path: ref.path
18957
19287
  }), "notExists");
18958
- truthy = /* @__PURE__ */ __name5((ref) => ({
19288
+ truthy = /* @__PURE__ */ __name6((ref) => ({
18959
19289
  op: "truthy",
18960
19290
  value: {
18961
19291
  path: ref.path
18962
19292
  }
18963
19293
  }), "truthy");
18964
- falsy = /* @__PURE__ */ __name5((ref) => ({
19294
+ falsy = /* @__PURE__ */ __name6((ref) => ({
18965
19295
  op: "falsy",
18966
19296
  value: {
18967
19297
  path: ref.path
18968
19298
  }
18969
19299
  }), "falsy");
18970
- and = /* @__PURE__ */ __name5((...args2) => ({
19300
+ and = /* @__PURE__ */ __name6((...args2) => ({
18971
19301
  op: "and",
18972
19302
  args: args2
18973
19303
  }), "and");
18974
- or = /* @__PURE__ */ __name5((...args2) => ({
19304
+ or = /* @__PURE__ */ __name6((...args2) => ({
18975
19305
  op: "or",
18976
19306
  args: args2
18977
19307
  }), "or");
18978
- not = /* @__PURE__ */ __name5((arg) => ({
19308
+ not = /* @__PURE__ */ __name6((arg) => ({
18979
19309
  op: "not",
18980
19310
  arg
18981
19311
  }), "not");
@@ -19027,17 +19357,17 @@ var init_dist2 = __esm({
19027
19357
  "text"
19028
19358
  ]);
19029
19359
  __name(continuedFailureValue, "continuedFailureValue");
19030
- __name5(continuedFailureValue, "continuedFailureValue");
19360
+ __name6(continuedFailureValue, "continuedFailureValue");
19031
19361
  __name(isContinuedFailureValue, "isContinuedFailureValue");
19032
- __name5(isContinuedFailureValue, "isContinuedFailureValue");
19033
- isHitlNode2 = /* @__PURE__ */ __name5((n2) => isWorkflowHitlEntryType(n2.type), "isHitlNode");
19362
+ __name6(isContinuedFailureValue, "isContinuedFailureValue");
19363
+ isHitlNode2 = /* @__PURE__ */ __name6((n2) => isWorkflowHitlEntryType(n2.type), "isHitlNode");
19034
19364
  __name(inlineContainerArm, "inlineContainerArm");
19035
- __name5(inlineContainerArm, "inlineContainerArm");
19036
- nodeIdOf = /* @__PURE__ */ __name5((n2) => n2.type === "step" ? n2.step.id : n2.id, "nodeIdOf");
19365
+ __name6(inlineContainerArm, "inlineContainerArm");
19366
+ nodeIdOf = /* @__PURE__ */ __name6((n2) => n2.type === "step" ? n2.step.id : n2.id, "nodeIdOf");
19037
19367
  __name(entryIds, "entryIds");
19038
- __name5(entryIds, "entryIds");
19368
+ __name6(entryIds, "entryIds");
19039
19369
  __name(resolvePlacements, "resolvePlacements");
19040
- __name5(resolvePlacements, "resolvePlacements");
19370
+ __name6(resolvePlacements, "resolvePlacements");
19041
19371
  GOAL_JUDGE_STEP_ID = "__goal_judge";
19042
19372
  NON_LEAF_KINDS = /* @__PURE__ */ new Set([
19043
19373
  "foreach",
@@ -19045,26 +19375,26 @@ var init_dist2 = __esm({
19045
19375
  ]);
19046
19376
  CONDITIONAL_JOIN_ID = /^conditional@\d+\.join$/;
19047
19377
  __name(isConditionalJoinId, "isConditionalJoinId");
19048
- __name5(isConditionalJoinId, "isConditionalJoinId");
19378
+ __name6(isConditionalJoinId, "isConditionalJoinId");
19049
19379
  __name(isPlainObject3, "isPlainObject");
19050
- __name5(isPlainObject3, "isPlainObject");
19380
+ __name6(isPlainObject3, "isPlainObject");
19051
19381
  __name(leafValue, "leafValue");
19052
- __name5(leafValue, "leafValue");
19382
+ __name6(leafValue, "leafValue");
19053
19383
  __name(runOutputLeaves, "runOutputLeaves");
19054
- __name5(runOutputLeaves, "runOutputLeaves");
19384
+ __name6(runOutputLeaves, "runOutputLeaves");
19055
19385
  __name(deriveRunOutput, "deriveRunOutput");
19056
- __name5(deriveRunOutput, "deriveRunOutput");
19386
+ __name6(deriveRunOutput, "deriveRunOutput");
19057
19387
  __name(subrunSettledOutput, "subrunSettledOutput");
19058
- __name5(subrunSettledOutput, "subrunSettledOutput");
19388
+ __name6(subrunSettledOutput, "subrunSettledOutput");
19059
19389
  __name(seedLedgerFromRun, "seedLedgerFromRun");
19060
- __name5(seedLedgerFromRun, "seedLedgerFromRun");
19061
- branchArmId = /* @__PURE__ */ __name5((arm) => arm.type === "step" ? arm.step.id : arm.id, "branchArmId");
19390
+ __name6(seedLedgerFromRun, "seedLedgerFromRun");
19391
+ branchArmId = /* @__PURE__ */ __name6((arm) => arm.type === "step" ? arm.step.id : arm.id, "branchArmId");
19062
19392
  __name(branchSpecFromConditional, "branchSpecFromConditional");
19063
- __name5(branchSpecFromConditional, "branchSpecFromConditional");
19393
+ __name6(branchSpecFromConditional, "branchSpecFromConditional");
19064
19394
  __name(selectBranchArms, "selectBranchArms");
19065
- __name5(selectBranchArms, "selectBranchArms");
19066
- canonical = /* @__PURE__ */ __name5((v) => JSON.stringify(sortKeys(v)), "canonical");
19067
- sortKeys = /* @__PURE__ */ __name5((v) => {
19395
+ __name6(selectBranchArms, "selectBranchArms");
19396
+ canonical = /* @__PURE__ */ __name6((v) => JSON.stringify(sortKeys(v)), "canonical");
19397
+ sortKeys = /* @__PURE__ */ __name6((v) => {
19068
19398
  if (Array.isArray(v)) return v.map(sortKeys);
19069
19399
  if (v && typeof v === "object") {
19070
19400
  return Object.fromEntries(Object.keys(v).sort().map((k) => [
@@ -19075,63 +19405,63 @@ var init_dist2 = __esm({
19075
19405
  return v;
19076
19406
  }, "sortKeys");
19077
19407
  __name(replayLedger, "replayLedger");
19078
- __name5(replayLedger, "replayLedger");
19408
+ __name6(replayLedger, "replayLedger");
19079
19409
  JOIN = ".join";
19080
- entryOfJoin = /* @__PURE__ */ __name5((id2) => id2.endsWith(JOIN) ? id2.slice(0, -JOIN.length) : void 0, "entryOfJoin");
19410
+ entryOfJoin = /* @__PURE__ */ __name6((id2) => id2.endsWith(JOIN) ? id2.slice(0, -JOIN.length) : void 0, "entryOfJoin");
19081
19411
  __name(replayResultOf, "replayResultOf");
19082
- __name5(replayResultOf, "replayResultOf");
19412
+ __name6(replayResultOf, "replayResultOf");
19083
19413
  __name(ancestorResults, "ancestorResults");
19084
- __name5(ancestorResults, "ancestorResults");
19414
+ __name6(ancestorResults, "ancestorResults");
19085
19415
  __name(inferTaken, "inferTaken");
19086
- __name5(inferTaken, "inferTaken");
19416
+ __name6(inferTaken, "inferTaken");
19087
19417
  __name(countChildren, "countChildren");
19088
- __name5(countChildren, "countChildren");
19418
+ __name6(countChildren, "countChildren");
19089
19419
  FORCE_CANCEL_STALE_MS = 10 * 60 * 1e3;
19090
19420
  TERMINAL = new Set(WORKFLOW_RUN_TERMINAL);
19091
19421
  __name(isTerminalRunStatus, "isTerminalRunStatus");
19092
- __name5(isTerminalRunStatus, "isTerminalRunStatus");
19422
+ __name6(isTerminalRunStatus, "isTerminalRunStatus");
19093
19423
  __name(pruneUndefined, "pruneUndefined");
19094
- __name5(pruneUndefined, "pruneUndefined");
19424
+ __name6(pruneUndefined, "pruneUndefined");
19095
19425
  WORKFLOW_INLINE_RUN_TAG = "inline";
19096
19426
  __name(runOrigin, "runOrigin");
19097
- __name5(runOrigin, "runOrigin");
19427
+ __name6(runOrigin, "runOrigin");
19098
19428
  RUN_ERROR_ISSUES_MAX = 20;
19099
19429
  __name(runErrorIssues, "runErrorIssues");
19100
- __name5(runErrorIssues, "runErrorIssues");
19430
+ __name6(runErrorIssues, "runErrorIssues");
19101
19431
  __name(runNextAction, "runNextAction");
19102
- __name5(runNextAction, "runNextAction");
19432
+ __name6(runNextAction, "runNextAction");
19103
19433
  IN_FLIGHT = new Set(WORKFLOW_STEP_IN_FLIGHT);
19104
19434
  __name(emptyRunCounts, "emptyRunCounts");
19105
- __name5(emptyRunCounts, "emptyRunCounts");
19435
+ __name6(emptyRunCounts, "emptyRunCounts");
19106
19436
  __name(runCountsFromStatusTally, "runCountsFromStatusTally");
19107
- __name5(runCountsFromStatusTally, "runCountsFromStatusTally");
19437
+ __name6(runCountsFromStatusTally, "runCountsFromStatusTally");
19108
19438
  __name(runCountsFromStepStatuses, "runCountsFromStepStatuses");
19109
- __name5(runCountsFromStepStatuses, "runCountsFromStepStatuses");
19439
+ __name6(runCountsFromStepStatuses, "runCountsFromStepStatuses");
19110
19440
  __name(isBillingHeldStep, "isBillingHeldStep");
19111
- __name5(isBillingHeldStep, "isBillingHeldStep");
19441
+ __name6(isBillingHeldStep, "isBillingHeldStep");
19112
19442
  __name(stepEffectiveStatus, "stepEffectiveStatus");
19113
- __name5(stepEffectiveStatus, "stepEffectiveStatus");
19114
- n = /* @__PURE__ */ __name5((v) => typeof v === "number" && Number.isFinite(v) ? v : 0, "n");
19443
+ __name6(stepEffectiveStatus, "stepEffectiveStatus");
19444
+ n = /* @__PURE__ */ __name6((v) => typeof v === "number" && Number.isFinite(v) ? v : 0, "n");
19115
19445
  __name(runCounts, "runCounts");
19116
- __name5(runCounts, "runCounts");
19446
+ __name6(runCounts, "runCounts");
19117
19447
  __name(isPricedStepReceipt, "isPricedStepReceipt");
19118
- __name5(isPricedStepReceipt, "isPricedStepReceipt");
19448
+ __name6(isPricedStepReceipt, "isPricedStepReceipt");
19119
19449
  __name(receiptEngine, "receiptEngine");
19120
- __name5(receiptEngine, "receiptEngine");
19450
+ __name6(receiptEngine, "receiptEngine");
19121
19451
  __name(receiptTier, "receiptTier");
19122
- __name5(receiptTier, "receiptTier");
19452
+ __name6(receiptTier, "receiptTier");
19123
19453
  __name(stepBillingView, "stepBillingView");
19124
- __name5(stepBillingView, "stepBillingView");
19454
+ __name6(stepBillingView, "stepBillingView");
19125
19455
  __name(runUsage, "runUsage");
19126
- __name5(runUsage, "runUsage");
19456
+ __name6(runUsage, "runUsage");
19127
19457
  __name(runBudgetCap, "runBudgetCap");
19128
- __name5(runBudgetCap, "runBudgetCap");
19458
+ __name6(runBudgetCap, "runBudgetCap");
19129
19459
  __name(runBudgetRemaining, "runBudgetRemaining");
19130
- __name5(runBudgetRemaining, "runBudgetRemaining");
19460
+ __name6(runBudgetRemaining, "runBudgetRemaining");
19131
19461
  __name(runCancelView, "runCancelView");
19132
- __name5(runCancelView, "runCancelView");
19462
+ __name6(runCancelView, "runCancelView");
19133
19463
  __name(runWorkspaceView, "runWorkspaceView");
19134
- __name5(runWorkspaceView, "runWorkspaceView");
19464
+ __name6(runWorkspaceView, "runWorkspaceView");
19135
19465
  SUSPENDED_FOR_DIMENSIONS = /* @__PURE__ */ new Set([
19136
19466
  "credits",
19137
19467
  "actions",
@@ -19139,9 +19469,9 @@ var init_dist2 = __esm({
19139
19469
  "jobSeconds"
19140
19470
  ]);
19141
19471
  __name(runSuspendedForView, "runSuspendedForView");
19142
- __name5(runSuspendedForView, "runSuspendedForView");
19472
+ __name6(runSuspendedForView, "runSuspendedForView");
19143
19473
  __name(toWorkflowRunSummary, "toWorkflowRunSummary");
19144
- __name5(toWorkflowRunSummary, "toWorkflowRunSummary");
19474
+ __name6(toWorkflowRunSummary, "toWorkflowRunSummary");
19145
19475
  STEP_ERROR_DETAIL_KEYS = [
19146
19476
  "reason",
19147
19477
  "key",
@@ -19195,9 +19525,9 @@ var init_dist2 = __esm({
19195
19525
  DETAIL_MAX_DEPTH = 4;
19196
19526
  DETAIL_MAX_ITEMS = 100;
19197
19527
  __name(scrubDetailValue, "scrubDetailValue");
19198
- __name5(scrubDetailValue, "scrubDetailValue");
19528
+ __name6(scrubDetailValue, "scrubDetailValue");
19199
19529
  __name(stepErrorDetail, "stepErrorDetail");
19200
- __name5(stepErrorDetail, "stepErrorDetail");
19530
+ __name6(stepErrorDetail, "stepErrorDetail");
19201
19531
  MAX_HOLIDAYS = 366;
19202
19532
  MAX_WALK_DAYS = 400;
19203
19533
  HHMM = /^([01]\d|2[0-3]):([0-5]\d)$/;
@@ -19217,18 +19547,18 @@ var init_dist2 = __esm({
19217
19547
  };
19218
19548
  supportedTz = null;
19219
19549
  __name(timeZoneSupported, "timeZoneSupported");
19220
- __name5(timeZoneSupported, "timeZoneSupported");
19550
+ __name6(timeZoneSupported, "timeZoneSupported");
19221
19551
  __name(validateBusinessHours, "validateBusinessHours");
19222
- __name5(validateBusinessHours, "validateBusinessHours");
19552
+ __name6(validateBusinessHours, "validateBusinessHours");
19223
19553
  __name(toMinutes, "toMinutes");
19224
- __name5(toMinutes, "toMinutes");
19554
+ __name6(toMinutes, "toMinutes");
19225
19555
  __name(resolveCalendar, "resolveCalendar");
19226
- __name5(resolveCalendar, "resolveCalendar");
19556
+ __name6(resolveCalendar, "resolveCalendar");
19227
19557
  __name(assertValid, "assertValid");
19228
- __name5(assertValid, "assertValid");
19558
+ __name6(assertValid, "assertValid");
19229
19559
  fmtCache = /* @__PURE__ */ new Map();
19230
19560
  __name(formatter, "formatter");
19231
- __name5(formatter, "formatter");
19561
+ __name6(formatter, "formatter");
19232
19562
  WEEKDAYS = {
19233
19563
  Sun: 0,
19234
19564
  Mon: 1,
@@ -19239,25 +19569,25 @@ var init_dist2 = __esm({
19239
19569
  Sat: 6
19240
19570
  };
19241
19571
  __name(localParts, "localParts");
19242
- __name5(localParts, "localParts");
19572
+ __name6(localParts, "localParts");
19243
19573
  __name(offsetAt, "offsetAt");
19244
- __name5(offsetAt, "offsetAt");
19574
+ __name6(offsetAt, "offsetAt");
19245
19575
  __name(localToUtc, "localToUtc");
19246
- __name5(localToUtc, "localToUtc");
19576
+ __name6(localToUtc, "localToUtc");
19247
19577
  __name(sameWall, "sameWall");
19248
- __name5(sameWall, "sameWall");
19578
+ __name6(sameWall, "sameWall");
19249
19579
  __name(ymd, "ymd");
19250
- __name5(ymd, "ymd");
19580
+ __name6(ymd, "ymd");
19251
19581
  __name(windowOf, "windowOf");
19252
- __name5(windowOf, "windowOf");
19582
+ __name6(windowOf, "windowOf");
19253
19583
  __name(nextDayAnchor, "nextDayAnchor");
19254
- __name5(nextDayAnchor, "nextDayAnchor");
19584
+ __name6(nextDayAnchor, "nextDayAnchor");
19255
19585
  __name(addBusinessTime, "addBusinessTime");
19256
- __name5(addBusinessTime, "addBusinessTime");
19586
+ __name6(addBusinessTime, "addBusinessTime");
19257
19587
  __name(roundToBusinessTime, "roundToBusinessTime");
19258
- __name5(roundToBusinessTime, "roundToBusinessTime");
19588
+ __name6(roundToBusinessTime, "roundToBusinessTime");
19259
19589
  __name(isBusinessTime, "isBusinessTime");
19260
- __name5(isBusinessTime, "isBusinessTime");
19590
+ __name6(isBusinessTime, "isBusinessTime");
19261
19591
  JSON_PATCH_OPS = [
19262
19592
  "replace",
19263
19593
  "add",
@@ -19268,27 +19598,27 @@ var init_dist2 = __esm({
19268
19598
  JSON_PATCH_MAX_TOTAL_BYTES = 1024 * 1024;
19269
19599
  SEGMENT_RE = /^([A-Za-z_$][\w$-]*)((?:\[(?:\*|\d+)\])*)$/;
19270
19600
  __name(parseEditablePath, "parseEditablePath");
19271
- __name5(parseEditablePath, "parseEditablePath");
19601
+ __name6(parseEditablePath, "parseEditablePath");
19272
19602
  __name(isEditablePathEntry, "isEditablePathEntry");
19273
- __name5(isEditablePathEntry, "isEditablePathEntry");
19603
+ __name6(isEditablePathEntry, "isEditablePathEntry");
19274
19604
  __name(pointerToSegments, "pointerToSegments");
19275
- __name5(pointerToSegments, "pointerToSegments");
19605
+ __name6(pointerToSegments, "pointerToSegments");
19276
19606
  __name(pointerToDotPath, "pointerToDotPath");
19277
- __name5(pointerToDotPath, "pointerToDotPath");
19607
+ __name6(pointerToDotPath, "pointerToDotPath");
19278
19608
  __name(coveredBy, "coveredBy");
19279
- __name5(coveredBy, "coveredBy");
19609
+ __name6(coveredBy, "coveredBy");
19280
19610
  __name(matchesEditablePath, "matchesEditablePath");
19281
- __name5(matchesEditablePath, "matchesEditablePath");
19611
+ __name6(matchesEditablePath, "matchesEditablePath");
19282
19612
  __name(changedPointers, "changedPointers");
19283
- __name5(changedPointers, "changedPointers");
19613
+ __name6(changedPointers, "changedPointers");
19284
19614
  __name(escapePointer, "escapePointer");
19285
- __name5(escapePointer, "escapePointer");
19615
+ __name6(escapePointer, "escapePointer");
19286
19616
  __name(validateJsonPatch, "validateJsonPatch");
19287
- __name5(validateJsonPatch, "validateJsonPatch");
19617
+ __name6(validateJsonPatch, "validateJsonPatch");
19288
19618
  __name(applyJsonPatch, "applyJsonPatch");
19289
- __name5(applyJsonPatch, "applyJsonPatch");
19619
+ __name6(applyJsonPatch, "applyJsonPatch");
19290
19620
  __name(rebaseItemPointer, "rebaseItemPointer");
19291
- __name5(rebaseItemPointer, "rebaseItemPointer");
19621
+ __name6(rebaseItemPointer, "rebaseItemPointer");
19292
19622
  WORKFLOW_SCHEDULE_TYPES = [
19293
19623
  "cron",
19294
19624
  "interval",
@@ -19300,22 +19630,22 @@ var init_dist2 = __esm({
19300
19630
  "installer",
19301
19631
  "system"
19302
19632
  ];
19303
- isObject = /* @__PURE__ */ __name5((v) => typeof v === "object" && v !== null && !Array.isArray(v), "isObject");
19633
+ isObject = /* @__PURE__ */ __name6((v) => typeof v === "object" && v !== null && !Array.isArray(v), "isObject");
19304
19634
  __name(validateWorkflowSchedule, "validateWorkflowSchedule");
19305
- __name5(validateWorkflowSchedule, "validateWorkflowSchedule");
19635
+ __name6(validateWorkflowSchedule, "validateWorkflowSchedule");
19306
19636
  WORKFLOW_ENV_OVERLAY_MAX_KEYS = 64;
19307
19637
  WORKFLOW_ENV_OVERLAY_MAX_VALUE_BYTES = 4096;
19308
19638
  WORKFLOW_ENV_TEMPLATE_SECRET_KEY_RE = /(SECRET|TOKEN|KEY|PASSWORD)$/;
19309
- isEnvRef = /* @__PURE__ */ __name5((v) => typeof v === "object" && v !== null && !Array.isArray(v) && typeof v.__envRef === "string" && Object.keys(v).length === 1, "isEnvRef");
19310
- looksLikeEmbeddedJson = /* @__PURE__ */ __name5((s) => s.length > 1 && s[0] === "{" && s.includes("__envRef"), "looksLikeEmbeddedJson");
19639
+ isEnvRef = /* @__PURE__ */ __name6((v) => typeof v === "object" && v !== null && !Array.isArray(v) && typeof v.__envRef === "string" && Object.keys(v).length === 1, "isEnvRef");
19640
+ looksLikeEmbeddedJson = /* @__PURE__ */ __name6((s) => s.length > 1 && s[0] === "{" && s.includes("__envRef"), "looksLikeEmbeddedJson");
19311
19641
  __name(collectEnvTemplateKeys, "collectEnvTemplateKeys");
19312
- __name5(collectEnvTemplateKeys, "collectEnvTemplateKeys");
19642
+ __name6(collectEnvTemplateKeys, "collectEnvTemplateKeys");
19313
19643
  __name(substituteEnvRefs, "substituteEnvRefs");
19314
- __name5(substituteEnvRefs, "substituteEnvRefs");
19644
+ __name6(substituteEnvRefs, "substituteEnvRefs");
19315
19645
  __name(hashEnvOverlay, "hashEnvOverlay");
19316
- __name5(hashEnvOverlay, "hashEnvOverlay");
19646
+ __name6(hashEnvOverlay, "hashEnvOverlay");
19317
19647
  __name(validateEnvOverlay, "validateEnvOverlay");
19318
- __name5(validateEnvOverlay, "validateEnvOverlay");
19648
+ __name6(validateEnvOverlay, "validateEnvOverlay");
19319
19649
  ZERO = {
19320
19650
  steps: {
19321
19651
  min: 0,
@@ -19328,36 +19658,36 @@ var init_dist2 = __esm({
19328
19658
  agentCalls: 0
19329
19659
  };
19330
19660
  __name(add, "add");
19331
- __name5(add, "add");
19661
+ __name6(add, "add");
19332
19662
  __name(scale, "scale");
19333
- __name5(scale, "scale");
19663
+ __name6(scale, "scale");
19334
19664
  __name(armEntry, "armEntry");
19335
- __name5(armEntry, "armEntry");
19665
+ __name6(armEntry, "armEntry");
19336
19666
  __name(ofEntry, "ofEntry");
19337
- __name5(ofEntry, "ofEntry");
19667
+ __name6(ofEntry, "ofEntry");
19338
19668
  __name(estimateGraph, "estimateGraph");
19339
- __name5(estimateGraph, "estimateGraph");
19340
- isRecord3 = /* @__PURE__ */ __name5((v) => !!v && typeof v === "object" && !Array.isArray(v), "isRecord");
19669
+ __name6(estimateGraph, "estimateGraph");
19670
+ isRecord4 = /* @__PURE__ */ __name6((v) => !!v && typeof v === "object" && !Array.isArray(v), "isRecord");
19341
19671
  __name(singleStepsOf, "singleStepsOf");
19342
- __name5(singleStepsOf, "singleStepsOf");
19672
+ __name6(singleStepsOf, "singleStepsOf");
19343
19673
  __name(entriesOf, "entriesOf");
19344
- __name5(entriesOf, "entriesOf");
19674
+ __name6(entriesOf, "entriesOf");
19345
19675
  __name(inheritTargets, "inheritTargets");
19346
- __name5(inheritTargets, "inheritTargets");
19676
+ __name6(inheritTargets, "inheritTargets");
19347
19677
  __name(needsInheritedWorkspace, "needsInheritedWorkspace");
19348
- __name5(needsInheritedWorkspace, "needsInheritedWorkspace");
19678
+ __name6(needsInheritedWorkspace, "needsInheritedWorkspace");
19349
19679
  __name(armEntry2, "armEntry2");
19350
- __name5(armEntry2, "armEntry");
19680
+ __name6(armEntry2, "armEntry");
19351
19681
  __name(entryHasJobTier, "entryHasJobTier");
19352
- __name5(entryHasJobTier, "entryHasJobTier");
19682
+ __name6(entryHasJobTier, "entryHasJobTier");
19353
19683
  __name(graphHasJobTierStep, "graphHasJobTierStep");
19354
- __name5(graphHasJobTierStep, "graphHasJobTierStep");
19684
+ __name6(graphHasJobTierStep, "graphHasJobTierStep");
19355
19685
  __name(jobTierSteps, "jobTierSteps");
19356
- __name5(jobTierSteps, "jobTierSteps");
19686
+ __name6(jobTierSteps, "jobTierSteps");
19357
19687
  __name(jobTierStepIds, "jobTierStepIds");
19358
- __name5(jobTierStepIds, "jobTierStepIds");
19688
+ __name6(jobTierStepIds, "jobTierStepIds");
19359
19689
  __name(collectJobTierSteps, "collectJobTierSteps");
19360
- __name5(collectJobTierSteps, "collectJobTierSteps");
19690
+ __name6(collectJobTierSteps, "collectJobTierSteps");
19361
19691
  }
19362
19692
  });
19363
19693
 
@@ -20411,7 +20741,9 @@ var init_compile_constants = __esm({
20411
20741
  template: template2,
20412
20742
  fromRequest: fromRequest2,
20413
20743
  rows: rows2,
20414
- fromKnowledge: fromKnowledge2
20744
+ fromKnowledge: fromKnowledge2,
20745
+ WORKFLOW_DEFAULT_MAX_DURATION_SECONDS,
20746
+ WORKFLOW_HITL_MAX_DURATION_SECONDS
20415
20747
  };
20416
20748
  WORKFLOW_SHIM_NAMES = [
20417
20749
  "LuaWorkflow",
@@ -20444,7 +20776,9 @@ var init_compile_constants = __esm({
20444
20776
  "template",
20445
20777
  "fromRequest",
20446
20778
  "rows",
20447
- "fromKnowledge"
20779
+ "fromKnowledge",
20780
+ "WORKFLOW_DEFAULT_MAX_DURATION_SECONDS",
20781
+ "WORKFLOW_HITL_MAX_DURATION_SECONDS"
20448
20782
  ];
20449
20783
  COMPILE_DIRS = {
20450
20784
  DIST: "dist",
@@ -20543,6 +20877,14 @@ async function classifyErrorResponse(response) {
20543
20877
  }
20544
20878
  throw new AuthenticationError(`Authentication failed: ${serverMessage}`, "unknown", serverMessage);
20545
20879
  }
20880
+ if (response.status === 403 && !isLuaErrorBody(errorData) && isHtmlResponse(response)) {
20881
+ throw new CliError("forbidden", "The request was blocked before it reached Lua (HTTP 403 from the network firewall), not by your credentials.", {
20882
+ exitCode: CLI_EXIT.FORBIDDEN,
20883
+ statusCode: 403,
20884
+ serverCode: EDGE_BLOCKED_CODE,
20885
+ hint: "Something in the request looked like an attack to the firewall, for example a URL that contains a system path. Change the request and try again."
20886
+ });
20887
+ }
20546
20888
  if (response.status === 403) {
20547
20889
  const detail = errorData.message || "You do not have permission to access this resource.";
20548
20890
  const serverCode = serverCodeOf(errorData.code, errorData.error);
@@ -20658,6 +21000,9 @@ async function* parseSseStream(body, signal) {
20658
21000
  }
20659
21001
  }
20660
21002
  }
21003
+ function isHtmlResponse(response) {
21004
+ return (response.headers.get("content-type") ?? "").toLowerCase().includes("text/html");
21005
+ }
20661
21006
  function parseRetryAfter(raw) {
20662
21007
  if (!raw) return void 0;
20663
21008
  const seconds = Number.parseInt(raw, 10);
@@ -21076,6 +21421,7 @@ var init_http_client = __esm({
21076
21421
  __name(serverCodeOf, "serverCodeOf");
21077
21422
  __name(refusalFromResponse, "refusalFromResponse");
21078
21423
  __name(parseSseStream, "parseSseStream");
21424
+ __name(isHtmlResponse, "isHtmlResponse");
21079
21425
  __name(parseRetryAfter, "parseRetryAfter");
21080
21426
  __name(isCoreDrainApiError, "isCoreDrainApiError");
21081
21427
  __name(coreDrainApiRetryDelayMs, "coreDrainApiRetryDelayMs");
@@ -21357,7 +21703,7 @@ function walkWorkspace(rootDir, opts = {}) {
21357
21703
  const refs = [];
21358
21704
  const contentByHash = /* @__PURE__ */ new Map();
21359
21705
  let totalSize = 0;
21360
- const visit = /* @__PURE__ */ __name6((relPrefix) => {
21706
+ const visit = /* @__PURE__ */ __name7((relPrefix) => {
21361
21707
  const absDir = relPrefix ? join4(rootDir, relPrefix) : rootDir;
21362
21708
  let entries;
21363
21709
  try {
@@ -21651,21 +21997,21 @@ function walk3(root, prefix, out) {
21651
21997
  }
21652
21998
  }
21653
21999
  }
21654
- var __defProp6, __name6, FILE_HASH_LENGTH, SKIP_DIRECTORIES, ARCHIVE_ONLY_SKIP_DIRECTORIES, DEFAULT_MAX_FILE_BYTES, KIND_BY_EXT, CHECK_BLOBS_MAX_HASHES, BackupHttpError, BackupHttpClient, DEFAULT_CONCURRENCY, CREDENTIAL_PATHS, WINDOWS_ABSOLUTE_PATH, ARCHIVE_SCHEMA_VERSION, SKILL_SOURCE_ARCHIVE_MAX_BYTES;
22000
+ var __defProp7, __name7, FILE_HASH_LENGTH, SKIP_DIRECTORIES, ARCHIVE_ONLY_SKIP_DIRECTORIES, DEFAULT_MAX_FILE_BYTES, KIND_BY_EXT, CHECK_BLOBS_MAX_HASHES, BackupHttpError, BackupHttpClient, DEFAULT_CONCURRENCY, CREDENTIAL_PATHS, WINDOWS_ABSOLUTE_PATH, ARCHIVE_SCHEMA_VERSION, SKILL_SOURCE_ARCHIVE_MAX_BYTES;
21655
22001
  var init_dist3 = __esm({
21656
22002
  "../shared-source-sync/dist/index.mjs"() {
21657
22003
  "use strict";
21658
- __defProp6 = Object.defineProperty;
21659
- __name6 = /* @__PURE__ */ __name((target, value3) => __defProp6(target, "name", { value: value3, configurable: true }), "__name");
22004
+ __defProp7 = Object.defineProperty;
22005
+ __name7 = /* @__PURE__ */ __name((target, value3) => __defProp7(target, "name", { value: value3, configurable: true }), "__name");
21660
22006
  FILE_HASH_LENGTH = 16;
21661
22007
  __name(hashContentTruncated, "hashContentTruncated");
21662
- __name6(hashContentTruncated, "hashContentTruncated");
22008
+ __name7(hashContentTruncated, "hashContentTruncated");
21663
22009
  __name(sha256Hex, "sha256Hex");
21664
- __name6(sha256Hex, "sha256Hex");
22010
+ __name7(sha256Hex, "sha256Hex");
21665
22011
  __name(matchesFileHash, "matchesFileHash");
21666
- __name6(matchesFileHash, "matchesFileHash");
22012
+ __name7(matchesFileHash, "matchesFileHash");
21667
22013
  __name(combineFileHashes, "combineFileHashes");
21668
- __name6(combineFileHashes, "combineFileHashes");
22014
+ __name7(combineFileHashes, "combineFileHashes");
21669
22015
  SKIP_DIRECTORIES = /* @__PURE__ */ new Set([
21670
22016
  "node_modules",
21671
22017
  "dist",
@@ -21682,9 +22028,9 @@ var init_dist3 = __esm({
21682
22028
  ]);
21683
22029
  DEFAULT_MAX_FILE_BYTES = 256 * 1024;
21684
22030
  __name(shouldSkipDirectory, "shouldSkipDirectory");
21685
- __name6(shouldSkipDirectory, "shouldSkipDirectory");
22031
+ __name7(shouldSkipDirectory, "shouldSkipDirectory");
21686
22032
  __name(shouldSkipFile, "shouldSkipFile");
21687
- __name6(shouldSkipFile, "shouldSkipFile");
22033
+ __name7(shouldSkipFile, "shouldSkipFile");
21688
22034
  KIND_BY_EXT = {
21689
22035
  ".ts": "source",
21690
22036
  ".tsx": "source",
@@ -21696,16 +22042,16 @@ var init_dist3 = __esm({
21696
22042
  ".toml": "config"
21697
22043
  };
21698
22044
  __name(classifyFile, "classifyFile");
21699
- __name6(classifyFile, "classifyFile");
22045
+ __name7(classifyFile, "classifyFile");
21700
22046
  __name(walkWorkspace, "walkWorkspace");
21701
- __name6(walkWorkspace, "walkWorkspace");
22047
+ __name7(walkWorkspace, "walkWorkspace");
21702
22048
  CHECK_BLOBS_MAX_HASHES = 500;
21703
22049
  BackupHttpError = class extends Error {
21704
22050
  static {
21705
22051
  __name(this, "BackupHttpError");
21706
22052
  }
21707
22053
  static {
21708
- __name6(this, "BackupHttpError");
22054
+ __name7(this, "BackupHttpError");
21709
22055
  }
21710
22056
  status;
21711
22057
  endpoint;
@@ -21720,7 +22066,7 @@ var init_dist3 = __esm({
21720
22066
  __name(this, "BackupHttpClient");
21721
22067
  }
21722
22068
  static {
21723
- __name6(this, "BackupHttpClient");
22069
+ __name7(this, "BackupHttpClient");
21724
22070
  }
21725
22071
  options;
21726
22072
  fetchFn;
@@ -21825,17 +22171,17 @@ var init_dist3 = __esm({
21825
22171
  };
21826
22172
  DEFAULT_CONCURRENCY = 10;
21827
22173
  __name(uploadBlobs, "uploadBlobs");
21828
- __name6(uploadBlobs, "uploadBlobs");
22174
+ __name7(uploadBlobs, "uploadBlobs");
21829
22175
  __name(decodeBlob, "decodeBlob");
21830
- __name6(decodeBlob, "decodeBlob");
22176
+ __name7(decodeBlob, "decodeBlob");
21831
22177
  __name(verifyDownloaded, "verifyDownloaded");
21832
- __name6(verifyDownloaded, "verifyDownloaded");
22178
+ __name7(verifyDownloaded, "verifyDownloaded");
21833
22179
  __name(downloadBlobs, "downloadBlobs");
21834
- __name6(downloadBlobs, "downloadBlobs");
22180
+ __name7(downloadBlobs, "downloadBlobs");
21835
22181
  __name(resolveBackupFileTarget, "resolveBackupFileTarget");
21836
- __name6(resolveBackupFileTarget, "resolveBackupFileTarget");
22182
+ __name7(resolveBackupFileTarget, "resolveBackupFileTarget");
21837
22183
  __name(restoreFromBlobs, "restoreFromBlobs");
21838
- __name6(restoreFromBlobs, "restoreFromBlobs");
22184
+ __name7(restoreFromBlobs, "restoreFromBlobs");
21839
22185
  CREDENTIAL_PATHS = /* @__PURE__ */ new Set([
21840
22186
  ".env",
21841
22187
  ".lua/config.json",
@@ -21843,22 +22189,22 @@ var init_dist3 = __esm({
21843
22189
  ]);
21844
22190
  WINDOWS_ABSOLUTE_PATH = /^[a-z]:\//i;
21845
22191
  __name(normalizeWorkspaceRelativePath, "normalizeWorkspaceRelativePath");
21846
- __name6(normalizeWorkspaceRelativePath, "normalizeWorkspaceRelativePath");
22192
+ __name7(normalizeWorkspaceRelativePath, "normalizeWorkspaceRelativePath");
21847
22193
  __name(isCredentialPersistencePath, "isCredentialPersistencePath");
21848
- __name6(isCredentialPersistencePath, "isCredentialPersistencePath");
22194
+ __name7(isCredentialPersistencePath, "isCredentialPersistencePath");
21849
22195
  __name(pushAgentBackup, "pushAgentBackup");
21850
- __name6(pushAgentBackup, "pushAgentBackup");
22196
+ __name7(pushAgentBackup, "pushAgentBackup");
21851
22197
  __name(pullAgentBackup, "pullAgentBackup");
21852
- __name6(pullAgentBackup, "pullAgentBackup");
22198
+ __name7(pullAgentBackup, "pullAgentBackup");
21853
22199
  ARCHIVE_SCHEMA_VERSION = 1;
21854
22200
  __name(encodeWorkspaceArchive, "encodeWorkspaceArchive");
21855
- __name6(encodeWorkspaceArchive, "encodeWorkspaceArchive");
22201
+ __name7(encodeWorkspaceArchive, "encodeWorkspaceArchive");
21856
22202
  __name(decodeWorkspaceArchive, "decodeWorkspaceArchive");
21857
- __name6(decodeWorkspaceArchive, "decodeWorkspaceArchive");
22203
+ __name7(decodeWorkspaceArchive, "decodeWorkspaceArchive");
21858
22204
  __name(writeArchiveToWorkspace, "writeArchiveToWorkspace");
21859
- __name6(writeArchiveToWorkspace, "writeArchiveToWorkspace");
22205
+ __name7(writeArchiveToWorkspace, "writeArchiveToWorkspace");
21860
22206
  __name(walk3, "walk");
21861
- __name6(walk3, "walk");
22207
+ __name7(walk3, "walk");
21862
22208
  SKILL_SOURCE_ARCHIVE_MAX_BYTES = 4 * 1024 * 1024;
21863
22209
  }
21864
22210
  });
@@ -22117,6 +22463,9 @@ var init_bundle_upload = __esm({
22117
22463
  });
22118
22464
 
22119
22465
  // src/primitives/base.handler.ts
22466
+ function nameFlagDeleteCommand(deleteCommand, displayName, name) {
22467
+ return `${deleteCommand} --${displayName.toLowerCase().replace(/\s+/g, "-")}-name ${name}`;
22468
+ }
22120
22469
  var DEFAULT_VERSION, BaseVersionedHandler, BaseNonVersionedHandler;
22121
22470
  var init_base_handler = __esm({
22122
22471
  "src/primitives/base.handler.ts"() {
@@ -22129,10 +22478,14 @@ var init_base_handler = __esm({
22129
22478
  init_auth_error();
22130
22479
  init_cli_error();
22131
22480
  DEFAULT_VERSION = SKILL_DEFAULTS.VERSION;
22481
+ __name(nameFlagDeleteCommand, "nameFlagDeleteCommand");
22132
22482
  BaseVersionedHandler = class {
22133
22483
  static {
22134
22484
  __name(this, "BaseVersionedHandler");
22135
22485
  }
22486
+ serverDeleteCommand(name) {
22487
+ return nameFlagDeleteCommand(this.deleteCommand, this.displayName, name);
22488
+ }
22136
22489
  /**
22137
22490
  * Strip a YAML item to only the canonical fields: name, version, [idField].
22138
22491
  * Override if your YAML type has additional fields.
@@ -22270,7 +22623,6 @@ var init_base_handler = __esm({
22270
22623
  }));
22271
22624
  yamlItems.push(...stubs);
22272
22625
  yamlUpdated = true;
22273
- const flagName = `--${this.displayName.toLowerCase().replace(/\s+/g, "-")}-name`;
22274
22626
  console.log(`
22275
22627
  \u26A0\uFE0F Found ${this.displayNamePlural} on server not in your local code:`);
22276
22628
  for (const item of orphans) {
@@ -22279,7 +22631,7 @@ var init_base_handler = __esm({
22279
22631
  console.log(msg);
22280
22632
  }
22281
22633
  console.log(` Added to lua.skill.yaml as server-only entries.`);
22282
- console.log(` To remove from server: ${this.deleteCommand} ${flagName} <name>`);
22634
+ console.log(` To remove from server: ${this.serverDeleteCommand("<name>")}`);
22283
22635
  console.log(` To restore source from backup: lua sync --accept
22284
22636
  `);
22285
22637
  orphanedCount = orphans.length;
@@ -22581,6 +22933,9 @@ var init_base_handler = __esm({
22581
22933
  static {
22582
22934
  __name(this, "BaseNonVersionedHandler");
22583
22935
  }
22936
+ serverDeleteCommand(name) {
22937
+ return nameFlagDeleteCommand(this.deleteCommand, this.displayName, name);
22938
+ }
22584
22939
  /**
22585
22940
  * Optional hook run after a successful upsert when autoDeploy is set.
22586
22941
  * Default: no-op. Handlers override for post-upsert actions (e.g. MCP
@@ -22657,7 +23012,6 @@ var init_base_handler = __esm({
22657
23012
  ...stubs
22658
23013
  ], config);
22659
23014
  yamlUpdated = true;
22660
- const flagName = `--${this.displayName.toLowerCase().replace(/\s+/g, "-")}-name`;
22661
23015
  console.log(`
22662
23016
  \u26A0\uFE0F Found ${this.displayNamePlural} on server not in your local code:`);
22663
23017
  for (const item of orphans) {
@@ -22666,7 +23020,7 @@ var init_base_handler = __esm({
22666
23020
  console.log(msg);
22667
23021
  }
22668
23022
  console.log(` Added to lua.skill.yaml as server-only entries.`);
22669
- console.log(` To remove from server: ${this.deleteCommand} ${flagName} <name>`);
23023
+ console.log(` To remove from server: ${this.serverDeleteCommand("<name>")}`);
22670
23024
  console.log(` To restore source from backup: lua sync --accept
22671
23025
  `);
22672
23026
  orphanedCount = orphans.length;
@@ -23383,15 +23737,22 @@ var init_analytics = __esm({
23383
23737
  });
23384
23738
 
23385
23739
  // src/utils/write-info.ts
23740
+ function clearLineFor(stream) {
23741
+ return stream.isTTY ? CLEAR_LINE : "";
23742
+ }
23386
23743
  function writeInfo(message) {
23387
- process.stdout.write("\r\x1B[K" + message + "\n");
23744
+ process.stdout.write(clearLineFor(process.stdout) + message + "\n");
23388
23745
  }
23389
23746
  function writeProgress(message) {
23390
- process.stderr.write("\r\x1B[K" + message);
23747
+ if (process.stderr.isTTY) process.stderr.write(CLEAR_LINE + message);
23748
+ else process.stderr.write(message + "\n");
23391
23749
  }
23750
+ var CLEAR_LINE;
23392
23751
  var init_write_info = __esm({
23393
23752
  "src/utils/write-info.ts"() {
23394
23753
  "use strict";
23754
+ CLEAR_LINE = "\r\x1B[K";
23755
+ __name(clearLineFor, "clearLineFor");
23395
23756
  __name(writeInfo, "writeInfo");
23396
23757
  __name(writeProgress, "writeProgress");
23397
23758
  }
@@ -23560,10 +23921,10 @@ function clearPromptLines(count2 = 1) {
23560
23921
  }
23561
23922
  }
23562
23923
  function writeSuccess(message) {
23563
- process.stdout.write("\r\x1B[K" + message + "\n");
23924
+ process.stdout.write(clearLineFor(process.stdout) + message + "\n");
23564
23925
  }
23565
23926
  function writeError(message) {
23566
- process.stderr.write("\r\x1B[K" + message + "\n");
23927
+ process.stderr.write(clearLineFor(process.stderr) + message + "\n");
23567
23928
  }
23568
23929
  var isCiMode, jsonOutputRequested;
23569
23930
  var init_cli = __esm({
@@ -23576,6 +23937,7 @@ var init_cli = __esm({
23576
23937
  init_analytics();
23577
23938
  init_hints();
23578
23939
  init_write_info();
23940
+ init_write_info();
23579
23941
  isCiMode = false;
23580
23942
  __name(setCiMode, "setCiMode");
23581
23943
  __name(isCiModeEnabled, "isCiModeEnabled");
@@ -23607,11 +23969,11 @@ function invalidContract(message) {
23607
23969
  }
23608
23970
  };
23609
23971
  }
23610
- function isRecord4(value3) {
23972
+ function isRecord5(value3) {
23611
23973
  return typeof value3 === "object" && value3 !== null && !Array.isArray(value3);
23612
23974
  }
23613
23975
  function parseCredentialIdentityContext(value3) {
23614
- if (!isRecord4(value3)) return void 0;
23976
+ if (!isRecord5(value3)) return void 0;
23615
23977
  const email = value3.email;
23616
23978
  const fullName = value3.fullName;
23617
23979
  if (email !== null && typeof email !== "string" || fullName !== null && typeof fullName !== "string") {
@@ -23639,7 +24001,7 @@ var init_cli_credentials_api_service = __esm({
23639
24001
  init_dist();
23640
24002
  __name(bearerHeaders, "bearerHeaders");
23641
24003
  __name(invalidContract, "invalidContract");
23642
- __name(isRecord4, "isRecord");
24004
+ __name(isRecord5, "isRecord");
23643
24005
  __name(parseCredentialIdentityContext, "parseCredentialIdentityContext");
23644
24006
  __name(resourceQuery, "resourceQuery");
23645
24007
  CliCredentialsApi = class extends HttpClient {
@@ -29357,23 +29719,23 @@ import { Agent as Agent2, buildConnector } from "undici";
29357
29719
  import * as net4 from "net";
29358
29720
  import { promises as dns2 } from "dns";
29359
29721
  function buildSandboxProcess(opts) {
29360
- const hrtimeFn = /* @__PURE__ */ __name7((time) => process.hrtime(time), "hrtimeFn");
29722
+ const hrtimeFn = /* @__PURE__ */ __name8((time) => process.hrtime(time), "hrtimeFn");
29361
29723
  hrtimeFn.bigint = () => process.hrtime.bigint();
29362
- const nextTickFn = /* @__PURE__ */ __name7((cb, ...args2) => {
29724
+ const nextTickFn = /* @__PURE__ */ __name8((cb, ...args2) => {
29363
29725
  process.nextTick(cb, ...args2);
29364
29726
  }, "nextTickFn");
29365
- const buildStdioStub = /* @__PURE__ */ __name7((fd) => {
29727
+ const buildStdioStub = /* @__PURE__ */ __name8((fd) => {
29366
29728
  const stub = {
29367
29729
  fd,
29368
29730
  isTTY: false,
29369
- write: /* @__PURE__ */ __name7(() => true, "write"),
29370
- end: /* @__PURE__ */ __name7(() => stub, "end"),
29371
- on: /* @__PURE__ */ __name7(() => stub, "on"),
29372
- once: /* @__PURE__ */ __name7(() => stub, "once"),
29373
- removeListener: /* @__PURE__ */ __name7(() => stub, "removeListener"),
29374
- cork: /* @__PURE__ */ __name7(() => {
29731
+ write: /* @__PURE__ */ __name8(() => true, "write"),
29732
+ end: /* @__PURE__ */ __name8(() => stub, "end"),
29733
+ on: /* @__PURE__ */ __name8(() => stub, "on"),
29734
+ once: /* @__PURE__ */ __name8(() => stub, "once"),
29735
+ removeListener: /* @__PURE__ */ __name8(() => stub, "removeListener"),
29736
+ cork: /* @__PURE__ */ __name8(() => {
29375
29737
  }, "cork"),
29376
- uncork: /* @__PURE__ */ __name7(() => {
29738
+ uncork: /* @__PURE__ */ __name8(() => {
29377
29739
  }, "uncork")
29378
29740
  };
29379
29741
  return stub;
@@ -29393,21 +29755,21 @@ function buildSandboxProcess(opts) {
29393
29755
  hrtime: hrtimeFn,
29394
29756
  // Lie — don't leak host filesystem layout. Skills should not depend on
29395
29757
  // the value matching anything real.
29396
- cwd: /* @__PURE__ */ __name7(() => "/", "cwd"),
29397
- uptime: /* @__PURE__ */ __name7(() => process.uptime(), "uptime"),
29398
- memoryUsage: /* @__PURE__ */ __name7(() => process.memoryUsage(), "memoryUsage"),
29758
+ cwd: /* @__PURE__ */ __name8(() => "/", "cwd"),
29759
+ uptime: /* @__PURE__ */ __name8(() => process.uptime(), "uptime"),
29760
+ memoryUsage: /* @__PURE__ */ __name8(() => process.memoryUsage(), "memoryUsage"),
29399
29761
  argv: [
29400
29762
  "node"
29401
29763
  ],
29402
29764
  argv0: "node",
29403
29765
  // No-op event API. Returns `proc` for chaining (matches Node convention).
29404
29766
  // Skills CANNOT register handlers on host signals via this stub.
29405
- on: /* @__PURE__ */ __name7(() => proc, "on"),
29406
- once: /* @__PURE__ */ __name7(() => proc, "once"),
29407
- off: /* @__PURE__ */ __name7(() => proc, "off"),
29408
- addListener: /* @__PURE__ */ __name7(() => proc, "addListener"),
29409
- removeListener: /* @__PURE__ */ __name7(() => proc, "removeListener"),
29410
- emit: /* @__PURE__ */ __name7(() => false, "emit")
29767
+ on: /* @__PURE__ */ __name8(() => proc, "on"),
29768
+ once: /* @__PURE__ */ __name8(() => proc, "once"),
29769
+ off: /* @__PURE__ */ __name8(() => proc, "off"),
29770
+ addListener: /* @__PURE__ */ __name8(() => proc, "addListener"),
29771
+ removeListener: /* @__PURE__ */ __name8(() => proc, "removeListener"),
29772
+ emit: /* @__PURE__ */ __name8(() => false, "emit")
29411
29773
  };
29412
29774
  return Object.freeze(proc);
29413
29775
  }
@@ -29502,7 +29864,7 @@ function isRequireBlocklisted(id2) {
29502
29864
  }
29503
29865
  function buildSandboxRequire(opts) {
29504
29866
  const realRequire = createRequire(path6.join(opts.cwd, "package.json"));
29505
- const wrapped = /* @__PURE__ */ __name7((id2) => {
29867
+ const wrapped = /* @__PURE__ */ __name8((id2) => {
29506
29868
  if (isRequireBlocklisted(id2)) {
29507
29869
  const evt = {
29508
29870
  event: "sandbox_require_blocklisted",
@@ -29793,7 +30155,7 @@ function buildFetchDispatcher(guard, target) {
29793
30155
  function wrapFetch(realFetch, opts) {
29794
30156
  if (opts.mode === "off") return realFetch;
29795
30157
  const guard = compile(opts);
29796
- const wrapped = /* @__PURE__ */ __name7(async (input, init3) => {
30158
+ const wrapped = /* @__PURE__ */ __name8(async (input, init3) => {
29797
30159
  const url = typeof input === "string" ? input : input instanceof URL ? input.href : input.url;
29798
30160
  let parsed;
29799
30161
  try {
@@ -29925,7 +30287,7 @@ function wrapHttpLike(real, opts) {
29925
30287
  for (const key of Object.keys(real)) {
29926
30288
  wrapped[key] = real[key];
29927
30289
  }
29928
- const wrapRequest = /* @__PURE__ */ __name7((origRequest) => function(...args2) {
30290
+ const wrapRequest = /* @__PURE__ */ __name8((origRequest) => function(...args2) {
29929
30291
  const first = args2[0];
29930
30292
  const host = extractHostname(first);
29931
30293
  if (host && net2.isIP(host)) {
@@ -29969,7 +30331,7 @@ function wrapHttpLike(real, opts) {
29969
30331
  __name(this, "WrappedAgent");
29970
30332
  }
29971
30333
  static {
29972
- __name7(this, "WrappedAgent");
30334
+ __name8(this, "WrappedAgent");
29973
30335
  }
29974
30336
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
29975
30337
  createConnection(options, cb) {
@@ -30048,11 +30410,11 @@ function wrapNetModule(real, opts) {
30048
30410
  for (const key of Object.keys(real)) {
30049
30411
  wrapped[key] = real[key];
30050
30412
  }
30051
- const wrappedCreate = /* @__PURE__ */ __name7(function(...args2) {
30413
+ const wrappedCreate = /* @__PURE__ */ __name8(function(...args2) {
30052
30414
  guardConnectArgs(args2, guard, "net.createConnection");
30053
30415
  return real.createConnection.apply(real, args2);
30054
30416
  }, "wrappedCreate");
30055
- const guardedSocketConnect = /* @__PURE__ */ __name7(function(...args2) {
30417
+ const guardedSocketConnect = /* @__PURE__ */ __name8(function(...args2) {
30056
30418
  guardConnectArgs(args2, guard, "net.Socket.connect");
30057
30419
  return real.Socket.prototype.connect.apply(this, args2);
30058
30420
  }, "guardedSocketConnect");
@@ -30061,7 +30423,7 @@ function wrapNetModule(real, opts) {
30061
30423
  __name(this, "WrappedSocket");
30062
30424
  }
30063
30425
  static {
30064
- __name7(this, "WrappedSocket");
30426
+ __name8(this, "WrappedSocket");
30065
30427
  }
30066
30428
  };
30067
30429
  Object.defineProperty(WrappedSocket.prototype, "connect", {
@@ -30090,11 +30452,11 @@ function wrapTlsModule(real, opts) {
30090
30452
  for (const key of Object.keys(real)) {
30091
30453
  wrapped[key] = real[key];
30092
30454
  }
30093
- const wrappedConnect = /* @__PURE__ */ __name7(function(...args2) {
30455
+ const wrappedConnect = /* @__PURE__ */ __name8(function(...args2) {
30094
30456
  guardConnectArgs(args2, guard, "tls.connect");
30095
30457
  return real.connect.apply(real, args2);
30096
30458
  }, "wrappedConnect");
30097
- const guardedTLSConnect = /* @__PURE__ */ __name7(function(...args2) {
30459
+ const guardedTLSConnect = /* @__PURE__ */ __name8(function(...args2) {
30098
30460
  guardConnectArgs(args2, guard, "tls.TLSSocket.connect");
30099
30461
  return real.TLSSocket.prototype.connect.apply(this, args2);
30100
30462
  }, "guardedTLSConnect");
@@ -30103,7 +30465,7 @@ function wrapTlsModule(real, opts) {
30103
30465
  __name(this, "WrappedTLSSocket");
30104
30466
  }
30105
30467
  static {
30106
- __name7(this, "WrappedTLSSocket");
30468
+ __name8(this, "WrappedTLSSocket");
30107
30469
  }
30108
30470
  };
30109
30471
  Object.defineProperty(WrappedTLSSocket.prototype, "connect", {
@@ -30131,7 +30493,7 @@ function wrapHttp2Module(real, opts) {
30131
30493
  for (const key of Object.keys(real)) {
30132
30494
  wrapped[key] = real[key];
30133
30495
  }
30134
- const wrappedConnect = /* @__PURE__ */ __name7(function(...args2) {
30496
+ const wrappedConnect = /* @__PURE__ */ __name8(function(...args2) {
30135
30497
  const authority = args2[0];
30136
30498
  const host = extractHostname(authority);
30137
30499
  if (host && net2.isIP(host)) {
@@ -30342,7 +30704,7 @@ function buildResponse(r) {
30342
30704
  function buildRecordFetch(opts) {
30343
30705
  const fixtures = compileFixtures(opts.fixtures);
30344
30706
  const recorder = opts.recorder;
30345
- const record = /* @__PURE__ */ __name7((entry) => {
30707
+ const record = /* @__PURE__ */ __name8((entry) => {
30346
30708
  if (!recorder) return;
30347
30709
  try {
30348
30710
  const result = recorder(entry);
@@ -30352,7 +30714,7 @@ function buildRecordFetch(opts) {
30352
30714
  } catch {
30353
30715
  }
30354
30716
  }, "record");
30355
- const recordFetch = /* @__PURE__ */ __name7(async (input, init3) => {
30717
+ const recordFetch = /* @__PURE__ */ __name8(async (input, init3) => {
30356
30718
  const req = isRequestLike(input) ? input : null;
30357
30719
  const signal = init3?.signal ?? req?.signal ?? null;
30358
30720
  if (signal?.aborted) throw abortReason(signal);
@@ -30403,7 +30765,7 @@ function abortReason(signal) {
30403
30765
  return signal.reason ?? new DOMException("This operation was aborted", "AbortError");
30404
30766
  }
30405
30767
  function blocker(via) {
30406
- return /* @__PURE__ */ __name7(/* @__PURE__ */ __name(function blocked() {
30768
+ return /* @__PURE__ */ __name8(/* @__PURE__ */ __name(function blocked() {
30407
30769
  throw testEgressBlockedError({
30408
30770
  via
30409
30771
  });
@@ -30424,7 +30786,7 @@ function blockedSubclass(Real, method, via) {
30424
30786
  __name(this, "Blocked");
30425
30787
  }
30426
30788
  static {
30427
- __name7(this, "Blocked");
30789
+ __name8(this, "Blocked");
30428
30790
  }
30429
30791
  };
30430
30792
  lockMethod(Blocked.prototype, method, block);
@@ -30569,7 +30931,7 @@ function namedError(name) {
30569
30931
  __name(this, "Ctor");
30570
30932
  }
30571
30933
  static {
30572
- __name7(this, "Ctor");
30934
+ __name8(this, "Ctor");
30573
30935
  }
30574
30936
  type;
30575
30937
  code;
@@ -30586,11 +30948,11 @@ function namedError(name) {
30586
30948
  return Ctor;
30587
30949
  }
30588
30950
  function buildNodeFetchShim(recordFetch) {
30589
- const shim = /* @__PURE__ */ __name7(async (input, init3) => {
30951
+ const shim = /* @__PURE__ */ __name8(async (input, init3) => {
30590
30952
  const res = await recordFetch(input, init3);
30591
30953
  if (typeof res.buffer !== "function") {
30592
30954
  Object.defineProperty(res, "buffer", {
30593
- value: /* @__PURE__ */ __name7(async () => Buffer.from(await res.arrayBuffer()), "value"),
30955
+ value: /* @__PURE__ */ __name8(async () => Buffer.from(await res.arrayBuffer()), "value"),
30594
30956
  configurable: true
30595
30957
  });
30596
30958
  }
@@ -30665,7 +31027,7 @@ function createBaseSandboxContext(opts) {
30665
31027
  fixtures: opts.testEgressFixtures,
30666
31028
  recorder: opts.testEgressRecorder
30667
31029
  }) : void 0;
30668
- const requireWithEgress = /* @__PURE__ */ __name7((id2) => {
31030
+ const requireWithEgress = /* @__PURE__ */ __name8((id2) => {
30669
31031
  if (recordFetch) {
30670
31032
  if (wrappedModuleCache.has(id2)) return wrappedModuleCache.get(id2);
30671
31033
  let override;
@@ -30796,7 +31158,7 @@ function pinnedDispatcherFor(addresses2) {
30796
31158
  addresses: pinned,
30797
31159
  // `destroy`, not `close`: close waits for in-flight requests, and this is called
30798
31160
  // once the body has been read or cancelled, where waiting can only hang.
30799
- close: /* @__PURE__ */ __name7(async () => {
31161
+ close: /* @__PURE__ */ __name8(async () => {
30800
31162
  try {
30801
31163
  await dispatcher.destroy();
30802
31164
  } catch {
@@ -30841,7 +31203,7 @@ function buildWorkflowScriptGlobals(hostConsole) {
30841
31203
  __name(this, "WorkflowDate");
30842
31204
  }
30843
31205
  static {
30844
- __name7(this, "WorkflowDate");
31206
+ __name8(this, "WorkflowDate");
30845
31207
  }
30846
31208
  constructor(...args2) {
30847
31209
  if (args2.length === 0) throw new WorkflowDeterminismError("new Date()", "new Date(now())");
@@ -31000,7 +31362,7 @@ function createGuardedDispatcher(opts = {}) {
31000
31362
  const base = buildConnector({
31001
31363
  lookup: guardedLookup(opts)
31002
31364
  });
31003
- const connect = /* @__PURE__ */ __name7((connectOpts, callback) => {
31365
+ const connect = /* @__PURE__ */ __name8((connectOpts, callback) => {
31004
31366
  const host = normalizeAddressHost(connectOpts.hostname ?? "");
31005
31367
  if (isIP2(host)) {
31006
31368
  const blockClass = classify(host);
@@ -31059,16 +31421,16 @@ function classifyHostname(host) {
31059
31421
  if (host === "metadata.google.internal" || host === "metadata") return "imds";
31060
31422
  return null;
31061
31423
  }
31062
- var __defProp7, __name7, REQUIRE_BLOCKLIST, SANDBOX_FAKE_DIRNAME, SANDBOX_FAKE_FILENAME, BLOCKLISTED_PACKAGES, EGRESS_DENIED_CODE, EGRESS_PROBE_DEFAULT_MS, PRIVATE_RANGES, dnsLookup, DEFAULT_BLOCK_CIDRS, HOSTNAME_NON_OVERRIDABLE_CIDRS, TEST_EGRESS_BLOCKED_CODE, REDACTED, SENSITIVE_NAME, SENSITIVE_HEADER, ENCODED_REDACTED, TELEGRAM_BOT_TOKEN_SEGMENT, MAX_REDACT_DEPTH, CHILD_PROCESS_ENTRY_POINTS, EXTERNAL_NETWORK_PACKAGES_BLOCKED, REQUIRE_BLOCKED_PACKAGES, REQUIRE_BLOCKED_BUILTINS, NODE_FETCH_MAIN_FILES, PINNED_ADDRESSES, WorkflowDeterminismError, WORKFLOW_SCRIPT_REMOVED_GLOBALS, WORKFLOW_SCRIPT_TRAPPED_GLOBALS, WORKFLOW_SCRIPT_FORBIDDEN_PLATFORM_KEYS, USER_CODE_ERROR_CODE, PLATFORM_VM_ERROR_CODE, UserCodeError, DEFAULT_MAX_CAUSE_DEPTH, MissingPrimitiveCodeError, BLOCKED_ADDRESS_CODE, BlockedAddressError, defaultResolve, MCP_URL_BLOCKED_CODE, McpUrlBlockedError, normalizeHost, DEFAULT_UNIFIED_MCP_HOSTS, defaultLookup, McpUrlGuard;
31424
+ var __defProp8, __name8, REQUIRE_BLOCKLIST, SANDBOX_FAKE_DIRNAME, SANDBOX_FAKE_FILENAME, BLOCKLISTED_PACKAGES, EGRESS_DENIED_CODE, EGRESS_PROBE_DEFAULT_MS, PRIVATE_RANGES, dnsLookup, DEFAULT_BLOCK_CIDRS, HOSTNAME_NON_OVERRIDABLE_CIDRS, TEST_EGRESS_BLOCKED_CODE, REDACTED, SENSITIVE_NAME, SENSITIVE_HEADER, ENCODED_REDACTED, TELEGRAM_BOT_TOKEN_SEGMENT, MAX_REDACT_DEPTH, CHILD_PROCESS_ENTRY_POINTS, EXTERNAL_NETWORK_PACKAGES_BLOCKED, REQUIRE_BLOCKED_PACKAGES, REQUIRE_BLOCKED_BUILTINS, NODE_FETCH_MAIN_FILES, PINNED_ADDRESSES, WorkflowDeterminismError, WORKFLOW_SCRIPT_REMOVED_GLOBALS, WORKFLOW_SCRIPT_TRAPPED_GLOBALS, WORKFLOW_SCRIPT_FORBIDDEN_PLATFORM_KEYS, USER_CODE_ERROR_CODE, PLATFORM_VM_ERROR_CODE, UserCodeError, DEFAULT_MAX_CAUSE_DEPTH, MissingPrimitiveCodeError, BLOCKED_ADDRESS_CODE, BlockedAddressError, defaultResolve, MCP_URL_BLOCKED_CODE, McpUrlBlockedError, normalizeHost, DEFAULT_UNIFIED_MCP_HOSTS, defaultLookup, McpUrlGuard;
31063
31425
  var init_dist4 = __esm({
31064
31426
  "../shared-sandbox/dist/index.mjs"() {
31065
31427
  "use strict";
31066
- __defProp7 = Object.defineProperty;
31067
- __name7 = /* @__PURE__ */ __name((target, value3) => __defProp7(target, "name", { value: value3, configurable: true }), "__name");
31428
+ __defProp8 = Object.defineProperty;
31429
+ __name8 = /* @__PURE__ */ __name((target, value3) => __defProp8(target, "name", { value: value3, configurable: true }), "__name");
31068
31430
  __name(buildSandboxProcess, "buildSandboxProcess");
31069
- __name7(buildSandboxProcess, "buildSandboxProcess");
31431
+ __name8(buildSandboxProcess, "buildSandboxProcess");
31070
31432
  __name(buildSandboxGlobals, "buildSandboxGlobals");
31071
- __name7(buildSandboxGlobals, "buildSandboxGlobals");
31433
+ __name8(buildSandboxGlobals, "buildSandboxGlobals");
31072
31434
  REQUIRE_BLOCKLIST = /* @__PURE__ */ new Set([
31073
31435
  "child_process",
31074
31436
  "node:child_process",
@@ -31107,15 +31469,15 @@ var init_dist4 = __esm({
31107
31469
  ...REQUIRE_BLOCKLIST
31108
31470
  ].filter((id2) => !id2.startsWith("node:") && !builtinModules.includes(id2));
31109
31471
  __name(isRequireBlocklisted, "isRequireBlocklisted");
31110
- __name7(isRequireBlocklisted, "isRequireBlocklisted");
31472
+ __name8(isRequireBlocklisted, "isRequireBlocklisted");
31111
31473
  __name(buildSandboxRequire, "buildSandboxRequire");
31112
- __name7(buildSandboxRequire, "buildSandboxRequire");
31474
+ __name8(buildSandboxRequire, "buildSandboxRequire");
31113
31475
  EGRESS_DENIED_CODE = "EGRESS_DENIED";
31114
31476
  EGRESS_PROBE_DEFAULT_MS = 3e3;
31115
31477
  __name(v4ToInt, "v4ToInt");
31116
- __name7(v4ToInt, "v4ToInt");
31478
+ __name8(v4ToInt, "v4ToInt");
31117
31479
  __name(range, "range");
31118
- __name7(range, "range");
31480
+ __name8(range, "range");
31119
31481
  PRIVATE_RANGES = [
31120
31482
  range("169.254.169.254/32", "imds"),
31121
31483
  range("169.254.0.0/16", "link_local"),
@@ -31125,19 +31487,19 @@ var init_dist4 = __esm({
31125
31487
  range("100.64.0.0/10", "cgnat")
31126
31488
  ];
31127
31489
  __name(inRange, "inRange");
31128
- __name7(inRange, "inRange");
31490
+ __name8(inRange, "inRange");
31129
31491
  __name(mappedV4, "mappedV4");
31130
- __name7(mappedV4, "mappedV4");
31492
+ __name8(mappedV4, "mappedV4");
31131
31493
  __name(classifyPrivateAddress, "classifyPrivateAddress");
31132
- __name7(classifyPrivateAddress, "classifyPrivateAddress");
31494
+ __name8(classifyPrivateAddress, "classifyPrivateAddress");
31133
31495
  __name(egressDeniedMessage, "egressDeniedMessage");
31134
- __name7(egressDeniedMessage, "egressDeniedMessage");
31496
+ __name8(egressDeniedMessage, "egressDeniedMessage");
31135
31497
  __name(egressDeniedError, "egressDeniedError");
31136
- __name7(egressDeniedError, "egressDeniedError");
31498
+ __name8(egressDeniedError, "egressDeniedError");
31137
31499
  __name(isEgressDeniedError, "isEgressDeniedError");
31138
- __name7(isEgressDeniedError, "isEgressDeniedError");
31500
+ __name8(isEgressDeniedError, "isEgressDeniedError");
31139
31501
  __name(resolveEgressProbeMs, "resolveEgressProbeMs");
31140
- __name7(resolveEgressProbeMs, "resolveEgressProbeMs");
31502
+ __name8(resolveEgressProbeMs, "resolveEgressProbeMs");
31141
31503
  dnsLookup = promisify(dns.lookup);
31142
31504
  DEFAULT_BLOCK_CIDRS = [
31143
31505
  // IPv4
@@ -31162,116 +31524,116 @@ var init_dist4 = __esm({
31162
31524
  "fd00:ec2::254/128"
31163
31525
  ];
31164
31526
  __name(ipv4ToInt, "ipv4ToInt");
31165
- __name7(ipv4ToInt, "ipv4ToInt");
31527
+ __name8(ipv4ToInt, "ipv4ToInt");
31166
31528
  __name(ipv6ToBigInt, "ipv6ToBigInt");
31167
- __name7(ipv6ToBigInt, "ipv6ToBigInt");
31529
+ __name8(ipv6ToBigInt, "ipv6ToBigInt");
31168
31530
  __name(ipv4MappedFromIpv6, "ipv4MappedFromIpv6");
31169
- __name7(ipv4MappedFromIpv6, "ipv4MappedFromIpv6");
31531
+ __name8(ipv4MappedFromIpv6, "ipv4MappedFromIpv6");
31170
31532
  __name(parseCidr, "parseCidr");
31171
- __name7(parseCidr, "parseCidr");
31533
+ __name8(parseCidr, "parseCidr");
31172
31534
  __name(ipInCidr, "ipInCidr");
31173
- __name7(ipInCidr, "ipInCidr");
31535
+ __name8(ipInCidr, "ipInCidr");
31174
31536
  __name(normalizeHostname, "normalizeHostname");
31175
- __name7(normalizeHostname, "normalizeHostname");
31537
+ __name8(normalizeHostname, "normalizeHostname");
31176
31538
  __name(parseAllowedHostname, "parseAllowedHostname");
31177
- __name7(parseAllowedHostname, "parseAllowedHostname");
31539
+ __name8(parseAllowedHostname, "parseAllowedHostname");
31178
31540
  __name(compile, "compile");
31179
- __name7(compile, "compile");
31541
+ __name8(compile, "compile");
31180
31542
  __name(isAllowedHostname, "isAllowedHostname");
31181
- __name7(isAllowedHostname, "isAllowedHostname");
31543
+ __name8(isAllowedHostname, "isAllowedHostname");
31182
31544
  __name(checkAddress, "checkAddress");
31183
- __name7(checkAddress, "checkAddress");
31545
+ __name8(checkAddress, "checkAddress");
31184
31546
  __name(resolveAndCheck, "resolveAndCheck");
31185
- __name7(resolveAndCheck, "resolveAndCheck");
31547
+ __name8(resolveAndCheck, "resolveAndCheck");
31186
31548
  __name(emit, "emit");
31187
- __name7(emit, "emit");
31549
+ __name8(emit, "emit");
31188
31550
  __name(extractHostname, "extractHostname");
31189
- __name7(extractHostname, "extractHostname");
31551
+ __name8(extractHostname, "extractHostname");
31190
31552
  __name(stripBrackets, "stripBrackets");
31191
- __name7(stripBrackets, "stripBrackets");
31553
+ __name8(stripBrackets, "stripBrackets");
31192
31554
  __name(parseHostHeader, "parseHostHeader");
31193
- __name7(parseHostHeader, "parseHostHeader");
31555
+ __name8(parseHostHeader, "parseHostHeader");
31194
31556
  __name(buildFetchDispatcher, "buildFetchDispatcher");
31195
- __name7(buildFetchDispatcher, "buildFetchDispatcher");
31557
+ __name8(buildFetchDispatcher, "buildFetchDispatcher");
31196
31558
  __name(wrapFetch, "wrapFetch");
31197
- __name7(wrapFetch, "wrapFetch");
31559
+ __name8(wrapFetch, "wrapFetch");
31198
31560
  __name(privateProbeTarget, "privateProbeTarget");
31199
- __name7(privateProbeTarget, "privateProbeTarget");
31561
+ __name8(privateProbeTarget, "privateProbeTarget");
31200
31562
  __name(fetchWithPrivateProbe, "fetchWithPrivateProbe");
31201
- __name7(fetchWithPrivateProbe, "fetchWithPrivateProbe");
31563
+ __name8(fetchWithPrivateProbe, "fetchWithPrivateProbe");
31202
31564
  __name(buildBlockingLookup, "buildBlockingLookup");
31203
- __name7(buildBlockingLookup, "buildBlockingLookup");
31565
+ __name8(buildBlockingLookup, "buildBlockingLookup");
31204
31566
  __name(wrapHttpLike, "wrapHttpLike");
31205
- __name7(wrapHttpLike, "wrapHttpLike");
31567
+ __name8(wrapHttpLike, "wrapHttpLike");
31206
31568
  __name(wrapHttpModule, "wrapHttpModule");
31207
- __name7(wrapHttpModule, "wrapHttpModule");
31569
+ __name8(wrapHttpModule, "wrapHttpModule");
31208
31570
  __name(wrapHttpsModule, "wrapHttpsModule");
31209
- __name7(wrapHttpsModule, "wrapHttpsModule");
31571
+ __name8(wrapHttpsModule, "wrapHttpsModule");
31210
31572
  __name(guardConnectArgs, "guardConnectArgs");
31211
- __name7(guardConnectArgs, "guardConnectArgs");
31573
+ __name8(guardConnectArgs, "guardConnectArgs");
31212
31574
  __name(wrapNetModule, "wrapNetModule");
31213
- __name7(wrapNetModule, "wrapNetModule");
31575
+ __name8(wrapNetModule, "wrapNetModule");
31214
31576
  __name(wrapTlsModule, "wrapTlsModule");
31215
- __name7(wrapTlsModule, "wrapTlsModule");
31577
+ __name8(wrapTlsModule, "wrapTlsModule");
31216
31578
  __name(wrapHttp2Module, "wrapHttp2Module");
31217
- __name7(wrapHttp2Module, "wrapHttp2Module");
31579
+ __name8(wrapHttp2Module, "wrapHttp2Module");
31218
31580
  TEST_EGRESS_BLOCKED_CODE = "TEST_EGRESS_BLOCKED";
31219
31581
  __name(testEgressBlockedError, "testEgressBlockedError");
31220
- __name7(testEgressBlockedError, "testEgressBlockedError");
31582
+ __name8(testEgressBlockedError, "testEgressBlockedError");
31221
31583
  __name(isTestEgressBlockedError, "isTestEgressBlockedError");
31222
- __name7(isTestEgressBlockedError, "isTestEgressBlockedError");
31584
+ __name8(isTestEgressBlockedError, "isTestEgressBlockedError");
31223
31585
  REDACTED = "[REDACTED]";
31224
31586
  SENSITIVE_NAME = /auth|cookie|token|secret|passw|pwd|api[-_]?key|access[-_]?key|private[-_]?key|subscription[-_]?key|session|signature|^sig$|^key$|credential/i;
31225
31587
  SENSITIVE_HEADER = new RegExp(`${SENSITIVE_NAME.source}|key|subscription`, "i");
31226
31588
  __name(redactHeaders, "redactHeaders");
31227
- __name7(redactHeaders, "redactHeaders");
31589
+ __name8(redactHeaders, "redactHeaders");
31228
31590
  ENCODED_REDACTED = /%5BREDACTED%5D/g;
31229
31591
  __name(readableRedacted, "readableRedacted");
31230
- __name7(readableRedacted, "readableRedacted");
31592
+ __name8(readableRedacted, "readableRedacted");
31231
31593
  TELEGRAM_BOT_TOKEN_SEGMENT = /^bot\d+:[A-Za-z0-9_-]+$/;
31232
31594
  __name(redactSecretPath, "redactSecretPath");
31233
- __name7(redactSecretPath, "redactSecretPath");
31595
+ __name8(redactSecretPath, "redactSecretPath");
31234
31596
  __name(redactUrl, "redactUrl");
31235
- __name7(redactUrl, "redactUrl");
31597
+ __name8(redactUrl, "redactUrl");
31236
31598
  MAX_REDACT_DEPTH = 8;
31237
31599
  __name(redactJsonValue, "redactJsonValue");
31238
- __name7(redactJsonValue, "redactJsonValue");
31600
+ __name8(redactJsonValue, "redactJsonValue");
31239
31601
  __name(redactBody, "redactBody");
31240
- __name7(redactBody, "redactBody");
31602
+ __name8(redactBody, "redactBody");
31241
31603
  __name(globToRegExp, "globToRegExp");
31242
- __name7(globToRegExp, "globToRegExp");
31604
+ __name8(globToRegExp, "globToRegExp");
31243
31605
  __name(compileFixtures, "compileFixtures");
31244
- __name7(compileFixtures, "compileFixtures");
31606
+ __name8(compileFixtures, "compileFixtures");
31245
31607
  __name(tagOf, "tagOf");
31246
- __name7(tagOf, "tagOf");
31608
+ __name8(tagOf, "tagOf");
31247
31609
  __name(isRequestLike, "isRequestLike");
31248
- __name7(isRequestLike, "isRequestLike");
31610
+ __name8(isRequestLike, "isRequestLike");
31249
31611
  __name(describeBody, "describeBody");
31250
- __name7(describeBody, "describeBody");
31612
+ __name8(describeBody, "describeBody");
31251
31613
  __name(buildResponse, "buildResponse");
31252
- __name7(buildResponse, "buildResponse");
31614
+ __name8(buildResponse, "buildResponse");
31253
31615
  __name(buildRecordFetch, "buildRecordFetch");
31254
- __name7(buildRecordFetch, "buildRecordFetch");
31616
+ __name8(buildRecordFetch, "buildRecordFetch");
31255
31617
  __name(abortReason, "abortReason");
31256
- __name7(abortReason, "abortReason");
31618
+ __name8(abortReason, "abortReason");
31257
31619
  __name(blocker, "blocker");
31258
- __name7(blocker, "blocker");
31620
+ __name8(blocker, "blocker");
31259
31621
  __name(lockMethod, "lockMethod");
31260
- __name7(lockMethod, "lockMethod");
31622
+ __name8(lockMethod, "lockMethod");
31261
31623
  __name(blockedSubclass, "blockedSubclass");
31262
- __name7(blockedSubclass, "blockedSubclass");
31624
+ __name8(blockedSubclass, "blockedSubclass");
31263
31625
  __name(shallowCopy, "shallowCopy");
31264
- __name7(shallowCopy, "shallowCopy");
31626
+ __name8(shallowCopy, "shallowCopy");
31265
31627
  __name(blockedCtor, "blockedCtor");
31266
- __name7(blockedCtor, "blockedCtor");
31628
+ __name8(blockedCtor, "blockedCtor");
31267
31629
  __name(blockHttpLike, "blockHttpLike");
31268
- __name7(blockHttpLike, "blockHttpLike");
31630
+ __name8(blockHttpLike, "blockHttpLike");
31269
31631
  __name(blockNet, "blockNet");
31270
- __name7(blockNet, "blockNet");
31632
+ __name8(blockNet, "blockNet");
31271
31633
  __name(blockTls, "blockTls");
31272
- __name7(blockTls, "blockTls");
31634
+ __name8(blockTls, "blockTls");
31273
31635
  __name(blockHttp2, "blockHttp2");
31274
- __name7(blockHttp2, "blockHttp2");
31636
+ __name8(blockHttp2, "blockHttp2");
31275
31637
  CHILD_PROCESS_ENTRY_POINTS = [
31276
31638
  "spawn",
31277
31639
  "spawnSync",
@@ -31283,13 +31645,13 @@ var init_dist4 = __esm({
31283
31645
  "_forkChild"
31284
31646
  ];
31285
31647
  __name(blockChildProcess, "blockChildProcess");
31286
- __name7(blockChildProcess, "blockChildProcess");
31648
+ __name8(blockChildProcess, "blockChildProcess");
31287
31649
  __name(blockWorkerThreads, "blockWorkerThreads");
31288
- __name7(blockWorkerThreads, "blockWorkerThreads");
31650
+ __name8(blockWorkerThreads, "blockWorkerThreads");
31289
31651
  __name(blockCluster, "blockCluster");
31290
- __name7(blockCluster, "blockCluster");
31652
+ __name8(blockCluster, "blockCluster");
31291
31653
  __name(blockModuleModule, "blockModuleModule");
31292
- __name7(blockModuleModule, "blockModuleModule");
31654
+ __name8(blockModuleModule, "blockModuleModule");
31293
31655
  EXTERNAL_NETWORK_PACKAGES_BLOCKED = [
31294
31656
  "ws",
31295
31657
  "socket.io-client"
@@ -31306,54 +31668,54 @@ var init_dist4 = __esm({
31306
31668
  "inspector/promises"
31307
31669
  ]);
31308
31670
  __name(isTestEgressRequireBlocked, "isTestEgressRequireBlocked");
31309
- __name7(isTestEgressRequireBlocked, "isTestEgressRequireBlocked");
31671
+ __name8(isTestEgressRequireBlocked, "isTestEgressRequireBlocked");
31310
31672
  NODE_FETCH_MAIN_FILES = /* @__PURE__ */ new Set([
31311
31673
  "lib/index.js",
31312
31674
  "lib/index"
31313
31675
  ]);
31314
31676
  __name(isNodeFetchId, "isNodeFetchId");
31315
- __name7(isNodeFetchId, "isNodeFetchId");
31677
+ __name8(isNodeFetchId, "isNodeFetchId");
31316
31678
  __name(isPathId, "isPathId");
31317
- __name7(isPathId, "isPathId");
31679
+ __name8(isPathId, "isPathId");
31318
31680
  __name(packageOfResolvedPath, "packageOfResolvedPath");
31319
- __name7(packageOfResolvedPath, "packageOfResolvedPath");
31681
+ __name8(packageOfResolvedPath, "packageOfResolvedPath");
31320
31682
  __name(interceptedIdForPath, "interceptedIdForPath");
31321
- __name7(interceptedIdForPath, "interceptedIdForPath");
31683
+ __name8(interceptedIdForPath, "interceptedIdForPath");
31322
31684
  __name(namedError, "namedError");
31323
- __name7(namedError, "namedError");
31685
+ __name8(namedError, "namedError");
31324
31686
  __name(buildNodeFetchShim, "buildNodeFetchShim");
31325
- __name7(buildNodeFetchShim, "buildNodeFetchShim");
31687
+ __name8(buildNodeFetchShim, "buildNodeFetchShim");
31326
31688
  __name(testEgressRequireOverride, "testEgressRequireOverride");
31327
- __name7(testEgressRequireOverride, "testEgressRequireOverride");
31689
+ __name8(testEgressRequireOverride, "testEgressRequireOverride");
31328
31690
  __name(wrapModuleForTestEgress, "wrapModuleForTestEgress");
31329
- __name7(wrapModuleForTestEgress, "wrapModuleForTestEgress");
31691
+ __name8(wrapModuleForTestEgress, "wrapModuleForTestEgress");
31330
31692
  __name(createBaseSandboxContext, "createBaseSandboxContext");
31331
- __name7(createBaseSandboxContext, "createBaseSandboxContext");
31693
+ __name8(createBaseSandboxContext, "createBaseSandboxContext");
31332
31694
  __name(applyGlobalSelfReference, "applyGlobalSelfReference");
31333
- __name7(applyGlobalSelfReference, "applyGlobalSelfReference");
31695
+ __name8(applyGlobalSelfReference, "applyGlobalSelfReference");
31334
31696
  __name(resolveExtraAllowedCidrs, "resolveExtraAllowedCidrs");
31335
- __name7(resolveExtraAllowedCidrs, "resolveExtraAllowedCidrs");
31697
+ __name8(resolveExtraAllowedCidrs, "resolveExtraAllowedCidrs");
31336
31698
  __name(resolveExtraAllowedHostnames, "resolveExtraAllowedHostnames");
31337
- __name7(resolveExtraAllowedHostnames, "resolveExtraAllowedHostnames");
31699
+ __name8(resolveExtraAllowedHostnames, "resolveExtraAllowedHostnames");
31338
31700
  PINNED_ADDRESSES = /* @__PURE__ */ Symbol.for("lua.pinnedDispatch.addresses");
31339
31701
  __name(pinnedLookup, "pinnedLookup");
31340
- __name7(pinnedLookup, "pinnedLookup");
31702
+ __name8(pinnedLookup, "pinnedLookup");
31341
31703
  __name(pinnedDispatcherFor, "pinnedDispatcherFor");
31342
- __name7(pinnedDispatcherFor, "pinnedDispatcherFor");
31704
+ __name8(pinnedDispatcherFor, "pinnedDispatcherFor");
31343
31705
  __name(pinnedAddressesOf, "pinnedAddressesOf");
31344
- __name7(pinnedAddressesOf, "pinnedAddressesOf");
31706
+ __name8(pinnedAddressesOf, "pinnedAddressesOf");
31345
31707
  __name(withPinnedDispatcher, "withPinnedDispatcher");
31346
- __name7(withPinnedDispatcher, "withPinnedDispatcher");
31708
+ __name8(withPinnedDispatcher, "withPinnedDispatcher");
31347
31709
  __name(wrapBundleAsCjsModule, "wrapBundleAsCjsModule");
31348
- __name7(wrapBundleAsCjsModule, "wrapBundleAsCjsModule");
31710
+ __name8(wrapBundleAsCjsModule, "wrapBundleAsCjsModule");
31349
31711
  __name(runBundleInContext, "runBundleInContext");
31350
- __name7(runBundleInContext, "runBundleInContext");
31712
+ __name8(runBundleInContext, "runBundleInContext");
31351
31713
  WorkflowDeterminismError = class extends Error {
31352
31714
  static {
31353
31715
  __name(this, "WorkflowDeterminismError");
31354
31716
  }
31355
31717
  static {
31356
- __name7(this, "WorkflowDeterminismError");
31718
+ __name8(this, "WorkflowDeterminismError");
31357
31719
  }
31358
31720
  api;
31359
31721
  code = "WORKFLOW_DETERMINISM";
@@ -31449,7 +31811,7 @@ var init_dist4 = __esm({
31449
31811
  "compressCode"
31450
31812
  ];
31451
31813
  __name(buildWorkflowScriptGlobals, "buildWorkflowScriptGlobals");
31452
- __name7(buildWorkflowScriptGlobals, "buildWorkflowScriptGlobals");
31814
+ __name8(buildWorkflowScriptGlobals, "buildWorkflowScriptGlobals");
31453
31815
  USER_CODE_ERROR_CODE = "USER_CODE_ERROR";
31454
31816
  PLATFORM_VM_ERROR_CODE = "PLATFORM_VM_ERROR";
31455
31817
  UserCodeError = class extends Error {
@@ -31457,7 +31819,7 @@ var init_dist4 = __esm({
31457
31819
  __name(this, "UserCodeError");
31458
31820
  }
31459
31821
  static {
31460
- __name7(this, "UserCodeError");
31822
+ __name8(this, "UserCodeError");
31461
31823
  }
31462
31824
  code = USER_CODE_ERROR_CODE;
31463
31825
  source;
@@ -31473,18 +31835,18 @@ var init_dist4 = __esm({
31473
31835
  }
31474
31836
  };
31475
31837
  __name(isUserCodeError, "isUserCodeError");
31476
- __name7(isUserCodeError, "isUserCodeError");
31838
+ __name8(isUserCodeError, "isUserCodeError");
31477
31839
  __name(isPlatformVmError, "isPlatformVmError");
31478
- __name7(isPlatformVmError, "isPlatformVmError");
31840
+ __name8(isPlatformVmError, "isPlatformVmError");
31479
31841
  DEFAULT_MAX_CAUSE_DEPTH = 10;
31480
31842
  __name(findUserCodeErrorInCauseChain, "findUserCodeErrorInCauseChain");
31481
- __name7(findUserCodeErrorInCauseChain, "findUserCodeErrorInCauseChain");
31843
+ __name8(findUserCodeErrorInCauseChain, "findUserCodeErrorInCauseChain");
31482
31844
  MissingPrimitiveCodeError = class extends Error {
31483
31845
  static {
31484
31846
  __name(this, "MissingPrimitiveCodeError");
31485
31847
  }
31486
31848
  static {
31487
- __name7(this, "MissingPrimitiveCodeError");
31849
+ __name8(this, "MissingPrimitiveCodeError");
31488
31850
  }
31489
31851
  code = PLATFORM_VM_ERROR_CODE;
31490
31852
  source;
@@ -31501,26 +31863,26 @@ var init_dist4 = __esm({
31501
31863
  }
31502
31864
  };
31503
31865
  __name(assertPrimitiveCodePresent, "assertPrimitiveCodePresent");
31504
- __name7(assertPrimitiveCodePresent, "assertPrimitiveCodePresent");
31866
+ __name8(assertPrimitiveCodePresent, "assertPrimitiveCodePresent");
31505
31867
  __name(withUserCodeBoundary, "withUserCodeBoundary");
31506
- __name7(withUserCodeBoundary, "withUserCodeBoundary");
31868
+ __name8(withUserCodeBoundary, "withUserCodeBoundary");
31507
31869
  __name(logUserCodeOrError, "logUserCodeOrError");
31508
- __name7(logUserCodeOrError, "logUserCodeOrError");
31870
+ __name8(logUserCodeOrError, "logUserCodeOrError");
31509
31871
  __name(normalizeAddressHost, "normalizeAddressHost");
31510
- __name7(normalizeAddressHost, "normalizeAddressHost");
31872
+ __name8(normalizeAddressHost, "normalizeAddressHost");
31511
31873
  __name(ipv6Hextets, "ipv6Hextets");
31512
- __name7(ipv6Hextets, "ipv6Hextets");
31874
+ __name8(ipv6Hextets, "ipv6Hextets");
31513
31875
  __name(classifyV4, "classifyV4");
31514
- __name7(classifyV4, "classifyV4");
31876
+ __name8(classifyV4, "classifyV4");
31515
31877
  __name(classifyBlockedAddress, "classifyBlockedAddress");
31516
- __name7(classifyBlockedAddress, "classifyBlockedAddress");
31878
+ __name8(classifyBlockedAddress, "classifyBlockedAddress");
31517
31879
  BLOCKED_ADDRESS_CODE = "EBLOCKEDADDRESS";
31518
31880
  BlockedAddressError = class extends Error {
31519
31881
  static {
31520
31882
  __name(this, "BlockedAddressError");
31521
31883
  }
31522
31884
  static {
31523
- __name7(this, "BlockedAddressError");
31885
+ __name8(this, "BlockedAddressError");
31524
31886
  }
31525
31887
  code = BLOCKED_ADDRESS_CODE;
31526
31888
  host;
@@ -31537,24 +31899,24 @@ var init_dist4 = __esm({
31537
31899
  }
31538
31900
  };
31539
31901
  __name(isBlockedAddressError, "isBlockedAddressError");
31540
- __name7(isBlockedAddressError, "isBlockedAddressError");
31541
- defaultResolve = /* @__PURE__ */ __name7(async (host) => (await dnsPromises.lookup(host, {
31902
+ __name8(isBlockedAddressError, "isBlockedAddressError");
31903
+ defaultResolve = /* @__PURE__ */ __name8(async (host) => (await dnsPromises.lookup(host, {
31542
31904
  all: true,
31543
31905
  verbatim: true
31544
31906
  })).map((r) => r.address), "defaultResolve");
31545
31907
  __name(guardedLookup, "guardedLookup");
31546
- __name7(guardedLookup, "guardedLookup");
31908
+ __name8(guardedLookup, "guardedLookup");
31547
31909
  __name(createGuardedDispatcher, "createGuardedDispatcher");
31548
- __name7(createGuardedDispatcher, "createGuardedDispatcher");
31910
+ __name8(createGuardedDispatcher, "createGuardedDispatcher");
31549
31911
  __name(fetchVia, "fetchVia");
31550
- __name7(fetchVia, "fetchVia");
31912
+ __name8(fetchVia, "fetchVia");
31551
31913
  MCP_URL_BLOCKED_CODE = "MCP_URL_BLOCKED";
31552
31914
  McpUrlBlockedError = class extends Error {
31553
31915
  static {
31554
31916
  __name(this, "McpUrlBlockedError");
31555
31917
  }
31556
31918
  static {
31557
- __name7(this, "McpUrlBlockedError");
31919
+ __name8(this, "McpUrlBlockedError");
31558
31920
  }
31559
31921
  code = MCP_URL_BLOCKED_CODE;
31560
31922
  host;
@@ -31569,24 +31931,24 @@ var init_dist4 = __esm({
31569
31931
  }
31570
31932
  };
31571
31933
  __name(isMcpUrlBlockedError, "isMcpUrlBlockedError");
31572
- __name7(isMcpUrlBlockedError, "isMcpUrlBlockedError");
31934
+ __name8(isMcpUrlBlockedError, "isMcpUrlBlockedError");
31573
31935
  __name(resolveMcpSsrfGuardMode, "resolveMcpSsrfGuardMode");
31574
- __name7(resolveMcpSsrfGuardMode, "resolveMcpSsrfGuardMode");
31936
+ __name8(resolveMcpSsrfGuardMode, "resolveMcpSsrfGuardMode");
31575
31937
  normalizeHost = normalizeAddressHost;
31576
31938
  __name(hostListEntry, "hostListEntry");
31577
- __name7(hostListEntry, "hostListEntry");
31939
+ __name8(hostListEntry, "hostListEntry");
31578
31940
  __name(parseHostList, "parseHostList");
31579
- __name7(parseHostList, "parseHostList");
31941
+ __name8(parseHostList, "parseHostList");
31580
31942
  __name(parseMcpSsrfAllowHosts, "parseMcpSsrfAllowHosts");
31581
- __name7(parseMcpSsrfAllowHosts, "parseMcpSsrfAllowHosts");
31943
+ __name8(parseMcpSsrfAllowHosts, "parseMcpSsrfAllowHosts");
31582
31944
  DEFAULT_UNIFIED_MCP_HOSTS = /* @__PURE__ */ new Set([
31583
31945
  "mcp-api.unified.to"
31584
31946
  ]);
31585
31947
  __name(isTrustedUnifiedMcpHost, "isTrustedUnifiedMcpHost");
31586
- __name7(isTrustedUnifiedMcpHost, "isTrustedUnifiedMcpHost");
31948
+ __name8(isTrustedUnifiedMcpHost, "isTrustedUnifiedMcpHost");
31587
31949
  __name(classifyHostname, "classifyHostname");
31588
- __name7(classifyHostname, "classifyHostname");
31589
- defaultLookup = /* @__PURE__ */ __name7(async (host) => {
31950
+ __name8(classifyHostname, "classifyHostname");
31951
+ defaultLookup = /* @__PURE__ */ __name8(async (host) => {
31590
31952
  const records = await dns2.lookup(host, {
31591
31953
  all: true,
31592
31954
  verbatim: true
@@ -31598,7 +31960,7 @@ var init_dist4 = __esm({
31598
31960
  __name(this, "_McpUrlGuard");
31599
31961
  }
31600
31962
  static {
31601
- __name7(this, "McpUrlGuard");
31963
+ __name8(this, "McpUrlGuard");
31602
31964
  }
31603
31965
  opts;
31604
31966
  allowMemo = /* @__PURE__ */ new Map();
@@ -31652,7 +32014,7 @@ var init_dist4 = __esm({
31652
32014
  ...this.opts.lookup ? {
31653
32015
  resolve: this.opts.lookup
31654
32016
  } : {},
31655
- onBlocked: /* @__PURE__ */ __name7((info) => this.opts.onConnectBlocked?.(info), "onBlocked")
32017
+ onBlocked: /* @__PURE__ */ __name8((info) => this.opts.onConnectBlocked?.(info), "onBlocked")
31656
32018
  });
31657
32019
  this.guardedFetch = fetchVia(dispatcher);
31658
32020
  }
@@ -32186,10 +32548,11 @@ function deterministicCrypto() {
32186
32548
  }
32187
32549
  });
32188
32550
  }
32189
- function throwingFacade(name) {
32551
+ function throwingFacade(name, pure = {}) {
32190
32552
  return new Proxy({}, {
32191
32553
  get: /* @__PURE__ */ __name((_t, prop) => {
32192
32554
  if (prop === "then" || typeof prop === "symbol") return void 0;
32555
+ if (Object.hasOwn(pure, prop)) return pure[prop];
32193
32556
  return notStaticStub(`${name}.${String(prop)}`)();
32194
32557
  }, "get")
32195
32558
  });
@@ -32240,7 +32603,7 @@ function createSerializationContext() {
32240
32603
  });
32241
32604
  }, "sandboxRequire");
32242
32605
  const facades = {};
32243
- for (const name of PLATFORM_GLOBALS) facades[name] = throwingFacade(name);
32606
+ for (const name of PLATFORM_GLOBALS) facades[name] = throwingFacade(name, PURE_FACADE_MEMBERS[name]);
32244
32607
  const context = vm3.createContext({
32245
32608
  ...PRIMITIVE_SHIMS,
32246
32609
  ...facades,
@@ -32817,11 +33180,12 @@ function applyInheritCandidate(d) {
32817
33180
  })
32818
33181
  };
32819
33182
  }
32820
- var NOT_STATIC, isNotStatic, isBuildError, inheritRefsOf, COMMITTED_WORKFLOW_MEMBERS, isCommittedWorkflow, PLATFORM_GLOBALS, calleeName, kindOf, GRAPH_HASH_PLACEHOLDER, issueKey;
33183
+ var NOT_STATIC, isNotStatic, isBuildError, inheritRefsOf, COMMITTED_WORKFLOW_MEMBERS, isCommittedWorkflow, PLATFORM_GLOBALS, PURE_FACADE_MEMBERS, calleeName, kindOf, GRAPH_HASH_PLACEHOLDER, issueKey;
32821
33184
  var init_graph_serializer = __esm({
32822
33185
  "src/compiler/utils/graph-serializer.ts"() {
32823
33186
  "use strict";
32824
33187
  init_dist4();
33188
+ init_decisions_api();
32825
33189
  init_dist();
32826
33190
  init_dist2();
32827
33191
  init_compile_constants();
@@ -32867,6 +33231,13 @@ var init_graph_serializer = __esm({
32867
33231
  "Threads",
32868
33232
  "Browser"
32869
33233
  ];
33234
+ PURE_FACADE_MEMBERS = {
33235
+ Decisions: {
33236
+ odds,
33237
+ choice,
33238
+ score
33239
+ }
33240
+ };
32870
33241
  __name(safeDate, "safeDate");
32871
33242
  __name(safeMath, "safeMath");
32872
33243
  __name(createSerializationContext, "createSerializationContext");
@@ -34019,7 +34390,7 @@ function unresolvedRefIssues(all, browsers) {
34019
34390
  }
34020
34391
  return issues;
34021
34392
  }
34022
- var oneOf2, stringList, positiveIntUpTo, SETTING_CHECKS, BROWSER_SETTING_KEYS, BrowserPlugin;
34393
+ var oneOf2, stringList, positiveIntUpTo, SETTING_CHECKS, wholeNumberUpTo, SETTING_RULES, BROWSER_SETTING_KEYS, BrowserPlugin;
34023
34394
  var init_browser_plugin = __esm({
34024
34395
  "src/compiler/plugins/browser.plugin.ts"() {
34025
34396
  "use strict";
@@ -34046,6 +34417,21 @@ var init_browser_plugin = __esm({
34046
34417
  persist: /* @__PURE__ */ __name((value3) => typeof value3 === "boolean", "persist"),
34047
34418
  credentials: stringList
34048
34419
  };
34420
+ wholeNumberUpTo = /* @__PURE__ */ __name((max, unit) => `it must be a whole number of ${unit} from 1 to ${max}`, "wholeNumberUpTo");
34421
+ SETTING_RULES = {
34422
+ engine: `it must be one of ${BROWSER_ENGINES.join(", ")}`,
34423
+ fallback: `it must be one of ${BROWSER_FALLBACKS.join(", ")}`,
34424
+ proxyCountry: 'it must be a two-letter country code, like "de"',
34425
+ allowedDomains: "it must be a list of non-empty domain strings",
34426
+ confirmActions: "it must be a list of non-empty action names",
34427
+ maxSessionMinutes: wholeNumberUpTo(BROWSER_LIMIT_MAX.maxSessionMinutes, "minutes"),
34428
+ idleTimeoutSeconds: wholeNumberUpTo(BROWSER_LIMIT_MAX.idleTimeoutSeconds, "seconds"),
34429
+ maxConcurrentSessions: wholeNumberUpTo(BROWSER_LIMIT_MAX.maxConcurrentSessions, "sessions"),
34430
+ screenshots: `it must be one of ${BROWSER_SCREENSHOT_POLICIES.join(", ")}`,
34431
+ logContent: `it must be one of ${BROWSER_LOG_CONTENT_MODES.join(", ")}`,
34432
+ persist: "it must be true or false",
34433
+ credentials: "it must be a list of non-empty credential names"
34434
+ };
34049
34435
  BROWSER_SETTING_KEYS = Object.keys(SETTING_CHECKS);
34050
34436
  __name(shapeBrowserSettings, "shapeBrowserSettings");
34051
34437
  __name(duplicateNameIssues, "duplicateNameIssues");
@@ -34087,7 +34473,7 @@ var init_browser_plugin = __esm({
34087
34473
  }));
34088
34474
  }
34089
34475
  for (const key of metadata.metadata.invalidSettings ?? []) {
34090
- errors.push(validationError(`Browser "${metadata.name}" has an invalid \`${key}\``, {
34476
+ errors.push(validationError(`Browser "${metadata.name}" has an invalid \`${key}\`: ${SETTING_RULES[key]}`, {
34091
34477
  line: metadata.line
34092
34478
  }));
34093
34479
  }
@@ -34137,217 +34523,6 @@ var init_browser_plugin = __esm({
34137
34523
  }
34138
34524
  });
34139
34525
 
34140
- // ../sandbox-runtime/dist/decisions-api.mjs
34141
- function isRecord5(value3) {
34142
- return typeof value3 === "object" && value3 !== null && !Array.isArray(value3);
34143
- }
34144
- function isProvider(value3) {
34145
- return DECISION_PROVIDERS.includes(value3);
34146
- }
34147
- function invalid(message) {
34148
- return new DecisionError(message, {
34149
- code: DECISION_ERROR_CODES.INVALID
34150
- });
34151
- }
34152
- function assertInstructions(builder, instructions) {
34153
- if (typeof instructions !== "string" || instructions.trim().length === 0) {
34154
- throw invalid(`Decisions.${builder} needs non-empty instructions`);
34155
- }
34156
- if (instructions.length > DECISION_LIMITS.maxInstructionChars) {
34157
- throw invalid(`Decisions.${builder} instructions must be at most ${DECISION_LIMITS.maxInstructionChars} characters`);
34158
- }
34159
- }
34160
- function assertCount(what, count2, min, max) {
34161
- if (count2 < min || count2 > max) {
34162
- throw invalid(`${what} must hold ${min} to ${max} entries, got ${count2}`);
34163
- }
34164
- }
34165
- function odds(instructions, criteria) {
34166
- assertInstructions("odds", instructions);
34167
- if (criteria === void 0) return {
34168
- type: "odds",
34169
- instructions
34170
- };
34171
- if (!isRecord5(criteria)) throw invalid("Decisions.odds criteria must be an object like { yes, no }");
34172
- return {
34173
- type: "odds",
34174
- instructions,
34175
- criteria
34176
- };
34177
- }
34178
- function choice(instructions, options) {
34179
- assertInstructions("choice", instructions);
34180
- if (!isRecord5(options)) throw invalid("Decisions.choice options must be an object of label to description");
34181
- assertCount("Decisions.choice options", Object.keys(options).length, DECISION_LIMITS.minOptions, DECISION_LIMITS.maxOptions);
34182
- return {
34183
- type: "choice",
34184
- instructions,
34185
- options
34186
- };
34187
- }
34188
- function score(instructions, levels) {
34189
- assertInstructions("score", instructions);
34190
- if (!Array.isArray(levels)) throw invalid("Decisions.score levels must be an array");
34191
- assertCount("Decisions.score levels", levels.length, DECISION_LIMITS.minLevels, DECISION_LIMITS.maxLevels);
34192
- return {
34193
- type: "score",
34194
- instructions,
34195
- levels
34196
- };
34197
- }
34198
- function assertDecisionQuestion(name, question) {
34199
- if (!isRecord5(question) || !DECISION_QUESTION_TYPES.includes(question.type)) {
34200
- throw invalid(`questions.${name} must be built with Decisions.odds, Decisions.choice or Decisions.score`);
34201
- }
34202
- if (typeof question.instructions !== "string" || question.instructions.trim().length === 0) {
34203
- throw invalid(`questions.${name}.instructions must be a non-empty string`);
34204
- }
34205
- }
34206
- function checkDecisionRequest(request2) {
34207
- if (!isRecord5(request2)) {
34208
- throw invalid("Decisions.ask needs { state, questions } or (state, question)");
34209
- }
34210
- if (request2.state === void 0 || request2.state === null) {
34211
- throw invalid("Decisions.ask needs a state");
34212
- }
34213
- if (!isRecord5(request2.questions) || Object.keys(request2.questions).length === 0) {
34214
- throw invalid("Decisions.ask needs at least one question in questions");
34215
- }
34216
- for (const [name, question] of Object.entries(request2.questions)) assertDecisionQuestion(name, question);
34217
- return request2;
34218
- }
34219
- function checkDecisionRunRequest(request2) {
34220
- if (typeof request2.name !== "string" || !DECISION_NAME_PATTERN.test(request2.name)) {
34221
- throw invalid("Decisions.run needs the name of a decision declared on the agent");
34222
- }
34223
- if (request2.state === void 0 || request2.state === null) {
34224
- throw invalid("Decisions.run needs a state");
34225
- }
34226
- return request2;
34227
- }
34228
- function toDecisionError(caught) {
34229
- if (caught instanceof DecisionError) return caught;
34230
- const raw = isRecord5(caught) ? caught : {};
34231
- const message = typeof raw.message === "string" && raw.message.length > 0 ? raw.message : "Decision failed";
34232
- const code = typeof raw.code === "string" && raw.code.length > 0 ? raw.code : DECISION_ERROR_CODES.UNAVAILABLE;
34233
- return new DecisionError(message, {
34234
- code,
34235
- ...isProvider(raw.provider) && {
34236
- provider: raw.provider
34237
- },
34238
- ...typeof raw.upstreamStatus === "number" && {
34239
- upstreamStatus: raw.upstreamStatus
34240
- },
34241
- ...typeof raw.decisionId === "string" && {
34242
- decisionId: raw.decisionId
34243
- }
34244
- });
34245
- }
34246
- function buildDecisionsApi(transport) {
34247
- async function relay2(send) {
34248
- if (!transport) {
34249
- throw new DecisionError("Decisions is not available in this runtime", {
34250
- code: DECISION_ERROR_CODES.UNAVAILABLE
34251
- });
34252
- }
34253
- try {
34254
- return await send(transport);
34255
- } catch (caught) {
34256
- throw toDecisionError(caught);
34257
- }
34258
- }
34259
- __name(relay2, "relay");
34260
- __name8(relay2, "relay");
34261
- async function ask(requestOrState, question, options) {
34262
- if (question === void 0) {
34263
- const request22 = checkDecisionRequest(requestOrState);
34264
- return relay2((t) => t.ask(request22));
34265
- }
34266
- const request2 = checkDecisionRequest({
34267
- ...options,
34268
- state: requestOrState,
34269
- questions: {
34270
- [SINGLE_DECISION_KEY]: question
34271
- }
34272
- });
34273
- const result = await relay2((t) => t.ask(request2));
34274
- return result.answers[SINGLE_DECISION_KEY];
34275
- }
34276
- __name(ask, "ask");
34277
- __name8(ask, "ask");
34278
- async function run(name, state3, options) {
34279
- const request2 = checkDecisionRunRequest({
34280
- ...options,
34281
- name,
34282
- state: state3
34283
- });
34284
- return await relay2((t) => t.run(request2));
34285
- }
34286
- __name(run, "run");
34287
- __name8(run, "run");
34288
- return {
34289
- ask,
34290
- run,
34291
- odds,
34292
- choice,
34293
- score
34294
- };
34295
- }
34296
- var __defProp8, __name8, DECISION_ERROR_NAME, SINGLE_DECISION_KEY, DecisionError;
34297
- var init_decisions_api = __esm({
34298
- "../sandbox-runtime/dist/decisions-api.mjs"() {
34299
- "use strict";
34300
- init_dist();
34301
- __defProp8 = Object.defineProperty;
34302
- __name8 = /* @__PURE__ */ __name((target, value3) => __defProp8(target, "name", { value: value3, configurable: true }), "__name");
34303
- DECISION_ERROR_NAME = "DecisionError";
34304
- SINGLE_DECISION_KEY = "answer";
34305
- DecisionError = class extends Error {
34306
- static {
34307
- __name(this, "DecisionError");
34308
- }
34309
- static {
34310
- __name8(this, "DecisionError");
34311
- }
34312
- code;
34313
- constructor(message, fields) {
34314
- super(message);
34315
- this.name = DECISION_ERROR_NAME;
34316
- this.code = fields.code;
34317
- if (fields.provider !== void 0) this.provider = fields.provider;
34318
- if (fields.upstreamStatus !== void 0) this.upstreamStatus = fields.upstreamStatus;
34319
- if (fields.decisionId !== void 0) this.decisionId = fields.decisionId;
34320
- }
34321
- };
34322
- __name(isRecord5, "isRecord");
34323
- __name8(isRecord5, "isRecord");
34324
- __name(isProvider, "isProvider");
34325
- __name8(isProvider, "isProvider");
34326
- __name(invalid, "invalid");
34327
- __name8(invalid, "invalid");
34328
- __name(assertInstructions, "assertInstructions");
34329
- __name8(assertInstructions, "assertInstructions");
34330
- __name(assertCount, "assertCount");
34331
- __name8(assertCount, "assertCount");
34332
- __name(odds, "odds");
34333
- __name8(odds, "odds");
34334
- __name(choice, "choice");
34335
- __name8(choice, "choice");
34336
- __name(score, "score");
34337
- __name8(score, "score");
34338
- __name(assertDecisionQuestion, "assertDecisionQuestion");
34339
- __name8(assertDecisionQuestion, "assertDecisionQuestion");
34340
- __name(checkDecisionRequest, "checkDecisionRequest");
34341
- __name8(checkDecisionRequest, "checkDecisionRequest");
34342
- __name(checkDecisionRunRequest, "checkDecisionRunRequest");
34343
- __name8(checkDecisionRunRequest, "checkDecisionRunRequest");
34344
- __name(toDecisionError, "toDecisionError");
34345
- __name8(toDecisionError, "toDecisionError");
34346
- __name(buildDecisionsApi, "buildDecisionsApi");
34347
- __name8(buildDecisionsApi, "buildDecisionsApi");
34348
- }
34349
- });
34350
-
34351
34526
  // src/compiler/plugins/decision.plugin.ts
34352
34527
  import fs8 from "fs/promises";
34353
34528
  import { Node as Node20 } from "ts-morph";
@@ -34519,7 +34694,7 @@ var init_decision_plugin = __esm({
34519
34694
  line
34520
34695
  }));
34521
34696
  if (extractionErrors.length === 0) {
34522
- const parsed = DecisionDefinitionSchema.safeParse(definitionOf(metadata.name, metadata.description, metadata.metadata));
34697
+ const parsed = DecisionDefinitionWriteSchema.safeParse(definitionOf(metadata.name, metadata.description, metadata.metadata));
34523
34698
  if (!parsed.success) {
34524
34699
  for (const issue of parsed.error.issues) {
34525
34700
  const path32 = issue.path.length > 0 ? issue.path.join(".") : "<root>";
@@ -34666,7 +34841,13 @@ import { build } from "esbuild";
34666
34841
  function nodeCapabilityUnavailableMessage(specifier) {
34667
34842
  return `${NODE_CAPABILITY_UNAVAILABLE}: \`${specifier}\` is not available to a workflow code step \u2014 on the Job tier run a command through \`ctx.exec(['git', 'status'])\` or \`ctx.$\`git status\`\` (allow-listed binaries, argv only, no shell; see docs/workflows/workspaces-and-long-steps.md); a worker-tier step has no process access at all`;
34668
34843
  }
34669
- var WORKFLOW_BUILDER_SUBPATH, WORKFLOW_BUILDER_INJECT_FILE, WEB_APP_RUNTIME_INJECT_FILE, WEB_APP_RUNTIME_INJECT_SOURCE, NODE_CAPABILITY_UNAVAILABLE, NODE_CAPABILITY_GUARDED, Bundler;
34844
+ function workflowConstantUnavailableMessage(name, specifier) {
34845
+ return `${WORKFLOW_CONSTANT_UNAVAILABLE}: \`${name}\` (from '${specifier}') is workflow-only and is not available outside a workflow \u2014 inside a workflow import it from 'lua-cli/workflow-builder'; in a tool, job or webhook inline the number instead`;
34846
+ }
34847
+ function isLuaCliSpecifier(spec) {
34848
+ return spec === "lua-cli" || spec === "lua-cli/skill" || spec === "lua-cli/voice" || spec.includes("api-exports");
34849
+ }
34850
+ var WORKFLOW_BUILDER_SUBPATH, WORKFLOW_BUILDER_INJECT_FILE, WEB_APP_RUNTIME_INJECT_FILE, WEB_APP_RUNTIME_INJECT_SOURCE, INERT_WORKFLOW_BUILDER_SPECIFIER, INERT_WORKFLOW_BUILDER_NAMESPACE, WORKFLOW_SHIM_NAME_SET, INERT_WORKFLOW_BUILDER_SOURCE, NODE_CAPABILITY_UNAVAILABLE, NODE_CAPABILITY_GUARDED, WORKFLOW_CONSTANT_UNAVAILABLE, WORKFLOW_CONSTANT_NAMES, COMPILE_GUARD_CODES, Bundler;
34670
34851
  var init_bundler = __esm({
34671
34852
  "src/compiler/bundler.ts"() {
34672
34853
  "use strict";
@@ -34694,9 +34875,34 @@ export function defineWebApp(config) {
34694
34875
  return config;
34695
34876
  }
34696
34877
  `;
34878
+ INERT_WORKFLOW_BUILDER_SPECIFIER = "lua-cli-inert-workflow-builder";
34879
+ INERT_WORKFLOW_BUILDER_NAMESPACE = "lua-inert-workflow-builder";
34880
+ WORKFLOW_SHIM_NAME_SET = new Set(WORKFLOW_SHIM_NAMES);
34881
+ INERT_WORKFLOW_BUILDER_SOURCE = `function inert() {
34882
+ return new Proxy(function () {}, {
34883
+ get: (_target, key) => (typeof key === 'symbol' ? undefined : inert()),
34884
+ apply: () => inert(),
34885
+ construct: () => inert(),
34886
+ });
34887
+ }
34888
+ ` + WORKFLOW_SHIM_NAMES.map((name) => `export function ${name}() {
34889
+ return inert();
34890
+ }
34891
+ `).join("");
34697
34892
  NODE_CAPABILITY_UNAVAILABLE = "node-capability-unavailable";
34698
34893
  NODE_CAPABILITY_GUARDED = /^(node:)?(child_process|worker_threads|cluster)$/;
34699
34894
  __name(nodeCapabilityUnavailableMessage, "nodeCapabilityUnavailableMessage");
34895
+ WORKFLOW_CONSTANT_UNAVAILABLE = "workflow-constant-unavailable";
34896
+ WORKFLOW_CONSTANT_NAMES = [
34897
+ "WORKFLOW_DEFAULT_MAX_DURATION_SECONDS",
34898
+ "WORKFLOW_HITL_MAX_DURATION_SECONDS"
34899
+ ];
34900
+ COMPILE_GUARD_CODES = [
34901
+ NODE_CAPABILITY_UNAVAILABLE,
34902
+ WORKFLOW_CONSTANT_UNAVAILABLE
34903
+ ];
34904
+ __name(workflowConstantUnavailableMessage, "workflowConstantUnavailableMessage");
34905
+ __name(isLuaCliSpecifier, "isLuaCliSpecifier");
34700
34906
  Bundler = class {
34701
34907
  static {
34702
34908
  __name(this, "Bundler");
@@ -34738,18 +34944,40 @@ export function defineWebApp(config) {
34738
34944
  *
34739
34945
  * Replaces the prior `buildLuaCliStubBlock` runtime-stub approach (BAC-234).
34740
34946
  */
34741
- stripLuaCliImportsAST(code, filename = "temp.ts") {
34947
+ stripLuaCliImportsAST(code, filename, stubWorkflowBuilders) {
34742
34948
  try {
34743
34949
  const tempFile = this.project.createSourceFile(`__strip_${filename}`, code, {
34744
34950
  overwrite: true
34745
34951
  });
34746
34952
  rewriteCrossFileCallsInSourceFile(tempFile, this.crossFileSpecs, this.sdkBaseClassNames);
34953
+ const inertBindings = /* @__PURE__ */ new Map();
34747
34954
  tempFile.getImportDeclarations().forEach((imp) => {
34748
34955
  const spec = imp.getModuleSpecifierValue();
34749
34956
  if (spec === "lua-cli" || spec === "lua-cli/skill" || spec === "lua-cli/voice" || spec.includes("api-exports")) {
34957
+ if (stubWorkflowBuilders && !imp.isTypeOnly()) {
34958
+ for (const named of imp.getNamedImports()) {
34959
+ const name = named.getName();
34960
+ if (named.isTypeOnly() || !WORKFLOW_SHIM_NAME_SET.has(name)) continue;
34961
+ const alias = named.getAliasNode()?.getText();
34962
+ inertBindings.set(alias ?? name, alias ? {
34963
+ name,
34964
+ alias
34965
+ } : {
34966
+ name
34967
+ });
34968
+ }
34969
+ }
34750
34970
  imp.remove();
34751
34971
  }
34752
34972
  });
34973
+ if (inertBindings.size > 0) {
34974
+ tempFile.insertImportDeclaration(0, {
34975
+ namedImports: [
34976
+ ...inertBindings.values()
34977
+ ],
34978
+ moduleSpecifier: INERT_WORKFLOW_BUILDER_SPECIFIER
34979
+ });
34980
+ }
34753
34981
  const result = tempFile.getText();
34754
34982
  this.project.removeSourceFile(tempFile);
34755
34983
  return result;
@@ -34769,8 +34997,9 @@ export function defineWebApp(config) {
34769
34997
  this.verbose(` Source: ${metadata.sourcePath}`);
34770
34998
  this.verbose(` Output: ${outfile}`);
34771
34999
  }
34772
- const virtualSourcePlugin = this.createVirtualSourcePlugin(metadata);
34773
- const luaCliShimPlugin = this.createLuaCliShimPlugin();
35000
+ const stubWorkflowBuilders = metadata.kind !== "workflow";
35001
+ const virtualSourcePlugin = this.createVirtualSourcePlugin(metadata, stubWorkflowBuilders);
35002
+ const luaCliShimPlugin = this.createLuaCliShimPlugin(metadata.kind, stubWorkflowBuilders);
34774
35003
  const selfContainedWorkflow = metadata.kind === "workflow";
34775
35004
  const inject = selfContainedWorkflow ? [
34776
35005
  await this.writeWorkflowBuilderInject(tempDir)
@@ -34810,10 +35039,11 @@ export function defineWebApp(config) {
34810
35039
  });
34811
35040
  } catch (err) {
34812
35041
  const failure2 = err;
34813
- const guard = failure2?.errors?.find((e) => typeof e.text === "string" && e.text.startsWith(NODE_CAPABILITY_UNAVAILABLE));
35042
+ const guardText = /* @__PURE__ */ __name((e) => typeof e.text === "string" ? e.text.replace(/^\[plugin [^\]]*\]\s*/, "") : "", "guardText");
35043
+ const guard = failure2?.errors?.find((e) => COMPILE_GUARD_CODES.some((c) => guardText(e).startsWith(c)));
34814
35044
  if (guard) {
34815
35045
  const at = guard.location ? ` (${guard.location.file}:${guard.location.line}:${guard.location.column + 1})` : "";
34816
- throw new Error(`${guard.text}${at}`);
35046
+ throw new Error(`${guardText(guard)}${at}`);
34817
35047
  }
34818
35048
  throw err;
34819
35049
  }
@@ -34930,10 +35160,56 @@ export { ${WORKFLOW_SHIM_NAMES.join(", ")} } from ${JSON.stringify(this.workflow
34930
35160
  };
34931
35161
  }
34932
35162
  /**
35163
+ * BAC-2490: throw `workflow-constant-unavailable` when `code` value-imports or re-exports a workflow-only
35164
+ * constant from a lua-cli specifier. Type-only forms, comments and strings are fine. Best-effort: dynamic
35165
+ * `import()` / `require` are not covered.
35166
+ */
35167
+ assertNoWorkflowConstants(code, filename) {
35168
+ if (!WORKFLOW_CONSTANT_NAMES.some((n2) => code.includes(n2)) && !/export\s*\*/.test(code)) return;
35169
+ const tempFile = this.project.createSourceFile(`__guard_${path10.basename(filename)}`, code, {
35170
+ overwrite: true
35171
+ });
35172
+ const fail = /* @__PURE__ */ __name((name, spec, pos) => {
35173
+ const { line, column } = tempFile.getLineAndColumnAtPos(pos);
35174
+ throw new Error(`${workflowConstantUnavailableMessage(name, spec)} (${filename}:${line}:${column})`);
35175
+ }, "fail");
35176
+ try {
35177
+ for (const imp of tempFile.getImportDeclarations()) {
35178
+ const spec = imp.getModuleSpecifierValue();
35179
+ if (!isLuaCliSpecifier(spec) || imp.isTypeOnly()) continue;
35180
+ for (const n2 of imp.getNamedImports()) {
35181
+ if (n2.isTypeOnly()) continue;
35182
+ if (WORKFLOW_CONSTANT_NAMES.includes(n2.getName())) fail(n2.getName(), spec, n2.getStart());
35183
+ }
35184
+ const ns = imp.getNamespaceImport();
35185
+ if (ns) {
35186
+ for (const c of WORKFLOW_CONSTANT_NAMES) {
35187
+ const idx = code.search(new RegExp(`\\b${ns.getText()}\\.${c}\\b`));
35188
+ if (idx >= 0) fail(c, spec, idx);
35189
+ }
35190
+ }
35191
+ }
35192
+ for (const exp of tempFile.getExportDeclarations()) {
35193
+ const spec = exp.getModuleSpecifierValue();
35194
+ if (!spec || !isLuaCliSpecifier(spec) || exp.isTypeOnly()) continue;
35195
+ const named = exp.getNamedExports();
35196
+ if (named.length === 0 && !exp.getNamespaceExport()) {
35197
+ fail(WORKFLOW_CONSTANT_NAMES.join(" / "), spec, exp.getStart());
35198
+ }
35199
+ for (const n2 of named) {
35200
+ if (n2.isTypeOnly()) continue;
35201
+ if (WORKFLOW_CONSTANT_NAMES.includes(n2.getName())) fail(n2.getName(), spec, n2.getStart());
35202
+ }
35203
+ }
35204
+ } finally {
35205
+ this.project.removeSourceFile(tempFile);
35206
+ }
35207
+ }
35208
+ /**
34933
35209
  * Create esbuild plugin that serves the source file as a virtual module
34934
35210
  * with an appended named export for the primitive.
34935
35211
  */
34936
- createVirtualSourcePlugin(metadata) {
35212
+ createVirtualSourcePlugin(metadata, stubWorkflowBuilders) {
34937
35213
  const bundler = this;
34938
35214
  const sourcePath = metadata.sourcePath;
34939
35215
  const exportName = metadata.exportName;
@@ -34961,7 +35237,10 @@ export { ${WORKFLOW_SHIM_NAMES.join(", ")} } from ${JSON.stringify(this.workflow
34961
35237
  }, async () => {
34962
35238
  const sourceFile = bundler.project.getSourceFile(sourcePath);
34963
35239
  let content = sourceFile?.getText() ?? await fs9.readFile(sourcePath, "utf-8");
34964
- content = bundler.stripLuaCliImportsAST(content, path10.basename(sourcePath));
35240
+ if (metadata.kind !== "workflow") {
35241
+ bundler.assertNoWorkflowConstants(content, sourcePath);
35242
+ }
35243
+ content = bundler.stripLuaCliImportsAST(content, path10.basename(sourcePath), stubWorkflowBuilders);
34965
35244
  const virtualContent = metadata.isDefaultExport ? content : `${content}
34966
35245
  export { ${exportName} as __lua_target__ };
34967
35246
  `;
@@ -34979,8 +35258,9 @@ export { ${exportName} as __lua_target__ };
34979
35258
  * Uses ts-morph to properly parse and remove import declarations, handling all edge cases
34980
35259
  * including multiline imports, comments, and complex syntax that regex can't handle.
34981
35260
  */
34982
- createLuaCliShimPlugin() {
34983
- const stripImports = this.stripLuaCliImportsAST.bind(this);
35261
+ createLuaCliShimPlugin(kind, stubWorkflowBuilders) {
35262
+ const assertNoConstants = this.assertNoWorkflowConstants.bind(this);
35263
+ const stripImports = /* @__PURE__ */ __name((code, filename) => this.stripLuaCliImportsAST(code, filename, stubWorkflowBuilders), "stripImports");
34984
35264
  const isWorkflowBuilderSource = this.isWorkflowBuilderSource.bind(this);
34985
35265
  return {
34986
35266
  name: "lua-cli-import-stripper",
@@ -34995,6 +35275,7 @@ export { ${exportName} as __lua_target__ };
34995
35275
  if (!contents.includes("lua-cli") && !contents.includes("api-exports")) {
34996
35276
  return null;
34997
35277
  }
35278
+ if (kind !== "workflow") assertNoConstants(contents, args2.path);
34998
35279
  try {
34999
35280
  const modifiedContents = stripImports(contents, path10.basename(args2.path));
35000
35281
  if (modifiedContents !== contents) {
@@ -35029,6 +35310,19 @@ export { ${exportName} as __lua_target__ };
35029
35310
  contents: "/* lua-cli stripped - APIs provided by VM sandbox */",
35030
35311
  loader: "js"
35031
35312
  }));
35313
+ build2.onResolve({
35314
+ filter: /^lua-cli-inert-workflow-builder$/
35315
+ }, () => ({
35316
+ path: INERT_WORKFLOW_BUILDER_SPECIFIER,
35317
+ namespace: INERT_WORKFLOW_BUILDER_NAMESPACE
35318
+ }));
35319
+ build2.onLoad({
35320
+ filter: /.*/,
35321
+ namespace: INERT_WORKFLOW_BUILDER_NAMESPACE
35322
+ }, () => ({
35323
+ contents: INERT_WORKFLOW_BUILDER_SOURCE,
35324
+ loader: "js"
35325
+ }));
35032
35326
  }
35033
35327
  };
35034
35328
  }
@@ -38783,13 +39077,20 @@ function resultOf(response) {
38783
39077
  }
38784
39078
  return response.data;
38785
39079
  }
38786
- function buildOfflineDecisionsApi(getService) {
39080
+ function decisionTestSiteHeaders(site) {
39081
+ return {
39082
+ [DECISION_SANDBOX_SITE_HEADER]: DECISION_LUA_TEST_SITE,
39083
+ [DECISION_SANDBOX_PRIMITIVE_HEADER]: formatDecisionSandboxPrimitive(`${site.kind}:${site.name}`, site.tool)
39084
+ };
39085
+ }
39086
+ function buildOfflineDecisionsApi(getService, testSite) {
39087
+ const headers = testSite ? decisionTestSiteHeaders(testSite) : void 0;
38787
39088
  return buildDecisionsApi({
38788
- ask: /* @__PURE__ */ __name(async (request2) => (await getService()).askForSandbox(request2), "ask"),
38789
- run: /* @__PURE__ */ __name(async (request2) => (await getService()).runForSandbox(request2), "run")
39089
+ ask: /* @__PURE__ */ __name(async (request2) => (await getService()).askForSandbox(request2, headers), "ask"),
39090
+ run: /* @__PURE__ */ __name(async (request2) => (await getService()).runForSandbox(request2, headers), "run")
38790
39091
  });
38791
39092
  }
38792
- var DecisionsApiService;
39093
+ var DECISION_LUA_TEST_SITE, DecisionsApiService;
38793
39094
  var init_decisions_api_service = __esm({
38794
39095
  "src/api/decisions.api.service.ts"() {
38795
39096
  "use strict";
@@ -38797,6 +39098,8 @@ var init_decisions_api_service = __esm({
38797
39098
  init_decisions_api();
38798
39099
  init_http_client();
38799
39100
  __name(resultOf, "resultOf");
39101
+ DECISION_LUA_TEST_SITE = "lua-test";
39102
+ __name(decisionTestSiteHeaders, "decisionTestSiteHeaders");
38800
39103
  DecisionsApiService = class extends HttpClient {
38801
39104
  static {
38802
39105
  __name(this, "DecisionsApiService");
@@ -38805,17 +39108,17 @@ var init_decisions_api_service = __esm({
38805
39108
  constructor(baseUrl, credential, agentId2) {
38806
39109
  super(baseUrl, credential), this.agentId = agentId2;
38807
39110
  }
38808
- async ask(body) {
38809
- return this.httpPostOnce(`/developer/decisions/${this.agentId}/ask`, body, {});
39111
+ async ask(body, headers = {}) {
39112
+ return this.httpPostOnce(`/developer/decisions/${this.agentId}/ask`, body, headers);
38810
39113
  }
38811
- async run({ name, ...body }) {
38812
- return this.httpPostOnce(`/developer/decisions/${this.agentId}/run/${encodeURIComponent(name)}`, body, {});
39114
+ async run({ name, ...body }, headers = {}) {
39115
+ return this.httpPostOnce(`/developer/decisions/${this.agentId}/run/${encodeURIComponent(name)}`, body, headers);
38813
39116
  }
38814
- async askForSandbox(request2) {
38815
- return resultOf(await this.ask(request2));
39117
+ async askForSandbox(request2, headers) {
39118
+ return resultOf(await this.ask(request2, headers));
38816
39119
  }
38817
- async runForSandbox(request2) {
38818
- return resultOf(await this.run(request2));
39120
+ async runForSandbox(request2, headers) {
39121
+ return resultOf(await this.run(request2, headers));
38819
39122
  }
38820
39123
  async getDecisions() {
38821
39124
  return this.httpGet(`/developer/decisions/${this.agentId}/definitions`, {});
@@ -51237,7 +51540,7 @@ function createSandbox(options) {
51237
51540
  Decisions: buildOfflineDecisionsApi(async () => {
51238
51541
  const { getDecisionsInstance: getDecisionsInstance2 } = await Promise.resolve().then(() => (init_lazy_instances(), lazy_instances_exports));
51239
51542
  return getDecisionsInstance2();
51240
- }),
51543
+ }, options.testSite),
51241
51544
  DecisionError,
51242
51545
  Agents: {
51243
51546
  invoke: /* @__PURE__ */ __name(async (targetAgentId, promptOrInput) => {
@@ -52539,6 +52842,9 @@ var DecisionHandler = class extends BaseVersionedHandler {
52539
52842
  yamlKey: "decisions",
52540
52843
  idField: "decisionId"
52541
52844
  };
52845
+ serverDeleteCommand(name) {
52846
+ return `lua decisions delete ${name}`;
52847
+ }
52542
52848
  getApi(apiKey, agentId2) {
52543
52849
  return new DecisionsApiService(BASE_URLS.API, apiKey, agentId2);
52544
52850
  }
@@ -52873,6 +53179,7 @@ __name(printToolOutput, "printToolOutput");
52873
53179
 
52874
53180
  // src/commands/test.ts
52875
53181
  init_cli();
53182
+ init_write_info();
52876
53183
  init_command_utils();
52877
53184
 
52878
53185
  // src/utils/web-app-route.ts
@@ -55609,7 +55916,7 @@ async function selectEntityOrPrompt(options) {
55609
55916
  __name(selectEntityOrPrompt, "selectEntityOrPrompt");
55610
55917
  function progress(asJson, message) {
55611
55918
  if (asJson) {
55612
- process.stderr.write("\r\x1B[K" + message + "\n");
55919
+ process.stderr.write(clearLineFor(process.stderr) + message + "\n");
55613
55920
  } else {
55614
55921
  writeProgress(message);
55615
55922
  }
@@ -55617,7 +55924,7 @@ function progress(asJson, message) {
55617
55924
  __name(progress, "progress");
55618
55925
  function success(asJson, message) {
55619
55926
  if (asJson) {
55620
- process.stderr.write("\r\x1B[K" + message + "\n");
55927
+ process.stderr.write(clearLineFor(process.stderr) + message + "\n");
55621
55928
  } else {
55622
55929
  writeSuccess(message);
55623
55930
  }
@@ -55825,7 +56132,12 @@ async function testSkill(entityName, inputJson, asJson = false) {
55825
56132
  inputs: inputValues,
55826
56133
  apiKey,
55827
56134
  agentId: agentId2,
55828
- channel: "dev"
56135
+ channel: "dev",
56136
+ testSite: {
56137
+ kind: "skill",
56138
+ name: selectedTool.skillName,
56139
+ tool: selectedTool.name
56140
+ }
55829
56141
  });
55830
56142
  success(asJson, "\u2705 Tool execution successful!");
55831
56143
  printToolOutput("Tool", result, asJson);
@@ -55938,7 +56250,11 @@ async function testWebhook(entityName, inputJson, asJson = false) {
55938
56250
  body,
55939
56251
  rawBody,
55940
56252
  apiKey,
55941
- agentId: agentId2
56253
+ agentId: agentId2,
56254
+ testSite: {
56255
+ kind: "webhook",
56256
+ name: selectedWebhook.name
56257
+ }
55942
56258
  });
55943
56259
  success(asJson, "\n\u2705 Webhook execution successful!");
55944
56260
  printToolOutput("Webhook", result, asJson);
@@ -56066,7 +56382,11 @@ async function testWebApp(entityName, routeSpec, inputJson, asJson = false) {
56066
56382
  appCode,
56067
56383
  input: webRouteInput,
56068
56384
  apiKey,
56069
- agentId: agentId2
56385
+ agentId: agentId2,
56386
+ testSite: {
56387
+ kind: "web-route",
56388
+ name: app.name
56389
+ }
56070
56390
  });
56071
56391
  if (asJson) {
56072
56392
  console.log(JSON.stringify(result, null, 2));
@@ -56126,6 +56446,10 @@ async function testJob(entityName, asJson = false) {
56126
56446
  jobCode,
56127
56447
  apiKey,
56128
56448
  agentId: agentId2,
56449
+ testSite: {
56450
+ kind: "job",
56451
+ name: selectedJob.name
56452
+ },
56129
56453
  jobData: {
56130
56454
  id: jobId,
56131
56455
  jobId,
@@ -56234,35 +56558,25 @@ async function testPreProcessor(entityName, inputJson, asJson = false) {
56234
56558
  const { apiKey, agentId: agentId2 } = await loadAuthOrFail();
56235
56559
  const preprocessorCode = loadArtifact(selected, process.cwd());
56236
56560
  await withSandboxEnv(async () => {
56561
+ const messages = [
56562
+ {
56563
+ type: "text",
56564
+ text: message
56565
+ }
56566
+ ];
56237
56567
  try {
56238
- const messages = [
56239
- {
56240
- type: "text",
56241
- text: message
56242
- }
56243
- ];
56244
56568
  const result = await executePreProcessor({
56245
56569
  processorCode: preprocessorCode,
56246
56570
  messages,
56247
56571
  channel,
56248
56572
  apiKey,
56249
- agentId: agentId2
56573
+ agentId: agentId2,
56574
+ testSite: {
56575
+ kind: "preprocessor",
56576
+ name: preprocessorName
56577
+ }
56250
56578
  });
56251
56579
  success(asJson, "\n\u2705 PreProcessor execution successful!");
56252
- const displayMessages = /* @__PURE__ */ __name((outputMessages) => {
56253
- console.log(`Processed messages (${outputMessages.length}):`);
56254
- outputMessages.forEach((msg, idx) => {
56255
- if (msg.type === "text") {
56256
- console.log(` ${idx + 1}. [TEXT] ${msg.text}`);
56257
- } else if (msg.type === "image") {
56258
- console.log(` ${idx + 1}. [IMAGE] ${msg.mimeType}`);
56259
- } else if (msg.type === "file") {
56260
- console.log(` ${idx + 1}. [FILE] ${msg.mimeType}`);
56261
- } else {
56262
- console.log(` ${idx + 1}. [${msg.type}]`, msg);
56263
- }
56264
- });
56265
- }, "displayMessages");
56266
56580
  if (asJson) {
56267
56581
  printToolOutput("PreProcessor", result, true);
56268
56582
  } else if (result.action === "block") {
@@ -56305,7 +56619,7 @@ Raw result:`);
56305
56619
  });
56306
56620
  }
56307
56621
  } catch (error) {
56308
- handleExecutionError(error, "PreProcessor", asJson);
56622
+ reportPreprocessorFailOpen(error, messages, asJson);
56309
56623
  if (!asJson) {
56310
56624
  writeHintBlock({
56311
56625
  headline: "Preprocessor ran locally \u2014 no server logs exist for this execution.",
@@ -56326,6 +56640,37 @@ Raw result:`);
56326
56640
  });
56327
56641
  }
56328
56642
  __name(testPreProcessor, "testPreProcessor");
56643
+ function displayMessages(outputMessages) {
56644
+ console.log(`Processed messages (${outputMessages.length}):`);
56645
+ outputMessages.forEach((msg, idx) => {
56646
+ if (msg.type === "text") {
56647
+ console.log(` ${idx + 1}. [TEXT] ${msg.text}`);
56648
+ } else if (msg.type === "image") {
56649
+ console.log(` ${idx + 1}. [IMAGE] ${msg.mimeType}`);
56650
+ } else if (msg.type === "file") {
56651
+ console.log(` ${idx + 1}. [FILE] ${msg.mimeType}`);
56652
+ } else {
56653
+ console.log(` ${idx + 1}. [${msg.type}]`, msg);
56654
+ }
56655
+ });
56656
+ }
56657
+ __name(displayMessages, "displayMessages");
56658
+ function reportPreprocessorFailOpen(error, messages, asJson) {
56659
+ const detail = cliErrorDetail(error);
56660
+ if (asJson) {
56661
+ printToolOutput("PreProcessor", {
56662
+ action: "proceed",
56663
+ error: detail
56664
+ }, true);
56665
+ return;
56666
+ }
56667
+ console.error(`
56668
+ \u26A0\uFE0F PreProcessor threw: ${detail.message}`);
56669
+ console.error(" Live, a chat message goes through unchanged when its pre-processor throws, so this run proceeds.");
56670
+ console.log("\nAction: PROCEED");
56671
+ displayMessages(messages);
56672
+ }
56673
+ __name(reportPreprocessorFailOpen, "reportPreprocessorFailOpen");
56329
56674
  async function testPostProcessor(entityName, inputJson, asJson = false) {
56330
56675
  progress(asJson, "\u{1F4E4} Testing postprocessor...");
56331
56676
  progress(asJson, "\u{1F4E6} Compiling code first...");
@@ -56402,7 +56747,11 @@ async function testPostProcessor(entityName, inputJson, asJson = false) {
56402
56747
  response,
56403
56748
  channel,
56404
56749
  apiKey,
56405
- agentId: agentId2
56750
+ agentId: agentId2,
56751
+ testSite: {
56752
+ kind: "postprocessor",
56753
+ name: selected.name
56754
+ }
56406
56755
  });
56407
56756
  success(asJson, "\n\u2705 PostProcessor execution successful!");
56408
56757
  if (asJson) {
@@ -65197,7 +65546,8 @@ function renderLogEntry(log, isLast) {
65197
65546
  }
65198
65547
  } else {
65199
65548
  if (primitiveName) {
65200
- console.log(chalk2.gray(` ${capitalizedType} Name: ${primitiveName}`));
65549
+ const label2 = logSource === "browser" ? "Called by" : `${capitalizedType} Name`;
65550
+ console.log(chalk2.gray(` ${label2}: ${primitiveName}`));
65201
65551
  }
65202
65552
  if (primitiveId) {
65203
65553
  console.log(chalk2.gray(` ${capitalizedType} ID: ${primitiveId}`));
@@ -68981,8 +69331,7 @@ async function gatherPrimitives(input, warnings) {
68981
69331
  if (localNames.has(s.name)) continue;
68982
69332
  if (!(handler.isActive?.(s) ?? true)) continue;
68983
69333
  if (!handler.shouldConsiderForOrphan(s)) continue;
68984
- const flagName = `--${handler.displayName.toLowerCase().replace(/\s+/g, "-")}-name`;
68985
- const cleanupCommand = handler.kind !== PrimitiveKind.DEVICE_TRIGGER ? `${handler.deleteCommand} ${flagName} "${s.name}"` : "";
69334
+ const cleanupCommand = handler.kind !== PrimitiveKind.DEVICE_TRIGGER ? handler.serverDeleteCommand(`"${s.name}"`) : "";
68986
69335
  orphans.push({
68987
69336
  name: s.name,
68988
69337
  cleanupCommand,
@@ -72272,6 +72621,13 @@ function parseProvider2(raw) {
72272
72621
  return provider;
72273
72622
  }
72274
72623
  __name(parseProvider2, "parseProvider");
72624
+ function parseModel(raw) {
72625
+ if (raw === void 0) return void 0;
72626
+ const model = raw.trim();
72627
+ if (!model) throw CliError.usage("--model must name a model, such as jev-latest, gpt-6-luna or liquid/d1");
72628
+ return model;
72629
+ }
72630
+ __name(parseModel, "parseModel");
72275
72631
  function parseMinConfidence(raw) {
72276
72632
  if (raw === void 0) return void 0;
72277
72633
  const value3 = Number(raw);
@@ -72411,6 +72767,7 @@ async function runAction(api, name, options) {
72411
72767
  const decisionName = requireArg(name, "A decision name", "lua decisions run <name> --message '<text>'");
72412
72768
  const { state: state3, input } = parseState(options);
72413
72769
  const provider = parseProvider2(options.provider);
72770
+ const model = parseModel(options.model);
72414
72771
  const minConfidence = parseMinConfidence(options.minConfidence);
72415
72772
  const request2 = {
72416
72773
  name: decisionName,
@@ -72418,6 +72775,9 @@ async function runAction(api, name, options) {
72418
72775
  ...provider !== void 0 && {
72419
72776
  provider
72420
72777
  },
72778
+ ...model !== void 0 && {
72779
+ model
72780
+ },
72421
72781
  ...minConfidence !== void 0 && {
72422
72782
  minConfidence
72423
72783
  }
@@ -72426,6 +72786,7 @@ async function runAction(api, name, options) {
72426
72786
  trackEvent("cli_decisions_run", {
72427
72787
  input,
72428
72788
  provider: result.provider,
72789
+ model: model !== void 0,
72429
72790
  rule: result.rule,
72430
72791
  fallback: !!result.fallback,
72431
72792
  cached: result.cached,
@@ -73151,6 +73512,19 @@ async function activateCore(ctx, name, on) {
73151
73512
  return WORKFLOW_EXIT.OK;
73152
73513
  }
73153
73514
  __name(activateCore, "activateCore");
73515
+ function runsInFlightLine(wfName, err) {
73516
+ const blocking = err?.blockingRunId;
73517
+ const cancel = `wait for it or cancel it: lua workflows cancel ${blocking ?? "<runId>"}`;
73518
+ const head = `\u274C "${wfName}" has concurrencyPolicy:'forbid' and run \`${blocking ?? "?"}\` is in flight`;
73519
+ if (typeof err?.correlationKey === "string" && err.correlationKey !== "") {
73520
+ return `${head} for correlationKey ${JSON.stringify(err.correlationKey)} \u2014 ${cancel}`;
73521
+ }
73522
+ if (err?.concurrencyKey === "correlationKey") {
73523
+ return `${head} \u2014 it was started without a correlationKey; pass --correlation-key <key> to start in parallel, or ${cancel}`;
73524
+ }
73525
+ return `${head} \u2014 ${cancel}`;
73526
+ }
73527
+ __name(runsInFlightLine, "runsInFlightLine");
73154
73528
  function startResultLine(d, requestedName) {
73155
73529
  if (!d.deduplicated && !d.idempotentReplay) return `\u2705 Run ${d.runId} \xB7 ${d.status}`;
73156
73530
  const name = d.workflowName ?? requestedName;
@@ -73194,10 +73568,7 @@ async function startCore(ctx, name, o) {
73194
73568
  if (!res.success || !res.data) {
73195
73569
  if (res.error?.statusCode === 409 && (res.error.code ?? res.error.error) === "RUNS_IN_FLIGHT") {
73196
73570
  emitJson(ctx, res);
73197
- const blocking = res.error.blockingRunId;
73198
- if (!ctx.json) {
73199
- console.error(`\u274C "${wf.name}" has concurrencyPolicy:'forbid' and run \`${blocking ?? "?"}\` is in flight \u2014 wait for it or cancel it: lua workflows cancel ${blocking ?? "<runId>"}`);
73200
- }
73571
+ if (!ctx.json) console.error(runsInFlightLine(wf.name, res.error));
73201
73572
  return WORKFLOW_EXIT.API;
73202
73573
  }
73203
73574
  return apiFailure(ctx, res, "start");
@@ -75968,6 +76339,10 @@ async function goalsGetCore(ctx, goalId) {
75968
76339
  return WORKFLOW_EXIT.OK;
75969
76340
  }
75970
76341
  __name(goalsGetCore, "goalsGetCore");
76342
+ function goalUnitSuffix(g) {
76343
+ return g.budgetUnit ? ` \xB7 unit ${g.budgetUnit}` : "";
76344
+ }
76345
+ __name(goalUnitSuffix, "goalUnitSuffix");
75971
76346
  function printGoalDetail(g) {
75972
76347
  console.log(`
75973
76348
  \u{1F3AF} Goal ${g.goalId} \xB7 ${goalStatusLabel(g)}`);
@@ -75976,7 +76351,7 @@ function printGoalDetail(g) {
75976
76351
  console.log(` Judge: ${judgeLabel(g.judge)}`);
75977
76352
  console.log(` Cadence: ${cadenceLabel(g.cadence)} \xB7 mode ${g.evaluation?.mode ?? "immediate"}${g.evaluation?.delaySeconds ? ` \xB7 delay ${g.evaluation.delaySeconds}s` : ""}`);
75978
76353
  console.log(` Runs: ${g.runsUsed}/${g.maxRuns} used \xB7 iteration ${g.iteration ?? 0}${g.consecutiveContinues ? ` \xB7 ${g.consecutiveContinues} consecutive continue(s)` : ""}${g.currentRunId ? ` \xB7 current ${g.currentRunId}` : ""}`);
75979
- if (g.budget?.maxCredits || g.maxTotalCredits) console.log(` Budget: ${g.budget?.maxCredits ? `per-run ${g.budget.maxCredits} credits` : ""}${g.budget?.maxCredits && g.maxTotalCredits ? " \xB7 " : ""}${g.maxTotalCredits ? `lineage cap ${g.maxTotalCredits} credits` : ""}`);
76354
+ if (g.budget?.maxCredits || g.maxTotalCredits) console.log(` Budget: ${g.budget?.maxCredits ? `per-run ${g.budget.maxCredits} credits` : ""}${g.budget?.maxCredits && g.maxTotalCredits ? " \xB7 " : ""}${g.maxTotalCredits ? `lineage cap ${g.maxTotalCredits} credits` : ""}${goalUnitSuffix(g)}`);
75980
76355
  if (g.status === "paused" && (g.pauseReason === "budget" || g.pauseReason === "max_runs")) console.log(` \u23F8 parked at its ${g.pauseReason === "budget" ? "credit" : "run"} cap \u2014 ${goalRaiseHint(g.goalId, g.pauseReason)}`);
75981
76356
  if (g.note) console.log(` Note: ${g.note}`);
75982
76357
  if (g.closeNote) console.log(` Closed: ${g.closeNote}`);
@@ -76042,7 +76417,7 @@ function parseEveryFlag(raw) {
76042
76417
  }
76043
76418
  __name(parseEveryFlag, "parseEveryFlag");
76044
76419
  function printGoalWriteSummary(g, past) {
76045
- writeSuccess(`\u2705 goal ${g.goalId} ${past} \xB7 ${goalStatusLabel(g)} \xB7 runs ${g.runsUsed}/${g.maxRuns}${g.maxTotalCredits ? ` \xB7 lineage cap ${g.maxTotalCredits} credits` : ""}${g.jobId ? ` \xB7 schedule ${g.jobId}${goalJobStateLabel(g)}` : ""}`);
76420
+ writeSuccess(`\u2705 goal ${g.goalId} ${past} \xB7 ${goalStatusLabel(g)} \xB7 runs ${g.runsUsed}/${g.maxRuns}${g.maxTotalCredits ? ` \xB7 lineage cap ${g.maxTotalCredits} credits${goalUnitSuffix(g)}` : ""}${g.jobId ? ` \xB7 schedule ${g.jobId}${goalJobStateLabel(g)}` : ""}`);
76046
76421
  if (g.rearmed) writeInfo(" \u21BA re-armed \u2014 the cap park cleared and the goal is active again (no backfill)");
76047
76422
  if (g.resumed === false) writeInfo(` \u26A0\uFE0F the goal parked again (${g.pauseReason ?? "strikes"}) \u2014 see: lua workflows goals get ${g.goalId}`);
76048
76423
  if (!g.rearmed && g.status === "paused" && (g.pauseReason === "budget" || g.pauseReason === "max_runs")) writeInfo(` still parked (${g.pauseReason}) \u2014 ${goalRaiseHint(g.goalId, g.pauseReason)}`);
@@ -88131,11 +88506,12 @@ function currentVersionOf(row2) {
88131
88506
  __name(currentVersionOf, "currentVersionOf");
88132
88507
  function buildVersionStatusRows(inputs) {
88133
88508
  const rows3 = [];
88134
- for (const { type, localItems, pinned, live } of inputs) {
88509
+ for (const { type, localItems, pinned, live, idsAreAuthoritative } of inputs) {
88135
88510
  for (const item of localItems) {
88136
- const match = (item.id ? pinned.find((p) => p.id === item.id) : void 0) ?? pinned.find((p) => p.name != null && p.name === item.name);
88511
+ const byName = !item.id || !idsAreAuthoritative;
88512
+ const match = (item.id ? pinned.find((p) => p.id === item.id) : void 0) ?? (byName ? pinned.find((p) => p.name != null && p.name === item.name) : void 0);
88137
88513
  const pinnedVersion = match ? match.version : null;
88138
- const server = (item.id ? live?.find((l) => l.id === item.id) : void 0) ?? live?.find((l) => l.name === item.name && !l.deleted);
88514
+ const server = (item.id ? live?.find((l) => l.id === item.id) : void 0) ?? (byName ? live?.find((l) => l.name === item.name && !l.deleted) : void 0);
88139
88515
  const drift = server !== void 0 && (server.deleted || server.version !== pinnedVersion);
88140
88516
  const row2 = {
88141
88517
  type,
@@ -88295,6 +88671,7 @@ function buildStatusRowInputs(config, snapshot, serverDecisions) {
88295
88671
  version: p.version,
88296
88672
  name: p.name
88297
88673
  })),
88674
+ idsAreAuthoritative: true,
88298
88675
  ...serverDecisions && {
88299
88676
  live: serverDecisions.map((d) => ({
88300
88677
  id: d.id,
@@ -89213,14 +89590,29 @@ var REFUSAL_HINTS = {
89213
89590
  BROWSER_CLI_CONCURRENCY: "Wait for a run to finish, or press Ctrl-C on it to cancel it.",
89214
89591
  BROWSER_CLI_LIMITER_UNAVAILABLE: "Try again in a minute."
89215
89592
  };
89593
+ var BROWSER_RUN_MAX_STEPS = 60;
89594
+ var BROWSER_RUN_MIN_COST_USD = 0.01;
89595
+ var BROWSER_RUN_MAX_COST_USD = 10;
89216
89596
  function parseEnvironment2(raw) {
89217
89597
  if (raw === void 0) return "sandbox";
89218
89598
  const env = raw.toLowerCase();
89219
- if (env === "sandbox" || env === "staging") return "sandbox";
89220
- if (env === "production") return "production";
89221
- throw CliError.usage(`-e must be sandbox, staging or production (got '${raw}')`);
89599
+ if (env === "sandbox" || env === "production") return env;
89600
+ throw CliError.usage(`-e must be sandbox or production (got '${raw}')`, "Log rows are tagged sandbox or production.");
89222
89601
  }
89223
89602
  __name(parseEnvironment2, "parseEnvironment");
89603
+ function parseWebUrl(raw, flag) {
89604
+ let parsed;
89605
+ try {
89606
+ parsed = new URL(raw.trim());
89607
+ } catch {
89608
+ throw CliError.usage(`${flag} must be a full web address like https://example.com (got '${raw}')`);
89609
+ }
89610
+ if (parsed.protocol !== "http:" && parsed.protocol !== "https:") {
89611
+ throw CliError.usage(`${flag} must start with http:// or https:// (got '${raw}')`);
89612
+ }
89613
+ return raw.trim();
89614
+ }
89615
+ __name(parseWebUrl, "parseWebUrl");
89224
89616
  function parseReadFormat(raw) {
89225
89617
  if (raw === void 0) return void 0;
89226
89618
  const format = BROWSER_READ_FORMATS2.find((f) => f === raw);
@@ -89241,12 +89633,20 @@ function parseMaxCost(raw) {
89241
89633
  if (raw === void 0) return void 0;
89242
89634
  const amount = raw.trim().replace(/^\$/, "");
89243
89635
  const n2 = Number(amount);
89244
- if (!/^(\d+(\.\d+)?|\.\d+)$/.test(amount) || n2 <= 0) {
89245
- throw CliError.usage(`--max-cost must be an amount in USD above 0, like 0.50 (got '${raw}')`);
89636
+ if (!/^(\d+(\.\d+)?|\.\d+)$/.test(amount) || n2 < BROWSER_RUN_MIN_COST_USD || n2 > BROWSER_RUN_MAX_COST_USD) {
89637
+ throw CliError.usage(`--max-cost must be an amount in USD from ${BROWSER_RUN_MIN_COST_USD} to ${BROWSER_RUN_MAX_COST_USD}, like 0.50 (got '${raw}')`);
89246
89638
  }
89247
89639
  return n2;
89248
89640
  }
89249
89641
  __name(parseMaxCost, "parseMaxCost");
89642
+ function parseMaxSteps(raw) {
89643
+ const n2 = parsePositiveInt(raw, "--max-steps");
89644
+ if (n2 !== void 0 && n2 > BROWSER_RUN_MAX_STEPS) {
89645
+ throw CliError.usage(`--max-steps must be ${BROWSER_RUN_MAX_STEPS} or less (got '${raw}')`);
89646
+ }
89647
+ return n2;
89648
+ }
89649
+ __name(parseMaxSteps, "parseMaxSteps");
89250
89650
  function readSchemaFile(path32, read = readUtf8) {
89251
89651
  if (path32 === void 0) return void 0;
89252
89652
  let text2;
@@ -89278,16 +89678,23 @@ function readResultLines(output) {
89278
89678
  `URL: ${data.finalUrl || data.url || "(unknown)"}`
89279
89679
  ];
89280
89680
  if (data.url && data.finalUrl && data.url !== data.finalUrl) lines.push(`Requested: ${data.url}`);
89281
- lines.push(`Engine: ${output.engine}`);
89282
- if (data.blocked) {
89283
- lines.push(`Blocked: yes${data.blocker ? ` (${data.blocker}${data.blockerKind ? `, ${data.blockerKind}` : ""})` : ""}`);
89284
- if (data.blockerGuidance) lines.push(`Guidance: ${data.blockerGuidance}`);
89285
- }
89286
- lines.push("", data.content ?? "");
89681
+ if (typeof data.status === "number" && data.status !== 200) lines.push(`Status: HTTP ${data.status}`);
89682
+ if (typeof data.matches === "number") lines.push(`Matches: ${data.matches}`);
89683
+ lines.push(`Engine: ${output.engine}`, ...blockedLines(data), "", data.content ?? "");
89287
89684
  if (data.truncated) lines.push("", "(content was cut short)");
89288
89685
  return lines;
89289
89686
  }
89290
89687
  __name(readResultLines, "readResultLines");
89688
+ function blockedLines(data) {
89689
+ if (!data.blocked) return [];
89690
+ const kind = data.blockerKind ? `, ${data.blockerKind}` : "";
89691
+ const lines = [
89692
+ `Blocked: yes${data.blocker ? ` (${data.blocker}${kind})` : ""}`
89693
+ ];
89694
+ if (data.blockerGuidance) lines.push(`Guidance: ${data.blockerGuidance}`);
89695
+ return lines;
89696
+ }
89697
+ __name(blockedLines, "blockedLines");
89291
89698
  function runStepLine(step3) {
89292
89699
  const where = step3.url ? ` on ${step3.url}` : "";
89293
89700
  const failed = step3.ok ? "" : ` (failed${step3.error ? `: ${step3.error}` : ""})`;
@@ -89341,7 +89748,7 @@ async function guarded(agentId2, call2) {
89341
89748
  try {
89342
89749
  return await call2();
89343
89750
  } catch (error) {
89344
- if (!isAccessDeniedError(error)) throw error;
89751
+ if (!isAccessDeniedError(error) || isEdgeBlockedError(error)) throw error;
89345
89752
  throw CliError.forbidden(`Your API key can't run the browser for agent ${agentId2}.`, "It needs agents:write on that agent. Check the agent id, or run `lua auth configure` with a key for it.");
89346
89753
  }
89347
89754
  }
@@ -89381,8 +89788,9 @@ function logsHint() {
89381
89788
  __name(logsHint, "logsHint");
89382
89789
  async function runBrowserRead(ctx, url, options) {
89383
89790
  const format = parseReadFormat(options.format);
89791
+ const target = parseWebUrl(url, "The URL");
89384
89792
  const output = unwrap5(await guarded(ctx.agentId, () => ctx.api.read({
89385
- url,
89793
+ url: target,
89386
89794
  environment: ctx.environment,
89387
89795
  ...options.selector ? {
89388
89796
  selector: options.selector
@@ -89444,22 +89852,31 @@ async function followBrowserRun(api, first, signal, out, startedAt = Date.now())
89444
89852
  return view;
89445
89853
  }
89446
89854
  __name(followBrowserRun, "followBrowserRun");
89447
- async function runBrowserTask(ctx, task, options, out = {
89448
- write: /* @__PURE__ */ __name((line) => console.log(line), "write"),
89449
- progress: writeProgress
89450
- }) {
89855
+ function terminalRunOutput(stderr = process.stderr) {
89856
+ return {
89857
+ write: /* @__PURE__ */ __name((line) => {
89858
+ if (stderr.isTTY) stderr.write("\r\x1B[K");
89859
+ console.log(line);
89860
+ }, "write"),
89861
+ progress: /* @__PURE__ */ __name((line) => {
89862
+ if (stderr.isTTY) writeProgress(line);
89863
+ }, "progress")
89864
+ };
89865
+ }
89866
+ __name(terminalRunOutput, "terminalRunOutput");
89867
+ async function runBrowserTask(ctx, task, options, out = terminalRunOutput()) {
89451
89868
  if (!task.trim()) throw CliError.usage("A task is required", 'Usage: lua browser run "<task>"');
89452
89869
  const body = {
89453
89870
  task,
89454
89871
  environment: ctx.environment,
89455
89872
  ...options.startUrl ? {
89456
- startUrl: options.startUrl
89873
+ startUrl: parseWebUrl(options.startUrl, "--start-url")
89457
89874
  } : {},
89458
89875
  ...options.schema ? {
89459
89876
  schema: readSchemaFile(options.schema)
89460
89877
  } : {},
89461
89878
  ...options.maxSteps !== void 0 ? {
89462
- maxSteps: parsePositiveInt(options.maxSteps, "--max-steps")
89879
+ maxSteps: parseMaxSteps(options.maxSteps)
89463
89880
  } : {},
89464
89881
  ...options.maxCost !== void 0 ? {
89465
89882
  maxCostUsd: parseMaxCost(options.maxCost)
@@ -89732,7 +90149,7 @@ Examples:
89732
90149
  }));
89733
90150
  program2.command("test [type]").description("\u{1F9EA} Test skills, webhooks, or jobs interactively").option("--name <name>", "Entity name to test").option("--input <json>", "JSON input string for testing").option("--json", "Output result as raw JSON (useful for scripting and piping)").option("--route <route>", "Web app: the route to call, e.g. 'GET /tickets?status=open'").option("--step-output <id=json>", "Workflow: complete a step with this output (repeatable)", collect, []).option("--approve <id[=@payload]>", "Workflow: pre-answer an approval (repeatable)", collect, []).option("--deny <id[=@reason]>", "Workflow: pre-deny an approval (repeatable)", collect, []).option("--signal <name=json>", "Workflow: pre-supply a waitForSignal payload (repeatable)", collect, []).option("--from-run <runId>", "Workflow: seed completed steps from a real run").option("--force", "Workflow: seed from a run whose graph differs").option("--record <dir>", "Workflow: record live agent replies as fixtures (needs --agents live; tool steps never run offline)").option("--fixtures <dir>", "Workflow: replay recorded fixtures (exit 5 when one is missing)").option("--step-wall <s>", "Workflow: per-step wall in seconds (default 600)").option("--job-wall <s>", "Workflow: virtual wall for tier:'job' steps \u2014 splits at 14400 s segments, > 86400 is exit 2").option("--max-ticks <n>", "Workflow (script form): tick cap before SCRIPT_TICK_LIMIT (default 64)").option("--ledger-out <file>", "Workflow: write the in-memory ledger as JSON").option("--agents <fake|live>", "Workflow: fake agent steps (default) or call the dev API").option("--now <iso>", "Workflow: virtual clock start").option("--park <id>", "Workflow: simulate a platform-fault park of this step (repeatable)", collect, []).option("--fast-retries", "Workflow: collapse retry backoff waits to 0").option("--real-time", "Workflow: actually wait on sleeps/backoffs instead of fast-forwarding").option("--artefacts-dir <dir>", "Workflow: back ctx.artefacts.* on disk").option("--workspace <dir>", "Workflow: the checkout Job-tier code steps run in (ctx.workspace + ctx.exec / ctx.$)").addHelpText("after", `
89734
90151
  Arguments:
89735
- type Optional: 'skill', 'webhook', 'job' or 'workflow' (prompts if not provided)
90152
+ type Optional: ${getCanonicalValues("test.type").map((type) => `'${type}'`).join(", ")} (prompts if not provided)
89736
90153
 
89737
90154
  Options:
89738
90155
  --name <name> Entity name to test (non-interactive selection)
@@ -90117,7 +90534,7 @@ Examples:
90117
90534
  $ lua jobs versions -i myJob View job versions
90118
90535
  $ lua jobs history -i myJob View execution history
90119
90536
  `).action(jobsCommand);
90120
- program2.command("decisions [action] [name] [version]").description("\u{1F9ED} See, try and roll back named decisions (list, versions, publish, run, delete)").option("--json", "Machine-readable output (list, versions, run)").option("--force", "Skip the confirmation (publish, delete)").option("--state <json>", "run: the state to decide on, as JSON").option("--message <text>", "run: a message to decide on, sent as { message: <text> }").option("--provider <provider>", "run: jev, openai or auto").option("--min-confidence <n>", "run: below this confidence an answer is marked uncertain (0 to 1)").addHelpText("after", `
90537
+ program2.command("decisions [action] [name] [version]").description("\u{1F9ED} See, try and roll back named decisions (list, versions, publish, run, delete)").option("--json", "Machine-readable output (list, versions, run)").option("--force", "Skip the confirmation (publish, delete)").option("--state <json>", "run: the state to decide on, as JSON").option("--message <text>", "run: a message to decide on, sent as { message: <text> }").option("--provider <provider>", "run: jev, openai, openrouter or auto").option("--model <id>", "run: the model to answer with; an OpenRouter id such as liquid/d1 pins openrouter").option("--min-confidence <n>", "run: below this confidence an answer is marked uncertain (0 to 1)").addHelpText("after", `
90121
90538
  Arguments:
90122
90539
  action Optional: list (default), versions, publish, run, delete
90123
90540
  name The decision's name