lua-cli 3.40.0 → 3.42.0-beta.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 +62 -18
- package/dist/api-exports.js +192 -21
- package/dist/api-exports.js.map +1 -1
- package/dist/index.js +2812 -602
- package/dist/index.js.map +1 -1
- package/dist/workflow-builder.d.ts +19 -3
- package/dist/workflow-builder.js +177 -8
- package/dist/workflow-builder.js.map +1 -1
- package/docs/workflows/reply-channels.md +2 -2
- package/docs/workflows/workspaces-and-long-steps.md +1 -1
- package/package.json +2 -1
- package/template/package.json +1 -1
- package/template/tsconfig.json +1 -1
- package/template-web-app/app.ts +29 -0
- package/template-web-app/web/index.html +12 -0
- package/template-web-app/web/package.json +27 -0
- package/template-web-app/web/src/App.tsx +28 -0
- package/template-web-app/web/src/index.css +3 -0
- package/template-web-app/web/src/lua/client.ts +254 -0
- package/template-web-app/web/src/main.tsx +16 -0
- package/template-web-app/web/tsconfig.json +14 -0
- package/template-web-app/web/vite.config.ts +9 -0
package/dist/api-exports.d.ts
CHANGED
|
@@ -476,10 +476,11 @@ export declare interface AgentStepOptions {
|
|
|
476
476
|
/**
|
|
477
477
|
* EM-WS3: pin a plugin step's Lua-API proxy (and its key) to ANOTHER agent instead of this workflow's own. Legal only
|
|
478
478
|
* beside `plugins`. Refused at run time (`target_not_granted`) unless the platform's plugin-target switch is on AND
|
|
479
|
-
* this workflow's agent holds a `supervision:act` or `supervision:release` grant on the target.
|
|
479
|
+
* this workflow's agent holds a `supervision:act` or `supervision:release` grant on the target. EM-WS3 × EM-WS2: the
|
|
480
|
+
* id may be `template('${initData.<path>}')`, rendered from the run input at dispatch (a per-run target).
|
|
480
481
|
*/
|
|
481
482
|
target?: {
|
|
482
|
-
agentId: string;
|
|
483
|
+
agentId: string | TemplateBinding;
|
|
483
484
|
};
|
|
484
485
|
/**
|
|
485
486
|
* What this step DOES: `classify` | `extract` | `transform` | `draft` | `research` | `reason` | `code` |
|
|
@@ -1187,7 +1188,7 @@ export declare type Channel = 'web' | 'whatsapp' | 'facebook' | 'instagram' | 's
|
|
|
1187
1188
|
|
|
1188
1189
|
/** Channels accepted by the v1 unified send. Warm-only channels (teams,
|
|
1189
1190
|
* instagram, messenger) require a prior inbound conversation. */
|
|
1190
|
-
export declare const CHANNEL_SEND_CHANNELS: readonly ["whatsapp", "sms", "email", "webchat", "teams", "instagram", "messenger"];
|
|
1191
|
+
export declare const CHANNEL_SEND_CHANNELS: readonly ["whatsapp", "sms", "email", "webchat", "teams", "instagram", "messenger", "slack"];
|
|
1191
1192
|
|
|
1192
1193
|
export declare const Channels: ChannelsApi;
|
|
1193
1194
|
|
|
@@ -1237,6 +1238,16 @@ export declare const Channels: ChannelsApi;
|
|
|
1237
1238
|
* to: { conversationId: '19:9495c339...@thread.v2' },
|
|
1238
1239
|
* text: 'Sample LOT-4471 is missing origin and cupping score.',
|
|
1239
1240
|
* });
|
|
1241
|
+
*
|
|
1242
|
+
* // Reply in a Slack thread through the agent's own bot (the bot must be in the channel)
|
|
1243
|
+
* await Channels.send({
|
|
1244
|
+
* channel: 'slack',
|
|
1245
|
+
* to: { conversationId: 'C0123ABCDEF:1712345678.000100' },
|
|
1246
|
+
* text: 'The overnight load finished with 3 warnings.',
|
|
1247
|
+
* });
|
|
1248
|
+
*
|
|
1249
|
+
* // DM a person on Slack, found by their email in the bot's workspace
|
|
1250
|
+
* await Channels.send({ channel: 'slack', to: { email: 'pat@acme.co' }, text: 'Your report is ready.' });
|
|
1240
1251
|
* ```
|
|
1241
1252
|
*/
|
|
1242
1253
|
export declare interface ChannelsApi {
|
|
@@ -1245,9 +1256,15 @@ export declare interface ChannelsApi {
|
|
|
1245
1256
|
* Returns `ChannelSendOutput` — check `persisted` if memory durability matters.
|
|
1246
1257
|
*
|
|
1247
1258
|
* Address a person with `userId` (any channel), `phoneNumber` (whatsapp/sms)
|
|
1248
|
-
* or `email
|
|
1249
|
-
*
|
|
1250
|
-
*
|
|
1259
|
+
* or `email` (email, slack). Address a conversation with `conversationId`
|
|
1260
|
+
* (teams, slack) — everyone in it receives the message. It is recorded in the
|
|
1261
|
+
* room that mirrors the conversation when the agent has one; otherwise the send
|
|
1262
|
+
* returns `persisted: false`.
|
|
1263
|
+
*
|
|
1264
|
+
* Slack `conversationId` forms: `Lua.request.conversation.externalId`, a channel
|
|
1265
|
+
* id (`C…`, top level), `C…:threadTs` (a reply in that thread), a member id
|
|
1266
|
+
* (`U…`, their DM with the bot) or 2–8 member ids (`U…,U…`, a group DM). With
|
|
1267
|
+
* more than one Slack connection, pass `options.channelIdentifier` (`T…-A…`).
|
|
1251
1268
|
*
|
|
1252
1269
|
* @example
|
|
1253
1270
|
* ```typescript
|
|
@@ -1385,8 +1402,10 @@ export declare interface ChannelSendOutput {
|
|
|
1385
1402
|
*/
|
|
1386
1403
|
status: DeliveryStatus;
|
|
1387
1404
|
delivered: boolean;
|
|
1388
|
-
/**
|
|
1389
|
-
*
|
|
1405
|
+
/** Whether agent memory recorded the message. A conversation-scoped send is
|
|
1406
|
+
* recorded in the room that mirrors the conversation when the agent has one
|
|
1407
|
+
* (and a Slack DM in the conversation of the post's own thread); otherwise it
|
|
1408
|
+
* is delivered but not recorded (`persisted: false` with a `warning`). */
|
|
1390
1409
|
persisted: boolean;
|
|
1391
1410
|
/**
|
|
1392
1411
|
* True when the send was deferred to the WhatsApp message-request queue
|
|
@@ -1404,11 +1423,16 @@ export declare interface ChannelSendOutput {
|
|
|
1404
1423
|
}
|
|
1405
1424
|
|
|
1406
1425
|
/** Recipient — exactly one of the fields must be set. userId works on every
|
|
1407
|
-
* channel (resolved via the user's channel history
|
|
1408
|
-
*
|
|
1409
|
-
*
|
|
1410
|
-
*
|
|
1411
|
-
*
|
|
1426
|
+
* channel (resolved via the user's channel history; on Slack, via the user's
|
|
1427
|
+
* email to the workspace member); raw identifiers only on cold-start-capable
|
|
1428
|
+
* channels (whatsapp/sms → phoneNumber, email and slack → email).
|
|
1429
|
+
* `conversationId` addresses a conversation rather than a person — everyone in
|
|
1430
|
+
* it receives the message:
|
|
1431
|
+
* - teams: a group chat or channel the agent is already part of;
|
|
1432
|
+
* - slack: `Lua.request.conversation.externalId` (`T…:A…:C…[:threadTs]`), a
|
|
1433
|
+
* channel id (`C…`, top level), `C…:threadTs` (a reply in that thread), a
|
|
1434
|
+
* member id (`U…`, their DM with the bot) or 2–8 member ids (`U…,U…`, a group
|
|
1435
|
+
* DM). The bot must be in the channel. */
|
|
1412
1436
|
export declare interface ChannelSendTarget {
|
|
1413
1437
|
userId?: string;
|
|
1414
1438
|
phoneNumber?: string;
|
|
@@ -1564,16 +1588,16 @@ export declare interface ConversationParticipant {
|
|
|
1564
1588
|
}
|
|
1565
1589
|
|
|
1566
1590
|
/**
|
|
1567
|
-
* The conversation a turn runs in. Present on group turns (a desktop room
|
|
1568
|
-
* Teams group chat); undefined on 1:1 chats,
|
|
1569
|
-
* workflow steps.
|
|
1591
|
+
* The conversation a turn runs in. Present on group turns (a desktop room, a
|
|
1592
|
+
* Teams group chat, a Slack channel thread or group DM); undefined on 1:1 chats,
|
|
1593
|
+
* jobs, webhooks, triggers and workflow steps.
|
|
1570
1594
|
*/
|
|
1571
1595
|
export declare interface ConversationRef {
|
|
1572
1596
|
/** The room conversation id (`room:<id>`). */
|
|
1573
1597
|
id: string;
|
|
1574
1598
|
kind: ConversationKind;
|
|
1575
1599
|
channel: Channel;
|
|
1576
|
-
/** The provider's conversation id; pass it to `Channels.send({ to: { conversationId } })` to reply proactively. */
|
|
1600
|
+
/** The provider's conversation id (Teams chat id, Slack `T…:A…:C…:threadTs`); pass it to `Channels.send({ to: { conversationId } })` to reply proactively. */
|
|
1577
1601
|
externalId?: string;
|
|
1578
1602
|
currentSpeakerId?: string;
|
|
1579
1603
|
/** Capped at 50 entries, current speaker first; see `participantCount` and `truncated`. */
|
|
@@ -3402,6 +3426,7 @@ export declare class LuaAgent {
|
|
|
3402
3426
|
private readonly triggers;
|
|
3403
3427
|
private readonly jobs;
|
|
3404
3428
|
private readonly workflows;
|
|
3429
|
+
private readonly webApps;
|
|
3405
3430
|
private readonly preProcessors;
|
|
3406
3431
|
private readonly postProcessors;
|
|
3407
3432
|
private readonly mcpServers;
|
|
@@ -3441,6 +3466,7 @@ export declare class LuaAgent {
|
|
|
3441
3466
|
getTriggers(): LuaTrigger[];
|
|
3442
3467
|
getJobs(): LuaJob[];
|
|
3443
3468
|
getWorkflows(): LuaWorkflow[];
|
|
3469
|
+
getWebApps(): LuaWebApp[];
|
|
3444
3470
|
getPreProcessors(): PreProcessor[];
|
|
3445
3471
|
getPostProcessors(): PostProcessor[];
|
|
3446
3472
|
getMCPServers(): LuaMCPServer[];
|
|
@@ -3485,6 +3511,8 @@ export declare interface LuaAgentConfig {
|
|
|
3485
3511
|
jobs?: LuaJob[];
|
|
3486
3512
|
/** Array of workflows (createWorkflow / defineWorkflow) — 03 §3.1; resolved by the compiler traverser, dropped from the agent bundle */
|
|
3487
3513
|
workflows?: LuaWorkflow[];
|
|
3514
|
+
/** Web apps (defineWebApp) opened from Lua Workspace and the admin console; pushed with `lua push webapp` */
|
|
3515
|
+
webApps?: LuaWebApp[];
|
|
3488
3516
|
/** Array of preprocessors (run before messages reach the agent) */
|
|
3489
3517
|
preProcessors?: PreProcessor[];
|
|
3490
3518
|
/** Array of postprocessors (run after agent generates responses) */
|
|
@@ -5468,7 +5496,7 @@ export declare type LuaWorkflowBuildCode = 'duplicate-step-id' | 'unknown-step-r
|
|
|
5468
5496
|
*/
|
|
5469
5497
|
| 'workspace-not-declared' | 'workspace-inherit-without-parent-workspace' | 'workspace-inherit-conflict' | 'harness-requires-job-tier' | 'max-turns-requires-job-tier' | 'max-turns-invalid'
|
|
5470
5498
|
/** EM-WS3: a step's `plugins` outside the allowlist, repeated, or off the Job tier. */
|
|
5471
|
-
| 'plugins-invalid' | 'cap-exceeded' | 'chunk-size-invalid' | 'rate-limit-invalid' | 'backoff-invalid' | 'loop-interval-out-of-range' | 'mapping-placement' | 'container-arm-empty'
|
|
5499
|
+
| 'plugins-invalid' | 'target-invalid' | 'lua-api-invalid' | 'cap-exceeded' | 'chunk-size-invalid' | 'rate-limit-invalid' | 'backoff-invalid' | 'loop-interval-out-of-range' | 'mapping-placement' | 'container-arm-empty'
|
|
5472
5500
|
/**
|
|
5473
5501
|
* @deprecated LUA-684 — the builder no longer throws it: an `approval` / `waitForSignal` IS a container arm
|
|
5474
5502
|
* (`parallel(['approve', …])`). Where the engine cannot run one — a `loop` body, the step of a `[map, step]`
|
|
@@ -5617,6 +5645,21 @@ export declare interface LuaWorkflowStep<TIn extends ZodType = ZodType, TOut ext
|
|
|
5617
5645
|
workspace?: WorkflowStepWorkspace;
|
|
5618
5646
|
jobResources?: WorkflowJobResources;
|
|
5619
5647
|
jobTools?: WorkflowJobToolId[];
|
|
5648
|
+
/**
|
|
5649
|
+
* EM-WS3 × EM-WS2: let this `tier:'job'` step run `lua` (`ctx.exec('lua', [...])`, `` ctx.$`lua push …` ``) against the
|
|
5650
|
+
* Lua API through the platform's staging-only proxy, with a short-lived key for ONE agent: this workflow's agent, or
|
|
5651
|
+
* `target`. It is the same proxy and the same deny rules as a plugin agent step: deploy, promote, publish,
|
|
5652
|
+
* activate, env, chat and runtime calls are refused.
|
|
5653
|
+
*/
|
|
5654
|
+
luaApi?: true;
|
|
5655
|
+
/**
|
|
5656
|
+
* EM-WS3: pin the `luaApi` proxy (and its key) to ANOTHER agent. The id may be static or
|
|
5657
|
+
* `template('${initData.<path>}')`, rendered from the run input at dispatch. The same flag and supervision-grant
|
|
5658
|
+
* rules apply as on a plugin agent step.
|
|
5659
|
+
*/
|
|
5660
|
+
target?: {
|
|
5661
|
+
agentId: string | TemplateBinding;
|
|
5662
|
+
};
|
|
5620
5663
|
/** default { maxAttempts: 1 } */
|
|
5621
5664
|
retry?: RetryPolicy;
|
|
5622
5665
|
/** default 'none'; 'external' ⇒ park on platform-fault reclaim. */
|
|
@@ -7649,6 +7692,7 @@ export declare interface WaitForSignalOptions {
|
|
|
7649
7692
|
*/
|
|
7650
7693
|
declare const WEB_APP_CSP_KEYS: readonly ["scriptSrc", "styleSrc", "imgSrc", "connectSrc", "fontSrc", "frameSrc", "workerSrc"];
|
|
7651
7694
|
|
|
7695
|
+
/** `defineWebApp({ name })`: the name leads the app's host label, so a DNS-safe subset. */
|
|
7652
7696
|
export declare const WEB_APP_NAME_PATTERN: RegExp;
|
|
7653
7697
|
|
|
7654
7698
|
declare const WEB_ROUTE_METHODS: readonly ["GET", "POST", "PUT", "PATCH", "DELETE"];
|
package/dist/api-exports.js
CHANGED
|
@@ -2513,7 +2513,15 @@ function sortVerdictReasons(reasons) {
|
|
|
2513
2513
|
...reasons
|
|
2514
2514
|
].sort((a, b) => REVIEW_VERDICT_REASON_ORDER.indexOf(a.kind) - REVIEW_VERDICT_REASON_ORDER.indexOf(b.kind));
|
|
2515
2515
|
}
|
|
2516
|
-
|
|
2516
|
+
function envTemplatePlaceholder(key) {
|
|
2517
|
+
if (ENV_TEMPLATE_SECRET_KEY_RE.test(key)) {
|
|
2518
|
+
throw new Error(`env-template-secret-key: \`${key}\` looks like a secret \u2014 read it with env('${key}') inside execute instead`);
|
|
2519
|
+
}
|
|
2520
|
+
return {
|
|
2521
|
+
__envRef: key
|
|
2522
|
+
};
|
|
2523
|
+
}
|
|
2524
|
+
var __defProp3, __name3, PLUMBING_THREAD_CHANNELS, CHANNEL_CONVERSATION_CHANNELS, HIDDEN_THREAD_CHANNELS, PLATFORM_INVOCATION_CALLERS, SUPERVISION_OPS, CHANNEL_SEND_CHANNELS, 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, BROWSER_COMMANDS, BROWSER_COMMAND_NAMES, 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, 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_MODEL_CLASSES, WORKFLOW_DEFAULT_TASK_CLASS_MAP, WORKFLOW_MODELS_MAX_CLASS_DEFAULT, WORKFLOW_AUTONOMY_NUMERIC_KEYS, WORKFLOW_AUTONOMY_ENVELOPE_KEYS, 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, AGENT_LOG_SOURCES, AGENT_LOG_FIELDS_MAX_WIRE_KEYS, LOG_DRAIN_TYPES_PHASE1, LOG_DRAIN_TYPES_PHASE2, LOG_DRAIN_TYPES_IMPLEMENTED, LOG_DRAIN_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, 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, 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_CONNECTION_KEY_RE, WORKFLOW_JOB_MODEL_SOURCE_LABELS, WORKFLOW_SUSPEND_KINDS, WORKFLOW_RUN_NOTIFICATION_SUSPENDED_KINDS, WORKFLOW_SIGNAL_PAYLOAD_MAX_BYTES, WORKFLOW_RESOLVE_OUTPUT_MAX_BYTES, SCHEDULE_HEALTH_NOTIFY_CHANNELS, SCHEDULE_HEALTH_DEFAULT_NOTIFY, SCHEDULE_HEALTH_LIMITS, KNOWN_KEYS, WORKFLOW_GOAL_JUDGE_SELF, 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, 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_REQUEST_BODY_BYTES, WEB_ROUTE_MAX_RESPONSE_BYTES, WEB_APP_NAME_PATTERN, WEB_APP_ENTRY_HTML_MAX_CHARS, WEB_APP_MAX_ASSET_BYTES, 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;
|
|
2517
2525
|
var init_dist = __esm({
|
|
2518
2526
|
"../shared-types/dist/index.mjs"() {
|
|
2519
2527
|
"use strict";
|
|
@@ -2594,7 +2602,8 @@ var init_dist = __esm({
|
|
|
2594
2602
|
"webchat",
|
|
2595
2603
|
"teams",
|
|
2596
2604
|
"instagram",
|
|
2597
|
-
"messenger"
|
|
2605
|
+
"messenger",
|
|
2606
|
+
"slack"
|
|
2598
2607
|
];
|
|
2599
2608
|
REVIEWABLE_ACTION_EXECUTE_TOOL_ALLOWLIST = [
|
|
2600
2609
|
"sendChannelMessage",
|
|
@@ -2605,7 +2614,8 @@ var init_dist = __esm({
|
|
|
2605
2614
|
"sendWebchatMessage",
|
|
2606
2615
|
"sendTeamsMessage",
|
|
2607
2616
|
"sendInstagramMessage",
|
|
2608
|
-
"sendMessengerMessage"
|
|
2617
|
+
"sendMessengerMessage",
|
|
2618
|
+
"sendSlackMessage"
|
|
2609
2619
|
];
|
|
2610
2620
|
__name(isAllowedReviewableExecuteTool, "isAllowedReviewableExecuteTool");
|
|
2611
2621
|
__name3(isAllowedReviewableExecuteTool, "isAllowedReviewableExecuteTool");
|
|
@@ -4827,6 +4837,24 @@ listed here; never invent a target.`;
|
|
|
4827
4837
|
label: copy(100),
|
|
4828
4838
|
body: onboardingRichTextSchema
|
|
4829
4839
|
}).strict();
|
|
4840
|
+
onboardingInstallScreenSchema = z4.object({
|
|
4841
|
+
title: onboardingHeadingSchema,
|
|
4842
|
+
subtitle: copy(240),
|
|
4843
|
+
ctaLabel: copy(80),
|
|
4844
|
+
ctaHelperText: onboardingRichTextSchema
|
|
4845
|
+
}).strict();
|
|
4846
|
+
onboardingResultScreenSchema = z4.object({
|
|
4847
|
+
title: onboardingHeadingSchema,
|
|
4848
|
+
subheader: copy(240),
|
|
4849
|
+
inputPlaceholder: copy(120)
|
|
4850
|
+
}).strict();
|
|
4851
|
+
onboardingConnectScreenSchema = z4.object({
|
|
4852
|
+
title: onboardingHeadingSchema,
|
|
4853
|
+
description: onboardingRichTextSchema,
|
|
4854
|
+
ctaLabel: copy(80),
|
|
4855
|
+
neverLine: copy(120),
|
|
4856
|
+
footnote: copy(240)
|
|
4857
|
+
}).strict();
|
|
4830
4858
|
onboardingTemplateContentSchema = z4.object({
|
|
4831
4859
|
id,
|
|
4832
4860
|
templateId: copy(160),
|
|
@@ -4839,7 +4867,10 @@ listed here; never invent a target.`;
|
|
|
4839
4867
|
artwork: onboardingArtworkSchema,
|
|
4840
4868
|
hireButtonLabel: copy(80),
|
|
4841
4869
|
changeRoleButtonLabel: copy(80),
|
|
4842
|
-
nextStepText: onboardingRichTextSchema
|
|
4870
|
+
nextStepText: onboardingRichTextSchema,
|
|
4871
|
+
install: onboardingInstallScreenSchema.optional(),
|
|
4872
|
+
result: onboardingResultScreenSchema.optional(),
|
|
4873
|
+
connect: onboardingConnectScreenSchema.optional()
|
|
4843
4874
|
}).strict();
|
|
4844
4875
|
onboardingUnavailableOutcomeSchema = z4.object({
|
|
4845
4876
|
id,
|
|
@@ -5009,6 +5040,9 @@ listed here; never invent a target.`;
|
|
|
5009
5040
|
__name3(isQueryRecord, "isQueryRecord");
|
|
5010
5041
|
__name(isWebRouteInput, "isWebRouteInput");
|
|
5011
5042
|
__name3(isWebRouteInput, "isWebRouteInput");
|
|
5043
|
+
WEB_APP_NAME_PATTERN = /^[a-z][a-z0-9-]*$/;
|
|
5044
|
+
WEB_APP_ENTRY_HTML_MAX_CHARS = 256 * 1024;
|
|
5045
|
+
WEB_APP_MAX_ASSET_BYTES = 8 * 1024 * 1024;
|
|
5012
5046
|
EVIDENCE_SESSION_IDLE_MS = 30 * 6e4;
|
|
5013
5047
|
EVIDENCE_MIN_CONVERSATIONS = 20;
|
|
5014
5048
|
EVIDENCE_LOW_CONFIDENCE_N = 5;
|
|
@@ -5116,6 +5150,9 @@ listed here; never invent a target.`;
|
|
|
5116
5150
|
];
|
|
5117
5151
|
__name(sortVerdictReasons, "sortVerdictReasons");
|
|
5118
5152
|
__name3(sortVerdictReasons, "sortVerdictReasons");
|
|
5153
|
+
ENV_TEMPLATE_SECRET_KEY_RE = /(SECRET|TOKEN|KEY|PASSWORD)$/;
|
|
5154
|
+
__name(envTemplatePlaceholder, "envTemplatePlaceholder");
|
|
5155
|
+
__name3(envTemplatePlaceholder, "envTemplatePlaceholder");
|
|
5119
5156
|
}
|
|
5120
5157
|
});
|
|
5121
5158
|
|
|
@@ -5144,16 +5181,110 @@ function workflowJobPluginsProblem(plugins) {
|
|
|
5144
5181
|
if (new Set(plugins).size !== plugins.length) return "plugins must not repeat";
|
|
5145
5182
|
return null;
|
|
5146
5183
|
}
|
|
5147
|
-
function
|
|
5184
|
+
function workflowJobTargetTemplatePath(binding) {
|
|
5185
|
+
if (!binding || typeof binding !== "object" || Array.isArray(binding)) return null;
|
|
5186
|
+
const keys = Object.keys(binding);
|
|
5187
|
+
const tpl = binding.template;
|
|
5188
|
+
if (keys.length !== 1 || typeof tpl !== "string" || tpl.length > 512) return null;
|
|
5189
|
+
const m = WORKFLOW_JOB_TARGET_TEMPLATE_RE.exec(tpl.trim());
|
|
5190
|
+
if (!m) return null;
|
|
5191
|
+
const names = m[1].split(".").map((seg) => seg.replace(/\[(?:0|[1-9]\d*)\]/g, ""));
|
|
5192
|
+
if (names.some((n2) => n2 === "__proto__" || n2 === "prototype" || n2 === "constructor")) return null;
|
|
5193
|
+
return m[1].split(".").every((seg) => TARGET_PATH_SEGMENT_RE.test(seg)) ? m[1] : null;
|
|
5194
|
+
}
|
|
5195
|
+
function isWorkflowJobTargetTemplate(target) {
|
|
5196
|
+
const agentId = target?.agentId;
|
|
5197
|
+
return !!agentId && typeof agentId === "object";
|
|
5198
|
+
}
|
|
5199
|
+
function workflowJobLuaApiProblem(luaApi, nodeType, tier) {
|
|
5200
|
+
if (luaApi === void 0) return null;
|
|
5201
|
+
if (luaApi !== true) return "`luaApi` must be exactly true";
|
|
5202
|
+
if (nodeType !== "code") return "`luaApi` is legal on code steps only (an agent step uses `plugins`)";
|
|
5203
|
+
if (tier !== "job") return "`luaApi` requires tier:'job'";
|
|
5204
|
+
return null;
|
|
5205
|
+
}
|
|
5206
|
+
function workflowJobUsesLuaApi(step3) {
|
|
5207
|
+
return Array.isArray(step3.plugins) && step3.plugins.length > 0 || step3.kind === "code" && step3.luaApi === true;
|
|
5208
|
+
}
|
|
5209
|
+
function workflowJobTargetProblem(target, plugins, luaApi) {
|
|
5148
5210
|
if (target === void 0) return null;
|
|
5149
5211
|
if (!target || typeof target !== "object" || Array.isArray(target)) return "target must be { agentId }";
|
|
5150
5212
|
const keys = Object.keys(target);
|
|
5151
5213
|
const agentId = target.agentId;
|
|
5152
|
-
if (keys.length !== 1 ||
|
|
5153
|
-
if (
|
|
5214
|
+
if (keys.length !== 1 || !("agentId" in target)) return "target must be exactly { agentId }";
|
|
5215
|
+
if (typeof agentId === "string") {
|
|
5216
|
+
if (!agentId.trim() || agentId.length > 256) return "target must be exactly { agentId: <non-empty string> }";
|
|
5217
|
+
if (agentId.includes("${")) return "a run-input target is written template('${initData.<path>}'), never a string with ${\u2026}";
|
|
5218
|
+
} else if (workflowJobTargetTemplatePath(agentId) === null) {
|
|
5219
|
+
return "target.agentId must be a static id or template('${initData.<path>}') \u2014 exactly one initData placeholder, no default";
|
|
5220
|
+
}
|
|
5221
|
+
const hasPlugins = Array.isArray(plugins) && plugins.length > 0;
|
|
5222
|
+
if (!hasPlugins && luaApi !== true) return "`target` is legal only beside `plugins` or `luaApi: true`";
|
|
5154
5223
|
return null;
|
|
5155
5224
|
}
|
|
5156
|
-
|
|
5225
|
+
function readInitDataPath(root, path3) {
|
|
5226
|
+
let cur = root;
|
|
5227
|
+
for (const seg of path3.split(".")) {
|
|
5228
|
+
const name = seg.replace(/\[(?:0|[1-9]\d*)\]/g, "");
|
|
5229
|
+
const indexes = [
|
|
5230
|
+
...seg.matchAll(/\[(0|[1-9]\d*)\]/g)
|
|
5231
|
+
].map((x) => Number(x[1]));
|
|
5232
|
+
if (cur === null || typeof cur !== "object" || !Object.prototype.hasOwnProperty.call(cur, name)) return void 0;
|
|
5233
|
+
cur = cur[name];
|
|
5234
|
+
for (const i of indexes) {
|
|
5235
|
+
if (!Array.isArray(cur) || i >= cur.length) return void 0;
|
|
5236
|
+
cur = cur[i];
|
|
5237
|
+
}
|
|
5238
|
+
}
|
|
5239
|
+
return cur;
|
|
5240
|
+
}
|
|
5241
|
+
function renderWorkflowJobTarget(target, initData) {
|
|
5242
|
+
const agentId = target?.agentId;
|
|
5243
|
+
if (target === void 0 || target === null || agentId === void 0) return {
|
|
5244
|
+
ok: true,
|
|
5245
|
+
agentId: void 0,
|
|
5246
|
+
templated: false
|
|
5247
|
+
};
|
|
5248
|
+
if (typeof agentId === "string") {
|
|
5249
|
+
if (!agentId.trim() || agentId.includes("${")) return {
|
|
5250
|
+
ok: false,
|
|
5251
|
+
reason: "invalid",
|
|
5252
|
+
message: "target.agentId is invalid"
|
|
5253
|
+
};
|
|
5254
|
+
return {
|
|
5255
|
+
ok: true,
|
|
5256
|
+
agentId,
|
|
5257
|
+
templated: false
|
|
5258
|
+
};
|
|
5259
|
+
}
|
|
5260
|
+
const path3 = workflowJobTargetTemplatePath(agentId);
|
|
5261
|
+
if (path3 === null) return {
|
|
5262
|
+
ok: false,
|
|
5263
|
+
reason: "invalid",
|
|
5264
|
+
message: "target.agentId is not a valid initData template"
|
|
5265
|
+
};
|
|
5266
|
+
const value3 = readInitDataPath(initData, path3);
|
|
5267
|
+
if (value3 === void 0 || value3 === null) {
|
|
5268
|
+
return {
|
|
5269
|
+
ok: false,
|
|
5270
|
+
reason: "unbound",
|
|
5271
|
+
message: `target_unresolved: the run input has no initData.${path3}`
|
|
5272
|
+
};
|
|
5273
|
+
}
|
|
5274
|
+
if (typeof value3 !== "string" || !value3.trim() || value3.length > 256 || /\s/.test(value3.trim())) {
|
|
5275
|
+
return {
|
|
5276
|
+
ok: false,
|
|
5277
|
+
reason: "empty",
|
|
5278
|
+
message: `target_unresolved: initData.${path3} is not a non-empty agent id`
|
|
5279
|
+
};
|
|
5280
|
+
}
|
|
5281
|
+
return {
|
|
5282
|
+
ok: true,
|
|
5283
|
+
agentId: value3.trim(),
|
|
5284
|
+
templated: true
|
|
5285
|
+
};
|
|
5286
|
+
}
|
|
5287
|
+
var __defProp4, __name4, WORKFLOW_JOB_TOOLS, WORKFLOW_JOB_READ_ONLY_DROPPED, WORKFLOW_JOB_DEFAULT_TOOLS, WORKFLOW_JOB_PLUGINS, WORKFLOW_JOB_PLUGIN_ROOT, WORKFLOW_JOB_PLUGINS_MAX, WORKFLOW_JOB_TARGET_TEMPLATE_RE, TARGET_PATH_SEGMENT_RE;
|
|
5157
5288
|
var init_workflow_job_tools = __esm({
|
|
5158
5289
|
"../shared-types/dist/workflow-job-tools.mjs"() {
|
|
5159
5290
|
"use strict";
|
|
@@ -5199,8 +5330,22 @@ var init_workflow_job_tools = __esm({
|
|
|
5199
5330
|
__name4(workflowJobPluginDir, "workflowJobPluginDir");
|
|
5200
5331
|
__name(workflowJobPluginsProblem, "workflowJobPluginsProblem");
|
|
5201
5332
|
__name4(workflowJobPluginsProblem, "workflowJobPluginsProblem");
|
|
5333
|
+
WORKFLOW_JOB_TARGET_TEMPLATE_RE = /^\$\{\s*initData\.([A-Za-z0-9_.\-[\]]+)\s*\}$/;
|
|
5334
|
+
TARGET_PATH_SEGMENT_RE = /^[A-Za-z0-9_-]+(?:\[(?:0|[1-9]\d*)\])*$/;
|
|
5335
|
+
__name(workflowJobTargetTemplatePath, "workflowJobTargetTemplatePath");
|
|
5336
|
+
__name4(workflowJobTargetTemplatePath, "workflowJobTargetTemplatePath");
|
|
5337
|
+
__name(isWorkflowJobTargetTemplate, "isWorkflowJobTargetTemplate");
|
|
5338
|
+
__name4(isWorkflowJobTargetTemplate, "isWorkflowJobTargetTemplate");
|
|
5339
|
+
__name(workflowJobLuaApiProblem, "workflowJobLuaApiProblem");
|
|
5340
|
+
__name4(workflowJobLuaApiProblem, "workflowJobLuaApiProblem");
|
|
5341
|
+
__name(workflowJobUsesLuaApi, "workflowJobUsesLuaApi");
|
|
5342
|
+
__name4(workflowJobUsesLuaApi, "workflowJobUsesLuaApi");
|
|
5202
5343
|
__name(workflowJobTargetProblem, "workflowJobTargetProblem");
|
|
5203
5344
|
__name4(workflowJobTargetProblem, "workflowJobTargetProblem");
|
|
5345
|
+
__name(readInitDataPath, "readInitDataPath");
|
|
5346
|
+
__name4(readInitDataPath, "readInitDataPath");
|
|
5347
|
+
__name(renderWorkflowJobTarget, "renderWorkflowJobTarget");
|
|
5348
|
+
__name4(renderWorkflowJobTarget, "renderWorkflowJobTarget");
|
|
5204
5349
|
}
|
|
5205
5350
|
});
|
|
5206
5351
|
|
|
@@ -5676,6 +5821,15 @@ function liftRenderedApprover(row, rendered) {
|
|
|
5676
5821
|
group: text
|
|
5677
5822
|
};
|
|
5678
5823
|
}
|
|
5824
|
+
function approverUsersOf(users) {
|
|
5825
|
+
if (Array.isArray(users)) {
|
|
5826
|
+
if (users.length === 0 || users.length > APPROVER_SPEC_MAX_USERS) return null;
|
|
5827
|
+
return users.every((m) => typeof m === "string" && m.length > 0 && m.length <= 128) ? users : null;
|
|
5828
|
+
}
|
|
5829
|
+
if (typeof users !== "string") return null;
|
|
5830
|
+
const lifted = liftRenderedApprover("users", users);
|
|
5831
|
+
return lifted && "users" in lifted ? lifted.users : null;
|
|
5832
|
+
}
|
|
5679
5833
|
function workspaceTemplatePath(template22) {
|
|
5680
5834
|
const key = template22.trim();
|
|
5681
5835
|
const expr = WORKSPACE_TEMPLATE_EXPR_RE.exec(key);
|
|
@@ -6153,8 +6307,13 @@ function validateLuaExtensions(g, caps = WORKFLOW_CAPS_DEFAULT, opts = {
|
|
|
6153
6307
|
}
|
|
6154
6308
|
const plugins = node.plugins;
|
|
6155
6309
|
const target = node.target;
|
|
6310
|
+
const luaApi = node.luaApi;
|
|
6311
|
+
if (luaApi !== void 0) {
|
|
6312
|
+
const problem = workflowJobLuaApiProblem(luaApi, node.type === "step" ? "code" : node.type, isJobTier(node) ? "job" : node.tier);
|
|
6313
|
+
if (problem) err("lua-api-invalid", problem, `${path3}.luaApi`, id2);
|
|
6314
|
+
}
|
|
6156
6315
|
if (target !== void 0) {
|
|
6157
|
-
const problem = workflowJobTargetProblem(target, plugins);
|
|
6316
|
+
const problem = workflowJobTargetProblem(target, plugins, luaApi);
|
|
6158
6317
|
if (problem) err("target-invalid", problem, `${path3}.target`, id2);
|
|
6159
6318
|
}
|
|
6160
6319
|
if (plugins !== void 0) {
|
|
@@ -8918,6 +9077,8 @@ var init_dist2 = __esm({
|
|
|
8918
9077
|
__name5(validateApproverBlock, "validateApproverBlock");
|
|
8919
9078
|
__name(liftRenderedApprover, "liftRenderedApprover");
|
|
8920
9079
|
__name5(liftRenderedApprover, "liftRenderedApprover");
|
|
9080
|
+
__name(approverUsersOf, "approverUsersOf");
|
|
9081
|
+
__name5(approverUsersOf, "approverUsersOf");
|
|
8921
9082
|
WORKSPACE_TEMPLATE_EXPR_RE = /^\$\{\s*(?:initData|input)\.([^}]+?)\s*\}$/;
|
|
8922
9083
|
__name(workspaceTemplatePath, "workspaceTemplatePath");
|
|
8923
9084
|
__name5(workspaceTemplatePath, "workspaceTemplatePath");
|
|
@@ -9574,7 +9735,9 @@ function stepNodeOf(s) {
|
|
|
9574
9735
|
tier,
|
|
9575
9736
|
workspace: s.workspace,
|
|
9576
9737
|
jobResources: s.jobResources,
|
|
9577
|
-
jobTools: s.jobTools
|
|
9738
|
+
jobTools: s.jobTools,
|
|
9739
|
+
luaApi: s.luaApi,
|
|
9740
|
+
target: s.target
|
|
9578
9741
|
});
|
|
9579
9742
|
}
|
|
9580
9743
|
function materializeEntry(entry, steps) {
|
|
@@ -9919,6 +10082,14 @@ var init_workflow = __esm({
|
|
|
9919
10082
|
const tier = s.tier ?? (s.workspace ? "job" : void 0);
|
|
9920
10083
|
if (s.workspace && s.tier !== void 0 && s.tier !== "job") throw new LuaWorkflowBuildError("workspace-requires-job-tier", `"${s.id}": a step mounting a workspace must be tier:'job'`);
|
|
9921
10084
|
if (s.jobTools && tier !== "job") throw new LuaWorkflowBuildError("cap-exceeded", `"${s.id}": jobTools require tier:'job' (job-tools-require-job-tier)`);
|
|
10085
|
+
if (s.luaApi !== void 0) {
|
|
10086
|
+
const problem = workflowJobLuaApiProblem(s.luaApi, "code", tier);
|
|
10087
|
+
if (problem) throw new LuaWorkflowBuildError("lua-api-invalid", `"${s.id}": ${problem}`);
|
|
10088
|
+
}
|
|
10089
|
+
if (s.target !== void 0) {
|
|
10090
|
+
const problem = workflowJobTargetProblem(s.target, void 0, s.luaApi);
|
|
10091
|
+
if (problem) throw new LuaWorkflowBuildError("target-invalid", `"${s.id}": ${problem}`);
|
|
10092
|
+
}
|
|
9922
10093
|
assertTimeout({
|
|
9923
10094
|
id: s.id,
|
|
9924
10095
|
timeoutSeconds: s.timeoutSeconds,
|
|
@@ -10175,7 +10346,7 @@ var init_workflow = __esm({
|
|
|
10175
10346
|
}
|
|
10176
10347
|
if (opts.target !== void 0) {
|
|
10177
10348
|
const problem = workflowJobTargetProblem(opts.target, opts.plugins);
|
|
10178
|
-
if (problem) throw new LuaWorkflowBuildError("
|
|
10349
|
+
if (problem) throw new LuaWorkflowBuildError("target-invalid", `"${id2}": ${problem}`);
|
|
10179
10350
|
}
|
|
10180
10351
|
assertTimeout({
|
|
10181
10352
|
id: id2,
|
|
@@ -11994,6 +12165,7 @@ var init_types = __esm({
|
|
|
11994
12165
|
PrimitiveKind2["DEVICE_TRIGGER"] = "device-trigger";
|
|
11995
12166
|
PrimitiveKind2["VOICE"] = "voice";
|
|
11996
12167
|
PrimitiveKind2["WORKFLOW"] = "workflow";
|
|
12168
|
+
PrimitiveKind2["WEB_APP"] = "web-app";
|
|
11997
12169
|
return PrimitiveKind2;
|
|
11998
12170
|
})({});
|
|
11999
12171
|
}
|
|
@@ -13490,7 +13662,8 @@ var init_skill_handler = __esm({
|
|
|
13490
13662
|
}
|
|
13491
13663
|
return {
|
|
13492
13664
|
name: skill.name,
|
|
13493
|
-
description
|
|
13665
|
+
// Same fallback as createOnServer — the server's version row requires a description.
|
|
13666
|
+
description: skill.description || `A Lua skill for ${skill.name}`,
|
|
13494
13667
|
// Same gate as createOnServer — server validator rejects empty content.
|
|
13495
13668
|
...hasPersonaTextContent(skill.context) ? {
|
|
13496
13669
|
context: skill.context
|
|
@@ -18078,14 +18251,8 @@ var readEnv = /* @__PURE__ */ __name((key) => {
|
|
|
18078
18251
|
return void 0;
|
|
18079
18252
|
}, "readEnv");
|
|
18080
18253
|
var env = Object.assign((key, _opts) => readEnv(key), {
|
|
18081
|
-
|
|
18082
|
-
|
|
18083
|
-
throw new Error(`env-template-secret-key: \`${key}\` looks like a secret \u2014 read it with env('${key}') inside execute instead`);
|
|
18084
|
-
}
|
|
18085
|
-
return {
|
|
18086
|
-
__envRef: key
|
|
18087
|
-
};
|
|
18088
|
-
}, "template")
|
|
18254
|
+
// The ONE factory (`@lua/shared-types`) — the deployed step runtime's `env.template` is the same function.
|
|
18255
|
+
template: /* @__PURE__ */ __name((key) => envTemplatePlaceholder(key), "template")
|
|
18089
18256
|
});
|
|
18090
18257
|
var log = Object.freeze({
|
|
18091
18258
|
debug: /* @__PURE__ */ __name((message, fields) => emitLocalLog("debug", message, fields), "debug"),
|
|
@@ -18609,6 +18776,7 @@ var LuaAgent = class {
|
|
|
18609
18776
|
triggers;
|
|
18610
18777
|
jobs;
|
|
18611
18778
|
workflows;
|
|
18779
|
+
webApps;
|
|
18612
18780
|
preProcessors;
|
|
18613
18781
|
postProcessors;
|
|
18614
18782
|
mcpServers;
|
|
@@ -18653,6 +18821,7 @@ var LuaAgent = class {
|
|
|
18653
18821
|
this.triggers = config.triggers || [];
|
|
18654
18822
|
this.jobs = config.jobs || [];
|
|
18655
18823
|
this.workflows = config.workflows || [];
|
|
18824
|
+
this.webApps = config.webApps || [];
|
|
18656
18825
|
this.preProcessors = config.preProcessors || [];
|
|
18657
18826
|
this.postProcessors = config.postProcessors || [];
|
|
18658
18827
|
this.mcpServers = config.mcpServers || [];
|
|
@@ -18698,6 +18867,9 @@ var LuaAgent = class {
|
|
|
18698
18867
|
getWorkflows() {
|
|
18699
18868
|
return this.workflows;
|
|
18700
18869
|
}
|
|
18870
|
+
getWebApps() {
|
|
18871
|
+
return this.webApps;
|
|
18872
|
+
}
|
|
18701
18873
|
getPreProcessors() {
|
|
18702
18874
|
return this.preProcessors;
|
|
18703
18875
|
}
|
|
@@ -18833,7 +19005,6 @@ __name(defineVoice, "defineVoice");
|
|
|
18833
19005
|
|
|
18834
19006
|
// src/types/web-app.ts
|
|
18835
19007
|
init_dist();
|
|
18836
|
-
var WEB_APP_NAME_PATTERN = /^[a-z][a-z0-9-]*$/;
|
|
18837
19008
|
var ROUTE_KEY_PATTERN = new RegExp(`^(${WEB_ROUTE_METHODS.join("|")}) /\\S*$`);
|
|
18838
19009
|
function route(def) {
|
|
18839
19010
|
if (typeof def.handler !== "function") {
|