lua-cli 3.49.0 → 3.49.1
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/api-exports.d.ts +22 -3
- package/dist/api-exports.js +331 -261
- package/dist/api-exports.js.map +1 -1
- package/dist/index.js +1086 -811
- package/dist/index.js.map +1 -1
- package/dist/workflow-builder.d.ts +2 -0
- package/dist/workflow-builder.js +25 -0
- package/dist/workflow-builder.js.map +1 -1
- package/docs/README.md +3 -3
- package/docs/api/LuaDecision.md +2 -2
- package/docs/api/LuaWorkflow.md +17 -1
- package/docs/api/Workflows.md +2 -1
- package/package.json +2 -2
- package/template/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -950,6 +950,24 @@ function aiGenerateInputFromSimplified(prompt, content) {
|
|
|
950
950
|
]
|
|
951
951
|
};
|
|
952
952
|
}
|
|
953
|
+
function formatDecisionSandboxPrimitive(name, tool) {
|
|
954
|
+
return tool ? `${name}${DECISION_SANDBOX_TOOL_SEPARATOR}${tool}` : name;
|
|
955
|
+
}
|
|
956
|
+
function parseDecisionSandboxPrimitive(value3) {
|
|
957
|
+
const at = value3.indexOf(DECISION_SANDBOX_TOOL_SEPARATOR);
|
|
958
|
+
const name = at < 0 ? value3 : value3.slice(0, at);
|
|
959
|
+
const tool = at < 0 ? "" : value3.slice(at + DECISION_SANDBOX_TOOL_SEPARATOR.length);
|
|
960
|
+
if (name.length === 0) return void 0;
|
|
961
|
+
return tool.length > 0 ? {
|
|
962
|
+
name,
|
|
963
|
+
tool
|
|
964
|
+
} : {
|
|
965
|
+
name
|
|
966
|
+
};
|
|
967
|
+
}
|
|
968
|
+
function decisionPublishStampKey(agentId2) {
|
|
969
|
+
return `decisions:stamp:${agentId2}`;
|
|
970
|
+
}
|
|
953
971
|
function isIntegrationPassthroughReadMethod(method) {
|
|
954
972
|
return typeof method === "string" && INTEGRATION_PASSTHROUGH_READ_METHODS.includes(method.toUpperCase());
|
|
955
973
|
}
|
|
@@ -7496,7 +7514,7 @@ function maskMcpServerHeaders(server) {
|
|
|
7496
7514
|
headersSet: headerNames.length > 0
|
|
7497
7515
|
};
|
|
7498
7516
|
}
|
|
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;
|
|
7517
|
+
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_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, 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
7518
|
var init_dist = __esm({
|
|
7501
7519
|
"../shared-types/dist/index.mjs"() {
|
|
7502
7520
|
"use strict";
|
|
@@ -7578,6 +7596,15 @@ var init_dist = __esm({
|
|
|
7578
7596
|
"score"
|
|
7579
7597
|
];
|
|
7580
7598
|
DECISION_NAME_PATTERN = /^[a-zA-Z0-9_-]{1,64}$/;
|
|
7599
|
+
DECISION_SANDBOX_SITE_HEADER = "x-lua-sandbox-site";
|
|
7600
|
+
DECISION_SANDBOX_PRIMITIVE_HEADER = "x-lua-sandbox-primitive";
|
|
7601
|
+
DECISION_SANDBOX_TOOL_SEPARATOR = "#";
|
|
7602
|
+
__name(formatDecisionSandboxPrimitive, "formatDecisionSandboxPrimitive");
|
|
7603
|
+
__name3(formatDecisionSandboxPrimitive, "formatDecisionSandboxPrimitive");
|
|
7604
|
+
__name(parseDecisionSandboxPrimitive, "parseDecisionSandboxPrimitive");
|
|
7605
|
+
__name3(parseDecisionSandboxPrimitive, "parseDecisionSandboxPrimitive");
|
|
7606
|
+
__name(decisionPublishStampKey, "decisionPublishStampKey");
|
|
7607
|
+
__name3(decisionPublishStampKey, "decisionPublishStampKey");
|
|
7581
7608
|
DECISION_LIMITS = {
|
|
7582
7609
|
maxQuestions: 64,
|
|
7583
7610
|
minOptions: 2,
|
|
@@ -7603,7 +7630,8 @@ var init_dist = __esm({
|
|
|
7603
7630
|
UNAVAILABLE: "decision_unavailable",
|
|
7604
7631
|
DISABLED: "decision_disabled",
|
|
7605
7632
|
INSUFFICIENT_CREDITS: "decision_insufficient_credits",
|
|
7606
|
-
NOT_FOUND: "decision_not_found"
|
|
7633
|
+
NOT_FOUND: "decision_not_found",
|
|
7634
|
+
CANCELLED: "decision_cancelled"
|
|
7607
7635
|
};
|
|
7608
7636
|
DECISION_INACTIVE_CODE = "decision_inactive";
|
|
7609
7637
|
MAX_NAME_CHARS = 64;
|
|
@@ -13329,6 +13357,218 @@ var init_auth_error = __esm({
|
|
|
13329
13357
|
}
|
|
13330
13358
|
});
|
|
13331
13359
|
|
|
13360
|
+
// ../sandbox-runtime/dist/decisions-api.mjs
|
|
13361
|
+
function isRecord3(value3) {
|
|
13362
|
+
return typeof value3 === "object" && value3 !== null && !Array.isArray(value3);
|
|
13363
|
+
}
|
|
13364
|
+
function isProvider(value3) {
|
|
13365
|
+
return DECISION_PROVIDERS.includes(value3);
|
|
13366
|
+
}
|
|
13367
|
+
function invalid(message) {
|
|
13368
|
+
return new DecisionError(message, {
|
|
13369
|
+
code: DECISION_ERROR_CODES.INVALID
|
|
13370
|
+
});
|
|
13371
|
+
}
|
|
13372
|
+
function assertInstructions(builder, instructions) {
|
|
13373
|
+
if (typeof instructions !== "string" || instructions.trim().length === 0) {
|
|
13374
|
+
throw invalid(`Decisions.${builder} needs non-empty instructions`);
|
|
13375
|
+
}
|
|
13376
|
+
if (instructions.length > DECISION_LIMITS.maxInstructionChars) {
|
|
13377
|
+
throw invalid(`Decisions.${builder} instructions must be at most ${DECISION_LIMITS.maxInstructionChars} characters`);
|
|
13378
|
+
}
|
|
13379
|
+
}
|
|
13380
|
+
function assertCount(what, count2, min, max) {
|
|
13381
|
+
if (count2 < min || count2 > max) {
|
|
13382
|
+
throw invalid(`${what} must hold ${min} to ${max} entries, got ${count2}`);
|
|
13383
|
+
}
|
|
13384
|
+
}
|
|
13385
|
+
function odds(instructions, criteria) {
|
|
13386
|
+
assertInstructions("odds", instructions);
|
|
13387
|
+
if (criteria === void 0) return {
|
|
13388
|
+
type: "odds",
|
|
13389
|
+
instructions
|
|
13390
|
+
};
|
|
13391
|
+
if (!isRecord3(criteria)) throw invalid("Decisions.odds criteria must be an object like { yes, no }");
|
|
13392
|
+
return {
|
|
13393
|
+
type: "odds",
|
|
13394
|
+
instructions,
|
|
13395
|
+
criteria
|
|
13396
|
+
};
|
|
13397
|
+
}
|
|
13398
|
+
function choice(instructions, options) {
|
|
13399
|
+
assertInstructions("choice", instructions);
|
|
13400
|
+
if (!isRecord3(options)) throw invalid("Decisions.choice options must be an object of label to description");
|
|
13401
|
+
assertCount("Decisions.choice options", Object.keys(options).length, DECISION_LIMITS.minOptions, DECISION_LIMITS.maxOptions);
|
|
13402
|
+
return {
|
|
13403
|
+
type: "choice",
|
|
13404
|
+
instructions,
|
|
13405
|
+
options
|
|
13406
|
+
};
|
|
13407
|
+
}
|
|
13408
|
+
function score(instructions, levels) {
|
|
13409
|
+
assertInstructions("score", instructions);
|
|
13410
|
+
if (!Array.isArray(levels)) throw invalid("Decisions.score levels must be an array");
|
|
13411
|
+
assertCount("Decisions.score levels", levels.length, DECISION_LIMITS.minLevels, DECISION_LIMITS.maxLevels);
|
|
13412
|
+
return {
|
|
13413
|
+
type: "score",
|
|
13414
|
+
instructions,
|
|
13415
|
+
levels
|
|
13416
|
+
};
|
|
13417
|
+
}
|
|
13418
|
+
function assertDecisionQuestion(name, question) {
|
|
13419
|
+
if (!isRecord3(question) || !DECISION_QUESTION_TYPES.includes(question.type)) {
|
|
13420
|
+
throw invalid(`questions.${name} must be built with Decisions.odds, Decisions.choice or Decisions.score`);
|
|
13421
|
+
}
|
|
13422
|
+
if (typeof question.instructions !== "string" || question.instructions.trim().length === 0) {
|
|
13423
|
+
throw invalid(`questions.${name}.instructions must be a non-empty string`);
|
|
13424
|
+
}
|
|
13425
|
+
}
|
|
13426
|
+
function checkDecisionRequest(request2) {
|
|
13427
|
+
if (!isRecord3(request2)) {
|
|
13428
|
+
throw invalid("Decisions.ask needs { state, questions } or (state, question)");
|
|
13429
|
+
}
|
|
13430
|
+
if (request2.state === void 0 || request2.state === null) {
|
|
13431
|
+
throw invalid("Decisions.ask needs a state");
|
|
13432
|
+
}
|
|
13433
|
+
if (!isRecord3(request2.questions) || Object.keys(request2.questions).length === 0) {
|
|
13434
|
+
throw invalid("Decisions.ask needs at least one question in questions");
|
|
13435
|
+
}
|
|
13436
|
+
for (const [name, question] of Object.entries(request2.questions)) assertDecisionQuestion(name, question);
|
|
13437
|
+
return request2;
|
|
13438
|
+
}
|
|
13439
|
+
function checkDecisionRunRequest(request2) {
|
|
13440
|
+
if (typeof request2.name !== "string" || !DECISION_NAME_PATTERN.test(request2.name)) {
|
|
13441
|
+
throw invalid("Decisions.run needs the name of a decision declared on the agent");
|
|
13442
|
+
}
|
|
13443
|
+
if (request2.state === void 0 || request2.state === null) {
|
|
13444
|
+
throw invalid("Decisions.run needs a state");
|
|
13445
|
+
}
|
|
13446
|
+
return request2;
|
|
13447
|
+
}
|
|
13448
|
+
function toDecisionError(caught) {
|
|
13449
|
+
if (caught instanceof DecisionError) return caught;
|
|
13450
|
+
const raw = isRecord3(caught) ? caught : {};
|
|
13451
|
+
const detail = typeof raw.message === "string" && raw.message.length > 0 ? raw.message : "Decision failed";
|
|
13452
|
+
const code = typeof raw.code === "string" && raw.code.length > 0 ? raw.code : DECISION_ERROR_CODES.UNAVAILABLE;
|
|
13453
|
+
const message = detail.startsWith(`${code}: `) ? detail : `${code}: ${detail}`;
|
|
13454
|
+
return new DecisionError(message, {
|
|
13455
|
+
code,
|
|
13456
|
+
...isProvider(raw.provider) && {
|
|
13457
|
+
provider: raw.provider
|
|
13458
|
+
},
|
|
13459
|
+
...typeof raw.upstreamStatus === "number" && {
|
|
13460
|
+
upstreamStatus: raw.upstreamStatus
|
|
13461
|
+
},
|
|
13462
|
+
...typeof raw.decisionId === "string" && {
|
|
13463
|
+
decisionId: raw.decisionId
|
|
13464
|
+
}
|
|
13465
|
+
});
|
|
13466
|
+
}
|
|
13467
|
+
function buildDecisionsApi(transport) {
|
|
13468
|
+
async function relay2(send) {
|
|
13469
|
+
if (!transport) {
|
|
13470
|
+
throw new DecisionError("Decisions is not available in this runtime", {
|
|
13471
|
+
code: DECISION_ERROR_CODES.UNAVAILABLE
|
|
13472
|
+
});
|
|
13473
|
+
}
|
|
13474
|
+
try {
|
|
13475
|
+
return await send(transport);
|
|
13476
|
+
} catch (caught) {
|
|
13477
|
+
throw toDecisionError(caught);
|
|
13478
|
+
}
|
|
13479
|
+
}
|
|
13480
|
+
__name(relay2, "relay");
|
|
13481
|
+
__name4(relay2, "relay");
|
|
13482
|
+
async function ask(requestOrState, question, options) {
|
|
13483
|
+
if (question === void 0) {
|
|
13484
|
+
const request22 = checkDecisionRequest(requestOrState);
|
|
13485
|
+
return relay2((t) => t.ask(request22));
|
|
13486
|
+
}
|
|
13487
|
+
const request2 = checkDecisionRequest({
|
|
13488
|
+
...options,
|
|
13489
|
+
state: requestOrState,
|
|
13490
|
+
questions: {
|
|
13491
|
+
[SINGLE_DECISION_KEY]: question
|
|
13492
|
+
}
|
|
13493
|
+
});
|
|
13494
|
+
const result = await relay2((t) => t.ask(request2));
|
|
13495
|
+
return result.answers[SINGLE_DECISION_KEY];
|
|
13496
|
+
}
|
|
13497
|
+
__name(ask, "ask");
|
|
13498
|
+
__name4(ask, "ask");
|
|
13499
|
+
async function run(name, state3, options) {
|
|
13500
|
+
const request2 = checkDecisionRunRequest({
|
|
13501
|
+
...options,
|
|
13502
|
+
name,
|
|
13503
|
+
state: state3
|
|
13504
|
+
});
|
|
13505
|
+
return await relay2((t) => t.run(request2));
|
|
13506
|
+
}
|
|
13507
|
+
__name(run, "run");
|
|
13508
|
+
__name4(run, "run");
|
|
13509
|
+
return {
|
|
13510
|
+
ask,
|
|
13511
|
+
run,
|
|
13512
|
+
odds,
|
|
13513
|
+
choice,
|
|
13514
|
+
score
|
|
13515
|
+
};
|
|
13516
|
+
}
|
|
13517
|
+
var __defProp4, __name4, DECISION_ERROR_NAME, SINGLE_DECISION_KEY, DecisionError;
|
|
13518
|
+
var init_decisions_api = __esm({
|
|
13519
|
+
"../sandbox-runtime/dist/decisions-api.mjs"() {
|
|
13520
|
+
"use strict";
|
|
13521
|
+
init_dist();
|
|
13522
|
+
__defProp4 = Object.defineProperty;
|
|
13523
|
+
__name4 = /* @__PURE__ */ __name((target, value3) => __defProp4(target, "name", { value: value3, configurable: true }), "__name");
|
|
13524
|
+
DECISION_ERROR_NAME = "DecisionError";
|
|
13525
|
+
SINGLE_DECISION_KEY = "answer";
|
|
13526
|
+
DecisionError = class extends Error {
|
|
13527
|
+
static {
|
|
13528
|
+
__name(this, "DecisionError");
|
|
13529
|
+
}
|
|
13530
|
+
static {
|
|
13531
|
+
__name4(this, "DecisionError");
|
|
13532
|
+
}
|
|
13533
|
+
code;
|
|
13534
|
+
constructor(message, fields) {
|
|
13535
|
+
super(message);
|
|
13536
|
+
this.name = DECISION_ERROR_NAME;
|
|
13537
|
+
this.code = fields.code;
|
|
13538
|
+
if (fields.provider !== void 0) this.provider = fields.provider;
|
|
13539
|
+
if (fields.upstreamStatus !== void 0) this.upstreamStatus = fields.upstreamStatus;
|
|
13540
|
+
if (fields.decisionId !== void 0) this.decisionId = fields.decisionId;
|
|
13541
|
+
}
|
|
13542
|
+
};
|
|
13543
|
+
__name(isRecord3, "isRecord");
|
|
13544
|
+
__name4(isRecord3, "isRecord");
|
|
13545
|
+
__name(isProvider, "isProvider");
|
|
13546
|
+
__name4(isProvider, "isProvider");
|
|
13547
|
+
__name(invalid, "invalid");
|
|
13548
|
+
__name4(invalid, "invalid");
|
|
13549
|
+
__name(assertInstructions, "assertInstructions");
|
|
13550
|
+
__name4(assertInstructions, "assertInstructions");
|
|
13551
|
+
__name(assertCount, "assertCount");
|
|
13552
|
+
__name4(assertCount, "assertCount");
|
|
13553
|
+
__name(odds, "odds");
|
|
13554
|
+
__name4(odds, "odds");
|
|
13555
|
+
__name(choice, "choice");
|
|
13556
|
+
__name4(choice, "choice");
|
|
13557
|
+
__name(score, "score");
|
|
13558
|
+
__name4(score, "score");
|
|
13559
|
+
__name(assertDecisionQuestion, "assertDecisionQuestion");
|
|
13560
|
+
__name4(assertDecisionQuestion, "assertDecisionQuestion");
|
|
13561
|
+
__name(checkDecisionRequest, "checkDecisionRequest");
|
|
13562
|
+
__name4(checkDecisionRequest, "checkDecisionRequest");
|
|
13563
|
+
__name(checkDecisionRunRequest, "checkDecisionRunRequest");
|
|
13564
|
+
__name4(checkDecisionRunRequest, "checkDecisionRunRequest");
|
|
13565
|
+
__name(toDecisionError, "toDecisionError");
|
|
13566
|
+
__name4(toDecisionError, "toDecisionError");
|
|
13567
|
+
__name(buildDecisionsApi, "buildDecisionsApi");
|
|
13568
|
+
__name4(buildDecisionsApi, "buildDecisionsApi");
|
|
13569
|
+
}
|
|
13570
|
+
});
|
|
13571
|
+
|
|
13332
13572
|
// src/errors/cli.error.ts
|
|
13333
13573
|
function apiErrorDetail(error) {
|
|
13334
13574
|
return {
|
|
@@ -13459,6 +13699,41 @@ function numericStatus(error) {
|
|
|
13459
13699
|
const candidate = error.statusCode ?? error.status;
|
|
13460
13700
|
return typeof candidate === "number" && Number.isFinite(candidate) ? candidate : void 0;
|
|
13461
13701
|
}
|
|
13702
|
+
function statusClass(status) {
|
|
13703
|
+
if (status === 401) return {
|
|
13704
|
+
code: "auth",
|
|
13705
|
+
exitCode: CLI_EXIT.AUTH
|
|
13706
|
+
};
|
|
13707
|
+
if (status === 403) return {
|
|
13708
|
+
code: "forbidden",
|
|
13709
|
+
exitCode: CLI_EXIT.FORBIDDEN
|
|
13710
|
+
};
|
|
13711
|
+
if (status === 404) return {
|
|
13712
|
+
code: "not_found",
|
|
13713
|
+
exitCode: CLI_EXIT.NOT_FOUND
|
|
13714
|
+
};
|
|
13715
|
+
if (status >= 400 && status < 500) return {
|
|
13716
|
+
code: `http_${status}`,
|
|
13717
|
+
exitCode: CLI_EXIT.FORBIDDEN
|
|
13718
|
+
};
|
|
13719
|
+
if (status >= 500 || status === 0) return {
|
|
13720
|
+
code: "unavailable",
|
|
13721
|
+
exitCode: CLI_EXIT.UNAVAILABLE
|
|
13722
|
+
};
|
|
13723
|
+
return void 0;
|
|
13724
|
+
}
|
|
13725
|
+
function decisionErrorClass(error, message) {
|
|
13726
|
+
if (error.name !== DECISION_ERROR_NAME || typeof error.code !== "string" || error.code.length === 0) return void 0;
|
|
13727
|
+
const status = Object.hasOwn(DECISION_STATUS, error.code) ? DECISION_STATUS[error.code] : void 0;
|
|
13728
|
+
return {
|
|
13729
|
+
code: error.code,
|
|
13730
|
+
exitCode: (status === void 0 ? void 0 : statusClass(status)?.exitCode) ?? CLI_EXIT.ERROR,
|
|
13731
|
+
message,
|
|
13732
|
+
...typeof error.decisionId === "string" && error.decisionId.length > 0 ? {
|
|
13733
|
+
decisionId: error.decisionId
|
|
13734
|
+
} : {}
|
|
13735
|
+
};
|
|
13736
|
+
}
|
|
13462
13737
|
function classifyCliError(error) {
|
|
13463
13738
|
if (CliError.isCliError(error)) {
|
|
13464
13739
|
return {
|
|
@@ -13488,40 +13763,15 @@ function classifyCliError(error) {
|
|
|
13488
13763
|
message
|
|
13489
13764
|
};
|
|
13490
13765
|
}
|
|
13766
|
+
const decision = decisionErrorClass(e, message);
|
|
13767
|
+
if (decision) return decision;
|
|
13491
13768
|
const status = numericStatus(e);
|
|
13492
|
-
|
|
13493
|
-
|
|
13494
|
-
|
|
13495
|
-
|
|
13496
|
-
|
|
13497
|
-
|
|
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
|
-
}
|
|
13769
|
+
const byStatus = status === void 0 ? void 0 : statusClass(status);
|
|
13770
|
+
if (byStatus) return {
|
|
13771
|
+
...byStatus,
|
|
13772
|
+
message,
|
|
13773
|
+
statusCode: status
|
|
13774
|
+
};
|
|
13525
13775
|
const causeCode = e.cause?.code;
|
|
13526
13776
|
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
13777
|
return {
|
|
@@ -13560,20 +13810,26 @@ function renderCliError(reported, options = {}) {
|
|
|
13560
13810
|
if (options.stack) lines.push("", options.stack);
|
|
13561
13811
|
return lines;
|
|
13562
13812
|
}
|
|
13563
|
-
function
|
|
13813
|
+
function cliErrorDetail(error) {
|
|
13564
13814
|
const reported = classifyCliError(error);
|
|
13815
|
+
return {
|
|
13816
|
+
code: reported.serverCode ?? reported.code,
|
|
13817
|
+
...reported.statusCode !== void 0 ? {
|
|
13818
|
+
statusCode: reported.statusCode
|
|
13819
|
+
} : {},
|
|
13820
|
+
message: reported.message,
|
|
13821
|
+
...reported.issues?.length ? {
|
|
13822
|
+
issues: reported.issues
|
|
13823
|
+
} : {},
|
|
13824
|
+
...reported.decisionId ? {
|
|
13825
|
+
decisionId: reported.decisionId
|
|
13826
|
+
} : {}
|
|
13827
|
+
};
|
|
13828
|
+
}
|
|
13829
|
+
function cliErrorEnvelope(error) {
|
|
13565
13830
|
return {
|
|
13566
13831
|
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
|
-
}
|
|
13832
|
+
error: cliErrorDetail(error)
|
|
13577
13833
|
};
|
|
13578
13834
|
}
|
|
13579
13835
|
function reportCliError(error, options = {}) {
|
|
@@ -13612,10 +13868,12 @@ function reportUnhandledCliError(error) {
|
|
|
13612
13868
|
process.exitCode = reported.exitCode;
|
|
13613
13869
|
return reported.exitCode;
|
|
13614
13870
|
}
|
|
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;
|
|
13871
|
+
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, DECISION_STATUS, CLI_EXIT_CODE_HELP;
|
|
13616
13872
|
var init_cli_error = __esm({
|
|
13617
13873
|
"src/errors/cli.error.ts"() {
|
|
13618
13874
|
"use strict";
|
|
13875
|
+
init_dist();
|
|
13876
|
+
init_decisions_api();
|
|
13619
13877
|
init_auth_error();
|
|
13620
13878
|
CLI_EXIT = {
|
|
13621
13879
|
OK: 0,
|
|
@@ -13792,9 +14050,22 @@ var init_cli_error = __esm({
|
|
|
13792
14050
|
__name(providerRejectedHint, "providerRejectedHint");
|
|
13793
14051
|
__name(authHint, "authHint");
|
|
13794
14052
|
__name(numericStatus, "numericStatus");
|
|
14053
|
+
__name(statusClass, "statusClass");
|
|
14054
|
+
DECISION_STATUS = {
|
|
14055
|
+
[DECISION_ERROR_CODES.INVALID]: 400,
|
|
14056
|
+
[DECISION_ERROR_CODES.INSUFFICIENT_CREDITS]: 402,
|
|
14057
|
+
[DECISION_ERROR_CODES.NOT_FOUND]: 404,
|
|
14058
|
+
[DECISION_ERROR_CODES.REJECTED]: 422,
|
|
14059
|
+
[DECISION_ERROR_CODES.TIMEOUT]: 503,
|
|
14060
|
+
[DECISION_ERROR_CODES.UNAVAILABLE]: 503,
|
|
14061
|
+
[DECISION_ERROR_CODES.DISABLED]: 503,
|
|
14062
|
+
[DECISION_ERROR_CODES.CANCELLED]: 400
|
|
14063
|
+
};
|
|
14064
|
+
__name(decisionErrorClass, "decisionErrorClass");
|
|
13795
14065
|
__name(classifyCliError, "classifyCliError");
|
|
13796
14066
|
__name(issueLines, "issueLines");
|
|
13797
14067
|
__name(renderCliError, "renderCliError");
|
|
14068
|
+
__name(cliErrorDetail, "cliErrorDetail");
|
|
13798
14069
|
__name(cliErrorEnvelope, "cliErrorEnvelope");
|
|
13799
14070
|
__name(reportCliError, "reportCliError");
|
|
13800
14071
|
__name(commanderExitCode, "commanderExitCode");
|
|
@@ -14832,12 +15103,12 @@ function renderWorkflowJobTarget(target, initData) {
|
|
|
14832
15103
|
templated: true
|
|
14833
15104
|
};
|
|
14834
15105
|
}
|
|
14835
|
-
var
|
|
15106
|
+
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
15107
|
var init_workflow_job_tools = __esm({
|
|
14837
15108
|
"../shared-types/dist/workflow-job-tools.mjs"() {
|
|
14838
15109
|
"use strict";
|
|
14839
|
-
|
|
14840
|
-
|
|
15110
|
+
__defProp5 = Object.defineProperty;
|
|
15111
|
+
__name5 = /* @__PURE__ */ __name((target, value3) => __defProp5(target, "name", { value: value3, configurable: true }), "__name");
|
|
14841
15112
|
WORKFLOW_JOB_TOOLS = [
|
|
14842
15113
|
"shell",
|
|
14843
15114
|
"read",
|
|
@@ -14866,34 +15137,34 @@ var init_workflow_job_tools = __esm({
|
|
|
14866
15137
|
"git"
|
|
14867
15138
|
];
|
|
14868
15139
|
__name(effectiveJobTools, "effectiveJobTools");
|
|
14869
|
-
|
|
15140
|
+
__name5(effectiveJobTools, "effectiveJobTools");
|
|
14870
15141
|
WORKFLOW_JOB_PLUGINS = [
|
|
14871
15142
|
"lua-agent-builder"
|
|
14872
15143
|
];
|
|
14873
15144
|
WORKFLOW_JOB_PLUGIN_ROOT = "/opt/lua/plugins";
|
|
14874
15145
|
WORKFLOW_JOB_PLUGINS_MAX = 4;
|
|
14875
15146
|
__name(isWorkflowJobPluginId, "isWorkflowJobPluginId");
|
|
14876
|
-
|
|
15147
|
+
__name5(isWorkflowJobPluginId, "isWorkflowJobPluginId");
|
|
14877
15148
|
__name(workflowJobPluginDir, "workflowJobPluginDir");
|
|
14878
|
-
|
|
15149
|
+
__name5(workflowJobPluginDir, "workflowJobPluginDir");
|
|
14879
15150
|
__name(workflowJobPluginsProblem, "workflowJobPluginsProblem");
|
|
14880
|
-
|
|
15151
|
+
__name5(workflowJobPluginsProblem, "workflowJobPluginsProblem");
|
|
14881
15152
|
WORKFLOW_JOB_TARGET_TEMPLATE_RE = /^\$\{\s*initData\.([A-Za-z0-9_.\-[\]]+)\s*\}$/;
|
|
14882
15153
|
TARGET_PATH_SEGMENT_RE = /^[A-Za-z0-9_-]+(?:\[(?:0|[1-9]\d*)\])*$/;
|
|
14883
15154
|
__name(workflowJobTargetTemplatePath, "workflowJobTargetTemplatePath");
|
|
14884
|
-
|
|
15155
|
+
__name5(workflowJobTargetTemplatePath, "workflowJobTargetTemplatePath");
|
|
14885
15156
|
__name(isWorkflowJobTargetTemplate, "isWorkflowJobTargetTemplate");
|
|
14886
|
-
|
|
15157
|
+
__name5(isWorkflowJobTargetTemplate, "isWorkflowJobTargetTemplate");
|
|
14887
15158
|
__name(workflowJobLuaApiProblem, "workflowJobLuaApiProblem");
|
|
14888
|
-
|
|
15159
|
+
__name5(workflowJobLuaApiProblem, "workflowJobLuaApiProblem");
|
|
14889
15160
|
__name(workflowJobUsesLuaApi, "workflowJobUsesLuaApi");
|
|
14890
|
-
|
|
15161
|
+
__name5(workflowJobUsesLuaApi, "workflowJobUsesLuaApi");
|
|
14891
15162
|
__name(workflowJobTargetProblem, "workflowJobTargetProblem");
|
|
14892
|
-
|
|
15163
|
+
__name5(workflowJobTargetProblem, "workflowJobTargetProblem");
|
|
14893
15164
|
__name(readInitDataPath, "readInitDataPath");
|
|
14894
|
-
|
|
15165
|
+
__name5(readInitDataPath, "readInitDataPath");
|
|
14895
15166
|
__name(renderWorkflowJobTarget, "renderWorkflowJobTarget");
|
|
14896
|
-
|
|
15167
|
+
__name5(renderWorkflowJobTarget, "renderWorkflowJobTarget");
|
|
14897
15168
|
}
|
|
14898
15169
|
});
|
|
14899
15170
|
|
|
@@ -15001,7 +15272,7 @@ function isMapDescriptor(v) {
|
|
|
15001
15272
|
if (v === null || typeof v !== "object" || Array.isArray(v)) return false;
|
|
15002
15273
|
const d = v;
|
|
15003
15274
|
const keys = Object.keys(d);
|
|
15004
|
-
const only = /* @__PURE__ */
|
|
15275
|
+
const only = /* @__PURE__ */ __name6((...allowed2) => keys.every((k) => allowed2.includes(k)), "only");
|
|
15005
15276
|
if ("value" in d) return keys.length === 1;
|
|
15006
15277
|
if ("template" in d) return keys.length === 1 && typeof d.template === "string";
|
|
15007
15278
|
if ("requestContextPath" in d) return keys.length === 1 && typeof d.requestContextPath === "string";
|
|
@@ -15280,13 +15551,13 @@ function validateApproverBlock(node, opts = {
|
|
|
15280
15551
|
path: "approval"
|
|
15281
15552
|
}) {
|
|
15282
15553
|
const issues = [];
|
|
15283
|
-
const push = /* @__PURE__ */
|
|
15554
|
+
const push = /* @__PURE__ */ __name6((code, path32, message, severity = "error") => issues.push({
|
|
15284
15555
|
code,
|
|
15285
15556
|
path: path32,
|
|
15286
15557
|
severity,
|
|
15287
15558
|
message
|
|
15288
15559
|
}), "push");
|
|
15289
|
-
const checkSpec = /* @__PURE__ */
|
|
15560
|
+
const checkSpec = /* @__PURE__ */ __name6((spec, path32) => {
|
|
15290
15561
|
const r = ApproverSpecSchema.safeParse(spec);
|
|
15291
15562
|
if (!r.success) {
|
|
15292
15563
|
const users = spec?.users;
|
|
@@ -15641,7 +15912,7 @@ function validateLuaExtensions(g, caps = WORKFLOW_CAPS_DEFAULT, opts = {
|
|
|
15641
15912
|
static: true
|
|
15642
15913
|
}) {
|
|
15643
15914
|
const issues = [];
|
|
15644
|
-
const err = /* @__PURE__ */
|
|
15915
|
+
const err = /* @__PURE__ */ __name6((code, message, path32, stepId) => {
|
|
15645
15916
|
issues.push({
|
|
15646
15917
|
code,
|
|
15647
15918
|
message,
|
|
@@ -15650,7 +15921,7 @@ function validateLuaExtensions(g, caps = WORKFLOW_CAPS_DEFAULT, opts = {
|
|
|
15650
15921
|
stepId
|
|
15651
15922
|
});
|
|
15652
15923
|
}, "err");
|
|
15653
|
-
const warn = /* @__PURE__ */
|
|
15924
|
+
const warn = /* @__PURE__ */ __name6((code, message, path32, stepId) => {
|
|
15654
15925
|
issues.push({
|
|
15655
15926
|
code,
|
|
15656
15927
|
message,
|
|
@@ -15717,7 +15988,7 @@ function validateLuaExtensions(g, caps = WORKFLOW_CAPS_DEFAULT, opts = {
|
|
|
15717
15988
|
ownKeys.add(key);
|
|
15718
15989
|
declaredKeys.add(key);
|
|
15719
15990
|
});
|
|
15720
|
-
const undeclaredKey = /* @__PURE__ */
|
|
15991
|
+
const undeclaredKey = /* @__PURE__ */ __name6((ref) => typeof ref === "string" && !declaredKeys.has(ref) && isConnectionKeyShaped(ref) && opts.connectionIds?.has(ref) !== true, "undeclaredKey");
|
|
15721
15992
|
const credentialsRef = envelopeWorkspace?.credentialsRef;
|
|
15722
15993
|
if (undeclaredKey(credentialsRef)) {
|
|
15723
15994
|
err("connection-key-undeclared", connectionKeyUndeclaredMessage("workspace.credentialsRef", credentialsRef), "workspace.credentialsRef");
|
|
@@ -15725,7 +15996,7 @@ function validateLuaExtensions(g, caps = WORKFLOW_CAPS_DEFAULT, opts = {
|
|
|
15725
15996
|
const seen = /* @__PURE__ */ new Map();
|
|
15726
15997
|
let nodeCount = 0;
|
|
15727
15998
|
const upstream = /* @__PURE__ */ new Set();
|
|
15728
|
-
const checkId = /* @__PURE__ */
|
|
15999
|
+
const checkId = /* @__PURE__ */ __name6((id2, path32) => {
|
|
15729
16000
|
nodeCount += 1;
|
|
15730
16001
|
if (seen.has(id2)) {
|
|
15731
16002
|
err("duplicate-step-id", `step id "${id2}" is declared twice (first at ${seen.get(id2)})`, path32, id2);
|
|
@@ -15733,9 +16004,9 @@ function validateLuaExtensions(g, caps = WORKFLOW_CAPS_DEFAULT, opts = {
|
|
|
15733
16004
|
seen.set(id2, path32);
|
|
15734
16005
|
}
|
|
15735
16006
|
}, "checkId");
|
|
15736
|
-
const checkPolicyEnums = /* @__PURE__ */
|
|
16007
|
+
const checkPolicyEnums = /* @__PURE__ */ __name6((node, path32) => {
|
|
15737
16008
|
const id2 = singleId(node);
|
|
15738
|
-
const check = /* @__PURE__ */
|
|
16009
|
+
const check = /* @__PURE__ */ __name6((member, allowed2) => {
|
|
15739
16010
|
const value22 = node[member];
|
|
15740
16011
|
if (value22 === void 0 || typeof value22 === "string" && allowed2.includes(value22)) return;
|
|
15741
16012
|
err("invalid-envelope", `\`${member}\` must be ${allowed2.map((a) => `'${a}'`).join(" | ")} (got ${JSON.stringify(value22)})`, `${path32}.${member}`, id2);
|
|
@@ -15743,7 +16014,7 @@ function validateLuaExtensions(g, caps = WORKFLOW_CAPS_DEFAULT, opts = {
|
|
|
15743
16014
|
check("sideEffects", WORKFLOW_SIDE_EFFECTS);
|
|
15744
16015
|
check("jobResources", WORKFLOW_JOB_RESOURCES);
|
|
15745
16016
|
}, "checkPolicyEnums");
|
|
15746
|
-
const checkRetry = /* @__PURE__ */
|
|
16017
|
+
const checkRetry = /* @__PURE__ */ __name6((node, path32) => {
|
|
15747
16018
|
const r = node.retry;
|
|
15748
16019
|
if (!r) return;
|
|
15749
16020
|
const id2 = singleId(node);
|
|
@@ -15769,7 +16040,7 @@ function validateLuaExtensions(g, caps = WORKFLOW_CAPS_DEFAULT, opts = {
|
|
|
15769
16040
|
}
|
|
15770
16041
|
}
|
|
15771
16042
|
}, "checkRetry");
|
|
15772
|
-
const checkTimeout = /* @__PURE__ */
|
|
16043
|
+
const checkTimeout = /* @__PURE__ */ __name6((node, path32) => {
|
|
15773
16044
|
const t = node.timeoutSeconds;
|
|
15774
16045
|
if (t === void 0) return;
|
|
15775
16046
|
const id2 = singleId(node);
|
|
@@ -15788,7 +16059,7 @@ function validateLuaExtensions(g, caps = WORKFLOW_CAPS_DEFAULT, opts = {
|
|
|
15788
16059
|
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
16060
|
}
|
|
15790
16061
|
}, "checkTimeout");
|
|
15791
|
-
const checkSpecialistRole = /* @__PURE__ */
|
|
16062
|
+
const checkSpecialistRole = /* @__PURE__ */ __name6((node, path32) => {
|
|
15792
16063
|
const role = node.role;
|
|
15793
16064
|
const hasRef = typeof role.ref === "string";
|
|
15794
16065
|
const hasInline = role.name !== void 0 || role.instructions !== void 0 || Array.isArray(role.tools) && role.tools.length > 0;
|
|
@@ -15820,7 +16091,7 @@ function validateLuaExtensions(g, caps = WORKFLOW_CAPS_DEFAULT, opts = {
|
|
|
15820
16091
|
}
|
|
15821
16092
|
}
|
|
15822
16093
|
}, "checkSpecialistRole");
|
|
15823
|
-
const checkRequiredConnections = /* @__PURE__ */
|
|
16094
|
+
const checkRequiredConnections = /* @__PURE__ */ __name6((node, path32) => {
|
|
15824
16095
|
const required = node.requiredConnections;
|
|
15825
16096
|
if (!Array.isArray(required)) return;
|
|
15826
16097
|
const undeclared = required.filter(undeclaredKey);
|
|
@@ -15833,7 +16104,7 @@ function validateLuaExtensions(g, caps = WORKFLOW_CAPS_DEFAULT, opts = {
|
|
|
15833
16104
|
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
16105
|
}
|
|
15835
16106
|
}, "checkRequiredConnections");
|
|
15836
|
-
const jobClassifiablePin = /* @__PURE__ */
|
|
16107
|
+
const jobClassifiablePin = /* @__PURE__ */ __name6((model) => {
|
|
15837
16108
|
const pin = staticModelPin(model);
|
|
15838
16109
|
const modelClass = modelClassOf(pin);
|
|
15839
16110
|
if (modelClass === void 0) return pin;
|
|
@@ -15848,7 +16119,7 @@ function validateLuaExtensions(g, caps = WORKFLOW_CAPS_DEFAULT, opts = {
|
|
|
15848
16119
|
}
|
|
15849
16120
|
return void 0;
|
|
15850
16121
|
}, "jobClassifiablePin");
|
|
15851
|
-
const checkTier = /* @__PURE__ */
|
|
16122
|
+
const checkTier = /* @__PURE__ */ __name6((node, path32) => {
|
|
15852
16123
|
const id2 = singleId(node);
|
|
15853
16124
|
if (node.workspace && node.workspace !== "inherit" && node.tier !== void 0 && node.tier !== "job") {
|
|
15854
16125
|
err("workspace-requires-job-tier", "a step mounting a workspace must be tier:'job'", `${path32}.workspace`, id2);
|
|
@@ -15864,7 +16135,7 @@ function validateLuaExtensions(g, caps = WORKFLOW_CAPS_DEFAULT, opts = {
|
|
|
15864
16135
|
err("job-tier-provider-unsupported", `model provider '${provider}' is outside LUA_WF_JOB_PROVIDERS [${opts.policy.jobProviders.join(", ")}]`, `${path32}.model`, id2);
|
|
15865
16136
|
}
|
|
15866
16137
|
}, "checkTier");
|
|
15867
|
-
const checkModel = /* @__PURE__ */
|
|
16138
|
+
const checkModel = /* @__PURE__ */ __name6((node, path32) => {
|
|
15868
16139
|
if (node.type !== "agent" || typeof node.model !== "string") return;
|
|
15869
16140
|
const id2 = singleId(node);
|
|
15870
16141
|
const parsed = parseModelTemplate(node.model);
|
|
@@ -15881,7 +16152,7 @@ function validateLuaExtensions(g, caps = WORKFLOW_CAPS_DEFAULT, opts = {
|
|
|
15881
16152
|
const pin = parsed.kind === "template" ? parsed.template.default : node.model;
|
|
15882
16153
|
if (pin === void 0) return;
|
|
15883
16154
|
if (isModelClassRef(pin)) return;
|
|
15884
|
-
const inContext = /* @__PURE__ */
|
|
16155
|
+
const inContext = /* @__PURE__ */ __name6((message) => parsed.kind === "template" ? `${message} (the default of ${parsed.template.placeholder})` : message, "inContext");
|
|
15885
16156
|
const registry = opts.approvedModels;
|
|
15886
16157
|
if (registry === void 0) return;
|
|
15887
16158
|
if (registry === "unavailable") {
|
|
@@ -15894,13 +16165,13 @@ function validateLuaExtensions(g, caps = WORKFLOW_CAPS_DEFAULT, opts = {
|
|
|
15894
16165
|
const resolved2 = normalizeModelId(pin, registry);
|
|
15895
16166
|
if (!resolved2.ok) err("model-unresolved", inContext(modelUnresolvedMessage(resolved2)), `${path32}.model`, id2);
|
|
15896
16167
|
}, "checkModel");
|
|
15897
|
-
const checkTaskClass = /* @__PURE__ */
|
|
16168
|
+
const checkTaskClass = /* @__PURE__ */ __name6((node, path32) => {
|
|
15898
16169
|
if (node.type !== "agent" || node.taskClass === void 0) return;
|
|
15899
16170
|
if (!opts.static) return;
|
|
15900
16171
|
if (typeof node.model === "string" && node.model.trim()) return;
|
|
15901
16172
|
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
16173
|
}, "checkTaskClass");
|
|
15903
|
-
const checkWorkspace = /* @__PURE__ */
|
|
16174
|
+
const checkWorkspace = /* @__PURE__ */ __name6((node, path32) => {
|
|
15904
16175
|
const id2 = singleId(node);
|
|
15905
16176
|
const ws = workspaceOf(node);
|
|
15906
16177
|
if (isJobTier(node) && opts.policy && opts.policy.jobTier !== true) {
|
|
@@ -15970,16 +16241,16 @@ function validateLuaExtensions(g, caps = WORKFLOW_CAPS_DEFAULT, opts = {
|
|
|
15970
16241
|
}
|
|
15971
16242
|
}, "checkWorkspace");
|
|
15972
16243
|
const outputSchemas = /* @__PURE__ */ new Map();
|
|
15973
|
-
const recordOutputSchema = /* @__PURE__ */
|
|
16244
|
+
const recordOutputSchema = /* @__PURE__ */ __name6((node) => {
|
|
15974
16245
|
const schema = node.type === "step" ? node.step.outputSchema : node.type === "agent" ? node.outputSchema : void 0;
|
|
15975
16246
|
if (schema !== void 0) outputSchemas.set(singleId(node), schema);
|
|
15976
16247
|
}, "recordOutputSchema");
|
|
15977
|
-
const checkMapMembers = /* @__PURE__ */
|
|
16248
|
+
const checkMapMembers = /* @__PURE__ */ __name6((cfg, basePath, id2) => {
|
|
15978
16249
|
for (const m of malformedMapMembers(cfg)) {
|
|
15979
16250
|
warn(MAP_MEMBER_MALFORMED_CODE, mapMemberMalformedMessage(id2, m), `${basePath}.${m.member}`, id2);
|
|
15980
16251
|
}
|
|
15981
16252
|
}, "checkMapMembers");
|
|
15982
|
-
const checkInputShape = /* @__PURE__ */
|
|
16253
|
+
const checkInputShape = /* @__PURE__ */ __name6((node, path32) => {
|
|
15983
16254
|
const input = node.input;
|
|
15984
16255
|
if (input === void 0) return;
|
|
15985
16256
|
const id2 = singleId(node);
|
|
@@ -15989,11 +16260,11 @@ function validateLuaExtensions(g, caps = WORKFLOW_CAPS_DEFAULT, opts = {
|
|
|
15989
16260
|
}
|
|
15990
16261
|
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
16262
|
}, "checkInputShape");
|
|
15992
|
-
const checkBodyInput = /* @__PURE__ */
|
|
16263
|
+
const checkBodyInput = /* @__PURE__ */ __name6((body, path32, container) => {
|
|
15993
16264
|
if (body.type === "workflow" || body.input === void 0) return;
|
|
15994
16265
|
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
16266
|
}, "checkBodyInput");
|
|
15996
|
-
const checkSingle = /* @__PURE__ */
|
|
16267
|
+
const checkSingle = /* @__PURE__ */ __name6((node, path32, depth) => {
|
|
15997
16268
|
recordOutputSchema(node);
|
|
15998
16269
|
if (node.type === "workflow" && (typeof node.workflowId !== "string" || node.workflowId.length === 0)) {
|
|
15999
16270
|
checkId(node.id, path32);
|
|
@@ -16043,7 +16314,7 @@ function validateLuaExtensions(g, caps = WORKFLOW_CAPS_DEFAULT, opts = {
|
|
|
16043
16314
|
}
|
|
16044
16315
|
}
|
|
16045
16316
|
}, "checkSingle");
|
|
16046
|
-
const checkHitl = /* @__PURE__ */
|
|
16317
|
+
const checkHitl = /* @__PURE__ */ __name6((node, path32) => {
|
|
16047
16318
|
if (node.type === "waitForSignal") {
|
|
16048
16319
|
const w = node;
|
|
16049
16320
|
checkId(w.id, path32);
|
|
@@ -16089,7 +16360,7 @@ function validateLuaExtensions(g, caps = WORKFLOW_CAPS_DEFAULT, opts = {
|
|
|
16089
16360
|
}
|
|
16090
16361
|
}
|
|
16091
16362
|
}, "checkHitl");
|
|
16092
|
-
const checkHitlArm = /* @__PURE__ */
|
|
16363
|
+
const checkHitlArm = /* @__PURE__ */ __name6((node, path32, container) => {
|
|
16093
16364
|
if (!workflowContainerRunsHitlArm(container)) {
|
|
16094
16365
|
checkId(node.id, path32);
|
|
16095
16366
|
err("node-type-unsupported-in-container", workflowHitlArmUnsupportedMessage(node.type, node.id, container), path32, node.id);
|
|
@@ -16097,7 +16368,7 @@ function validateLuaExtensions(g, caps = WORKFLOW_CAPS_DEFAULT, opts = {
|
|
|
16097
16368
|
}
|
|
16098
16369
|
checkHitl(node, path32);
|
|
16099
16370
|
}, "checkHitlArm");
|
|
16100
|
-
const checkArm = /* @__PURE__ */
|
|
16371
|
+
const checkArm = /* @__PURE__ */ __name6((arm, path32, depth, container) => {
|
|
16101
16372
|
if (arm.type === "mapping") {
|
|
16102
16373
|
checkId(arm.id, path32);
|
|
16103
16374
|
checkMapMembers(readMapConfig(arm.mapConfig), `${path32}.mapConfig`, arm.id);
|
|
@@ -16333,7 +16604,7 @@ function isWellFormedPredicate(p) {
|
|
|
16333
16604
|
}
|
|
16334
16605
|
function canonicalJson(value22) {
|
|
16335
16606
|
const seen = /* @__PURE__ */ new WeakSet();
|
|
16336
|
-
const encode = /* @__PURE__ */
|
|
16607
|
+
const encode = /* @__PURE__ */ __name6((v) => {
|
|
16337
16608
|
if (v === null || typeof v === "number" || typeof v === "boolean") return JSON.stringify(v);
|
|
16338
16609
|
if (typeof v === "string") return JSON.stringify(v);
|
|
16339
16610
|
if (typeof v === "bigint") return JSON.stringify(`${v}n`);
|
|
@@ -16360,7 +16631,7 @@ function hashGraph(g) {
|
|
|
16360
16631
|
function compilePlan(g) {
|
|
16361
16632
|
const steps = {};
|
|
16362
16633
|
const order = [];
|
|
16363
|
-
const addNode = /* @__PURE__ */
|
|
16634
|
+
const addNode = /* @__PURE__ */ __name6((id2, node) => {
|
|
16364
16635
|
if (id2 in steps) {
|
|
16365
16636
|
throw new WorkflowPlanError("duplicate-step-id", `Duplicate step id "${id2}" in definition.graph`);
|
|
16366
16637
|
}
|
|
@@ -16690,7 +16961,7 @@ function renderRef(ref) {
|
|
|
16690
16961
|
function step(s) {
|
|
16691
16962
|
const id2 = stepIdOf(s);
|
|
16692
16963
|
return {
|
|
16693
|
-
path: /* @__PURE__ */
|
|
16964
|
+
path: /* @__PURE__ */ __name6((p) => ({
|
|
16694
16965
|
path: p === "" ? `stepResults.${id2}` : `stepResults.${id2}.${p}`
|
|
16695
16966
|
}), "path")
|
|
16696
16967
|
};
|
|
@@ -16778,7 +17049,7 @@ function resolvePlacements(calls) {
|
|
|
16778
17049
|
const declared = /* @__PURE__ */ new Map();
|
|
16779
17050
|
const placedBy = /* @__PURE__ */ new Map();
|
|
16780
17051
|
const allIds = /* @__PURE__ */ new Map();
|
|
16781
|
-
const claimId = /* @__PURE__ */
|
|
17052
|
+
const claimId = /* @__PURE__ */ __name6((id2, callIndex) => {
|
|
16782
17053
|
const first = allIds.get(id2);
|
|
16783
17054
|
if (first !== void 0 && first !== callIndex) {
|
|
16784
17055
|
issues.push({
|
|
@@ -16818,7 +17089,7 @@ function resolvePlacements(calls) {
|
|
|
16818
17089
|
break;
|
|
16819
17090
|
}
|
|
16820
17091
|
});
|
|
16821
|
-
const armMapPlacementIssue = /* @__PURE__ */
|
|
17092
|
+
const armMapPlacementIssue = /* @__PURE__ */ __name6((node, ref, i, container) => {
|
|
16822
17093
|
if (!ref.armMap || node.type === "mapping" || isHitlNode2(node)) return void 0;
|
|
16823
17094
|
const id2 = nodeIdOf(node);
|
|
16824
17095
|
if ((container === "foreach" || container === "loop") && node.type !== "workflow") {
|
|
@@ -16839,7 +17110,7 @@ function resolvePlacements(calls) {
|
|
|
16839
17110
|
}
|
|
16840
17111
|
return void 0;
|
|
16841
17112
|
}, "armMapPlacementIssue");
|
|
16842
|
-
const hitlPlacementIssue = /* @__PURE__ */
|
|
17113
|
+
const hitlPlacementIssue = /* @__PURE__ */ __name6((node, ref, i, container) => {
|
|
16843
17114
|
if (!isHitlNode2(node)) return void 0;
|
|
16844
17115
|
const id2 = node.id;
|
|
16845
17116
|
if (ref.armMap) {
|
|
@@ -16860,7 +17131,7 @@ function resolvePlacements(calls) {
|
|
|
16860
17131
|
}
|
|
16861
17132
|
return void 0;
|
|
16862
17133
|
}, "hitlPlacementIssue");
|
|
16863
|
-
const resolve7 = /* @__PURE__ */
|
|
17134
|
+
const resolve7 = /* @__PURE__ */ __name6((ref, i, allowMapping, container) => {
|
|
16864
17135
|
if ("node" in ref) {
|
|
16865
17136
|
if (ref.node.type === "mapping" && !allowMapping) {
|
|
16866
17137
|
issues.push({
|
|
@@ -16915,7 +17186,7 @@ function resolvePlacements(calls) {
|
|
|
16915
17186
|
placedBy.set(ref.ref, i);
|
|
16916
17187
|
return d.node;
|
|
16917
17188
|
}, "resolve");
|
|
16918
|
-
const claim = /* @__PURE__ */
|
|
17189
|
+
const claim = /* @__PURE__ */ __name6((ref, i, allowMapping, container) => {
|
|
16919
17190
|
if ("ref" in ref) {
|
|
16920
17191
|
resolve7(ref, i, allowMapping, container);
|
|
16921
17192
|
return;
|
|
@@ -16950,7 +17221,7 @@ function resolvePlacements(calls) {
|
|
|
16950
17221
|
}
|
|
16951
17222
|
});
|
|
16952
17223
|
const graph = [];
|
|
16953
|
-
const lookup = /* @__PURE__ */
|
|
17224
|
+
const lookup = /* @__PURE__ */ __name6((ref) => {
|
|
16954
17225
|
const n2 = "node" in ref ? ref.node : declared.get(ref.ref)?.node;
|
|
16955
17226
|
if (!n2 || !ref.armMap || n2.type === "mapping" || isHitlNode2(n2)) return n2;
|
|
16956
17227
|
return inlineContainerArm(ref.armMap, n2);
|
|
@@ -17093,11 +17364,11 @@ function seedLedgerFromRun(run, steps, targetPlan, opts = {}) {
|
|
|
17093
17364
|
const seeded = [];
|
|
17094
17365
|
const unseeded = [];
|
|
17095
17366
|
const known = new Set(Object.keys(targetPlan.steps));
|
|
17096
|
-
const parentOf = /* @__PURE__ */
|
|
17367
|
+
const parentOf = /* @__PURE__ */ __name6((id2) => {
|
|
17097
17368
|
const m = /^(.*)(\[\d+\]|#\d+)$/.exec(id2);
|
|
17098
17369
|
return m ? m[1] : void 0;
|
|
17099
17370
|
}, "parentOf");
|
|
17100
|
-
const dependsOf = /* @__PURE__ */
|
|
17371
|
+
const dependsOf = /* @__PURE__ */ __name6((id2) => {
|
|
17101
17372
|
const node = targetPlan.steps[id2];
|
|
17102
17373
|
if (node) return node.dependsOn;
|
|
17103
17374
|
const parent = parentOf(id2);
|
|
@@ -17184,7 +17455,7 @@ function replayLedger(g, ledger) {
|
|
|
17184
17455
|
startedAt: 0,
|
|
17185
17456
|
...ledger.requestContext
|
|
17186
17457
|
};
|
|
17187
|
-
const ctxFor = /* @__PURE__ */
|
|
17458
|
+
const ctxFor = /* @__PURE__ */ __name6((id2) => ({
|
|
17188
17459
|
initData: ledger.initData,
|
|
17189
17460
|
stepResults: ancestorResults(plan, id2, rows22),
|
|
17190
17461
|
state: ledger.state ?? {},
|
|
@@ -17266,7 +17537,7 @@ function ancestorResults(plan, id2, rows22) {
|
|
|
17266
17537
|
const out = {};
|
|
17267
17538
|
const joinAliased = /* @__PURE__ */ new Set();
|
|
17268
17539
|
const seen = /* @__PURE__ */ new Set();
|
|
17269
|
-
const take = /* @__PURE__ */
|
|
17540
|
+
const take = /* @__PURE__ */ __name6((rowId) => {
|
|
17270
17541
|
const hit = replayResultOf(rows22.get(rowId), plan.steps[rowId]);
|
|
17271
17542
|
if (!hit) return void 0;
|
|
17272
17543
|
if (!joinAliased.has(rowId)) out[rowId] = hit.value;
|
|
@@ -17283,7 +17554,7 @@ function ancestorResults(plan, id2, rows22) {
|
|
|
17283
17554
|
}
|
|
17284
17555
|
return hit;
|
|
17285
17556
|
}, "take");
|
|
17286
|
-
const walk22 = /* @__PURE__ */
|
|
17557
|
+
const walk22 = /* @__PURE__ */ __name6((ids) => {
|
|
17287
17558
|
for (const dep of ids) {
|
|
17288
17559
|
if (seen.has(dep)) continue;
|
|
17289
17560
|
seen.add(dep);
|
|
@@ -17509,8 +17780,8 @@ function runWorkspaceView(ws) {
|
|
|
17509
17780
|
function runSuspendedForView(run) {
|
|
17510
17781
|
const s = run.suspendedFor;
|
|
17511
17782
|
if (!s || typeof s !== "object" || typeof s.kind !== "string" || isTerminalRunStatus(run.status)) return void 0;
|
|
17512
|
-
const str3 = /* @__PURE__ */
|
|
17513
|
-
const num = /* @__PURE__ */
|
|
17783
|
+
const str3 = /* @__PURE__ */ __name6((v) => typeof v === "string" && v ? v : void 0, "str");
|
|
17784
|
+
const num = /* @__PURE__ */ __name6((v) => typeof v === "number" && Number.isFinite(v) ? v : void 0, "num");
|
|
17514
17785
|
const dimension = str3(s.dimension);
|
|
17515
17786
|
return pruneUndefined({
|
|
17516
17787
|
kind: s.kind,
|
|
@@ -17665,7 +17936,7 @@ function timeZoneSupported(tz) {
|
|
|
17665
17936
|
}
|
|
17666
17937
|
function validateBusinessHours(cal, path32 = "businessHours") {
|
|
17667
17938
|
const issues = [];
|
|
17668
|
-
const issue = /* @__PURE__ */
|
|
17939
|
+
const issue = /* @__PURE__ */ __name6((p, message) => issues.push({
|
|
17669
17940
|
code: "business-hours-invalid",
|
|
17670
17941
|
path: p,
|
|
17671
17942
|
message
|
|
@@ -17734,7 +18005,7 @@ function formatter(tz) {
|
|
|
17734
18005
|
}
|
|
17735
18006
|
function localParts(ms, tz) {
|
|
17736
18007
|
const parts = formatter(tz).formatToParts(new Date(ms));
|
|
17737
|
-
const get = /* @__PURE__ */
|
|
18008
|
+
const get = /* @__PURE__ */ __name6((t) => parts.find((p) => p.type === t)?.value ?? "", "get");
|
|
17738
18009
|
const hour = Number(get("hour")) % 24;
|
|
17739
18010
|
return {
|
|
17740
18011
|
year: Number(get("year")),
|
|
@@ -17904,7 +18175,7 @@ function matchesEditablePath(pointer, editablePaths, op = "replace") {
|
|
|
17904
18175
|
}
|
|
17905
18176
|
function changedPointers(before, after, base = "") {
|
|
17906
18177
|
if (before === after) return [];
|
|
17907
|
-
const isObj = /* @__PURE__ */
|
|
18178
|
+
const isObj = /* @__PURE__ */ __name6((v) => typeof v === "object" && v !== null && !Array.isArray(v), "isObj");
|
|
17908
18179
|
if (Array.isArray(before) && Array.isArray(after)) {
|
|
17909
18180
|
if (before.length !== after.length) return [
|
|
17910
18181
|
base || "/"
|
|
@@ -18112,7 +18383,7 @@ function rebaseItemPointer(pointer, itemsPath, index) {
|
|
|
18112
18383
|
}
|
|
18113
18384
|
function validateWorkflowSchedule(schedule, path32 = "/schedule") {
|
|
18114
18385
|
if (schedule === void 0 || schedule === null) return [];
|
|
18115
|
-
const issue = /* @__PURE__ */
|
|
18386
|
+
const issue = /* @__PURE__ */ __name6((at, detail) => [
|
|
18116
18387
|
{
|
|
18117
18388
|
code: WORKFLOW_SCHEDULE_SHAPE_ISSUE,
|
|
18118
18389
|
severity: "error",
|
|
@@ -18162,7 +18433,7 @@ function validateWorkflowSchedule(schedule, path32 = "/schedule") {
|
|
|
18162
18433
|
}
|
|
18163
18434
|
function collectEnvTemplateKeys(value22) {
|
|
18164
18435
|
const keys = /* @__PURE__ */ new Set();
|
|
18165
|
-
const walk22 = /* @__PURE__ */
|
|
18436
|
+
const walk22 = /* @__PURE__ */ __name6((v) => {
|
|
18166
18437
|
if (isEnvRef(v)) {
|
|
18167
18438
|
keys.add(v.__envRef);
|
|
18168
18439
|
return;
|
|
@@ -18189,7 +18460,7 @@ function collectEnvTemplateKeys(value22) {
|
|
|
18189
18460
|
}
|
|
18190
18461
|
function substituteEnvRefs(value22, overlay) {
|
|
18191
18462
|
const missing = /* @__PURE__ */ new Set();
|
|
18192
|
-
const walk22 = /* @__PURE__ */
|
|
18463
|
+
const walk22 = /* @__PURE__ */ __name6((v, slot = false) => {
|
|
18193
18464
|
if (isEnvRef(v)) {
|
|
18194
18465
|
if (Object.prototype.hasOwnProperty.call(overlay, v.__envRef)) {
|
|
18195
18466
|
const s = overlay[v.__envRef];
|
|
@@ -18399,7 +18670,7 @@ function estimateGraph(envelopeOrGraph) {
|
|
|
18399
18670
|
};
|
|
18400
18671
|
}
|
|
18401
18672
|
function* singleStepsOf(entry) {
|
|
18402
|
-
if (!
|
|
18673
|
+
if (!isRecord4(entry)) return;
|
|
18403
18674
|
switch (entry.type) {
|
|
18404
18675
|
case "step":
|
|
18405
18676
|
case "agent":
|
|
@@ -18423,8 +18694,8 @@ function* singleStepsOf(entry) {
|
|
|
18423
18694
|
}
|
|
18424
18695
|
}
|
|
18425
18696
|
function entriesOf(graph) {
|
|
18426
|
-
const definition =
|
|
18427
|
-
const entries =
|
|
18697
|
+
const definition = isRecord4(graph) ? graph.definition : void 0;
|
|
18698
|
+
const entries = isRecord4(definition) ? definition.graph : void 0;
|
|
18428
18699
|
return Array.isArray(entries) ? entries : [];
|
|
18429
18700
|
}
|
|
18430
18701
|
function inheritTargets(graphs) {
|
|
@@ -18441,7 +18712,7 @@ function inheritTargets(graphs) {
|
|
|
18441
18712
|
return targets;
|
|
18442
18713
|
}
|
|
18443
18714
|
function needsInheritedWorkspace(graph) {
|
|
18444
|
-
if (!
|
|
18715
|
+
if (!isRecord4(graph) || graph.workspace !== void 0) return false;
|
|
18445
18716
|
for (const entry of entriesOf(graph)) {
|
|
18446
18717
|
for (const node of singleStepsOf(entry)) {
|
|
18447
18718
|
if (node.workspace !== void 0 && node.workspace !== "inherit") return true;
|
|
@@ -18522,7 +18793,7 @@ function collectJobTierSteps(entry, out) {
|
|
|
18522
18793
|
return;
|
|
18523
18794
|
}
|
|
18524
18795
|
}
|
|
18525
|
-
var
|
|
18796
|
+
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
18797
|
var init_dist2 = __esm({
|
|
18527
18798
|
"../workflow-graph/dist/index.mjs"() {
|
|
18528
18799
|
"use strict";
|
|
@@ -18536,14 +18807,14 @@ var init_dist2 = __esm({
|
|
|
18536
18807
|
init_dist();
|
|
18537
18808
|
init_dist();
|
|
18538
18809
|
init_dist();
|
|
18539
|
-
|
|
18540
|
-
|
|
18810
|
+
__defProp6 = Object.defineProperty;
|
|
18811
|
+
__name6 = /* @__PURE__ */ __name((target, value22) => __defProp6(target, "name", { value: value22, configurable: true }), "__name");
|
|
18541
18812
|
WorkflowTemplateError = class extends Error {
|
|
18542
18813
|
static {
|
|
18543
18814
|
__name(this, "WorkflowTemplateError");
|
|
18544
18815
|
}
|
|
18545
18816
|
static {
|
|
18546
|
-
|
|
18817
|
+
__name6(this, "WorkflowTemplateError");
|
|
18547
18818
|
}
|
|
18548
18819
|
placeholder;
|
|
18549
18820
|
constructor(message, placeholder) {
|
|
@@ -18552,11 +18823,11 @@ var init_dist2 = __esm({
|
|
|
18552
18823
|
}
|
|
18553
18824
|
};
|
|
18554
18825
|
__name(isMapConfigObject, "isMapConfigObject");
|
|
18555
|
-
|
|
18826
|
+
__name6(isMapConfigObject, "isMapConfigObject");
|
|
18556
18827
|
__name(parseMapConfig, "parseMapConfig");
|
|
18557
|
-
|
|
18828
|
+
__name6(parseMapConfig, "parseMapConfig");
|
|
18558
18829
|
__name(mapConfigWire, "mapConfigWire");
|
|
18559
|
-
|
|
18830
|
+
__name6(mapConfigWire, "mapConfigWire");
|
|
18560
18831
|
TEMPLATE_PLACEHOLDER = /\$\{([^}]*)\}/g;
|
|
18561
18832
|
TEMPLATE_NAMESPACES = [
|
|
18562
18833
|
"initData",
|
|
@@ -18565,21 +18836,21 @@ var init_dist2 = __esm({
|
|
|
18565
18836
|
"stepResults"
|
|
18566
18837
|
];
|
|
18567
18838
|
__name(describeBadPlaceholder, "describeBadPlaceholder");
|
|
18568
|
-
|
|
18839
|
+
__name6(describeBadPlaceholder, "describeBadPlaceholder");
|
|
18569
18840
|
__name(parseTemplatePlaceholder, "parseTemplatePlaceholder");
|
|
18570
|
-
|
|
18841
|
+
__name6(parseTemplatePlaceholder, "parseTemplatePlaceholder");
|
|
18571
18842
|
__name(traverseMappingPath, "traverseMappingPath");
|
|
18572
|
-
|
|
18843
|
+
__name6(traverseMappingPath, "traverseMappingPath");
|
|
18573
18844
|
__name(stringifyTemplateValue, "stringifyTemplateValue");
|
|
18574
|
-
|
|
18845
|
+
__name6(stringifyTemplateValue, "stringifyTemplateValue");
|
|
18575
18846
|
__name(escapeFence, "escapeFence");
|
|
18576
|
-
|
|
18847
|
+
__name6(escapeFence, "escapeFence");
|
|
18577
18848
|
__name(fenceBlock, "fenceBlock");
|
|
18578
|
-
|
|
18849
|
+
__name6(fenceBlock, "fenceBlock");
|
|
18579
18850
|
__name(renderTemplate, "renderTemplate");
|
|
18580
|
-
|
|
18851
|
+
__name6(renderTemplate, "renderTemplate");
|
|
18581
18852
|
__name(isMapDescriptor, "isMapDescriptor");
|
|
18582
|
-
|
|
18853
|
+
__name6(isMapDescriptor, "isMapDescriptor");
|
|
18583
18854
|
MAP_DESCRIPTOR_KEYS = [
|
|
18584
18855
|
"step",
|
|
18585
18856
|
"path",
|
|
@@ -18591,39 +18862,39 @@ var init_dist2 = __esm({
|
|
|
18591
18862
|
];
|
|
18592
18863
|
MAP_MEMBER_MALFORMED_CODE = "map-member-malformed";
|
|
18593
18864
|
__name(malformedMapMembers, "malformedMapMembers");
|
|
18594
|
-
|
|
18865
|
+
__name6(malformedMapMembers, "malformedMapMembers");
|
|
18595
18866
|
__name(mapMemberMalformedMessage, "mapMemberMalformedMessage");
|
|
18596
|
-
|
|
18867
|
+
__name6(mapMemberMalformedMessage, "mapMemberMalformedMessage");
|
|
18597
18868
|
__name(resolveDescriptor, "resolveDescriptor");
|
|
18598
|
-
|
|
18869
|
+
__name6(resolveDescriptor, "resolveDescriptor");
|
|
18599
18870
|
__name(resolveMapping, "resolveMapping");
|
|
18600
|
-
|
|
18601
|
-
fromInit = /* @__PURE__ */
|
|
18871
|
+
__name6(resolveMapping, "resolveMapping");
|
|
18872
|
+
fromInit = /* @__PURE__ */ __name6((path32) => ({
|
|
18602
18873
|
initData: true,
|
|
18603
18874
|
path: path32
|
|
18604
18875
|
}), "fromInit");
|
|
18605
|
-
fromStep = /* @__PURE__ */
|
|
18606
|
-
const idOf = /* @__PURE__ */
|
|
18876
|
+
fromStep = /* @__PURE__ */ __name6((s, path32 = "") => {
|
|
18877
|
+
const idOf = /* @__PURE__ */ __name6((x) => typeof x === "string" ? x : x.id, "idOf");
|
|
18607
18878
|
return {
|
|
18608
18879
|
step: Array.isArray(s) ? s.map(idOf) : idOf(s),
|
|
18609
18880
|
path: path32
|
|
18610
18881
|
};
|
|
18611
18882
|
}, "fromStep");
|
|
18612
|
-
value = /* @__PURE__ */
|
|
18883
|
+
value = /* @__PURE__ */ __name6((v) => ({
|
|
18613
18884
|
value: v
|
|
18614
18885
|
}), "value");
|
|
18615
|
-
template = /* @__PURE__ */
|
|
18886
|
+
template = /* @__PURE__ */ __name6((s) => ({
|
|
18616
18887
|
template: s
|
|
18617
18888
|
}), "template");
|
|
18618
|
-
fromRequest = /* @__PURE__ */
|
|
18889
|
+
fromRequest = /* @__PURE__ */ __name6((path32) => ({
|
|
18619
18890
|
requestContextPath: path32
|
|
18620
18891
|
}), "fromRequest");
|
|
18621
|
-
rows = /* @__PURE__ */
|
|
18892
|
+
rows = /* @__PURE__ */ __name6((s, path32, page) => ({
|
|
18622
18893
|
step: typeof s === "string" ? s : s.id,
|
|
18623
18894
|
path: path32,
|
|
18624
18895
|
rows: page
|
|
18625
18896
|
}), "rows");
|
|
18626
|
-
fromKnowledge = /* @__PURE__ */
|
|
18897
|
+
fromKnowledge = /* @__PURE__ */ __name6((k) => ({
|
|
18627
18898
|
knowledge: k
|
|
18628
18899
|
}), "fromKnowledge");
|
|
18629
18900
|
SideEffectsSchema = z9.enum(WORKFLOW_SIDE_EFFECTS);
|
|
@@ -18632,23 +18903,23 @@ var init_dist2 = __esm({
|
|
|
18632
18903
|
WORKFLOW_MODEL_TEMPLATE_RE = /^\$\{\s*initData\.([A-Za-z0-9_.\-[\]]+)\s*(?:\|([^}]*))?\}$/;
|
|
18633
18904
|
PATH_SEGMENT_RE = /^[A-Za-z0-9_-]+(?:\[(?:0|[1-9]\d*)\])*$/;
|
|
18634
18905
|
__name(looksLikeModelTemplate, "looksLikeModelTemplate");
|
|
18635
|
-
|
|
18906
|
+
__name6(looksLikeModelTemplate, "looksLikeModelTemplate");
|
|
18636
18907
|
__name(parseModelTemplate, "parseModelTemplate");
|
|
18637
|
-
|
|
18908
|
+
__name6(parseModelTemplate, "parseModelTemplate");
|
|
18638
18909
|
__name(modelTemplateInvalidMessage, "modelTemplateInvalidMessage");
|
|
18639
|
-
|
|
18910
|
+
__name6(modelTemplateInvalidMessage, "modelTemplateInvalidMessage");
|
|
18640
18911
|
__name(modelTemplateDefaultRequiredMessage, "modelTemplateDefaultRequiredMessage");
|
|
18641
|
-
|
|
18912
|
+
__name6(modelTemplateDefaultRequiredMessage, "modelTemplateDefaultRequiredMessage");
|
|
18642
18913
|
__name(staticModelPin, "staticModelPin");
|
|
18643
|
-
|
|
18914
|
+
__name6(staticModelPin, "staticModelPin");
|
|
18644
18915
|
__name(readPath2, "readPath");
|
|
18645
|
-
|
|
18916
|
+
__name6(readPath2, "readPath");
|
|
18646
18917
|
__name(renderModelTemplate, "renderModelTemplate");
|
|
18647
|
-
|
|
18918
|
+
__name6(renderModelTemplate, "renderModelTemplate");
|
|
18648
18919
|
__name(modelTemplateUnboundMessage, "modelTemplateUnboundMessage");
|
|
18649
|
-
|
|
18920
|
+
__name6(modelTemplateUnboundMessage, "modelTemplateUnboundMessage");
|
|
18650
18921
|
__name(modelTemplateInputNotObjectMessage, "modelTemplateInputNotObjectMessage");
|
|
18651
|
-
|
|
18922
|
+
__name6(modelTemplateInputNotObjectMessage, "modelTemplateInputNotObjectMessage");
|
|
18652
18923
|
APPROVER_SPEC_MAX_USERS = 20;
|
|
18653
18924
|
ESCALATION_MAX_HOPS = 3;
|
|
18654
18925
|
TemplateBindingSchema = z22.object({
|
|
@@ -18714,7 +18985,7 @@ var init_dist2 = __esm({
|
|
|
18714
18985
|
APPROVER_WRITTEN_MAX = 120;
|
|
18715
18986
|
USER_ID_SHAPED_RE = /^[^\s@]{1,128}$/;
|
|
18716
18987
|
__name(describeApproverSpecRefusal, "describeApproverSpecRefusal");
|
|
18717
|
-
|
|
18988
|
+
__name6(describeApproverSpecRefusal, "describeApproverSpecRefusal");
|
|
18718
18989
|
BINDING_ROOTS = [
|
|
18719
18990
|
"initData",
|
|
18720
18991
|
"stepResults",
|
|
@@ -18722,42 +18993,42 @@ var init_dist2 = __esm({
|
|
|
18722
18993
|
"state"
|
|
18723
18994
|
];
|
|
18724
18995
|
__name(bindingRootsOk, "bindingRootsOk");
|
|
18725
|
-
|
|
18996
|
+
__name6(bindingRootsOk, "bindingRootsOk");
|
|
18726
18997
|
__name(isTemplateBinding, "isTemplateBinding");
|
|
18727
|
-
|
|
18998
|
+
__name6(isTemplateBinding, "isTemplateBinding");
|
|
18728
18999
|
__name(approvalEditable, "approvalEditable");
|
|
18729
|
-
|
|
19000
|
+
__name6(approvalEditable, "approvalEditable");
|
|
18730
19001
|
__name(validateApproverBlock, "validateApproverBlock");
|
|
18731
|
-
|
|
19002
|
+
__name6(validateApproverBlock, "validateApproverBlock");
|
|
18732
19003
|
APPROVAL_REMIND_AFTER_HOURS_MIN = 1;
|
|
18733
19004
|
APPROVAL_REMIND_AFTER_HOURS_MAX = 720;
|
|
18734
19005
|
APPROVAL_TIMEOUT_HOURS_MIN = 1;
|
|
18735
19006
|
APPROVAL_TIMEOUT_HOURS_MAX = 720;
|
|
18736
19007
|
__name(validateApprovalReminder, "validateApprovalReminder");
|
|
18737
|
-
|
|
19008
|
+
__name6(validateApprovalReminder, "validateApprovalReminder");
|
|
18738
19009
|
__name(validateHitlTimeoutHours, "validateHitlTimeoutHours");
|
|
18739
|
-
|
|
19010
|
+
__name6(validateHitlTimeoutHours, "validateHitlTimeoutHours");
|
|
18740
19011
|
__name(firstAskDeadline, "firstAskDeadline");
|
|
18741
|
-
|
|
19012
|
+
__name6(firstAskDeadline, "firstAskDeadline");
|
|
18742
19013
|
__name(liftRenderedApprover, "liftRenderedApprover");
|
|
18743
|
-
|
|
19014
|
+
__name6(liftRenderedApprover, "liftRenderedApprover");
|
|
18744
19015
|
__name(approverUsersOf, "approverUsersOf");
|
|
18745
|
-
|
|
19016
|
+
__name6(approverUsersOf, "approverUsersOf");
|
|
18746
19017
|
WORKSPACE_TEMPLATE_EXPR_RE = /^\$\{\s*(?:initData|input)\.([^}]+?)\s*\}$/;
|
|
18747
19018
|
__name(workspaceTemplatePath, "workspaceTemplatePath");
|
|
18748
|
-
|
|
19019
|
+
__name6(workspaceTemplatePath, "workspaceTemplatePath");
|
|
18749
19020
|
__name(retryBackoffs, "retryBackoffs");
|
|
18750
|
-
|
|
19021
|
+
__name6(retryBackoffs, "retryBackoffs");
|
|
18751
19022
|
SLEEP_UNTIL_REPLACEMENT = Object.freeze({
|
|
18752
19023
|
type: "sleep",
|
|
18753
19024
|
duration: 6e4
|
|
18754
19025
|
});
|
|
18755
19026
|
__name(sleepUntilUnsupportedMessage, "sleepUntilUnsupportedMessage");
|
|
18756
|
-
|
|
19027
|
+
__name6(sleepUntilUnsupportedMessage, "sleepUntilUnsupportedMessage");
|
|
18757
19028
|
__name(signalNameInvalidMessage, "signalNameInvalidMessage");
|
|
18758
|
-
|
|
19029
|
+
__name6(signalNameInvalidMessage, "signalNameInvalidMessage");
|
|
18759
19030
|
__name(armSubrunUnsupportedMessage, "armSubrunUnsupportedMessage");
|
|
18760
|
-
|
|
19031
|
+
__name6(armSubrunUnsupportedMessage, "armSubrunUnsupportedMessage");
|
|
18761
19032
|
WORKFLOW_WORKSPACE_TTL_MAX_HOURS_DEFAULT = 168;
|
|
18762
19033
|
WORKFLOW_CAPS_DEFAULT = Object.freeze({
|
|
18763
19034
|
maxParallelArms: 16,
|
|
@@ -18785,60 +19056,60 @@ var init_dist2 = __esm({
|
|
|
18785
19056
|
"api",
|
|
18786
19057
|
"user"
|
|
18787
19058
|
];
|
|
18788
|
-
clone = /* @__PURE__ */
|
|
19059
|
+
clone = /* @__PURE__ */ __name6((v) => JSON.parse(JSON.stringify(v)), "clone");
|
|
18789
19060
|
__name(fillPolicy, "fillPolicy");
|
|
18790
|
-
|
|
19061
|
+
__name6(fillPolicy, "fillPolicy");
|
|
18791
19062
|
__name(fillSingle, "fillSingle");
|
|
18792
|
-
|
|
19063
|
+
__name6(fillSingle, "fillSingle");
|
|
18793
19064
|
__name(fillHitl, "fillHitl");
|
|
18794
|
-
|
|
19065
|
+
__name6(fillHitl, "fillHitl");
|
|
18795
19066
|
__name(fillArm, "fillArm");
|
|
18796
|
-
|
|
19067
|
+
__name6(fillArm, "fillArm");
|
|
18797
19068
|
__name(fillEntry, "fillEntry");
|
|
18798
|
-
|
|
19069
|
+
__name6(fillEntry, "fillEntry");
|
|
18799
19070
|
__name(withDefaultsFilled, "withDefaultsFilled");
|
|
18800
|
-
|
|
19071
|
+
__name6(withDefaultsFilled, "withDefaultsFilled");
|
|
18801
19072
|
CONNECTION_ID_HEX_RE = /^[0-9a-f]{24}$/;
|
|
18802
19073
|
__name(isConnectionKeyShaped, "isConnectionKeyShaped");
|
|
18803
|
-
|
|
19074
|
+
__name6(isConnectionKeyShaped, "isConnectionKeyShaped");
|
|
18804
19075
|
__name(connectionKeyUndeclaredMessage, "connectionKeyUndeclaredMessage");
|
|
18805
|
-
|
|
19076
|
+
__name6(connectionKeyUndeclaredMessage, "connectionKeyUndeclaredMessage");
|
|
18806
19077
|
WORKFLOW_JOB_MAX_WORKTREE_ARMS = 8;
|
|
18807
19078
|
__name(classifyModelProvider, "classifyModelProvider");
|
|
18808
|
-
|
|
18809
|
-
workspaceOf = /* @__PURE__ */
|
|
18810
|
-
mountsWorkspace = /* @__PURE__ */
|
|
19079
|
+
__name6(classifyModelProvider, "classifyModelProvider");
|
|
19080
|
+
workspaceOf = /* @__PURE__ */ __name6((node) => node.workspace, "workspaceOf");
|
|
19081
|
+
mountsWorkspace = /* @__PURE__ */ __name6((node) => {
|
|
18811
19082
|
const w = workspaceOf(node);
|
|
18812
19083
|
return w !== void 0 && w !== "inherit";
|
|
18813
19084
|
}, "mountsWorkspace");
|
|
18814
|
-
isJobTier = /* @__PURE__ */
|
|
18815
|
-
jobToolsOf = /* @__PURE__ */
|
|
19085
|
+
isJobTier = /* @__PURE__ */ __name6((node) => node.tier === "job" || mountsWorkspace(node), "isJobTier");
|
|
19086
|
+
jobToolsOf = /* @__PURE__ */ __name6((node) => {
|
|
18816
19087
|
if (node.type === "agent") return node.toolScope?.jobTools;
|
|
18817
19088
|
return node.jobTools;
|
|
18818
19089
|
}, "jobToolsOf");
|
|
18819
19090
|
__name(schemaAtPath, "schemaAtPath");
|
|
18820
|
-
|
|
18821
|
-
schemaIsArray = /* @__PURE__ */
|
|
19091
|
+
__name6(schemaAtPath, "schemaAtPath");
|
|
19092
|
+
schemaIsArray = /* @__PURE__ */ __name6((schema) => {
|
|
18822
19093
|
if (!schema) return void 0;
|
|
18823
19094
|
const t = schema.type;
|
|
18824
19095
|
if (t === void 0) return void 0;
|
|
18825
19096
|
return Array.isArray(t) ? t.includes("array") : t === "array";
|
|
18826
19097
|
}, "schemaIsArray");
|
|
18827
|
-
isHitlNode = /* @__PURE__ */
|
|
18828
|
-
isSingleStep = /* @__PURE__ */
|
|
18829
|
-
singleId = /* @__PURE__ */
|
|
18830
|
-
armId = /* @__PURE__ */
|
|
19098
|
+
isHitlNode = /* @__PURE__ */ __name6((n2) => isWorkflowHitlEntryType(n2.type), "isHitlNode");
|
|
19099
|
+
isSingleStep = /* @__PURE__ */ __name6((n2) => !isHitlNode(n2), "isSingleStep");
|
|
19100
|
+
singleId = /* @__PURE__ */ __name6((s) => s.type === "step" ? s.step.id : s.id, "singleId");
|
|
19101
|
+
armId = /* @__PURE__ */ __name6((a) => a.type === "mapping" ? a.id : singleId(a), "armId");
|
|
18831
19102
|
TEMPLATE_STEP_REF = /\$\{\s*stepResults\.([A-Za-z0-9_\-]+)/g;
|
|
18832
19103
|
__name(templateStepRefs, "templateStepRefs");
|
|
18833
|
-
|
|
19104
|
+
__name6(templateStepRefs, "templateStepRefs");
|
|
18834
19105
|
__name(readMapConfig, "readMapConfig");
|
|
18835
|
-
|
|
19106
|
+
__name6(readMapConfig, "readMapConfig");
|
|
18836
19107
|
__name(mapConfigStepRefs, "mapConfigStepRefs");
|
|
18837
|
-
|
|
19108
|
+
__name6(mapConfigStepRefs, "mapConfigStepRefs");
|
|
18838
19109
|
__name(nodeStepRefs, "nodeStepRefs");
|
|
18839
|
-
|
|
19110
|
+
__name6(nodeStepRefs, "nodeStepRefs");
|
|
18840
19111
|
__name(validateLuaExtensions, "validateLuaExtensions");
|
|
18841
|
-
|
|
19112
|
+
__name6(validateLuaExtensions, "validateLuaExtensions");
|
|
18842
19113
|
EDITABLE_PATH_RE = /^[A-Za-z_][A-Za-z0-9_]*(\[(\*|\d+)\])?(\.[A-Za-z_][A-Za-z0-9_]*(\[(\*|\d+)\])?)*$/;
|
|
18843
19114
|
PREDICATE_OPS = /* @__PURE__ */ new Set([
|
|
18844
19115
|
"eq",
|
|
@@ -18858,23 +19129,23 @@ var init_dist2 = __esm({
|
|
|
18858
19129
|
"not"
|
|
18859
19130
|
]);
|
|
18860
19131
|
__name(isPredicate, "isPredicate");
|
|
18861
|
-
|
|
18862
|
-
isPredicateScalar = /* @__PURE__ */
|
|
19132
|
+
__name6(isPredicate, "isPredicate");
|
|
19133
|
+
isPredicateScalar = /* @__PURE__ */ __name6((v) => v === null || typeof v === "string" || typeof v === "number" || typeof v === "boolean", "isPredicateScalar");
|
|
18863
19134
|
__name(isPathOrLiteral, "isPathOrLiteral");
|
|
18864
|
-
|
|
19135
|
+
__name6(isPathOrLiteral, "isPathOrLiteral");
|
|
18865
19136
|
__name(isWellFormedPredicate, "isWellFormedPredicate");
|
|
18866
|
-
|
|
19137
|
+
__name6(isWellFormedPredicate, "isWellFormedPredicate");
|
|
18867
19138
|
GRAPH_HASH_PREFIX = "sha256-cj1:";
|
|
18868
19139
|
__name(canonicalJson, "canonicalJson");
|
|
18869
|
-
|
|
19140
|
+
__name6(canonicalJson, "canonicalJson");
|
|
18870
19141
|
__name(hashGraph, "hashGraph");
|
|
18871
|
-
|
|
19142
|
+
__name6(hashGraph, "hashGraph");
|
|
18872
19143
|
WorkflowPlanError = class extends Error {
|
|
18873
19144
|
static {
|
|
18874
19145
|
__name(this, "WorkflowPlanError");
|
|
18875
19146
|
}
|
|
18876
19147
|
static {
|
|
18877
|
-
|
|
19148
|
+
__name6(this, "WorkflowPlanError");
|
|
18878
19149
|
}
|
|
18879
19150
|
code;
|
|
18880
19151
|
constructor(code, message) {
|
|
@@ -18882,47 +19153,47 @@ var init_dist2 = __esm({
|
|
|
18882
19153
|
this.name = "WorkflowPlanError";
|
|
18883
19154
|
}
|
|
18884
19155
|
};
|
|
18885
|
-
isArmStep = /* @__PURE__ */
|
|
18886
|
-
armStepId = /* @__PURE__ */
|
|
18887
|
-
armStepKind = /* @__PURE__ */
|
|
18888
|
-
joinIdOf = /* @__PURE__ */
|
|
18889
|
-
containerIdOf = /* @__PURE__ */
|
|
19156
|
+
isArmStep = /* @__PURE__ */ __name6((e) => isWorkflowArmEntryType(e.type), "isArmStep");
|
|
19157
|
+
armStepId = /* @__PURE__ */ __name6((e) => e.type === "step" ? e.step.id : e.id, "armStepId");
|
|
19158
|
+
armStepKind = /* @__PURE__ */ __name6((e) => WORKFLOW_ARM_ENTRY_STEP_KINDS[e.type], "armStepKind");
|
|
19159
|
+
joinIdOf = /* @__PURE__ */ __name6((entryId) => `${entryId}.join`, "joinIdOf");
|
|
19160
|
+
containerIdOf = /* @__PURE__ */ __name6((type, entryIndex) => `${type}@${entryIndex}`, "containerIdOf");
|
|
18890
19161
|
__name(compilePlan, "compilePlan");
|
|
18891
|
-
|
|
19162
|
+
__name6(compilePlan, "compilePlan");
|
|
18892
19163
|
PATH_PLACEHOLDER = /^\$\{([^}]+)\}$/;
|
|
18893
19164
|
MISSING = /* @__PURE__ */ Symbol("predicate.missing");
|
|
18894
19165
|
__name(resolvePath, "resolvePath");
|
|
18895
|
-
|
|
19166
|
+
__name6(resolvePath, "resolvePath");
|
|
18896
19167
|
__name(walk2, "walk");
|
|
18897
|
-
|
|
19168
|
+
__name6(walk2, "walk");
|
|
18898
19169
|
__name(resolveValue, "resolveValue");
|
|
18899
|
-
|
|
19170
|
+
__name6(resolveValue, "resolveValue");
|
|
18900
19171
|
__name(evaluatePredicate, "evaluatePredicate");
|
|
18901
|
-
|
|
19172
|
+
__name6(evaluatePredicate, "evaluatePredicate");
|
|
18902
19173
|
__name(compare, "compare");
|
|
18903
|
-
|
|
19174
|
+
__name6(compare, "compare");
|
|
18904
19175
|
__name(derivePredicateLabel, "derivePredicateLabel");
|
|
18905
|
-
|
|
19176
|
+
__name6(derivePredicateLabel, "derivePredicateLabel");
|
|
18906
19177
|
__name(renderPredicate, "renderPredicate");
|
|
18907
|
-
|
|
19178
|
+
__name6(renderPredicate, "renderPredicate");
|
|
18908
19179
|
__name(wrapLabel, "wrapLabel");
|
|
18909
|
-
|
|
19180
|
+
__name6(wrapLabel, "wrapLabel");
|
|
18910
19181
|
__name(renderRef, "renderRef");
|
|
18911
|
-
|
|
18912
|
-
stepIdOf = /* @__PURE__ */
|
|
19182
|
+
__name6(renderRef, "renderRef");
|
|
19183
|
+
stepIdOf = /* @__PURE__ */ __name6((s) => typeof s === "string" ? s : s.id, "stepIdOf");
|
|
18913
19184
|
__name(step, "step");
|
|
18914
|
-
|
|
19185
|
+
__name6(step, "step");
|
|
18915
19186
|
__name(stepOf, "stepOf");
|
|
18916
|
-
|
|
19187
|
+
__name6(stepOf, "stepOf");
|
|
18917
19188
|
__name(init, "init");
|
|
18918
|
-
|
|
19189
|
+
__name6(init, "init");
|
|
18919
19190
|
__name(state, "state");
|
|
18920
|
-
|
|
19191
|
+
__name6(state, "state");
|
|
18921
19192
|
__name(lit, "lit");
|
|
18922
|
-
|
|
19193
|
+
__name6(lit, "lit");
|
|
18923
19194
|
__name(toPathOrLiteral, "toPathOrLiteral");
|
|
18924
|
-
|
|
18925
|
-
cmp = /* @__PURE__ */
|
|
19195
|
+
__name6(toPathOrLiteral, "toPathOrLiteral");
|
|
19196
|
+
cmp = /* @__PURE__ */ __name6((op) => (l, r) => ({
|
|
18926
19197
|
op,
|
|
18927
19198
|
left: toPathOrLiteral(l),
|
|
18928
19199
|
right: toPathOrLiteral(r)
|
|
@@ -18933,49 +19204,49 @@ var init_dist2 = __esm({
|
|
|
18933
19204
|
gte = cmp("gte");
|
|
18934
19205
|
lt = cmp("lt");
|
|
18935
19206
|
lte = cmp("lte");
|
|
18936
|
-
inSet = /* @__PURE__ */
|
|
19207
|
+
inSet = /* @__PURE__ */ __name6((v, set) => ({
|
|
18937
19208
|
op: "in",
|
|
18938
19209
|
value: {
|
|
18939
19210
|
path: v.path
|
|
18940
19211
|
},
|
|
18941
19212
|
set
|
|
18942
19213
|
}), "inSet");
|
|
18943
|
-
notIn = /* @__PURE__ */
|
|
19214
|
+
notIn = /* @__PURE__ */ __name6((v, set) => ({
|
|
18944
19215
|
op: "notIn",
|
|
18945
19216
|
value: {
|
|
18946
19217
|
path: v.path
|
|
18947
19218
|
},
|
|
18948
19219
|
set
|
|
18949
19220
|
}), "notIn");
|
|
18950
|
-
exists = /* @__PURE__ */
|
|
19221
|
+
exists = /* @__PURE__ */ __name6((ref) => ({
|
|
18951
19222
|
op: "exists",
|
|
18952
19223
|
path: ref.path
|
|
18953
19224
|
}), "exists");
|
|
18954
|
-
notExists = /* @__PURE__ */
|
|
19225
|
+
notExists = /* @__PURE__ */ __name6((ref) => ({
|
|
18955
19226
|
op: "notExists",
|
|
18956
19227
|
path: ref.path
|
|
18957
19228
|
}), "notExists");
|
|
18958
|
-
truthy = /* @__PURE__ */
|
|
19229
|
+
truthy = /* @__PURE__ */ __name6((ref) => ({
|
|
18959
19230
|
op: "truthy",
|
|
18960
19231
|
value: {
|
|
18961
19232
|
path: ref.path
|
|
18962
19233
|
}
|
|
18963
19234
|
}), "truthy");
|
|
18964
|
-
falsy = /* @__PURE__ */
|
|
19235
|
+
falsy = /* @__PURE__ */ __name6((ref) => ({
|
|
18965
19236
|
op: "falsy",
|
|
18966
19237
|
value: {
|
|
18967
19238
|
path: ref.path
|
|
18968
19239
|
}
|
|
18969
19240
|
}), "falsy");
|
|
18970
|
-
and = /* @__PURE__ */
|
|
19241
|
+
and = /* @__PURE__ */ __name6((...args2) => ({
|
|
18971
19242
|
op: "and",
|
|
18972
19243
|
args: args2
|
|
18973
19244
|
}), "and");
|
|
18974
|
-
or = /* @__PURE__ */
|
|
19245
|
+
or = /* @__PURE__ */ __name6((...args2) => ({
|
|
18975
19246
|
op: "or",
|
|
18976
19247
|
args: args2
|
|
18977
19248
|
}), "or");
|
|
18978
|
-
not = /* @__PURE__ */
|
|
19249
|
+
not = /* @__PURE__ */ __name6((arg) => ({
|
|
18979
19250
|
op: "not",
|
|
18980
19251
|
arg
|
|
18981
19252
|
}), "not");
|
|
@@ -19027,17 +19298,17 @@ var init_dist2 = __esm({
|
|
|
19027
19298
|
"text"
|
|
19028
19299
|
]);
|
|
19029
19300
|
__name(continuedFailureValue, "continuedFailureValue");
|
|
19030
|
-
|
|
19301
|
+
__name6(continuedFailureValue, "continuedFailureValue");
|
|
19031
19302
|
__name(isContinuedFailureValue, "isContinuedFailureValue");
|
|
19032
|
-
|
|
19033
|
-
isHitlNode2 = /* @__PURE__ */
|
|
19303
|
+
__name6(isContinuedFailureValue, "isContinuedFailureValue");
|
|
19304
|
+
isHitlNode2 = /* @__PURE__ */ __name6((n2) => isWorkflowHitlEntryType(n2.type), "isHitlNode");
|
|
19034
19305
|
__name(inlineContainerArm, "inlineContainerArm");
|
|
19035
|
-
|
|
19036
|
-
nodeIdOf = /* @__PURE__ */
|
|
19306
|
+
__name6(inlineContainerArm, "inlineContainerArm");
|
|
19307
|
+
nodeIdOf = /* @__PURE__ */ __name6((n2) => n2.type === "step" ? n2.step.id : n2.id, "nodeIdOf");
|
|
19037
19308
|
__name(entryIds, "entryIds");
|
|
19038
|
-
|
|
19309
|
+
__name6(entryIds, "entryIds");
|
|
19039
19310
|
__name(resolvePlacements, "resolvePlacements");
|
|
19040
|
-
|
|
19311
|
+
__name6(resolvePlacements, "resolvePlacements");
|
|
19041
19312
|
GOAL_JUDGE_STEP_ID = "__goal_judge";
|
|
19042
19313
|
NON_LEAF_KINDS = /* @__PURE__ */ new Set([
|
|
19043
19314
|
"foreach",
|
|
@@ -19045,26 +19316,26 @@ var init_dist2 = __esm({
|
|
|
19045
19316
|
]);
|
|
19046
19317
|
CONDITIONAL_JOIN_ID = /^conditional@\d+\.join$/;
|
|
19047
19318
|
__name(isConditionalJoinId, "isConditionalJoinId");
|
|
19048
|
-
|
|
19319
|
+
__name6(isConditionalJoinId, "isConditionalJoinId");
|
|
19049
19320
|
__name(isPlainObject3, "isPlainObject");
|
|
19050
|
-
|
|
19321
|
+
__name6(isPlainObject3, "isPlainObject");
|
|
19051
19322
|
__name(leafValue, "leafValue");
|
|
19052
|
-
|
|
19323
|
+
__name6(leafValue, "leafValue");
|
|
19053
19324
|
__name(runOutputLeaves, "runOutputLeaves");
|
|
19054
|
-
|
|
19325
|
+
__name6(runOutputLeaves, "runOutputLeaves");
|
|
19055
19326
|
__name(deriveRunOutput, "deriveRunOutput");
|
|
19056
|
-
|
|
19327
|
+
__name6(deriveRunOutput, "deriveRunOutput");
|
|
19057
19328
|
__name(subrunSettledOutput, "subrunSettledOutput");
|
|
19058
|
-
|
|
19329
|
+
__name6(subrunSettledOutput, "subrunSettledOutput");
|
|
19059
19330
|
__name(seedLedgerFromRun, "seedLedgerFromRun");
|
|
19060
|
-
|
|
19061
|
-
branchArmId = /* @__PURE__ */
|
|
19331
|
+
__name6(seedLedgerFromRun, "seedLedgerFromRun");
|
|
19332
|
+
branchArmId = /* @__PURE__ */ __name6((arm) => arm.type === "step" ? arm.step.id : arm.id, "branchArmId");
|
|
19062
19333
|
__name(branchSpecFromConditional, "branchSpecFromConditional");
|
|
19063
|
-
|
|
19334
|
+
__name6(branchSpecFromConditional, "branchSpecFromConditional");
|
|
19064
19335
|
__name(selectBranchArms, "selectBranchArms");
|
|
19065
|
-
|
|
19066
|
-
canonical = /* @__PURE__ */
|
|
19067
|
-
sortKeys = /* @__PURE__ */
|
|
19336
|
+
__name6(selectBranchArms, "selectBranchArms");
|
|
19337
|
+
canonical = /* @__PURE__ */ __name6((v) => JSON.stringify(sortKeys(v)), "canonical");
|
|
19338
|
+
sortKeys = /* @__PURE__ */ __name6((v) => {
|
|
19068
19339
|
if (Array.isArray(v)) return v.map(sortKeys);
|
|
19069
19340
|
if (v && typeof v === "object") {
|
|
19070
19341
|
return Object.fromEntries(Object.keys(v).sort().map((k) => [
|
|
@@ -19075,63 +19346,63 @@ var init_dist2 = __esm({
|
|
|
19075
19346
|
return v;
|
|
19076
19347
|
}, "sortKeys");
|
|
19077
19348
|
__name(replayLedger, "replayLedger");
|
|
19078
|
-
|
|
19349
|
+
__name6(replayLedger, "replayLedger");
|
|
19079
19350
|
JOIN = ".join";
|
|
19080
|
-
entryOfJoin = /* @__PURE__ */
|
|
19351
|
+
entryOfJoin = /* @__PURE__ */ __name6((id2) => id2.endsWith(JOIN) ? id2.slice(0, -JOIN.length) : void 0, "entryOfJoin");
|
|
19081
19352
|
__name(replayResultOf, "replayResultOf");
|
|
19082
|
-
|
|
19353
|
+
__name6(replayResultOf, "replayResultOf");
|
|
19083
19354
|
__name(ancestorResults, "ancestorResults");
|
|
19084
|
-
|
|
19355
|
+
__name6(ancestorResults, "ancestorResults");
|
|
19085
19356
|
__name(inferTaken, "inferTaken");
|
|
19086
|
-
|
|
19357
|
+
__name6(inferTaken, "inferTaken");
|
|
19087
19358
|
__name(countChildren, "countChildren");
|
|
19088
|
-
|
|
19359
|
+
__name6(countChildren, "countChildren");
|
|
19089
19360
|
FORCE_CANCEL_STALE_MS = 10 * 60 * 1e3;
|
|
19090
19361
|
TERMINAL = new Set(WORKFLOW_RUN_TERMINAL);
|
|
19091
19362
|
__name(isTerminalRunStatus, "isTerminalRunStatus");
|
|
19092
|
-
|
|
19363
|
+
__name6(isTerminalRunStatus, "isTerminalRunStatus");
|
|
19093
19364
|
__name(pruneUndefined, "pruneUndefined");
|
|
19094
|
-
|
|
19365
|
+
__name6(pruneUndefined, "pruneUndefined");
|
|
19095
19366
|
WORKFLOW_INLINE_RUN_TAG = "inline";
|
|
19096
19367
|
__name(runOrigin, "runOrigin");
|
|
19097
|
-
|
|
19368
|
+
__name6(runOrigin, "runOrigin");
|
|
19098
19369
|
RUN_ERROR_ISSUES_MAX = 20;
|
|
19099
19370
|
__name(runErrorIssues, "runErrorIssues");
|
|
19100
|
-
|
|
19371
|
+
__name6(runErrorIssues, "runErrorIssues");
|
|
19101
19372
|
__name(runNextAction, "runNextAction");
|
|
19102
|
-
|
|
19373
|
+
__name6(runNextAction, "runNextAction");
|
|
19103
19374
|
IN_FLIGHT = new Set(WORKFLOW_STEP_IN_FLIGHT);
|
|
19104
19375
|
__name(emptyRunCounts, "emptyRunCounts");
|
|
19105
|
-
|
|
19376
|
+
__name6(emptyRunCounts, "emptyRunCounts");
|
|
19106
19377
|
__name(runCountsFromStatusTally, "runCountsFromStatusTally");
|
|
19107
|
-
|
|
19378
|
+
__name6(runCountsFromStatusTally, "runCountsFromStatusTally");
|
|
19108
19379
|
__name(runCountsFromStepStatuses, "runCountsFromStepStatuses");
|
|
19109
|
-
|
|
19380
|
+
__name6(runCountsFromStepStatuses, "runCountsFromStepStatuses");
|
|
19110
19381
|
__name(isBillingHeldStep, "isBillingHeldStep");
|
|
19111
|
-
|
|
19382
|
+
__name6(isBillingHeldStep, "isBillingHeldStep");
|
|
19112
19383
|
__name(stepEffectiveStatus, "stepEffectiveStatus");
|
|
19113
|
-
|
|
19114
|
-
n = /* @__PURE__ */
|
|
19384
|
+
__name6(stepEffectiveStatus, "stepEffectiveStatus");
|
|
19385
|
+
n = /* @__PURE__ */ __name6((v) => typeof v === "number" && Number.isFinite(v) ? v : 0, "n");
|
|
19115
19386
|
__name(runCounts, "runCounts");
|
|
19116
|
-
|
|
19387
|
+
__name6(runCounts, "runCounts");
|
|
19117
19388
|
__name(isPricedStepReceipt, "isPricedStepReceipt");
|
|
19118
|
-
|
|
19389
|
+
__name6(isPricedStepReceipt, "isPricedStepReceipt");
|
|
19119
19390
|
__name(receiptEngine, "receiptEngine");
|
|
19120
|
-
|
|
19391
|
+
__name6(receiptEngine, "receiptEngine");
|
|
19121
19392
|
__name(receiptTier, "receiptTier");
|
|
19122
|
-
|
|
19393
|
+
__name6(receiptTier, "receiptTier");
|
|
19123
19394
|
__name(stepBillingView, "stepBillingView");
|
|
19124
|
-
|
|
19395
|
+
__name6(stepBillingView, "stepBillingView");
|
|
19125
19396
|
__name(runUsage, "runUsage");
|
|
19126
|
-
|
|
19397
|
+
__name6(runUsage, "runUsage");
|
|
19127
19398
|
__name(runBudgetCap, "runBudgetCap");
|
|
19128
|
-
|
|
19399
|
+
__name6(runBudgetCap, "runBudgetCap");
|
|
19129
19400
|
__name(runBudgetRemaining, "runBudgetRemaining");
|
|
19130
|
-
|
|
19401
|
+
__name6(runBudgetRemaining, "runBudgetRemaining");
|
|
19131
19402
|
__name(runCancelView, "runCancelView");
|
|
19132
|
-
|
|
19403
|
+
__name6(runCancelView, "runCancelView");
|
|
19133
19404
|
__name(runWorkspaceView, "runWorkspaceView");
|
|
19134
|
-
|
|
19405
|
+
__name6(runWorkspaceView, "runWorkspaceView");
|
|
19135
19406
|
SUSPENDED_FOR_DIMENSIONS = /* @__PURE__ */ new Set([
|
|
19136
19407
|
"credits",
|
|
19137
19408
|
"actions",
|
|
@@ -19139,9 +19410,9 @@ var init_dist2 = __esm({
|
|
|
19139
19410
|
"jobSeconds"
|
|
19140
19411
|
]);
|
|
19141
19412
|
__name(runSuspendedForView, "runSuspendedForView");
|
|
19142
|
-
|
|
19413
|
+
__name6(runSuspendedForView, "runSuspendedForView");
|
|
19143
19414
|
__name(toWorkflowRunSummary, "toWorkflowRunSummary");
|
|
19144
|
-
|
|
19415
|
+
__name6(toWorkflowRunSummary, "toWorkflowRunSummary");
|
|
19145
19416
|
STEP_ERROR_DETAIL_KEYS = [
|
|
19146
19417
|
"reason",
|
|
19147
19418
|
"key",
|
|
@@ -19195,9 +19466,9 @@ var init_dist2 = __esm({
|
|
|
19195
19466
|
DETAIL_MAX_DEPTH = 4;
|
|
19196
19467
|
DETAIL_MAX_ITEMS = 100;
|
|
19197
19468
|
__name(scrubDetailValue, "scrubDetailValue");
|
|
19198
|
-
|
|
19469
|
+
__name6(scrubDetailValue, "scrubDetailValue");
|
|
19199
19470
|
__name(stepErrorDetail, "stepErrorDetail");
|
|
19200
|
-
|
|
19471
|
+
__name6(stepErrorDetail, "stepErrorDetail");
|
|
19201
19472
|
MAX_HOLIDAYS = 366;
|
|
19202
19473
|
MAX_WALK_DAYS = 400;
|
|
19203
19474
|
HHMM = /^([01]\d|2[0-3]):([0-5]\d)$/;
|
|
@@ -19217,18 +19488,18 @@ var init_dist2 = __esm({
|
|
|
19217
19488
|
};
|
|
19218
19489
|
supportedTz = null;
|
|
19219
19490
|
__name(timeZoneSupported, "timeZoneSupported");
|
|
19220
|
-
|
|
19491
|
+
__name6(timeZoneSupported, "timeZoneSupported");
|
|
19221
19492
|
__name(validateBusinessHours, "validateBusinessHours");
|
|
19222
|
-
|
|
19493
|
+
__name6(validateBusinessHours, "validateBusinessHours");
|
|
19223
19494
|
__name(toMinutes, "toMinutes");
|
|
19224
|
-
|
|
19495
|
+
__name6(toMinutes, "toMinutes");
|
|
19225
19496
|
__name(resolveCalendar, "resolveCalendar");
|
|
19226
|
-
|
|
19497
|
+
__name6(resolveCalendar, "resolveCalendar");
|
|
19227
19498
|
__name(assertValid, "assertValid");
|
|
19228
|
-
|
|
19499
|
+
__name6(assertValid, "assertValid");
|
|
19229
19500
|
fmtCache = /* @__PURE__ */ new Map();
|
|
19230
19501
|
__name(formatter, "formatter");
|
|
19231
|
-
|
|
19502
|
+
__name6(formatter, "formatter");
|
|
19232
19503
|
WEEKDAYS = {
|
|
19233
19504
|
Sun: 0,
|
|
19234
19505
|
Mon: 1,
|
|
@@ -19239,25 +19510,25 @@ var init_dist2 = __esm({
|
|
|
19239
19510
|
Sat: 6
|
|
19240
19511
|
};
|
|
19241
19512
|
__name(localParts, "localParts");
|
|
19242
|
-
|
|
19513
|
+
__name6(localParts, "localParts");
|
|
19243
19514
|
__name(offsetAt, "offsetAt");
|
|
19244
|
-
|
|
19515
|
+
__name6(offsetAt, "offsetAt");
|
|
19245
19516
|
__name(localToUtc, "localToUtc");
|
|
19246
|
-
|
|
19517
|
+
__name6(localToUtc, "localToUtc");
|
|
19247
19518
|
__name(sameWall, "sameWall");
|
|
19248
|
-
|
|
19519
|
+
__name6(sameWall, "sameWall");
|
|
19249
19520
|
__name(ymd, "ymd");
|
|
19250
|
-
|
|
19521
|
+
__name6(ymd, "ymd");
|
|
19251
19522
|
__name(windowOf, "windowOf");
|
|
19252
|
-
|
|
19523
|
+
__name6(windowOf, "windowOf");
|
|
19253
19524
|
__name(nextDayAnchor, "nextDayAnchor");
|
|
19254
|
-
|
|
19525
|
+
__name6(nextDayAnchor, "nextDayAnchor");
|
|
19255
19526
|
__name(addBusinessTime, "addBusinessTime");
|
|
19256
|
-
|
|
19527
|
+
__name6(addBusinessTime, "addBusinessTime");
|
|
19257
19528
|
__name(roundToBusinessTime, "roundToBusinessTime");
|
|
19258
|
-
|
|
19529
|
+
__name6(roundToBusinessTime, "roundToBusinessTime");
|
|
19259
19530
|
__name(isBusinessTime, "isBusinessTime");
|
|
19260
|
-
|
|
19531
|
+
__name6(isBusinessTime, "isBusinessTime");
|
|
19261
19532
|
JSON_PATCH_OPS = [
|
|
19262
19533
|
"replace",
|
|
19263
19534
|
"add",
|
|
@@ -19268,27 +19539,27 @@ var init_dist2 = __esm({
|
|
|
19268
19539
|
JSON_PATCH_MAX_TOTAL_BYTES = 1024 * 1024;
|
|
19269
19540
|
SEGMENT_RE = /^([A-Za-z_$][\w$-]*)((?:\[(?:\*|\d+)\])*)$/;
|
|
19270
19541
|
__name(parseEditablePath, "parseEditablePath");
|
|
19271
|
-
|
|
19542
|
+
__name6(parseEditablePath, "parseEditablePath");
|
|
19272
19543
|
__name(isEditablePathEntry, "isEditablePathEntry");
|
|
19273
|
-
|
|
19544
|
+
__name6(isEditablePathEntry, "isEditablePathEntry");
|
|
19274
19545
|
__name(pointerToSegments, "pointerToSegments");
|
|
19275
|
-
|
|
19546
|
+
__name6(pointerToSegments, "pointerToSegments");
|
|
19276
19547
|
__name(pointerToDotPath, "pointerToDotPath");
|
|
19277
|
-
|
|
19548
|
+
__name6(pointerToDotPath, "pointerToDotPath");
|
|
19278
19549
|
__name(coveredBy, "coveredBy");
|
|
19279
|
-
|
|
19550
|
+
__name6(coveredBy, "coveredBy");
|
|
19280
19551
|
__name(matchesEditablePath, "matchesEditablePath");
|
|
19281
|
-
|
|
19552
|
+
__name6(matchesEditablePath, "matchesEditablePath");
|
|
19282
19553
|
__name(changedPointers, "changedPointers");
|
|
19283
|
-
|
|
19554
|
+
__name6(changedPointers, "changedPointers");
|
|
19284
19555
|
__name(escapePointer, "escapePointer");
|
|
19285
|
-
|
|
19556
|
+
__name6(escapePointer, "escapePointer");
|
|
19286
19557
|
__name(validateJsonPatch, "validateJsonPatch");
|
|
19287
|
-
|
|
19558
|
+
__name6(validateJsonPatch, "validateJsonPatch");
|
|
19288
19559
|
__name(applyJsonPatch, "applyJsonPatch");
|
|
19289
|
-
|
|
19560
|
+
__name6(applyJsonPatch, "applyJsonPatch");
|
|
19290
19561
|
__name(rebaseItemPointer, "rebaseItemPointer");
|
|
19291
|
-
|
|
19562
|
+
__name6(rebaseItemPointer, "rebaseItemPointer");
|
|
19292
19563
|
WORKFLOW_SCHEDULE_TYPES = [
|
|
19293
19564
|
"cron",
|
|
19294
19565
|
"interval",
|
|
@@ -19300,22 +19571,22 @@ var init_dist2 = __esm({
|
|
|
19300
19571
|
"installer",
|
|
19301
19572
|
"system"
|
|
19302
19573
|
];
|
|
19303
|
-
isObject = /* @__PURE__ */
|
|
19574
|
+
isObject = /* @__PURE__ */ __name6((v) => typeof v === "object" && v !== null && !Array.isArray(v), "isObject");
|
|
19304
19575
|
__name(validateWorkflowSchedule, "validateWorkflowSchedule");
|
|
19305
|
-
|
|
19576
|
+
__name6(validateWorkflowSchedule, "validateWorkflowSchedule");
|
|
19306
19577
|
WORKFLOW_ENV_OVERLAY_MAX_KEYS = 64;
|
|
19307
19578
|
WORKFLOW_ENV_OVERLAY_MAX_VALUE_BYTES = 4096;
|
|
19308
19579
|
WORKFLOW_ENV_TEMPLATE_SECRET_KEY_RE = /(SECRET|TOKEN|KEY|PASSWORD)$/;
|
|
19309
|
-
isEnvRef = /* @__PURE__ */
|
|
19310
|
-
looksLikeEmbeddedJson = /* @__PURE__ */
|
|
19580
|
+
isEnvRef = /* @__PURE__ */ __name6((v) => typeof v === "object" && v !== null && !Array.isArray(v) && typeof v.__envRef === "string" && Object.keys(v).length === 1, "isEnvRef");
|
|
19581
|
+
looksLikeEmbeddedJson = /* @__PURE__ */ __name6((s) => s.length > 1 && s[0] === "{" && s.includes("__envRef"), "looksLikeEmbeddedJson");
|
|
19311
19582
|
__name(collectEnvTemplateKeys, "collectEnvTemplateKeys");
|
|
19312
|
-
|
|
19583
|
+
__name6(collectEnvTemplateKeys, "collectEnvTemplateKeys");
|
|
19313
19584
|
__name(substituteEnvRefs, "substituteEnvRefs");
|
|
19314
|
-
|
|
19585
|
+
__name6(substituteEnvRefs, "substituteEnvRefs");
|
|
19315
19586
|
__name(hashEnvOverlay, "hashEnvOverlay");
|
|
19316
|
-
|
|
19587
|
+
__name6(hashEnvOverlay, "hashEnvOverlay");
|
|
19317
19588
|
__name(validateEnvOverlay, "validateEnvOverlay");
|
|
19318
|
-
|
|
19589
|
+
__name6(validateEnvOverlay, "validateEnvOverlay");
|
|
19319
19590
|
ZERO = {
|
|
19320
19591
|
steps: {
|
|
19321
19592
|
min: 0,
|
|
@@ -19328,36 +19599,36 @@ var init_dist2 = __esm({
|
|
|
19328
19599
|
agentCalls: 0
|
|
19329
19600
|
};
|
|
19330
19601
|
__name(add, "add");
|
|
19331
|
-
|
|
19602
|
+
__name6(add, "add");
|
|
19332
19603
|
__name(scale, "scale");
|
|
19333
|
-
|
|
19604
|
+
__name6(scale, "scale");
|
|
19334
19605
|
__name(armEntry, "armEntry");
|
|
19335
|
-
|
|
19606
|
+
__name6(armEntry, "armEntry");
|
|
19336
19607
|
__name(ofEntry, "ofEntry");
|
|
19337
|
-
|
|
19608
|
+
__name6(ofEntry, "ofEntry");
|
|
19338
19609
|
__name(estimateGraph, "estimateGraph");
|
|
19339
|
-
|
|
19340
|
-
|
|
19610
|
+
__name6(estimateGraph, "estimateGraph");
|
|
19611
|
+
isRecord4 = /* @__PURE__ */ __name6((v) => !!v && typeof v === "object" && !Array.isArray(v), "isRecord");
|
|
19341
19612
|
__name(singleStepsOf, "singleStepsOf");
|
|
19342
|
-
|
|
19613
|
+
__name6(singleStepsOf, "singleStepsOf");
|
|
19343
19614
|
__name(entriesOf, "entriesOf");
|
|
19344
|
-
|
|
19615
|
+
__name6(entriesOf, "entriesOf");
|
|
19345
19616
|
__name(inheritTargets, "inheritTargets");
|
|
19346
|
-
|
|
19617
|
+
__name6(inheritTargets, "inheritTargets");
|
|
19347
19618
|
__name(needsInheritedWorkspace, "needsInheritedWorkspace");
|
|
19348
|
-
|
|
19619
|
+
__name6(needsInheritedWorkspace, "needsInheritedWorkspace");
|
|
19349
19620
|
__name(armEntry2, "armEntry2");
|
|
19350
|
-
|
|
19621
|
+
__name6(armEntry2, "armEntry");
|
|
19351
19622
|
__name(entryHasJobTier, "entryHasJobTier");
|
|
19352
|
-
|
|
19623
|
+
__name6(entryHasJobTier, "entryHasJobTier");
|
|
19353
19624
|
__name(graphHasJobTierStep, "graphHasJobTierStep");
|
|
19354
|
-
|
|
19625
|
+
__name6(graphHasJobTierStep, "graphHasJobTierStep");
|
|
19355
19626
|
__name(jobTierSteps, "jobTierSteps");
|
|
19356
|
-
|
|
19627
|
+
__name6(jobTierSteps, "jobTierSteps");
|
|
19357
19628
|
__name(jobTierStepIds, "jobTierStepIds");
|
|
19358
|
-
|
|
19629
|
+
__name6(jobTierStepIds, "jobTierStepIds");
|
|
19359
19630
|
__name(collectJobTierSteps, "collectJobTierSteps");
|
|
19360
|
-
|
|
19631
|
+
__name6(collectJobTierSteps, "collectJobTierSteps");
|
|
19361
19632
|
}
|
|
19362
19633
|
});
|
|
19363
19634
|
|
|
@@ -20411,7 +20682,9 @@ var init_compile_constants = __esm({
|
|
|
20411
20682
|
template: template2,
|
|
20412
20683
|
fromRequest: fromRequest2,
|
|
20413
20684
|
rows: rows2,
|
|
20414
|
-
fromKnowledge: fromKnowledge2
|
|
20685
|
+
fromKnowledge: fromKnowledge2,
|
|
20686
|
+
WORKFLOW_DEFAULT_MAX_DURATION_SECONDS,
|
|
20687
|
+
WORKFLOW_HITL_MAX_DURATION_SECONDS
|
|
20415
20688
|
};
|
|
20416
20689
|
WORKFLOW_SHIM_NAMES = [
|
|
20417
20690
|
"LuaWorkflow",
|
|
@@ -20444,7 +20717,9 @@ var init_compile_constants = __esm({
|
|
|
20444
20717
|
"template",
|
|
20445
20718
|
"fromRequest",
|
|
20446
20719
|
"rows",
|
|
20447
|
-
"fromKnowledge"
|
|
20720
|
+
"fromKnowledge",
|
|
20721
|
+
"WORKFLOW_DEFAULT_MAX_DURATION_SECONDS",
|
|
20722
|
+
"WORKFLOW_HITL_MAX_DURATION_SECONDS"
|
|
20448
20723
|
];
|
|
20449
20724
|
COMPILE_DIRS = {
|
|
20450
20725
|
DIST: "dist",
|
|
@@ -21357,7 +21632,7 @@ function walkWorkspace(rootDir, opts = {}) {
|
|
|
21357
21632
|
const refs = [];
|
|
21358
21633
|
const contentByHash = /* @__PURE__ */ new Map();
|
|
21359
21634
|
let totalSize = 0;
|
|
21360
|
-
const visit = /* @__PURE__ */
|
|
21635
|
+
const visit = /* @__PURE__ */ __name7((relPrefix) => {
|
|
21361
21636
|
const absDir = relPrefix ? join4(rootDir, relPrefix) : rootDir;
|
|
21362
21637
|
let entries;
|
|
21363
21638
|
try {
|
|
@@ -21651,21 +21926,21 @@ function walk3(root, prefix, out) {
|
|
|
21651
21926
|
}
|
|
21652
21927
|
}
|
|
21653
21928
|
}
|
|
21654
|
-
var
|
|
21929
|
+
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
21930
|
var init_dist3 = __esm({
|
|
21656
21931
|
"../shared-source-sync/dist/index.mjs"() {
|
|
21657
21932
|
"use strict";
|
|
21658
|
-
|
|
21659
|
-
|
|
21933
|
+
__defProp7 = Object.defineProperty;
|
|
21934
|
+
__name7 = /* @__PURE__ */ __name((target, value3) => __defProp7(target, "name", { value: value3, configurable: true }), "__name");
|
|
21660
21935
|
FILE_HASH_LENGTH = 16;
|
|
21661
21936
|
__name(hashContentTruncated, "hashContentTruncated");
|
|
21662
|
-
|
|
21937
|
+
__name7(hashContentTruncated, "hashContentTruncated");
|
|
21663
21938
|
__name(sha256Hex, "sha256Hex");
|
|
21664
|
-
|
|
21939
|
+
__name7(sha256Hex, "sha256Hex");
|
|
21665
21940
|
__name(matchesFileHash, "matchesFileHash");
|
|
21666
|
-
|
|
21941
|
+
__name7(matchesFileHash, "matchesFileHash");
|
|
21667
21942
|
__name(combineFileHashes, "combineFileHashes");
|
|
21668
|
-
|
|
21943
|
+
__name7(combineFileHashes, "combineFileHashes");
|
|
21669
21944
|
SKIP_DIRECTORIES = /* @__PURE__ */ new Set([
|
|
21670
21945
|
"node_modules",
|
|
21671
21946
|
"dist",
|
|
@@ -21682,9 +21957,9 @@ var init_dist3 = __esm({
|
|
|
21682
21957
|
]);
|
|
21683
21958
|
DEFAULT_MAX_FILE_BYTES = 256 * 1024;
|
|
21684
21959
|
__name(shouldSkipDirectory, "shouldSkipDirectory");
|
|
21685
|
-
|
|
21960
|
+
__name7(shouldSkipDirectory, "shouldSkipDirectory");
|
|
21686
21961
|
__name(shouldSkipFile, "shouldSkipFile");
|
|
21687
|
-
|
|
21962
|
+
__name7(shouldSkipFile, "shouldSkipFile");
|
|
21688
21963
|
KIND_BY_EXT = {
|
|
21689
21964
|
".ts": "source",
|
|
21690
21965
|
".tsx": "source",
|
|
@@ -21696,16 +21971,16 @@ var init_dist3 = __esm({
|
|
|
21696
21971
|
".toml": "config"
|
|
21697
21972
|
};
|
|
21698
21973
|
__name(classifyFile, "classifyFile");
|
|
21699
|
-
|
|
21974
|
+
__name7(classifyFile, "classifyFile");
|
|
21700
21975
|
__name(walkWorkspace, "walkWorkspace");
|
|
21701
|
-
|
|
21976
|
+
__name7(walkWorkspace, "walkWorkspace");
|
|
21702
21977
|
CHECK_BLOBS_MAX_HASHES = 500;
|
|
21703
21978
|
BackupHttpError = class extends Error {
|
|
21704
21979
|
static {
|
|
21705
21980
|
__name(this, "BackupHttpError");
|
|
21706
21981
|
}
|
|
21707
21982
|
static {
|
|
21708
|
-
|
|
21983
|
+
__name7(this, "BackupHttpError");
|
|
21709
21984
|
}
|
|
21710
21985
|
status;
|
|
21711
21986
|
endpoint;
|
|
@@ -21720,7 +21995,7 @@ var init_dist3 = __esm({
|
|
|
21720
21995
|
__name(this, "BackupHttpClient");
|
|
21721
21996
|
}
|
|
21722
21997
|
static {
|
|
21723
|
-
|
|
21998
|
+
__name7(this, "BackupHttpClient");
|
|
21724
21999
|
}
|
|
21725
22000
|
options;
|
|
21726
22001
|
fetchFn;
|
|
@@ -21825,17 +22100,17 @@ var init_dist3 = __esm({
|
|
|
21825
22100
|
};
|
|
21826
22101
|
DEFAULT_CONCURRENCY = 10;
|
|
21827
22102
|
__name(uploadBlobs, "uploadBlobs");
|
|
21828
|
-
|
|
22103
|
+
__name7(uploadBlobs, "uploadBlobs");
|
|
21829
22104
|
__name(decodeBlob, "decodeBlob");
|
|
21830
|
-
|
|
22105
|
+
__name7(decodeBlob, "decodeBlob");
|
|
21831
22106
|
__name(verifyDownloaded, "verifyDownloaded");
|
|
21832
|
-
|
|
22107
|
+
__name7(verifyDownloaded, "verifyDownloaded");
|
|
21833
22108
|
__name(downloadBlobs, "downloadBlobs");
|
|
21834
|
-
|
|
22109
|
+
__name7(downloadBlobs, "downloadBlobs");
|
|
21835
22110
|
__name(resolveBackupFileTarget, "resolveBackupFileTarget");
|
|
21836
|
-
|
|
22111
|
+
__name7(resolveBackupFileTarget, "resolveBackupFileTarget");
|
|
21837
22112
|
__name(restoreFromBlobs, "restoreFromBlobs");
|
|
21838
|
-
|
|
22113
|
+
__name7(restoreFromBlobs, "restoreFromBlobs");
|
|
21839
22114
|
CREDENTIAL_PATHS = /* @__PURE__ */ new Set([
|
|
21840
22115
|
".env",
|
|
21841
22116
|
".lua/config.json",
|
|
@@ -21843,22 +22118,22 @@ var init_dist3 = __esm({
|
|
|
21843
22118
|
]);
|
|
21844
22119
|
WINDOWS_ABSOLUTE_PATH = /^[a-z]:\//i;
|
|
21845
22120
|
__name(normalizeWorkspaceRelativePath, "normalizeWorkspaceRelativePath");
|
|
21846
|
-
|
|
22121
|
+
__name7(normalizeWorkspaceRelativePath, "normalizeWorkspaceRelativePath");
|
|
21847
22122
|
__name(isCredentialPersistencePath, "isCredentialPersistencePath");
|
|
21848
|
-
|
|
22123
|
+
__name7(isCredentialPersistencePath, "isCredentialPersistencePath");
|
|
21849
22124
|
__name(pushAgentBackup, "pushAgentBackup");
|
|
21850
|
-
|
|
22125
|
+
__name7(pushAgentBackup, "pushAgentBackup");
|
|
21851
22126
|
__name(pullAgentBackup, "pullAgentBackup");
|
|
21852
|
-
|
|
22127
|
+
__name7(pullAgentBackup, "pullAgentBackup");
|
|
21853
22128
|
ARCHIVE_SCHEMA_VERSION = 1;
|
|
21854
22129
|
__name(encodeWorkspaceArchive, "encodeWorkspaceArchive");
|
|
21855
|
-
|
|
22130
|
+
__name7(encodeWorkspaceArchive, "encodeWorkspaceArchive");
|
|
21856
22131
|
__name(decodeWorkspaceArchive, "decodeWorkspaceArchive");
|
|
21857
|
-
|
|
22132
|
+
__name7(decodeWorkspaceArchive, "decodeWorkspaceArchive");
|
|
21858
22133
|
__name(writeArchiveToWorkspace, "writeArchiveToWorkspace");
|
|
21859
|
-
|
|
22134
|
+
__name7(writeArchiveToWorkspace, "writeArchiveToWorkspace");
|
|
21860
22135
|
__name(walk3, "walk");
|
|
21861
|
-
|
|
22136
|
+
__name7(walk3, "walk");
|
|
21862
22137
|
SKILL_SOURCE_ARCHIVE_MAX_BYTES = 4 * 1024 * 1024;
|
|
21863
22138
|
}
|
|
21864
22139
|
});
|
|
@@ -22117,6 +22392,9 @@ var init_bundle_upload = __esm({
|
|
|
22117
22392
|
});
|
|
22118
22393
|
|
|
22119
22394
|
// src/primitives/base.handler.ts
|
|
22395
|
+
function nameFlagDeleteCommand(deleteCommand, displayName, name) {
|
|
22396
|
+
return `${deleteCommand} --${displayName.toLowerCase().replace(/\s+/g, "-")}-name ${name}`;
|
|
22397
|
+
}
|
|
22120
22398
|
var DEFAULT_VERSION, BaseVersionedHandler, BaseNonVersionedHandler;
|
|
22121
22399
|
var init_base_handler = __esm({
|
|
22122
22400
|
"src/primitives/base.handler.ts"() {
|
|
@@ -22129,10 +22407,14 @@ var init_base_handler = __esm({
|
|
|
22129
22407
|
init_auth_error();
|
|
22130
22408
|
init_cli_error();
|
|
22131
22409
|
DEFAULT_VERSION = SKILL_DEFAULTS.VERSION;
|
|
22410
|
+
__name(nameFlagDeleteCommand, "nameFlagDeleteCommand");
|
|
22132
22411
|
BaseVersionedHandler = class {
|
|
22133
22412
|
static {
|
|
22134
22413
|
__name(this, "BaseVersionedHandler");
|
|
22135
22414
|
}
|
|
22415
|
+
serverDeleteCommand(name) {
|
|
22416
|
+
return nameFlagDeleteCommand(this.deleteCommand, this.displayName, name);
|
|
22417
|
+
}
|
|
22136
22418
|
/**
|
|
22137
22419
|
* Strip a YAML item to only the canonical fields: name, version, [idField].
|
|
22138
22420
|
* Override if your YAML type has additional fields.
|
|
@@ -22270,7 +22552,6 @@ var init_base_handler = __esm({
|
|
|
22270
22552
|
}));
|
|
22271
22553
|
yamlItems.push(...stubs);
|
|
22272
22554
|
yamlUpdated = true;
|
|
22273
|
-
const flagName = `--${this.displayName.toLowerCase().replace(/\s+/g, "-")}-name`;
|
|
22274
22555
|
console.log(`
|
|
22275
22556
|
\u26A0\uFE0F Found ${this.displayNamePlural} on server not in your local code:`);
|
|
22276
22557
|
for (const item of orphans) {
|
|
@@ -22279,7 +22560,7 @@ var init_base_handler = __esm({
|
|
|
22279
22560
|
console.log(msg);
|
|
22280
22561
|
}
|
|
22281
22562
|
console.log(` Added to lua.skill.yaml as server-only entries.`);
|
|
22282
|
-
console.log(` To remove from server: ${this.
|
|
22563
|
+
console.log(` To remove from server: ${this.serverDeleteCommand("<name>")}`);
|
|
22283
22564
|
console.log(` To restore source from backup: lua sync --accept
|
|
22284
22565
|
`);
|
|
22285
22566
|
orphanedCount = orphans.length;
|
|
@@ -22581,6 +22862,9 @@ var init_base_handler = __esm({
|
|
|
22581
22862
|
static {
|
|
22582
22863
|
__name(this, "BaseNonVersionedHandler");
|
|
22583
22864
|
}
|
|
22865
|
+
serverDeleteCommand(name) {
|
|
22866
|
+
return nameFlagDeleteCommand(this.deleteCommand, this.displayName, name);
|
|
22867
|
+
}
|
|
22584
22868
|
/**
|
|
22585
22869
|
* Optional hook run after a successful upsert when autoDeploy is set.
|
|
22586
22870
|
* Default: no-op. Handlers override for post-upsert actions (e.g. MCP
|
|
@@ -22657,7 +22941,6 @@ var init_base_handler = __esm({
|
|
|
22657
22941
|
...stubs
|
|
22658
22942
|
], config);
|
|
22659
22943
|
yamlUpdated = true;
|
|
22660
|
-
const flagName = `--${this.displayName.toLowerCase().replace(/\s+/g, "-")}-name`;
|
|
22661
22944
|
console.log(`
|
|
22662
22945
|
\u26A0\uFE0F Found ${this.displayNamePlural} on server not in your local code:`);
|
|
22663
22946
|
for (const item of orphans) {
|
|
@@ -22666,7 +22949,7 @@ var init_base_handler = __esm({
|
|
|
22666
22949
|
console.log(msg);
|
|
22667
22950
|
}
|
|
22668
22951
|
console.log(` Added to lua.skill.yaml as server-only entries.`);
|
|
22669
|
-
console.log(` To remove from server: ${this.
|
|
22952
|
+
console.log(` To remove from server: ${this.serverDeleteCommand("<name>")}`);
|
|
22670
22953
|
console.log(` To restore source from backup: lua sync --accept
|
|
22671
22954
|
`);
|
|
22672
22955
|
orphanedCount = orphans.length;
|
|
@@ -23607,11 +23890,11 @@ function invalidContract(message) {
|
|
|
23607
23890
|
}
|
|
23608
23891
|
};
|
|
23609
23892
|
}
|
|
23610
|
-
function
|
|
23893
|
+
function isRecord5(value3) {
|
|
23611
23894
|
return typeof value3 === "object" && value3 !== null && !Array.isArray(value3);
|
|
23612
23895
|
}
|
|
23613
23896
|
function parseCredentialIdentityContext(value3) {
|
|
23614
|
-
if (!
|
|
23897
|
+
if (!isRecord5(value3)) return void 0;
|
|
23615
23898
|
const email = value3.email;
|
|
23616
23899
|
const fullName = value3.fullName;
|
|
23617
23900
|
if (email !== null && typeof email !== "string" || fullName !== null && typeof fullName !== "string") {
|
|
@@ -23639,7 +23922,7 @@ var init_cli_credentials_api_service = __esm({
|
|
|
23639
23922
|
init_dist();
|
|
23640
23923
|
__name(bearerHeaders, "bearerHeaders");
|
|
23641
23924
|
__name(invalidContract, "invalidContract");
|
|
23642
|
-
__name(
|
|
23925
|
+
__name(isRecord5, "isRecord");
|
|
23643
23926
|
__name(parseCredentialIdentityContext, "parseCredentialIdentityContext");
|
|
23644
23927
|
__name(resourceQuery, "resourceQuery");
|
|
23645
23928
|
CliCredentialsApi = class extends HttpClient {
|
|
@@ -29357,23 +29640,23 @@ import { Agent as Agent2, buildConnector } from "undici";
|
|
|
29357
29640
|
import * as net4 from "net";
|
|
29358
29641
|
import { promises as dns2 } from "dns";
|
|
29359
29642
|
function buildSandboxProcess(opts) {
|
|
29360
|
-
const hrtimeFn = /* @__PURE__ */
|
|
29643
|
+
const hrtimeFn = /* @__PURE__ */ __name8((time) => process.hrtime(time), "hrtimeFn");
|
|
29361
29644
|
hrtimeFn.bigint = () => process.hrtime.bigint();
|
|
29362
|
-
const nextTickFn = /* @__PURE__ */
|
|
29645
|
+
const nextTickFn = /* @__PURE__ */ __name8((cb, ...args2) => {
|
|
29363
29646
|
process.nextTick(cb, ...args2);
|
|
29364
29647
|
}, "nextTickFn");
|
|
29365
|
-
const buildStdioStub = /* @__PURE__ */
|
|
29648
|
+
const buildStdioStub = /* @__PURE__ */ __name8((fd) => {
|
|
29366
29649
|
const stub = {
|
|
29367
29650
|
fd,
|
|
29368
29651
|
isTTY: false,
|
|
29369
|
-
write: /* @__PURE__ */
|
|
29370
|
-
end: /* @__PURE__ */
|
|
29371
|
-
on: /* @__PURE__ */
|
|
29372
|
-
once: /* @__PURE__ */
|
|
29373
|
-
removeListener: /* @__PURE__ */
|
|
29374
|
-
cork: /* @__PURE__ */
|
|
29652
|
+
write: /* @__PURE__ */ __name8(() => true, "write"),
|
|
29653
|
+
end: /* @__PURE__ */ __name8(() => stub, "end"),
|
|
29654
|
+
on: /* @__PURE__ */ __name8(() => stub, "on"),
|
|
29655
|
+
once: /* @__PURE__ */ __name8(() => stub, "once"),
|
|
29656
|
+
removeListener: /* @__PURE__ */ __name8(() => stub, "removeListener"),
|
|
29657
|
+
cork: /* @__PURE__ */ __name8(() => {
|
|
29375
29658
|
}, "cork"),
|
|
29376
|
-
uncork: /* @__PURE__ */
|
|
29659
|
+
uncork: /* @__PURE__ */ __name8(() => {
|
|
29377
29660
|
}, "uncork")
|
|
29378
29661
|
};
|
|
29379
29662
|
return stub;
|
|
@@ -29393,21 +29676,21 @@ function buildSandboxProcess(opts) {
|
|
|
29393
29676
|
hrtime: hrtimeFn,
|
|
29394
29677
|
// Lie — don't leak host filesystem layout. Skills should not depend on
|
|
29395
29678
|
// the value matching anything real.
|
|
29396
|
-
cwd: /* @__PURE__ */
|
|
29397
|
-
uptime: /* @__PURE__ */
|
|
29398
|
-
memoryUsage: /* @__PURE__ */
|
|
29679
|
+
cwd: /* @__PURE__ */ __name8(() => "/", "cwd"),
|
|
29680
|
+
uptime: /* @__PURE__ */ __name8(() => process.uptime(), "uptime"),
|
|
29681
|
+
memoryUsage: /* @__PURE__ */ __name8(() => process.memoryUsage(), "memoryUsage"),
|
|
29399
29682
|
argv: [
|
|
29400
29683
|
"node"
|
|
29401
29684
|
],
|
|
29402
29685
|
argv0: "node",
|
|
29403
29686
|
// No-op event API. Returns `proc` for chaining (matches Node convention).
|
|
29404
29687
|
// Skills CANNOT register handlers on host signals via this stub.
|
|
29405
|
-
on: /* @__PURE__ */
|
|
29406
|
-
once: /* @__PURE__ */
|
|
29407
|
-
off: /* @__PURE__ */
|
|
29408
|
-
addListener: /* @__PURE__ */
|
|
29409
|
-
removeListener: /* @__PURE__ */
|
|
29410
|
-
emit: /* @__PURE__ */
|
|
29688
|
+
on: /* @__PURE__ */ __name8(() => proc, "on"),
|
|
29689
|
+
once: /* @__PURE__ */ __name8(() => proc, "once"),
|
|
29690
|
+
off: /* @__PURE__ */ __name8(() => proc, "off"),
|
|
29691
|
+
addListener: /* @__PURE__ */ __name8(() => proc, "addListener"),
|
|
29692
|
+
removeListener: /* @__PURE__ */ __name8(() => proc, "removeListener"),
|
|
29693
|
+
emit: /* @__PURE__ */ __name8(() => false, "emit")
|
|
29411
29694
|
};
|
|
29412
29695
|
return Object.freeze(proc);
|
|
29413
29696
|
}
|
|
@@ -29502,7 +29785,7 @@ function isRequireBlocklisted(id2) {
|
|
|
29502
29785
|
}
|
|
29503
29786
|
function buildSandboxRequire(opts) {
|
|
29504
29787
|
const realRequire = createRequire(path6.join(opts.cwd, "package.json"));
|
|
29505
|
-
const wrapped = /* @__PURE__ */
|
|
29788
|
+
const wrapped = /* @__PURE__ */ __name8((id2) => {
|
|
29506
29789
|
if (isRequireBlocklisted(id2)) {
|
|
29507
29790
|
const evt = {
|
|
29508
29791
|
event: "sandbox_require_blocklisted",
|
|
@@ -29793,7 +30076,7 @@ function buildFetchDispatcher(guard, target) {
|
|
|
29793
30076
|
function wrapFetch(realFetch, opts) {
|
|
29794
30077
|
if (opts.mode === "off") return realFetch;
|
|
29795
30078
|
const guard = compile(opts);
|
|
29796
|
-
const wrapped = /* @__PURE__ */
|
|
30079
|
+
const wrapped = /* @__PURE__ */ __name8(async (input, init3) => {
|
|
29797
30080
|
const url = typeof input === "string" ? input : input instanceof URL ? input.href : input.url;
|
|
29798
30081
|
let parsed;
|
|
29799
30082
|
try {
|
|
@@ -29925,7 +30208,7 @@ function wrapHttpLike(real, opts) {
|
|
|
29925
30208
|
for (const key of Object.keys(real)) {
|
|
29926
30209
|
wrapped[key] = real[key];
|
|
29927
30210
|
}
|
|
29928
|
-
const wrapRequest = /* @__PURE__ */
|
|
30211
|
+
const wrapRequest = /* @__PURE__ */ __name8((origRequest) => function(...args2) {
|
|
29929
30212
|
const first = args2[0];
|
|
29930
30213
|
const host = extractHostname(first);
|
|
29931
30214
|
if (host && net2.isIP(host)) {
|
|
@@ -29969,7 +30252,7 @@ function wrapHttpLike(real, opts) {
|
|
|
29969
30252
|
__name(this, "WrappedAgent");
|
|
29970
30253
|
}
|
|
29971
30254
|
static {
|
|
29972
|
-
|
|
30255
|
+
__name8(this, "WrappedAgent");
|
|
29973
30256
|
}
|
|
29974
30257
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
29975
30258
|
createConnection(options, cb) {
|
|
@@ -30048,11 +30331,11 @@ function wrapNetModule(real, opts) {
|
|
|
30048
30331
|
for (const key of Object.keys(real)) {
|
|
30049
30332
|
wrapped[key] = real[key];
|
|
30050
30333
|
}
|
|
30051
|
-
const wrappedCreate = /* @__PURE__ */
|
|
30334
|
+
const wrappedCreate = /* @__PURE__ */ __name8(function(...args2) {
|
|
30052
30335
|
guardConnectArgs(args2, guard, "net.createConnection");
|
|
30053
30336
|
return real.createConnection.apply(real, args2);
|
|
30054
30337
|
}, "wrappedCreate");
|
|
30055
|
-
const guardedSocketConnect = /* @__PURE__ */
|
|
30338
|
+
const guardedSocketConnect = /* @__PURE__ */ __name8(function(...args2) {
|
|
30056
30339
|
guardConnectArgs(args2, guard, "net.Socket.connect");
|
|
30057
30340
|
return real.Socket.prototype.connect.apply(this, args2);
|
|
30058
30341
|
}, "guardedSocketConnect");
|
|
@@ -30061,7 +30344,7 @@ function wrapNetModule(real, opts) {
|
|
|
30061
30344
|
__name(this, "WrappedSocket");
|
|
30062
30345
|
}
|
|
30063
30346
|
static {
|
|
30064
|
-
|
|
30347
|
+
__name8(this, "WrappedSocket");
|
|
30065
30348
|
}
|
|
30066
30349
|
};
|
|
30067
30350
|
Object.defineProperty(WrappedSocket.prototype, "connect", {
|
|
@@ -30090,11 +30373,11 @@ function wrapTlsModule(real, opts) {
|
|
|
30090
30373
|
for (const key of Object.keys(real)) {
|
|
30091
30374
|
wrapped[key] = real[key];
|
|
30092
30375
|
}
|
|
30093
|
-
const wrappedConnect = /* @__PURE__ */
|
|
30376
|
+
const wrappedConnect = /* @__PURE__ */ __name8(function(...args2) {
|
|
30094
30377
|
guardConnectArgs(args2, guard, "tls.connect");
|
|
30095
30378
|
return real.connect.apply(real, args2);
|
|
30096
30379
|
}, "wrappedConnect");
|
|
30097
|
-
const guardedTLSConnect = /* @__PURE__ */
|
|
30380
|
+
const guardedTLSConnect = /* @__PURE__ */ __name8(function(...args2) {
|
|
30098
30381
|
guardConnectArgs(args2, guard, "tls.TLSSocket.connect");
|
|
30099
30382
|
return real.TLSSocket.prototype.connect.apply(this, args2);
|
|
30100
30383
|
}, "guardedTLSConnect");
|
|
@@ -30103,7 +30386,7 @@ function wrapTlsModule(real, opts) {
|
|
|
30103
30386
|
__name(this, "WrappedTLSSocket");
|
|
30104
30387
|
}
|
|
30105
30388
|
static {
|
|
30106
|
-
|
|
30389
|
+
__name8(this, "WrappedTLSSocket");
|
|
30107
30390
|
}
|
|
30108
30391
|
};
|
|
30109
30392
|
Object.defineProperty(WrappedTLSSocket.prototype, "connect", {
|
|
@@ -30131,7 +30414,7 @@ function wrapHttp2Module(real, opts) {
|
|
|
30131
30414
|
for (const key of Object.keys(real)) {
|
|
30132
30415
|
wrapped[key] = real[key];
|
|
30133
30416
|
}
|
|
30134
|
-
const wrappedConnect = /* @__PURE__ */
|
|
30417
|
+
const wrappedConnect = /* @__PURE__ */ __name8(function(...args2) {
|
|
30135
30418
|
const authority = args2[0];
|
|
30136
30419
|
const host = extractHostname(authority);
|
|
30137
30420
|
if (host && net2.isIP(host)) {
|
|
@@ -30342,7 +30625,7 @@ function buildResponse(r) {
|
|
|
30342
30625
|
function buildRecordFetch(opts) {
|
|
30343
30626
|
const fixtures = compileFixtures(opts.fixtures);
|
|
30344
30627
|
const recorder = opts.recorder;
|
|
30345
|
-
const record = /* @__PURE__ */
|
|
30628
|
+
const record = /* @__PURE__ */ __name8((entry) => {
|
|
30346
30629
|
if (!recorder) return;
|
|
30347
30630
|
try {
|
|
30348
30631
|
const result = recorder(entry);
|
|
@@ -30352,7 +30635,7 @@ function buildRecordFetch(opts) {
|
|
|
30352
30635
|
} catch {
|
|
30353
30636
|
}
|
|
30354
30637
|
}, "record");
|
|
30355
|
-
const recordFetch = /* @__PURE__ */
|
|
30638
|
+
const recordFetch = /* @__PURE__ */ __name8(async (input, init3) => {
|
|
30356
30639
|
const req = isRequestLike(input) ? input : null;
|
|
30357
30640
|
const signal = init3?.signal ?? req?.signal ?? null;
|
|
30358
30641
|
if (signal?.aborted) throw abortReason(signal);
|
|
@@ -30403,7 +30686,7 @@ function abortReason(signal) {
|
|
|
30403
30686
|
return signal.reason ?? new DOMException("This operation was aborted", "AbortError");
|
|
30404
30687
|
}
|
|
30405
30688
|
function blocker(via) {
|
|
30406
|
-
return /* @__PURE__ */
|
|
30689
|
+
return /* @__PURE__ */ __name8(/* @__PURE__ */ __name(function blocked() {
|
|
30407
30690
|
throw testEgressBlockedError({
|
|
30408
30691
|
via
|
|
30409
30692
|
});
|
|
@@ -30424,7 +30707,7 @@ function blockedSubclass(Real, method, via) {
|
|
|
30424
30707
|
__name(this, "Blocked");
|
|
30425
30708
|
}
|
|
30426
30709
|
static {
|
|
30427
|
-
|
|
30710
|
+
__name8(this, "Blocked");
|
|
30428
30711
|
}
|
|
30429
30712
|
};
|
|
30430
30713
|
lockMethod(Blocked.prototype, method, block);
|
|
@@ -30569,7 +30852,7 @@ function namedError(name) {
|
|
|
30569
30852
|
__name(this, "Ctor");
|
|
30570
30853
|
}
|
|
30571
30854
|
static {
|
|
30572
|
-
|
|
30855
|
+
__name8(this, "Ctor");
|
|
30573
30856
|
}
|
|
30574
30857
|
type;
|
|
30575
30858
|
code;
|
|
@@ -30586,11 +30869,11 @@ function namedError(name) {
|
|
|
30586
30869
|
return Ctor;
|
|
30587
30870
|
}
|
|
30588
30871
|
function buildNodeFetchShim(recordFetch) {
|
|
30589
|
-
const shim = /* @__PURE__ */
|
|
30872
|
+
const shim = /* @__PURE__ */ __name8(async (input, init3) => {
|
|
30590
30873
|
const res = await recordFetch(input, init3);
|
|
30591
30874
|
if (typeof res.buffer !== "function") {
|
|
30592
30875
|
Object.defineProperty(res, "buffer", {
|
|
30593
|
-
value: /* @__PURE__ */
|
|
30876
|
+
value: /* @__PURE__ */ __name8(async () => Buffer.from(await res.arrayBuffer()), "value"),
|
|
30594
30877
|
configurable: true
|
|
30595
30878
|
});
|
|
30596
30879
|
}
|
|
@@ -30665,7 +30948,7 @@ function createBaseSandboxContext(opts) {
|
|
|
30665
30948
|
fixtures: opts.testEgressFixtures,
|
|
30666
30949
|
recorder: opts.testEgressRecorder
|
|
30667
30950
|
}) : void 0;
|
|
30668
|
-
const requireWithEgress = /* @__PURE__ */
|
|
30951
|
+
const requireWithEgress = /* @__PURE__ */ __name8((id2) => {
|
|
30669
30952
|
if (recordFetch) {
|
|
30670
30953
|
if (wrappedModuleCache.has(id2)) return wrappedModuleCache.get(id2);
|
|
30671
30954
|
let override;
|
|
@@ -30796,7 +31079,7 @@ function pinnedDispatcherFor(addresses2) {
|
|
|
30796
31079
|
addresses: pinned,
|
|
30797
31080
|
// `destroy`, not `close`: close waits for in-flight requests, and this is called
|
|
30798
31081
|
// once the body has been read or cancelled, where waiting can only hang.
|
|
30799
|
-
close: /* @__PURE__ */
|
|
31082
|
+
close: /* @__PURE__ */ __name8(async () => {
|
|
30800
31083
|
try {
|
|
30801
31084
|
await dispatcher.destroy();
|
|
30802
31085
|
} catch {
|
|
@@ -30841,7 +31124,7 @@ function buildWorkflowScriptGlobals(hostConsole) {
|
|
|
30841
31124
|
__name(this, "WorkflowDate");
|
|
30842
31125
|
}
|
|
30843
31126
|
static {
|
|
30844
|
-
|
|
31127
|
+
__name8(this, "WorkflowDate");
|
|
30845
31128
|
}
|
|
30846
31129
|
constructor(...args2) {
|
|
30847
31130
|
if (args2.length === 0) throw new WorkflowDeterminismError("new Date()", "new Date(now())");
|
|
@@ -31000,7 +31283,7 @@ function createGuardedDispatcher(opts = {}) {
|
|
|
31000
31283
|
const base = buildConnector({
|
|
31001
31284
|
lookup: guardedLookup(opts)
|
|
31002
31285
|
});
|
|
31003
|
-
const connect = /* @__PURE__ */
|
|
31286
|
+
const connect = /* @__PURE__ */ __name8((connectOpts, callback) => {
|
|
31004
31287
|
const host = normalizeAddressHost(connectOpts.hostname ?? "");
|
|
31005
31288
|
if (isIP2(host)) {
|
|
31006
31289
|
const blockClass = classify(host);
|
|
@@ -31059,16 +31342,16 @@ function classifyHostname(host) {
|
|
|
31059
31342
|
if (host === "metadata.google.internal" || host === "metadata") return "imds";
|
|
31060
31343
|
return null;
|
|
31061
31344
|
}
|
|
31062
|
-
var
|
|
31345
|
+
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
31346
|
var init_dist4 = __esm({
|
|
31064
31347
|
"../shared-sandbox/dist/index.mjs"() {
|
|
31065
31348
|
"use strict";
|
|
31066
|
-
|
|
31067
|
-
|
|
31349
|
+
__defProp8 = Object.defineProperty;
|
|
31350
|
+
__name8 = /* @__PURE__ */ __name((target, value3) => __defProp8(target, "name", { value: value3, configurable: true }), "__name");
|
|
31068
31351
|
__name(buildSandboxProcess, "buildSandboxProcess");
|
|
31069
|
-
|
|
31352
|
+
__name8(buildSandboxProcess, "buildSandboxProcess");
|
|
31070
31353
|
__name(buildSandboxGlobals, "buildSandboxGlobals");
|
|
31071
|
-
|
|
31354
|
+
__name8(buildSandboxGlobals, "buildSandboxGlobals");
|
|
31072
31355
|
REQUIRE_BLOCKLIST = /* @__PURE__ */ new Set([
|
|
31073
31356
|
"child_process",
|
|
31074
31357
|
"node:child_process",
|
|
@@ -31107,15 +31390,15 @@ var init_dist4 = __esm({
|
|
|
31107
31390
|
...REQUIRE_BLOCKLIST
|
|
31108
31391
|
].filter((id2) => !id2.startsWith("node:") && !builtinModules.includes(id2));
|
|
31109
31392
|
__name(isRequireBlocklisted, "isRequireBlocklisted");
|
|
31110
|
-
|
|
31393
|
+
__name8(isRequireBlocklisted, "isRequireBlocklisted");
|
|
31111
31394
|
__name(buildSandboxRequire, "buildSandboxRequire");
|
|
31112
|
-
|
|
31395
|
+
__name8(buildSandboxRequire, "buildSandboxRequire");
|
|
31113
31396
|
EGRESS_DENIED_CODE = "EGRESS_DENIED";
|
|
31114
31397
|
EGRESS_PROBE_DEFAULT_MS = 3e3;
|
|
31115
31398
|
__name(v4ToInt, "v4ToInt");
|
|
31116
|
-
|
|
31399
|
+
__name8(v4ToInt, "v4ToInt");
|
|
31117
31400
|
__name(range, "range");
|
|
31118
|
-
|
|
31401
|
+
__name8(range, "range");
|
|
31119
31402
|
PRIVATE_RANGES = [
|
|
31120
31403
|
range("169.254.169.254/32", "imds"),
|
|
31121
31404
|
range("169.254.0.0/16", "link_local"),
|
|
@@ -31125,19 +31408,19 @@ var init_dist4 = __esm({
|
|
|
31125
31408
|
range("100.64.0.0/10", "cgnat")
|
|
31126
31409
|
];
|
|
31127
31410
|
__name(inRange, "inRange");
|
|
31128
|
-
|
|
31411
|
+
__name8(inRange, "inRange");
|
|
31129
31412
|
__name(mappedV4, "mappedV4");
|
|
31130
|
-
|
|
31413
|
+
__name8(mappedV4, "mappedV4");
|
|
31131
31414
|
__name(classifyPrivateAddress, "classifyPrivateAddress");
|
|
31132
|
-
|
|
31415
|
+
__name8(classifyPrivateAddress, "classifyPrivateAddress");
|
|
31133
31416
|
__name(egressDeniedMessage, "egressDeniedMessage");
|
|
31134
|
-
|
|
31417
|
+
__name8(egressDeniedMessage, "egressDeniedMessage");
|
|
31135
31418
|
__name(egressDeniedError, "egressDeniedError");
|
|
31136
|
-
|
|
31419
|
+
__name8(egressDeniedError, "egressDeniedError");
|
|
31137
31420
|
__name(isEgressDeniedError, "isEgressDeniedError");
|
|
31138
|
-
|
|
31421
|
+
__name8(isEgressDeniedError, "isEgressDeniedError");
|
|
31139
31422
|
__name(resolveEgressProbeMs, "resolveEgressProbeMs");
|
|
31140
|
-
|
|
31423
|
+
__name8(resolveEgressProbeMs, "resolveEgressProbeMs");
|
|
31141
31424
|
dnsLookup = promisify(dns.lookup);
|
|
31142
31425
|
DEFAULT_BLOCK_CIDRS = [
|
|
31143
31426
|
// IPv4
|
|
@@ -31162,116 +31445,116 @@ var init_dist4 = __esm({
|
|
|
31162
31445
|
"fd00:ec2::254/128"
|
|
31163
31446
|
];
|
|
31164
31447
|
__name(ipv4ToInt, "ipv4ToInt");
|
|
31165
|
-
|
|
31448
|
+
__name8(ipv4ToInt, "ipv4ToInt");
|
|
31166
31449
|
__name(ipv6ToBigInt, "ipv6ToBigInt");
|
|
31167
|
-
|
|
31450
|
+
__name8(ipv6ToBigInt, "ipv6ToBigInt");
|
|
31168
31451
|
__name(ipv4MappedFromIpv6, "ipv4MappedFromIpv6");
|
|
31169
|
-
|
|
31452
|
+
__name8(ipv4MappedFromIpv6, "ipv4MappedFromIpv6");
|
|
31170
31453
|
__name(parseCidr, "parseCidr");
|
|
31171
|
-
|
|
31454
|
+
__name8(parseCidr, "parseCidr");
|
|
31172
31455
|
__name(ipInCidr, "ipInCidr");
|
|
31173
|
-
|
|
31456
|
+
__name8(ipInCidr, "ipInCidr");
|
|
31174
31457
|
__name(normalizeHostname, "normalizeHostname");
|
|
31175
|
-
|
|
31458
|
+
__name8(normalizeHostname, "normalizeHostname");
|
|
31176
31459
|
__name(parseAllowedHostname, "parseAllowedHostname");
|
|
31177
|
-
|
|
31460
|
+
__name8(parseAllowedHostname, "parseAllowedHostname");
|
|
31178
31461
|
__name(compile, "compile");
|
|
31179
|
-
|
|
31462
|
+
__name8(compile, "compile");
|
|
31180
31463
|
__name(isAllowedHostname, "isAllowedHostname");
|
|
31181
|
-
|
|
31464
|
+
__name8(isAllowedHostname, "isAllowedHostname");
|
|
31182
31465
|
__name(checkAddress, "checkAddress");
|
|
31183
|
-
|
|
31466
|
+
__name8(checkAddress, "checkAddress");
|
|
31184
31467
|
__name(resolveAndCheck, "resolveAndCheck");
|
|
31185
|
-
|
|
31468
|
+
__name8(resolveAndCheck, "resolveAndCheck");
|
|
31186
31469
|
__name(emit, "emit");
|
|
31187
|
-
|
|
31470
|
+
__name8(emit, "emit");
|
|
31188
31471
|
__name(extractHostname, "extractHostname");
|
|
31189
|
-
|
|
31472
|
+
__name8(extractHostname, "extractHostname");
|
|
31190
31473
|
__name(stripBrackets, "stripBrackets");
|
|
31191
|
-
|
|
31474
|
+
__name8(stripBrackets, "stripBrackets");
|
|
31192
31475
|
__name(parseHostHeader, "parseHostHeader");
|
|
31193
|
-
|
|
31476
|
+
__name8(parseHostHeader, "parseHostHeader");
|
|
31194
31477
|
__name(buildFetchDispatcher, "buildFetchDispatcher");
|
|
31195
|
-
|
|
31478
|
+
__name8(buildFetchDispatcher, "buildFetchDispatcher");
|
|
31196
31479
|
__name(wrapFetch, "wrapFetch");
|
|
31197
|
-
|
|
31480
|
+
__name8(wrapFetch, "wrapFetch");
|
|
31198
31481
|
__name(privateProbeTarget, "privateProbeTarget");
|
|
31199
|
-
|
|
31482
|
+
__name8(privateProbeTarget, "privateProbeTarget");
|
|
31200
31483
|
__name(fetchWithPrivateProbe, "fetchWithPrivateProbe");
|
|
31201
|
-
|
|
31484
|
+
__name8(fetchWithPrivateProbe, "fetchWithPrivateProbe");
|
|
31202
31485
|
__name(buildBlockingLookup, "buildBlockingLookup");
|
|
31203
|
-
|
|
31486
|
+
__name8(buildBlockingLookup, "buildBlockingLookup");
|
|
31204
31487
|
__name(wrapHttpLike, "wrapHttpLike");
|
|
31205
|
-
|
|
31488
|
+
__name8(wrapHttpLike, "wrapHttpLike");
|
|
31206
31489
|
__name(wrapHttpModule, "wrapHttpModule");
|
|
31207
|
-
|
|
31490
|
+
__name8(wrapHttpModule, "wrapHttpModule");
|
|
31208
31491
|
__name(wrapHttpsModule, "wrapHttpsModule");
|
|
31209
|
-
|
|
31492
|
+
__name8(wrapHttpsModule, "wrapHttpsModule");
|
|
31210
31493
|
__name(guardConnectArgs, "guardConnectArgs");
|
|
31211
|
-
|
|
31494
|
+
__name8(guardConnectArgs, "guardConnectArgs");
|
|
31212
31495
|
__name(wrapNetModule, "wrapNetModule");
|
|
31213
|
-
|
|
31496
|
+
__name8(wrapNetModule, "wrapNetModule");
|
|
31214
31497
|
__name(wrapTlsModule, "wrapTlsModule");
|
|
31215
|
-
|
|
31498
|
+
__name8(wrapTlsModule, "wrapTlsModule");
|
|
31216
31499
|
__name(wrapHttp2Module, "wrapHttp2Module");
|
|
31217
|
-
|
|
31500
|
+
__name8(wrapHttp2Module, "wrapHttp2Module");
|
|
31218
31501
|
TEST_EGRESS_BLOCKED_CODE = "TEST_EGRESS_BLOCKED";
|
|
31219
31502
|
__name(testEgressBlockedError, "testEgressBlockedError");
|
|
31220
|
-
|
|
31503
|
+
__name8(testEgressBlockedError, "testEgressBlockedError");
|
|
31221
31504
|
__name(isTestEgressBlockedError, "isTestEgressBlockedError");
|
|
31222
|
-
|
|
31505
|
+
__name8(isTestEgressBlockedError, "isTestEgressBlockedError");
|
|
31223
31506
|
REDACTED = "[REDACTED]";
|
|
31224
31507
|
SENSITIVE_NAME = /auth|cookie|token|secret|passw|pwd|api[-_]?key|access[-_]?key|private[-_]?key|subscription[-_]?key|session|signature|^sig$|^key$|credential/i;
|
|
31225
31508
|
SENSITIVE_HEADER = new RegExp(`${SENSITIVE_NAME.source}|key|subscription`, "i");
|
|
31226
31509
|
__name(redactHeaders, "redactHeaders");
|
|
31227
|
-
|
|
31510
|
+
__name8(redactHeaders, "redactHeaders");
|
|
31228
31511
|
ENCODED_REDACTED = /%5BREDACTED%5D/g;
|
|
31229
31512
|
__name(readableRedacted, "readableRedacted");
|
|
31230
|
-
|
|
31513
|
+
__name8(readableRedacted, "readableRedacted");
|
|
31231
31514
|
TELEGRAM_BOT_TOKEN_SEGMENT = /^bot\d+:[A-Za-z0-9_-]+$/;
|
|
31232
31515
|
__name(redactSecretPath, "redactSecretPath");
|
|
31233
|
-
|
|
31516
|
+
__name8(redactSecretPath, "redactSecretPath");
|
|
31234
31517
|
__name(redactUrl, "redactUrl");
|
|
31235
|
-
|
|
31518
|
+
__name8(redactUrl, "redactUrl");
|
|
31236
31519
|
MAX_REDACT_DEPTH = 8;
|
|
31237
31520
|
__name(redactJsonValue, "redactJsonValue");
|
|
31238
|
-
|
|
31521
|
+
__name8(redactJsonValue, "redactJsonValue");
|
|
31239
31522
|
__name(redactBody, "redactBody");
|
|
31240
|
-
|
|
31523
|
+
__name8(redactBody, "redactBody");
|
|
31241
31524
|
__name(globToRegExp, "globToRegExp");
|
|
31242
|
-
|
|
31525
|
+
__name8(globToRegExp, "globToRegExp");
|
|
31243
31526
|
__name(compileFixtures, "compileFixtures");
|
|
31244
|
-
|
|
31527
|
+
__name8(compileFixtures, "compileFixtures");
|
|
31245
31528
|
__name(tagOf, "tagOf");
|
|
31246
|
-
|
|
31529
|
+
__name8(tagOf, "tagOf");
|
|
31247
31530
|
__name(isRequestLike, "isRequestLike");
|
|
31248
|
-
|
|
31531
|
+
__name8(isRequestLike, "isRequestLike");
|
|
31249
31532
|
__name(describeBody, "describeBody");
|
|
31250
|
-
|
|
31533
|
+
__name8(describeBody, "describeBody");
|
|
31251
31534
|
__name(buildResponse, "buildResponse");
|
|
31252
|
-
|
|
31535
|
+
__name8(buildResponse, "buildResponse");
|
|
31253
31536
|
__name(buildRecordFetch, "buildRecordFetch");
|
|
31254
|
-
|
|
31537
|
+
__name8(buildRecordFetch, "buildRecordFetch");
|
|
31255
31538
|
__name(abortReason, "abortReason");
|
|
31256
|
-
|
|
31539
|
+
__name8(abortReason, "abortReason");
|
|
31257
31540
|
__name(blocker, "blocker");
|
|
31258
|
-
|
|
31541
|
+
__name8(blocker, "blocker");
|
|
31259
31542
|
__name(lockMethod, "lockMethod");
|
|
31260
|
-
|
|
31543
|
+
__name8(lockMethod, "lockMethod");
|
|
31261
31544
|
__name(blockedSubclass, "blockedSubclass");
|
|
31262
|
-
|
|
31545
|
+
__name8(blockedSubclass, "blockedSubclass");
|
|
31263
31546
|
__name(shallowCopy, "shallowCopy");
|
|
31264
|
-
|
|
31547
|
+
__name8(shallowCopy, "shallowCopy");
|
|
31265
31548
|
__name(blockedCtor, "blockedCtor");
|
|
31266
|
-
|
|
31549
|
+
__name8(blockedCtor, "blockedCtor");
|
|
31267
31550
|
__name(blockHttpLike, "blockHttpLike");
|
|
31268
|
-
|
|
31551
|
+
__name8(blockHttpLike, "blockHttpLike");
|
|
31269
31552
|
__name(blockNet, "blockNet");
|
|
31270
|
-
|
|
31553
|
+
__name8(blockNet, "blockNet");
|
|
31271
31554
|
__name(blockTls, "blockTls");
|
|
31272
|
-
|
|
31555
|
+
__name8(blockTls, "blockTls");
|
|
31273
31556
|
__name(blockHttp2, "blockHttp2");
|
|
31274
|
-
|
|
31557
|
+
__name8(blockHttp2, "blockHttp2");
|
|
31275
31558
|
CHILD_PROCESS_ENTRY_POINTS = [
|
|
31276
31559
|
"spawn",
|
|
31277
31560
|
"spawnSync",
|
|
@@ -31283,13 +31566,13 @@ var init_dist4 = __esm({
|
|
|
31283
31566
|
"_forkChild"
|
|
31284
31567
|
];
|
|
31285
31568
|
__name(blockChildProcess, "blockChildProcess");
|
|
31286
|
-
|
|
31569
|
+
__name8(blockChildProcess, "blockChildProcess");
|
|
31287
31570
|
__name(blockWorkerThreads, "blockWorkerThreads");
|
|
31288
|
-
|
|
31571
|
+
__name8(blockWorkerThreads, "blockWorkerThreads");
|
|
31289
31572
|
__name(blockCluster, "blockCluster");
|
|
31290
|
-
|
|
31573
|
+
__name8(blockCluster, "blockCluster");
|
|
31291
31574
|
__name(blockModuleModule, "blockModuleModule");
|
|
31292
|
-
|
|
31575
|
+
__name8(blockModuleModule, "blockModuleModule");
|
|
31293
31576
|
EXTERNAL_NETWORK_PACKAGES_BLOCKED = [
|
|
31294
31577
|
"ws",
|
|
31295
31578
|
"socket.io-client"
|
|
@@ -31306,54 +31589,54 @@ var init_dist4 = __esm({
|
|
|
31306
31589
|
"inspector/promises"
|
|
31307
31590
|
]);
|
|
31308
31591
|
__name(isTestEgressRequireBlocked, "isTestEgressRequireBlocked");
|
|
31309
|
-
|
|
31592
|
+
__name8(isTestEgressRequireBlocked, "isTestEgressRequireBlocked");
|
|
31310
31593
|
NODE_FETCH_MAIN_FILES = /* @__PURE__ */ new Set([
|
|
31311
31594
|
"lib/index.js",
|
|
31312
31595
|
"lib/index"
|
|
31313
31596
|
]);
|
|
31314
31597
|
__name(isNodeFetchId, "isNodeFetchId");
|
|
31315
|
-
|
|
31598
|
+
__name8(isNodeFetchId, "isNodeFetchId");
|
|
31316
31599
|
__name(isPathId, "isPathId");
|
|
31317
|
-
|
|
31600
|
+
__name8(isPathId, "isPathId");
|
|
31318
31601
|
__name(packageOfResolvedPath, "packageOfResolvedPath");
|
|
31319
|
-
|
|
31602
|
+
__name8(packageOfResolvedPath, "packageOfResolvedPath");
|
|
31320
31603
|
__name(interceptedIdForPath, "interceptedIdForPath");
|
|
31321
|
-
|
|
31604
|
+
__name8(interceptedIdForPath, "interceptedIdForPath");
|
|
31322
31605
|
__name(namedError, "namedError");
|
|
31323
|
-
|
|
31606
|
+
__name8(namedError, "namedError");
|
|
31324
31607
|
__name(buildNodeFetchShim, "buildNodeFetchShim");
|
|
31325
|
-
|
|
31608
|
+
__name8(buildNodeFetchShim, "buildNodeFetchShim");
|
|
31326
31609
|
__name(testEgressRequireOverride, "testEgressRequireOverride");
|
|
31327
|
-
|
|
31610
|
+
__name8(testEgressRequireOverride, "testEgressRequireOverride");
|
|
31328
31611
|
__name(wrapModuleForTestEgress, "wrapModuleForTestEgress");
|
|
31329
|
-
|
|
31612
|
+
__name8(wrapModuleForTestEgress, "wrapModuleForTestEgress");
|
|
31330
31613
|
__name(createBaseSandboxContext, "createBaseSandboxContext");
|
|
31331
|
-
|
|
31614
|
+
__name8(createBaseSandboxContext, "createBaseSandboxContext");
|
|
31332
31615
|
__name(applyGlobalSelfReference, "applyGlobalSelfReference");
|
|
31333
|
-
|
|
31616
|
+
__name8(applyGlobalSelfReference, "applyGlobalSelfReference");
|
|
31334
31617
|
__name(resolveExtraAllowedCidrs, "resolveExtraAllowedCidrs");
|
|
31335
|
-
|
|
31618
|
+
__name8(resolveExtraAllowedCidrs, "resolveExtraAllowedCidrs");
|
|
31336
31619
|
__name(resolveExtraAllowedHostnames, "resolveExtraAllowedHostnames");
|
|
31337
|
-
|
|
31620
|
+
__name8(resolveExtraAllowedHostnames, "resolveExtraAllowedHostnames");
|
|
31338
31621
|
PINNED_ADDRESSES = /* @__PURE__ */ Symbol.for("lua.pinnedDispatch.addresses");
|
|
31339
31622
|
__name(pinnedLookup, "pinnedLookup");
|
|
31340
|
-
|
|
31623
|
+
__name8(pinnedLookup, "pinnedLookup");
|
|
31341
31624
|
__name(pinnedDispatcherFor, "pinnedDispatcherFor");
|
|
31342
|
-
|
|
31625
|
+
__name8(pinnedDispatcherFor, "pinnedDispatcherFor");
|
|
31343
31626
|
__name(pinnedAddressesOf, "pinnedAddressesOf");
|
|
31344
|
-
|
|
31627
|
+
__name8(pinnedAddressesOf, "pinnedAddressesOf");
|
|
31345
31628
|
__name(withPinnedDispatcher, "withPinnedDispatcher");
|
|
31346
|
-
|
|
31629
|
+
__name8(withPinnedDispatcher, "withPinnedDispatcher");
|
|
31347
31630
|
__name(wrapBundleAsCjsModule, "wrapBundleAsCjsModule");
|
|
31348
|
-
|
|
31631
|
+
__name8(wrapBundleAsCjsModule, "wrapBundleAsCjsModule");
|
|
31349
31632
|
__name(runBundleInContext, "runBundleInContext");
|
|
31350
|
-
|
|
31633
|
+
__name8(runBundleInContext, "runBundleInContext");
|
|
31351
31634
|
WorkflowDeterminismError = class extends Error {
|
|
31352
31635
|
static {
|
|
31353
31636
|
__name(this, "WorkflowDeterminismError");
|
|
31354
31637
|
}
|
|
31355
31638
|
static {
|
|
31356
|
-
|
|
31639
|
+
__name8(this, "WorkflowDeterminismError");
|
|
31357
31640
|
}
|
|
31358
31641
|
api;
|
|
31359
31642
|
code = "WORKFLOW_DETERMINISM";
|
|
@@ -31449,7 +31732,7 @@ var init_dist4 = __esm({
|
|
|
31449
31732
|
"compressCode"
|
|
31450
31733
|
];
|
|
31451
31734
|
__name(buildWorkflowScriptGlobals, "buildWorkflowScriptGlobals");
|
|
31452
|
-
|
|
31735
|
+
__name8(buildWorkflowScriptGlobals, "buildWorkflowScriptGlobals");
|
|
31453
31736
|
USER_CODE_ERROR_CODE = "USER_CODE_ERROR";
|
|
31454
31737
|
PLATFORM_VM_ERROR_CODE = "PLATFORM_VM_ERROR";
|
|
31455
31738
|
UserCodeError = class extends Error {
|
|
@@ -31457,7 +31740,7 @@ var init_dist4 = __esm({
|
|
|
31457
31740
|
__name(this, "UserCodeError");
|
|
31458
31741
|
}
|
|
31459
31742
|
static {
|
|
31460
|
-
|
|
31743
|
+
__name8(this, "UserCodeError");
|
|
31461
31744
|
}
|
|
31462
31745
|
code = USER_CODE_ERROR_CODE;
|
|
31463
31746
|
source;
|
|
@@ -31473,18 +31756,18 @@ var init_dist4 = __esm({
|
|
|
31473
31756
|
}
|
|
31474
31757
|
};
|
|
31475
31758
|
__name(isUserCodeError, "isUserCodeError");
|
|
31476
|
-
|
|
31759
|
+
__name8(isUserCodeError, "isUserCodeError");
|
|
31477
31760
|
__name(isPlatformVmError, "isPlatformVmError");
|
|
31478
|
-
|
|
31761
|
+
__name8(isPlatformVmError, "isPlatformVmError");
|
|
31479
31762
|
DEFAULT_MAX_CAUSE_DEPTH = 10;
|
|
31480
31763
|
__name(findUserCodeErrorInCauseChain, "findUserCodeErrorInCauseChain");
|
|
31481
|
-
|
|
31764
|
+
__name8(findUserCodeErrorInCauseChain, "findUserCodeErrorInCauseChain");
|
|
31482
31765
|
MissingPrimitiveCodeError = class extends Error {
|
|
31483
31766
|
static {
|
|
31484
31767
|
__name(this, "MissingPrimitiveCodeError");
|
|
31485
31768
|
}
|
|
31486
31769
|
static {
|
|
31487
|
-
|
|
31770
|
+
__name8(this, "MissingPrimitiveCodeError");
|
|
31488
31771
|
}
|
|
31489
31772
|
code = PLATFORM_VM_ERROR_CODE;
|
|
31490
31773
|
source;
|
|
@@ -31501,26 +31784,26 @@ var init_dist4 = __esm({
|
|
|
31501
31784
|
}
|
|
31502
31785
|
};
|
|
31503
31786
|
__name(assertPrimitiveCodePresent, "assertPrimitiveCodePresent");
|
|
31504
|
-
|
|
31787
|
+
__name8(assertPrimitiveCodePresent, "assertPrimitiveCodePresent");
|
|
31505
31788
|
__name(withUserCodeBoundary, "withUserCodeBoundary");
|
|
31506
|
-
|
|
31789
|
+
__name8(withUserCodeBoundary, "withUserCodeBoundary");
|
|
31507
31790
|
__name(logUserCodeOrError, "logUserCodeOrError");
|
|
31508
|
-
|
|
31791
|
+
__name8(logUserCodeOrError, "logUserCodeOrError");
|
|
31509
31792
|
__name(normalizeAddressHost, "normalizeAddressHost");
|
|
31510
|
-
|
|
31793
|
+
__name8(normalizeAddressHost, "normalizeAddressHost");
|
|
31511
31794
|
__name(ipv6Hextets, "ipv6Hextets");
|
|
31512
|
-
|
|
31795
|
+
__name8(ipv6Hextets, "ipv6Hextets");
|
|
31513
31796
|
__name(classifyV4, "classifyV4");
|
|
31514
|
-
|
|
31797
|
+
__name8(classifyV4, "classifyV4");
|
|
31515
31798
|
__name(classifyBlockedAddress, "classifyBlockedAddress");
|
|
31516
|
-
|
|
31799
|
+
__name8(classifyBlockedAddress, "classifyBlockedAddress");
|
|
31517
31800
|
BLOCKED_ADDRESS_CODE = "EBLOCKEDADDRESS";
|
|
31518
31801
|
BlockedAddressError = class extends Error {
|
|
31519
31802
|
static {
|
|
31520
31803
|
__name(this, "BlockedAddressError");
|
|
31521
31804
|
}
|
|
31522
31805
|
static {
|
|
31523
|
-
|
|
31806
|
+
__name8(this, "BlockedAddressError");
|
|
31524
31807
|
}
|
|
31525
31808
|
code = BLOCKED_ADDRESS_CODE;
|
|
31526
31809
|
host;
|
|
@@ -31537,24 +31820,24 @@ var init_dist4 = __esm({
|
|
|
31537
31820
|
}
|
|
31538
31821
|
};
|
|
31539
31822
|
__name(isBlockedAddressError, "isBlockedAddressError");
|
|
31540
|
-
|
|
31541
|
-
defaultResolve = /* @__PURE__ */
|
|
31823
|
+
__name8(isBlockedAddressError, "isBlockedAddressError");
|
|
31824
|
+
defaultResolve = /* @__PURE__ */ __name8(async (host) => (await dnsPromises.lookup(host, {
|
|
31542
31825
|
all: true,
|
|
31543
31826
|
verbatim: true
|
|
31544
31827
|
})).map((r) => r.address), "defaultResolve");
|
|
31545
31828
|
__name(guardedLookup, "guardedLookup");
|
|
31546
|
-
|
|
31829
|
+
__name8(guardedLookup, "guardedLookup");
|
|
31547
31830
|
__name(createGuardedDispatcher, "createGuardedDispatcher");
|
|
31548
|
-
|
|
31831
|
+
__name8(createGuardedDispatcher, "createGuardedDispatcher");
|
|
31549
31832
|
__name(fetchVia, "fetchVia");
|
|
31550
|
-
|
|
31833
|
+
__name8(fetchVia, "fetchVia");
|
|
31551
31834
|
MCP_URL_BLOCKED_CODE = "MCP_URL_BLOCKED";
|
|
31552
31835
|
McpUrlBlockedError = class extends Error {
|
|
31553
31836
|
static {
|
|
31554
31837
|
__name(this, "McpUrlBlockedError");
|
|
31555
31838
|
}
|
|
31556
31839
|
static {
|
|
31557
|
-
|
|
31840
|
+
__name8(this, "McpUrlBlockedError");
|
|
31558
31841
|
}
|
|
31559
31842
|
code = MCP_URL_BLOCKED_CODE;
|
|
31560
31843
|
host;
|
|
@@ -31569,24 +31852,24 @@ var init_dist4 = __esm({
|
|
|
31569
31852
|
}
|
|
31570
31853
|
};
|
|
31571
31854
|
__name(isMcpUrlBlockedError, "isMcpUrlBlockedError");
|
|
31572
|
-
|
|
31855
|
+
__name8(isMcpUrlBlockedError, "isMcpUrlBlockedError");
|
|
31573
31856
|
__name(resolveMcpSsrfGuardMode, "resolveMcpSsrfGuardMode");
|
|
31574
|
-
|
|
31857
|
+
__name8(resolveMcpSsrfGuardMode, "resolveMcpSsrfGuardMode");
|
|
31575
31858
|
normalizeHost = normalizeAddressHost;
|
|
31576
31859
|
__name(hostListEntry, "hostListEntry");
|
|
31577
|
-
|
|
31860
|
+
__name8(hostListEntry, "hostListEntry");
|
|
31578
31861
|
__name(parseHostList, "parseHostList");
|
|
31579
|
-
|
|
31862
|
+
__name8(parseHostList, "parseHostList");
|
|
31580
31863
|
__name(parseMcpSsrfAllowHosts, "parseMcpSsrfAllowHosts");
|
|
31581
|
-
|
|
31864
|
+
__name8(parseMcpSsrfAllowHosts, "parseMcpSsrfAllowHosts");
|
|
31582
31865
|
DEFAULT_UNIFIED_MCP_HOSTS = /* @__PURE__ */ new Set([
|
|
31583
31866
|
"mcp-api.unified.to"
|
|
31584
31867
|
]);
|
|
31585
31868
|
__name(isTrustedUnifiedMcpHost, "isTrustedUnifiedMcpHost");
|
|
31586
|
-
|
|
31869
|
+
__name8(isTrustedUnifiedMcpHost, "isTrustedUnifiedMcpHost");
|
|
31587
31870
|
__name(classifyHostname, "classifyHostname");
|
|
31588
|
-
|
|
31589
|
-
defaultLookup = /* @__PURE__ */
|
|
31871
|
+
__name8(classifyHostname, "classifyHostname");
|
|
31872
|
+
defaultLookup = /* @__PURE__ */ __name8(async (host) => {
|
|
31590
31873
|
const records = await dns2.lookup(host, {
|
|
31591
31874
|
all: true,
|
|
31592
31875
|
verbatim: true
|
|
@@ -31598,7 +31881,7 @@ var init_dist4 = __esm({
|
|
|
31598
31881
|
__name(this, "_McpUrlGuard");
|
|
31599
31882
|
}
|
|
31600
31883
|
static {
|
|
31601
|
-
|
|
31884
|
+
__name8(this, "McpUrlGuard");
|
|
31602
31885
|
}
|
|
31603
31886
|
opts;
|
|
31604
31887
|
allowMemo = /* @__PURE__ */ new Map();
|
|
@@ -31652,7 +31935,7 @@ var init_dist4 = __esm({
|
|
|
31652
31935
|
...this.opts.lookup ? {
|
|
31653
31936
|
resolve: this.opts.lookup
|
|
31654
31937
|
} : {},
|
|
31655
|
-
onBlocked: /* @__PURE__ */
|
|
31938
|
+
onBlocked: /* @__PURE__ */ __name8((info) => this.opts.onConnectBlocked?.(info), "onBlocked")
|
|
31656
31939
|
});
|
|
31657
31940
|
this.guardedFetch = fetchVia(dispatcher);
|
|
31658
31941
|
}
|
|
@@ -32186,10 +32469,11 @@ function deterministicCrypto() {
|
|
|
32186
32469
|
}
|
|
32187
32470
|
});
|
|
32188
32471
|
}
|
|
32189
|
-
function throwingFacade(name) {
|
|
32472
|
+
function throwingFacade(name, pure = {}) {
|
|
32190
32473
|
return new Proxy({}, {
|
|
32191
32474
|
get: /* @__PURE__ */ __name((_t, prop) => {
|
|
32192
32475
|
if (prop === "then" || typeof prop === "symbol") return void 0;
|
|
32476
|
+
if (Object.hasOwn(pure, prop)) return pure[prop];
|
|
32193
32477
|
return notStaticStub(`${name}.${String(prop)}`)();
|
|
32194
32478
|
}, "get")
|
|
32195
32479
|
});
|
|
@@ -32240,7 +32524,7 @@ function createSerializationContext() {
|
|
|
32240
32524
|
});
|
|
32241
32525
|
}, "sandboxRequire");
|
|
32242
32526
|
const facades = {};
|
|
32243
|
-
for (const name of PLATFORM_GLOBALS) facades[name] = throwingFacade(name);
|
|
32527
|
+
for (const name of PLATFORM_GLOBALS) facades[name] = throwingFacade(name, PURE_FACADE_MEMBERS[name]);
|
|
32244
32528
|
const context = vm3.createContext({
|
|
32245
32529
|
...PRIMITIVE_SHIMS,
|
|
32246
32530
|
...facades,
|
|
@@ -32817,11 +33101,12 @@ function applyInheritCandidate(d) {
|
|
|
32817
33101
|
})
|
|
32818
33102
|
};
|
|
32819
33103
|
}
|
|
32820
|
-
var NOT_STATIC, isNotStatic, isBuildError, inheritRefsOf, COMMITTED_WORKFLOW_MEMBERS, isCommittedWorkflow, PLATFORM_GLOBALS, calleeName, kindOf, GRAPH_HASH_PLACEHOLDER, issueKey;
|
|
33104
|
+
var NOT_STATIC, isNotStatic, isBuildError, inheritRefsOf, COMMITTED_WORKFLOW_MEMBERS, isCommittedWorkflow, PLATFORM_GLOBALS, PURE_FACADE_MEMBERS, calleeName, kindOf, GRAPH_HASH_PLACEHOLDER, issueKey;
|
|
32821
33105
|
var init_graph_serializer = __esm({
|
|
32822
33106
|
"src/compiler/utils/graph-serializer.ts"() {
|
|
32823
33107
|
"use strict";
|
|
32824
33108
|
init_dist4();
|
|
33109
|
+
init_decisions_api();
|
|
32825
33110
|
init_dist();
|
|
32826
33111
|
init_dist2();
|
|
32827
33112
|
init_compile_constants();
|
|
@@ -32867,6 +33152,13 @@ var init_graph_serializer = __esm({
|
|
|
32867
33152
|
"Threads",
|
|
32868
33153
|
"Browser"
|
|
32869
33154
|
];
|
|
33155
|
+
PURE_FACADE_MEMBERS = {
|
|
33156
|
+
Decisions: {
|
|
33157
|
+
odds,
|
|
33158
|
+
choice,
|
|
33159
|
+
score
|
|
33160
|
+
}
|
|
33161
|
+
};
|
|
32870
33162
|
__name(safeDate, "safeDate");
|
|
32871
33163
|
__name(safeMath, "safeMath");
|
|
32872
33164
|
__name(createSerializationContext, "createSerializationContext");
|
|
@@ -34137,217 +34429,6 @@ var init_browser_plugin = __esm({
|
|
|
34137
34429
|
}
|
|
34138
34430
|
});
|
|
34139
34431
|
|
|
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
34432
|
// src/compiler/plugins/decision.plugin.ts
|
|
34352
34433
|
import fs8 from "fs/promises";
|
|
34353
34434
|
import { Node as Node20 } from "ts-morph";
|
|
@@ -34666,7 +34747,13 @@ import { build } from "esbuild";
|
|
|
34666
34747
|
function nodeCapabilityUnavailableMessage(specifier) {
|
|
34667
34748
|
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
34749
|
}
|
|
34669
|
-
|
|
34750
|
+
function workflowConstantUnavailableMessage(name, specifier) {
|
|
34751
|
+
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`;
|
|
34752
|
+
}
|
|
34753
|
+
function isLuaCliSpecifier(spec) {
|
|
34754
|
+
return spec === "lua-cli" || spec === "lua-cli/skill" || spec === "lua-cli/voice" || spec.includes("api-exports");
|
|
34755
|
+
}
|
|
34756
|
+
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
34757
|
var init_bundler = __esm({
|
|
34671
34758
|
"src/compiler/bundler.ts"() {
|
|
34672
34759
|
"use strict";
|
|
@@ -34694,9 +34781,34 @@ export function defineWebApp(config) {
|
|
|
34694
34781
|
return config;
|
|
34695
34782
|
}
|
|
34696
34783
|
`;
|
|
34784
|
+
INERT_WORKFLOW_BUILDER_SPECIFIER = "lua-cli-inert-workflow-builder";
|
|
34785
|
+
INERT_WORKFLOW_BUILDER_NAMESPACE = "lua-inert-workflow-builder";
|
|
34786
|
+
WORKFLOW_SHIM_NAME_SET = new Set(WORKFLOW_SHIM_NAMES);
|
|
34787
|
+
INERT_WORKFLOW_BUILDER_SOURCE = `function inert() {
|
|
34788
|
+
return new Proxy(function () {}, {
|
|
34789
|
+
get: (_target, key) => (typeof key === 'symbol' ? undefined : inert()),
|
|
34790
|
+
apply: () => inert(),
|
|
34791
|
+
construct: () => inert(),
|
|
34792
|
+
});
|
|
34793
|
+
}
|
|
34794
|
+
` + WORKFLOW_SHIM_NAMES.map((name) => `export function ${name}() {
|
|
34795
|
+
return inert();
|
|
34796
|
+
}
|
|
34797
|
+
`).join("");
|
|
34697
34798
|
NODE_CAPABILITY_UNAVAILABLE = "node-capability-unavailable";
|
|
34698
34799
|
NODE_CAPABILITY_GUARDED = /^(node:)?(child_process|worker_threads|cluster)$/;
|
|
34699
34800
|
__name(nodeCapabilityUnavailableMessage, "nodeCapabilityUnavailableMessage");
|
|
34801
|
+
WORKFLOW_CONSTANT_UNAVAILABLE = "workflow-constant-unavailable";
|
|
34802
|
+
WORKFLOW_CONSTANT_NAMES = [
|
|
34803
|
+
"WORKFLOW_DEFAULT_MAX_DURATION_SECONDS",
|
|
34804
|
+
"WORKFLOW_HITL_MAX_DURATION_SECONDS"
|
|
34805
|
+
];
|
|
34806
|
+
COMPILE_GUARD_CODES = [
|
|
34807
|
+
NODE_CAPABILITY_UNAVAILABLE,
|
|
34808
|
+
WORKFLOW_CONSTANT_UNAVAILABLE
|
|
34809
|
+
];
|
|
34810
|
+
__name(workflowConstantUnavailableMessage, "workflowConstantUnavailableMessage");
|
|
34811
|
+
__name(isLuaCliSpecifier, "isLuaCliSpecifier");
|
|
34700
34812
|
Bundler = class {
|
|
34701
34813
|
static {
|
|
34702
34814
|
__name(this, "Bundler");
|
|
@@ -34738,18 +34850,40 @@ export function defineWebApp(config) {
|
|
|
34738
34850
|
*
|
|
34739
34851
|
* Replaces the prior `buildLuaCliStubBlock` runtime-stub approach (BAC-234).
|
|
34740
34852
|
*/
|
|
34741
|
-
stripLuaCliImportsAST(code, filename
|
|
34853
|
+
stripLuaCliImportsAST(code, filename, stubWorkflowBuilders) {
|
|
34742
34854
|
try {
|
|
34743
34855
|
const tempFile = this.project.createSourceFile(`__strip_${filename}`, code, {
|
|
34744
34856
|
overwrite: true
|
|
34745
34857
|
});
|
|
34746
34858
|
rewriteCrossFileCallsInSourceFile(tempFile, this.crossFileSpecs, this.sdkBaseClassNames);
|
|
34859
|
+
const inertBindings = /* @__PURE__ */ new Map();
|
|
34747
34860
|
tempFile.getImportDeclarations().forEach((imp) => {
|
|
34748
34861
|
const spec = imp.getModuleSpecifierValue();
|
|
34749
34862
|
if (spec === "lua-cli" || spec === "lua-cli/skill" || spec === "lua-cli/voice" || spec.includes("api-exports")) {
|
|
34863
|
+
if (stubWorkflowBuilders && !imp.isTypeOnly()) {
|
|
34864
|
+
for (const named of imp.getNamedImports()) {
|
|
34865
|
+
const name = named.getName();
|
|
34866
|
+
if (named.isTypeOnly() || !WORKFLOW_SHIM_NAME_SET.has(name)) continue;
|
|
34867
|
+
const alias = named.getAliasNode()?.getText();
|
|
34868
|
+
inertBindings.set(alias ?? name, alias ? {
|
|
34869
|
+
name,
|
|
34870
|
+
alias
|
|
34871
|
+
} : {
|
|
34872
|
+
name
|
|
34873
|
+
});
|
|
34874
|
+
}
|
|
34875
|
+
}
|
|
34750
34876
|
imp.remove();
|
|
34751
34877
|
}
|
|
34752
34878
|
});
|
|
34879
|
+
if (inertBindings.size > 0) {
|
|
34880
|
+
tempFile.insertImportDeclaration(0, {
|
|
34881
|
+
namedImports: [
|
|
34882
|
+
...inertBindings.values()
|
|
34883
|
+
],
|
|
34884
|
+
moduleSpecifier: INERT_WORKFLOW_BUILDER_SPECIFIER
|
|
34885
|
+
});
|
|
34886
|
+
}
|
|
34753
34887
|
const result = tempFile.getText();
|
|
34754
34888
|
this.project.removeSourceFile(tempFile);
|
|
34755
34889
|
return result;
|
|
@@ -34769,8 +34903,9 @@ export function defineWebApp(config) {
|
|
|
34769
34903
|
this.verbose(` Source: ${metadata.sourcePath}`);
|
|
34770
34904
|
this.verbose(` Output: ${outfile}`);
|
|
34771
34905
|
}
|
|
34772
|
-
const
|
|
34773
|
-
const
|
|
34906
|
+
const stubWorkflowBuilders = metadata.kind !== "workflow";
|
|
34907
|
+
const virtualSourcePlugin = this.createVirtualSourcePlugin(metadata, stubWorkflowBuilders);
|
|
34908
|
+
const luaCliShimPlugin = this.createLuaCliShimPlugin(metadata.kind, stubWorkflowBuilders);
|
|
34774
34909
|
const selfContainedWorkflow = metadata.kind === "workflow";
|
|
34775
34910
|
const inject = selfContainedWorkflow ? [
|
|
34776
34911
|
await this.writeWorkflowBuilderInject(tempDir)
|
|
@@ -34810,10 +34945,11 @@ export function defineWebApp(config) {
|
|
|
34810
34945
|
});
|
|
34811
34946
|
} catch (err) {
|
|
34812
34947
|
const failure2 = err;
|
|
34813
|
-
const
|
|
34948
|
+
const guardText = /* @__PURE__ */ __name((e) => typeof e.text === "string" ? e.text.replace(/^\[plugin [^\]]*\]\s*/, "") : "", "guardText");
|
|
34949
|
+
const guard = failure2?.errors?.find((e) => COMPILE_GUARD_CODES.some((c) => guardText(e).startsWith(c)));
|
|
34814
34950
|
if (guard) {
|
|
34815
34951
|
const at = guard.location ? ` (${guard.location.file}:${guard.location.line}:${guard.location.column + 1})` : "";
|
|
34816
|
-
throw new Error(`${guard
|
|
34952
|
+
throw new Error(`${guardText(guard)}${at}`);
|
|
34817
34953
|
}
|
|
34818
34954
|
throw err;
|
|
34819
34955
|
}
|
|
@@ -34930,10 +35066,56 @@ export { ${WORKFLOW_SHIM_NAMES.join(", ")} } from ${JSON.stringify(this.workflow
|
|
|
34930
35066
|
};
|
|
34931
35067
|
}
|
|
34932
35068
|
/**
|
|
35069
|
+
* BAC-2490: throw `workflow-constant-unavailable` when `code` value-imports or re-exports a workflow-only
|
|
35070
|
+
* constant from a lua-cli specifier. Type-only forms, comments and strings are fine. Best-effort: dynamic
|
|
35071
|
+
* `import()` / `require` are not covered.
|
|
35072
|
+
*/
|
|
35073
|
+
assertNoWorkflowConstants(code, filename) {
|
|
35074
|
+
if (!WORKFLOW_CONSTANT_NAMES.some((n2) => code.includes(n2)) && !/export\s*\*/.test(code)) return;
|
|
35075
|
+
const tempFile = this.project.createSourceFile(`__guard_${path10.basename(filename)}`, code, {
|
|
35076
|
+
overwrite: true
|
|
35077
|
+
});
|
|
35078
|
+
const fail = /* @__PURE__ */ __name((name, spec, pos) => {
|
|
35079
|
+
const { line, column } = tempFile.getLineAndColumnAtPos(pos);
|
|
35080
|
+
throw new Error(`${workflowConstantUnavailableMessage(name, spec)} (${filename}:${line}:${column})`);
|
|
35081
|
+
}, "fail");
|
|
35082
|
+
try {
|
|
35083
|
+
for (const imp of tempFile.getImportDeclarations()) {
|
|
35084
|
+
const spec = imp.getModuleSpecifierValue();
|
|
35085
|
+
if (!isLuaCliSpecifier(spec) || imp.isTypeOnly()) continue;
|
|
35086
|
+
for (const n2 of imp.getNamedImports()) {
|
|
35087
|
+
if (n2.isTypeOnly()) continue;
|
|
35088
|
+
if (WORKFLOW_CONSTANT_NAMES.includes(n2.getName())) fail(n2.getName(), spec, n2.getStart());
|
|
35089
|
+
}
|
|
35090
|
+
const ns = imp.getNamespaceImport();
|
|
35091
|
+
if (ns) {
|
|
35092
|
+
for (const c of WORKFLOW_CONSTANT_NAMES) {
|
|
35093
|
+
const idx = code.search(new RegExp(`\\b${ns.getText()}\\.${c}\\b`));
|
|
35094
|
+
if (idx >= 0) fail(c, spec, idx);
|
|
35095
|
+
}
|
|
35096
|
+
}
|
|
35097
|
+
}
|
|
35098
|
+
for (const exp of tempFile.getExportDeclarations()) {
|
|
35099
|
+
const spec = exp.getModuleSpecifierValue();
|
|
35100
|
+
if (!spec || !isLuaCliSpecifier(spec) || exp.isTypeOnly()) continue;
|
|
35101
|
+
const named = exp.getNamedExports();
|
|
35102
|
+
if (named.length === 0 && !exp.getNamespaceExport()) {
|
|
35103
|
+
fail(WORKFLOW_CONSTANT_NAMES.join(" / "), spec, exp.getStart());
|
|
35104
|
+
}
|
|
35105
|
+
for (const n2 of named) {
|
|
35106
|
+
if (n2.isTypeOnly()) continue;
|
|
35107
|
+
if (WORKFLOW_CONSTANT_NAMES.includes(n2.getName())) fail(n2.getName(), spec, n2.getStart());
|
|
35108
|
+
}
|
|
35109
|
+
}
|
|
35110
|
+
} finally {
|
|
35111
|
+
this.project.removeSourceFile(tempFile);
|
|
35112
|
+
}
|
|
35113
|
+
}
|
|
35114
|
+
/**
|
|
34933
35115
|
* Create esbuild plugin that serves the source file as a virtual module
|
|
34934
35116
|
* with an appended named export for the primitive.
|
|
34935
35117
|
*/
|
|
34936
|
-
createVirtualSourcePlugin(metadata) {
|
|
35118
|
+
createVirtualSourcePlugin(metadata, stubWorkflowBuilders) {
|
|
34937
35119
|
const bundler = this;
|
|
34938
35120
|
const sourcePath = metadata.sourcePath;
|
|
34939
35121
|
const exportName = metadata.exportName;
|
|
@@ -34961,7 +35143,10 @@ export { ${WORKFLOW_SHIM_NAMES.join(", ")} } from ${JSON.stringify(this.workflow
|
|
|
34961
35143
|
}, async () => {
|
|
34962
35144
|
const sourceFile = bundler.project.getSourceFile(sourcePath);
|
|
34963
35145
|
let content = sourceFile?.getText() ?? await fs9.readFile(sourcePath, "utf-8");
|
|
34964
|
-
|
|
35146
|
+
if (metadata.kind !== "workflow") {
|
|
35147
|
+
bundler.assertNoWorkflowConstants(content, sourcePath);
|
|
35148
|
+
}
|
|
35149
|
+
content = bundler.stripLuaCliImportsAST(content, path10.basename(sourcePath), stubWorkflowBuilders);
|
|
34965
35150
|
const virtualContent = metadata.isDefaultExport ? content : `${content}
|
|
34966
35151
|
export { ${exportName} as __lua_target__ };
|
|
34967
35152
|
`;
|
|
@@ -34979,8 +35164,9 @@ export { ${exportName} as __lua_target__ };
|
|
|
34979
35164
|
* Uses ts-morph to properly parse and remove import declarations, handling all edge cases
|
|
34980
35165
|
* including multiline imports, comments, and complex syntax that regex can't handle.
|
|
34981
35166
|
*/
|
|
34982
|
-
createLuaCliShimPlugin() {
|
|
34983
|
-
const
|
|
35167
|
+
createLuaCliShimPlugin(kind, stubWorkflowBuilders) {
|
|
35168
|
+
const assertNoConstants = this.assertNoWorkflowConstants.bind(this);
|
|
35169
|
+
const stripImports = /* @__PURE__ */ __name((code, filename) => this.stripLuaCliImportsAST(code, filename, stubWorkflowBuilders), "stripImports");
|
|
34984
35170
|
const isWorkflowBuilderSource = this.isWorkflowBuilderSource.bind(this);
|
|
34985
35171
|
return {
|
|
34986
35172
|
name: "lua-cli-import-stripper",
|
|
@@ -34995,6 +35181,7 @@ export { ${exportName} as __lua_target__ };
|
|
|
34995
35181
|
if (!contents.includes("lua-cli") && !contents.includes("api-exports")) {
|
|
34996
35182
|
return null;
|
|
34997
35183
|
}
|
|
35184
|
+
if (kind !== "workflow") assertNoConstants(contents, args2.path);
|
|
34998
35185
|
try {
|
|
34999
35186
|
const modifiedContents = stripImports(contents, path10.basename(args2.path));
|
|
35000
35187
|
if (modifiedContents !== contents) {
|
|
@@ -35029,6 +35216,19 @@ export { ${exportName} as __lua_target__ };
|
|
|
35029
35216
|
contents: "/* lua-cli stripped - APIs provided by VM sandbox */",
|
|
35030
35217
|
loader: "js"
|
|
35031
35218
|
}));
|
|
35219
|
+
build2.onResolve({
|
|
35220
|
+
filter: /^lua-cli-inert-workflow-builder$/
|
|
35221
|
+
}, () => ({
|
|
35222
|
+
path: INERT_WORKFLOW_BUILDER_SPECIFIER,
|
|
35223
|
+
namespace: INERT_WORKFLOW_BUILDER_NAMESPACE
|
|
35224
|
+
}));
|
|
35225
|
+
build2.onLoad({
|
|
35226
|
+
filter: /.*/,
|
|
35227
|
+
namespace: INERT_WORKFLOW_BUILDER_NAMESPACE
|
|
35228
|
+
}, () => ({
|
|
35229
|
+
contents: INERT_WORKFLOW_BUILDER_SOURCE,
|
|
35230
|
+
loader: "js"
|
|
35231
|
+
}));
|
|
35032
35232
|
}
|
|
35033
35233
|
};
|
|
35034
35234
|
}
|
|
@@ -38783,13 +38983,20 @@ function resultOf(response) {
|
|
|
38783
38983
|
}
|
|
38784
38984
|
return response.data;
|
|
38785
38985
|
}
|
|
38786
|
-
function
|
|
38986
|
+
function decisionTestSiteHeaders(site) {
|
|
38987
|
+
return {
|
|
38988
|
+
[DECISION_SANDBOX_SITE_HEADER]: DECISION_LUA_TEST_SITE,
|
|
38989
|
+
[DECISION_SANDBOX_PRIMITIVE_HEADER]: formatDecisionSandboxPrimitive(`${site.kind}:${site.name}`, site.tool)
|
|
38990
|
+
};
|
|
38991
|
+
}
|
|
38992
|
+
function buildOfflineDecisionsApi(getService, testSite) {
|
|
38993
|
+
const headers = testSite ? decisionTestSiteHeaders(testSite) : void 0;
|
|
38787
38994
|
return buildDecisionsApi({
|
|
38788
|
-
ask: /* @__PURE__ */ __name(async (request2) => (await getService()).askForSandbox(request2), "ask"),
|
|
38789
|
-
run: /* @__PURE__ */ __name(async (request2) => (await getService()).runForSandbox(request2), "run")
|
|
38995
|
+
ask: /* @__PURE__ */ __name(async (request2) => (await getService()).askForSandbox(request2, headers), "ask"),
|
|
38996
|
+
run: /* @__PURE__ */ __name(async (request2) => (await getService()).runForSandbox(request2, headers), "run")
|
|
38790
38997
|
});
|
|
38791
38998
|
}
|
|
38792
|
-
var DecisionsApiService;
|
|
38999
|
+
var DECISION_LUA_TEST_SITE, DecisionsApiService;
|
|
38793
39000
|
var init_decisions_api_service = __esm({
|
|
38794
39001
|
"src/api/decisions.api.service.ts"() {
|
|
38795
39002
|
"use strict";
|
|
@@ -38797,6 +39004,8 @@ var init_decisions_api_service = __esm({
|
|
|
38797
39004
|
init_decisions_api();
|
|
38798
39005
|
init_http_client();
|
|
38799
39006
|
__name(resultOf, "resultOf");
|
|
39007
|
+
DECISION_LUA_TEST_SITE = "lua-test";
|
|
39008
|
+
__name(decisionTestSiteHeaders, "decisionTestSiteHeaders");
|
|
38800
39009
|
DecisionsApiService = class extends HttpClient {
|
|
38801
39010
|
static {
|
|
38802
39011
|
__name(this, "DecisionsApiService");
|
|
@@ -38805,17 +39014,17 @@ var init_decisions_api_service = __esm({
|
|
|
38805
39014
|
constructor(baseUrl, credential, agentId2) {
|
|
38806
39015
|
super(baseUrl, credential), this.agentId = agentId2;
|
|
38807
39016
|
}
|
|
38808
|
-
async ask(body) {
|
|
38809
|
-
return this.httpPostOnce(`/developer/decisions/${this.agentId}/ask`, body,
|
|
39017
|
+
async ask(body, headers = {}) {
|
|
39018
|
+
return this.httpPostOnce(`/developer/decisions/${this.agentId}/ask`, body, headers);
|
|
38810
39019
|
}
|
|
38811
|
-
async run({ name, ...body }) {
|
|
38812
|
-
return this.httpPostOnce(`/developer/decisions/${this.agentId}/run/${encodeURIComponent(name)}`, body,
|
|
39020
|
+
async run({ name, ...body }, headers = {}) {
|
|
39021
|
+
return this.httpPostOnce(`/developer/decisions/${this.agentId}/run/${encodeURIComponent(name)}`, body, headers);
|
|
38813
39022
|
}
|
|
38814
|
-
async askForSandbox(request2) {
|
|
38815
|
-
return resultOf(await this.ask(request2));
|
|
39023
|
+
async askForSandbox(request2, headers) {
|
|
39024
|
+
return resultOf(await this.ask(request2, headers));
|
|
38816
39025
|
}
|
|
38817
|
-
async runForSandbox(request2) {
|
|
38818
|
-
return resultOf(await this.run(request2));
|
|
39026
|
+
async runForSandbox(request2, headers) {
|
|
39027
|
+
return resultOf(await this.run(request2, headers));
|
|
38819
39028
|
}
|
|
38820
39029
|
async getDecisions() {
|
|
38821
39030
|
return this.httpGet(`/developer/decisions/${this.agentId}/definitions`, {});
|
|
@@ -51237,7 +51446,7 @@ function createSandbox(options) {
|
|
|
51237
51446
|
Decisions: buildOfflineDecisionsApi(async () => {
|
|
51238
51447
|
const { getDecisionsInstance: getDecisionsInstance2 } = await Promise.resolve().then(() => (init_lazy_instances(), lazy_instances_exports));
|
|
51239
51448
|
return getDecisionsInstance2();
|
|
51240
|
-
}),
|
|
51449
|
+
}, options.testSite),
|
|
51241
51450
|
DecisionError,
|
|
51242
51451
|
Agents: {
|
|
51243
51452
|
invoke: /* @__PURE__ */ __name(async (targetAgentId, promptOrInput) => {
|
|
@@ -52539,6 +52748,9 @@ var DecisionHandler = class extends BaseVersionedHandler {
|
|
|
52539
52748
|
yamlKey: "decisions",
|
|
52540
52749
|
idField: "decisionId"
|
|
52541
52750
|
};
|
|
52751
|
+
serverDeleteCommand(name) {
|
|
52752
|
+
return `lua decisions delete ${name}`;
|
|
52753
|
+
}
|
|
52542
52754
|
getApi(apiKey, agentId2) {
|
|
52543
52755
|
return new DecisionsApiService(BASE_URLS.API, apiKey, agentId2);
|
|
52544
52756
|
}
|
|
@@ -55825,7 +56037,12 @@ async function testSkill(entityName, inputJson, asJson = false) {
|
|
|
55825
56037
|
inputs: inputValues,
|
|
55826
56038
|
apiKey,
|
|
55827
56039
|
agentId: agentId2,
|
|
55828
|
-
channel: "dev"
|
|
56040
|
+
channel: "dev",
|
|
56041
|
+
testSite: {
|
|
56042
|
+
kind: "skill",
|
|
56043
|
+
name: selectedTool.skillName,
|
|
56044
|
+
tool: selectedTool.name
|
|
56045
|
+
}
|
|
55829
56046
|
});
|
|
55830
56047
|
success(asJson, "\u2705 Tool execution successful!");
|
|
55831
56048
|
printToolOutput("Tool", result, asJson);
|
|
@@ -55938,7 +56155,11 @@ async function testWebhook(entityName, inputJson, asJson = false) {
|
|
|
55938
56155
|
body,
|
|
55939
56156
|
rawBody,
|
|
55940
56157
|
apiKey,
|
|
55941
|
-
agentId: agentId2
|
|
56158
|
+
agentId: agentId2,
|
|
56159
|
+
testSite: {
|
|
56160
|
+
kind: "webhook",
|
|
56161
|
+
name: selectedWebhook.name
|
|
56162
|
+
}
|
|
55942
56163
|
});
|
|
55943
56164
|
success(asJson, "\n\u2705 Webhook execution successful!");
|
|
55944
56165
|
printToolOutput("Webhook", result, asJson);
|
|
@@ -56066,7 +56287,11 @@ async function testWebApp(entityName, routeSpec, inputJson, asJson = false) {
|
|
|
56066
56287
|
appCode,
|
|
56067
56288
|
input: webRouteInput,
|
|
56068
56289
|
apiKey,
|
|
56069
|
-
agentId: agentId2
|
|
56290
|
+
agentId: agentId2,
|
|
56291
|
+
testSite: {
|
|
56292
|
+
kind: "web-route",
|
|
56293
|
+
name: app.name
|
|
56294
|
+
}
|
|
56070
56295
|
});
|
|
56071
56296
|
if (asJson) {
|
|
56072
56297
|
console.log(JSON.stringify(result, null, 2));
|
|
@@ -56126,6 +56351,10 @@ async function testJob(entityName, asJson = false) {
|
|
|
56126
56351
|
jobCode,
|
|
56127
56352
|
apiKey,
|
|
56128
56353
|
agentId: agentId2,
|
|
56354
|
+
testSite: {
|
|
56355
|
+
kind: "job",
|
|
56356
|
+
name: selectedJob.name
|
|
56357
|
+
},
|
|
56129
56358
|
jobData: {
|
|
56130
56359
|
id: jobId,
|
|
56131
56360
|
jobId,
|
|
@@ -56234,35 +56463,25 @@ async function testPreProcessor(entityName, inputJson, asJson = false) {
|
|
|
56234
56463
|
const { apiKey, agentId: agentId2 } = await loadAuthOrFail();
|
|
56235
56464
|
const preprocessorCode = loadArtifact(selected, process.cwd());
|
|
56236
56465
|
await withSandboxEnv(async () => {
|
|
56466
|
+
const messages = [
|
|
56467
|
+
{
|
|
56468
|
+
type: "text",
|
|
56469
|
+
text: message
|
|
56470
|
+
}
|
|
56471
|
+
];
|
|
56237
56472
|
try {
|
|
56238
|
-
const messages = [
|
|
56239
|
-
{
|
|
56240
|
-
type: "text",
|
|
56241
|
-
text: message
|
|
56242
|
-
}
|
|
56243
|
-
];
|
|
56244
56473
|
const result = await executePreProcessor({
|
|
56245
56474
|
processorCode: preprocessorCode,
|
|
56246
56475
|
messages,
|
|
56247
56476
|
channel,
|
|
56248
56477
|
apiKey,
|
|
56249
|
-
agentId: agentId2
|
|
56478
|
+
agentId: agentId2,
|
|
56479
|
+
testSite: {
|
|
56480
|
+
kind: "preprocessor",
|
|
56481
|
+
name: preprocessorName
|
|
56482
|
+
}
|
|
56250
56483
|
});
|
|
56251
56484
|
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
56485
|
if (asJson) {
|
|
56267
56486
|
printToolOutput("PreProcessor", result, true);
|
|
56268
56487
|
} else if (result.action === "block") {
|
|
@@ -56305,7 +56524,7 @@ Raw result:`);
|
|
|
56305
56524
|
});
|
|
56306
56525
|
}
|
|
56307
56526
|
} catch (error) {
|
|
56308
|
-
|
|
56527
|
+
reportPreprocessorFailOpen(error, messages, asJson);
|
|
56309
56528
|
if (!asJson) {
|
|
56310
56529
|
writeHintBlock({
|
|
56311
56530
|
headline: "Preprocessor ran locally \u2014 no server logs exist for this execution.",
|
|
@@ -56326,6 +56545,37 @@ Raw result:`);
|
|
|
56326
56545
|
});
|
|
56327
56546
|
}
|
|
56328
56547
|
__name(testPreProcessor, "testPreProcessor");
|
|
56548
|
+
function displayMessages(outputMessages) {
|
|
56549
|
+
console.log(`Processed messages (${outputMessages.length}):`);
|
|
56550
|
+
outputMessages.forEach((msg, idx) => {
|
|
56551
|
+
if (msg.type === "text") {
|
|
56552
|
+
console.log(` ${idx + 1}. [TEXT] ${msg.text}`);
|
|
56553
|
+
} else if (msg.type === "image") {
|
|
56554
|
+
console.log(` ${idx + 1}. [IMAGE] ${msg.mimeType}`);
|
|
56555
|
+
} else if (msg.type === "file") {
|
|
56556
|
+
console.log(` ${idx + 1}. [FILE] ${msg.mimeType}`);
|
|
56557
|
+
} else {
|
|
56558
|
+
console.log(` ${idx + 1}. [${msg.type}]`, msg);
|
|
56559
|
+
}
|
|
56560
|
+
});
|
|
56561
|
+
}
|
|
56562
|
+
__name(displayMessages, "displayMessages");
|
|
56563
|
+
function reportPreprocessorFailOpen(error, messages, asJson) {
|
|
56564
|
+
const detail = cliErrorDetail(error);
|
|
56565
|
+
if (asJson) {
|
|
56566
|
+
printToolOutput("PreProcessor", {
|
|
56567
|
+
action: "proceed",
|
|
56568
|
+
error: detail
|
|
56569
|
+
}, true);
|
|
56570
|
+
return;
|
|
56571
|
+
}
|
|
56572
|
+
console.error(`
|
|
56573
|
+
\u26A0\uFE0F PreProcessor threw: ${detail.message}`);
|
|
56574
|
+
console.error(" Live, a chat message goes through unchanged when its pre-processor throws, so this run proceeds.");
|
|
56575
|
+
console.log("\nAction: PROCEED");
|
|
56576
|
+
displayMessages(messages);
|
|
56577
|
+
}
|
|
56578
|
+
__name(reportPreprocessorFailOpen, "reportPreprocessorFailOpen");
|
|
56329
56579
|
async function testPostProcessor(entityName, inputJson, asJson = false) {
|
|
56330
56580
|
progress(asJson, "\u{1F4E4} Testing postprocessor...");
|
|
56331
56581
|
progress(asJson, "\u{1F4E6} Compiling code first...");
|
|
@@ -56402,7 +56652,11 @@ async function testPostProcessor(entityName, inputJson, asJson = false) {
|
|
|
56402
56652
|
response,
|
|
56403
56653
|
channel,
|
|
56404
56654
|
apiKey,
|
|
56405
|
-
agentId: agentId2
|
|
56655
|
+
agentId: agentId2,
|
|
56656
|
+
testSite: {
|
|
56657
|
+
kind: "postprocessor",
|
|
56658
|
+
name: selected.name
|
|
56659
|
+
}
|
|
56406
56660
|
});
|
|
56407
56661
|
success(asJson, "\n\u2705 PostProcessor execution successful!");
|
|
56408
56662
|
if (asJson) {
|
|
@@ -68981,8 +69235,7 @@ async function gatherPrimitives(input, warnings) {
|
|
|
68981
69235
|
if (localNames.has(s.name)) continue;
|
|
68982
69236
|
if (!(handler.isActive?.(s) ?? true)) continue;
|
|
68983
69237
|
if (!handler.shouldConsiderForOrphan(s)) continue;
|
|
68984
|
-
const
|
|
68985
|
-
const cleanupCommand = handler.kind !== PrimitiveKind.DEVICE_TRIGGER ? `${handler.deleteCommand} ${flagName} "${s.name}"` : "";
|
|
69238
|
+
const cleanupCommand = handler.kind !== PrimitiveKind.DEVICE_TRIGGER ? handler.serverDeleteCommand(`"${s.name}"`) : "";
|
|
68986
69239
|
orphans.push({
|
|
68987
69240
|
name: s.name,
|
|
68988
69241
|
cleanupCommand,
|
|
@@ -73151,6 +73404,19 @@ async function activateCore(ctx, name, on) {
|
|
|
73151
73404
|
return WORKFLOW_EXIT.OK;
|
|
73152
73405
|
}
|
|
73153
73406
|
__name(activateCore, "activateCore");
|
|
73407
|
+
function runsInFlightLine(wfName, err) {
|
|
73408
|
+
const blocking = err?.blockingRunId;
|
|
73409
|
+
const cancel = `wait for it or cancel it: lua workflows cancel ${blocking ?? "<runId>"}`;
|
|
73410
|
+
const head = `\u274C "${wfName}" has concurrencyPolicy:'forbid' and run \`${blocking ?? "?"}\` is in flight`;
|
|
73411
|
+
if (typeof err?.correlationKey === "string" && err.correlationKey !== "") {
|
|
73412
|
+
return `${head} for correlationKey ${JSON.stringify(err.correlationKey)} \u2014 ${cancel}`;
|
|
73413
|
+
}
|
|
73414
|
+
if (err?.concurrencyKey === "correlationKey") {
|
|
73415
|
+
return `${head} \u2014 it was started without a correlationKey; pass --correlation-key <key> to start in parallel, or ${cancel}`;
|
|
73416
|
+
}
|
|
73417
|
+
return `${head} \u2014 ${cancel}`;
|
|
73418
|
+
}
|
|
73419
|
+
__name(runsInFlightLine, "runsInFlightLine");
|
|
73154
73420
|
function startResultLine(d, requestedName) {
|
|
73155
73421
|
if (!d.deduplicated && !d.idempotentReplay) return `\u2705 Run ${d.runId} \xB7 ${d.status}`;
|
|
73156
73422
|
const name = d.workflowName ?? requestedName;
|
|
@@ -73194,10 +73460,7 @@ async function startCore(ctx, name, o) {
|
|
|
73194
73460
|
if (!res.success || !res.data) {
|
|
73195
73461
|
if (res.error?.statusCode === 409 && (res.error.code ?? res.error.error) === "RUNS_IN_FLIGHT") {
|
|
73196
73462
|
emitJson(ctx, res);
|
|
73197
|
-
|
|
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
|
-
}
|
|
73463
|
+
if (!ctx.json) console.error(runsInFlightLine(wf.name, res.error));
|
|
73201
73464
|
return WORKFLOW_EXIT.API;
|
|
73202
73465
|
}
|
|
73203
73466
|
return apiFailure(ctx, res, "start");
|
|
@@ -75968,6 +76231,10 @@ async function goalsGetCore(ctx, goalId) {
|
|
|
75968
76231
|
return WORKFLOW_EXIT.OK;
|
|
75969
76232
|
}
|
|
75970
76233
|
__name(goalsGetCore, "goalsGetCore");
|
|
76234
|
+
function goalUnitSuffix(g) {
|
|
76235
|
+
return g.budgetUnit ? ` \xB7 unit ${g.budgetUnit}` : "";
|
|
76236
|
+
}
|
|
76237
|
+
__name(goalUnitSuffix, "goalUnitSuffix");
|
|
75971
76238
|
function printGoalDetail(g) {
|
|
75972
76239
|
console.log(`
|
|
75973
76240
|
\u{1F3AF} Goal ${g.goalId} \xB7 ${goalStatusLabel(g)}`);
|
|
@@ -75976,7 +76243,7 @@ function printGoalDetail(g) {
|
|
|
75976
76243
|
console.log(` Judge: ${judgeLabel(g.judge)}`);
|
|
75977
76244
|
console.log(` Cadence: ${cadenceLabel(g.cadence)} \xB7 mode ${g.evaluation?.mode ?? "immediate"}${g.evaluation?.delaySeconds ? ` \xB7 delay ${g.evaluation.delaySeconds}s` : ""}`);
|
|
75978
76245
|
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` : ""}`);
|
|
76246
|
+
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
76247
|
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
76248
|
if (g.note) console.log(` Note: ${g.note}`);
|
|
75982
76249
|
if (g.closeNote) console.log(` Closed: ${g.closeNote}`);
|
|
@@ -76042,7 +76309,7 @@ function parseEveryFlag(raw) {
|
|
|
76042
76309
|
}
|
|
76043
76310
|
__name(parseEveryFlag, "parseEveryFlag");
|
|
76044
76311
|
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)}` : ""}`);
|
|
76312
|
+
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
76313
|
if (g.rearmed) writeInfo(" \u21BA re-armed \u2014 the cap park cleared and the goal is active again (no backfill)");
|
|
76047
76314
|
if (g.resumed === false) writeInfo(` \u26A0\uFE0F the goal parked again (${g.pauseReason ?? "strikes"}) \u2014 see: lua workflows goals get ${g.goalId}`);
|
|
76048
76315
|
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 +88398,12 @@ function currentVersionOf(row2) {
|
|
|
88131
88398
|
__name(currentVersionOf, "currentVersionOf");
|
|
88132
88399
|
function buildVersionStatusRows(inputs) {
|
|
88133
88400
|
const rows3 = [];
|
|
88134
|
-
for (const { type, localItems, pinned, live } of inputs) {
|
|
88401
|
+
for (const { type, localItems, pinned, live, idsAreAuthoritative } of inputs) {
|
|
88135
88402
|
for (const item of localItems) {
|
|
88136
|
-
const
|
|
88403
|
+
const byName = !item.id || !idsAreAuthoritative;
|
|
88404
|
+
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
88405
|
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);
|
|
88406
|
+
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
88407
|
const drift = server !== void 0 && (server.deleted || server.version !== pinnedVersion);
|
|
88140
88408
|
const row2 = {
|
|
88141
88409
|
type,
|
|
@@ -88295,6 +88563,7 @@ function buildStatusRowInputs(config, snapshot, serverDecisions) {
|
|
|
88295
88563
|
version: p.version,
|
|
88296
88564
|
name: p.name
|
|
88297
88565
|
})),
|
|
88566
|
+
idsAreAuthoritative: true,
|
|
88298
88567
|
...serverDecisions && {
|
|
88299
88568
|
live: serverDecisions.map((d) => ({
|
|
88300
88569
|
id: d.id,
|
|
@@ -89278,16 +89547,22 @@ function readResultLines(output) {
|
|
|
89278
89547
|
`URL: ${data.finalUrl || data.url || "(unknown)"}`
|
|
89279
89548
|
];
|
|
89280
89549
|
if (data.url && data.finalUrl && data.url !== data.finalUrl) lines.push(`Requested: ${data.url}`);
|
|
89281
|
-
lines.push(`
|
|
89282
|
-
|
|
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 ?? "");
|
|
89550
|
+
if (typeof data.status === "number" && data.status !== 200) lines.push(`Status: HTTP ${data.status}`);
|
|
89551
|
+
lines.push(`Engine: ${output.engine}`, ...blockedLines(data), "", data.content ?? "");
|
|
89287
89552
|
if (data.truncated) lines.push("", "(content was cut short)");
|
|
89288
89553
|
return lines;
|
|
89289
89554
|
}
|
|
89290
89555
|
__name(readResultLines, "readResultLines");
|
|
89556
|
+
function blockedLines(data) {
|
|
89557
|
+
if (!data.blocked) return [];
|
|
89558
|
+
const kind = data.blockerKind ? `, ${data.blockerKind}` : "";
|
|
89559
|
+
const lines = [
|
|
89560
|
+
`Blocked: yes${data.blocker ? ` (${data.blocker}${kind})` : ""}`
|
|
89561
|
+
];
|
|
89562
|
+
if (data.blockerGuidance) lines.push(`Guidance: ${data.blockerGuidance}`);
|
|
89563
|
+
return lines;
|
|
89564
|
+
}
|
|
89565
|
+
__name(blockedLines, "blockedLines");
|
|
89291
89566
|
function runStepLine(step3) {
|
|
89292
89567
|
const where = step3.url ? ` on ${step3.url}` : "";
|
|
89293
89568
|
const failed = step3.ok ? "" : ` (failed${step3.error ? `: ${step3.error}` : ""})`;
|
|
@@ -89732,7 +90007,7 @@ Examples:
|
|
|
89732
90007
|
}));
|
|
89733
90008
|
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
90009
|
Arguments:
|
|
89735
|
-
type Optional:
|
|
90010
|
+
type Optional: ${getCanonicalValues("test.type").map((type) => `'${type}'`).join(", ")} (prompts if not provided)
|
|
89736
90011
|
|
|
89737
90012
|
Options:
|
|
89738
90013
|
--name <name> Entity name to test (non-interactive selection)
|