lua-cli 3.39.2 → 3.39.4
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 +270 -72
- package/dist/api-exports.js +175 -8
- package/dist/api-exports.js.map +1 -1
- package/dist/index.js +164 -30
- package/dist/index.js.map +1 -1
- package/dist/voice/test/index.d.ts +72 -72
- package/dist/workflow-builder.js +77 -0
- package/dist/workflow-builder.js.map +1 -1
- package/package.json +5 -3
- package/template/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -957,6 +957,9 @@ function isInteractiveTurn(turn) {
|
|
|
957
957
|
function removeNavigateBlock(input) {
|
|
958
958
|
return input.replace(/::: navigate[\s\S]*?:::/g, "").trim();
|
|
959
959
|
}
|
|
960
|
+
function removeHiddenBlocks(input) {
|
|
961
|
+
return input.replace(/::: hide\b[\s\S]*?:::/gi, "").replace(/::: hide\b[\s\S]*$/gi, "").trim();
|
|
962
|
+
}
|
|
960
963
|
function transformChatHistoryContentParts(parts) {
|
|
961
964
|
const content = [];
|
|
962
965
|
for (const rawPart of parts ?? []) {
|
|
@@ -1586,6 +1589,7 @@ function utf8Bytes(value3) {
|
|
|
1586
1589
|
}
|
|
1587
1590
|
function isPlainFieldKey(key) {
|
|
1588
1591
|
if (!LOG_FIELD_KEY_PATTERN.test(key)) return false;
|
|
1592
|
+
if (key === LOG_FIELDS_CLAMPED_KEY) return false;
|
|
1589
1593
|
return !LOG_FIELD_SECRET_SHAPED_KEY_PATTERNS.some((pattern) => pattern.test(key));
|
|
1590
1594
|
}
|
|
1591
1595
|
function describeAgentLogFieldsViolation(value3) {
|
|
@@ -2811,7 +2815,44 @@ function parseOnboardingFlow(value3) {
|
|
|
2811
2815
|
function parsePublishedOnboardingResponse(value3) {
|
|
2812
2816
|
return getPublishedOnboardingResponseSchema.parse(value3);
|
|
2813
2817
|
}
|
|
2814
|
-
|
|
2818
|
+
function isForwardableWebRouteRequestHeader(name) {
|
|
2819
|
+
const n2 = name.toLowerCase();
|
|
2820
|
+
return WEB_ROUTE_REQUEST_HEADER_ALLOWLIST.includes(n2) || n2.startsWith("x-lua-");
|
|
2821
|
+
}
|
|
2822
|
+
function isForwardableWebRouteResponseHeader(name) {
|
|
2823
|
+
const n2 = name.toLowerCase();
|
|
2824
|
+
if (n2 === "set-cookie") return false;
|
|
2825
|
+
return WEB_ROUTE_RESPONSE_HEADER_ALLOWLIST.includes(n2) || n2.startsWith("x-lua-");
|
|
2826
|
+
}
|
|
2827
|
+
function isWebRouteBody(value3) {
|
|
2828
|
+
if (!value3 || typeof value3 !== "object") return false;
|
|
2829
|
+
const b = value3;
|
|
2830
|
+
if (b.kind === "json") return "value" in b;
|
|
2831
|
+
if (b.kind === "text" || b.kind === "base64") return typeof b.value === "string";
|
|
2832
|
+
return false;
|
|
2833
|
+
}
|
|
2834
|
+
function isWebRouteInput(value3) {
|
|
2835
|
+
if (!value3 || typeof value3 !== "object") return false;
|
|
2836
|
+
const v = value3;
|
|
2837
|
+
if (v.v !== WEB_ROUTE_PROTOCOL_VERSION) return false;
|
|
2838
|
+
const r = v.request;
|
|
2839
|
+
if (!r || typeof r !== "object") return false;
|
|
2840
|
+
if (!WEB_ROUTE_METHODS.includes(String(r.method))) return false;
|
|
2841
|
+
if (typeof r.path !== "string" || !r.path.startsWith("/")) return false;
|
|
2842
|
+
if (!r.params || typeof r.params !== "object") return false;
|
|
2843
|
+
if (!r.query || typeof r.query !== "object") return false;
|
|
2844
|
+
if (!r.headers || typeof r.headers !== "object") return false;
|
|
2845
|
+
if (r.body !== void 0) {
|
|
2846
|
+
if (r.method === "GET") return false;
|
|
2847
|
+
if (!isWebRouteBody(r.body)) return false;
|
|
2848
|
+
}
|
|
2849
|
+
const a = v.auth;
|
|
2850
|
+
if (!a || typeof a.userId !== "string" || typeof a.orgId !== "string" || typeof a.agentId !== "string") return false;
|
|
2851
|
+
const app = v.app;
|
|
2852
|
+
if (!app || typeof app.id !== "string" || typeof app.name !== "string" || typeof app.origin !== "string") return false;
|
|
2853
|
+
return true;
|
|
2854
|
+
}
|
|
2855
|
+
var __defProp2, __name2, PLUMBING_THREAD_CHANNELS, CHANNEL_CONVERSATION_CHANNELS, HIDDEN_THREAD_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_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, AGENT_LOG_SOURCES, AGENT_LOG_ENVIRONMENTS, AGENT_LOG_FIELDS_MAX_WIRE_KEYS, 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_JOB_MODEL_SOURCE_LABELS, WORKFLOW_SUSPEND_KINDS, WORKFLOW_RUN_NOTIFICATION_SUSPENDED_KINDS, WORKFLOW_SIGNAL_PAYLOAD_MAX_BYTES, WORKFLOW_RESOLVE_OUTPUT_MAX_BYTES, 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, 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;
|
|
2815
2856
|
var init_dist = __esm({
|
|
2816
2857
|
"../shared-types/dist/index.mjs"() {
|
|
2817
2858
|
"use strict";
|
|
@@ -2911,6 +2952,8 @@ var init_dist = __esm({
|
|
|
2911
2952
|
__name2(isInteractiveTurn, "isInteractiveTurn");
|
|
2912
2953
|
__name(removeNavigateBlock, "removeNavigateBlock");
|
|
2913
2954
|
__name2(removeNavigateBlock, "removeNavigateBlock");
|
|
2955
|
+
__name(removeHiddenBlocks, "removeHiddenBlocks");
|
|
2956
|
+
__name2(removeHiddenBlocks, "removeHiddenBlocks");
|
|
2914
2957
|
__name(transformChatHistoryContentParts, "transformChatHistoryContentParts");
|
|
2915
2958
|
__name2(transformChatHistoryContentParts, "transformChatHistoryContentParts");
|
|
2916
2959
|
RICH_PARTS_MESSAGE_ID_PREFIX = "rich-parts:";
|
|
@@ -3543,6 +3586,7 @@ This text is who you are for this person. As you learn them, their name, their w
|
|
|
3543
3586
|
"skill",
|
|
3544
3587
|
"job",
|
|
3545
3588
|
"webhook",
|
|
3589
|
+
"web-route",
|
|
3546
3590
|
"trigger",
|
|
3547
3591
|
"preprocessor",
|
|
3548
3592
|
"postprocessor",
|
|
@@ -5308,6 +5352,39 @@ listed here; never invent a target.`;
|
|
|
5308
5352
|
__name2(parseOnboardingFlow, "parseOnboardingFlow");
|
|
5309
5353
|
__name(parsePublishedOnboardingResponse, "parsePublishedOnboardingResponse");
|
|
5310
5354
|
__name2(parsePublishedOnboardingResponse, "parsePublishedOnboardingResponse");
|
|
5355
|
+
WEB_ROUTE_PROTOCOL_VERSION = 1;
|
|
5356
|
+
WEB_ROUTE_METHODS = [
|
|
5357
|
+
"GET",
|
|
5358
|
+
"POST",
|
|
5359
|
+
"PUT",
|
|
5360
|
+
"PATCH",
|
|
5361
|
+
"DELETE"
|
|
5362
|
+
];
|
|
5363
|
+
WEB_ROUTE_REQUEST_HEADER_ALLOWLIST = [
|
|
5364
|
+
"accept",
|
|
5365
|
+
"accept-language",
|
|
5366
|
+
"content-type",
|
|
5367
|
+
"if-none-match",
|
|
5368
|
+
"idempotency-key"
|
|
5369
|
+
];
|
|
5370
|
+
WEB_ROUTE_RESPONSE_HEADER_ALLOWLIST = [
|
|
5371
|
+
"content-type",
|
|
5372
|
+
"cache-control",
|
|
5373
|
+
"etag",
|
|
5374
|
+
"location",
|
|
5375
|
+
"content-disposition",
|
|
5376
|
+
"content-language"
|
|
5377
|
+
];
|
|
5378
|
+
__name(isForwardableWebRouteRequestHeader, "isForwardableWebRouteRequestHeader");
|
|
5379
|
+
__name2(isForwardableWebRouteRequestHeader, "isForwardableWebRouteRequestHeader");
|
|
5380
|
+
__name(isForwardableWebRouteResponseHeader, "isForwardableWebRouteResponseHeader");
|
|
5381
|
+
__name2(isForwardableWebRouteResponseHeader, "isForwardableWebRouteResponseHeader");
|
|
5382
|
+
WEB_ROUTE_MAX_REQUEST_BODY_BYTES = 1 * 1024 * 1024;
|
|
5383
|
+
WEB_ROUTE_MAX_RESPONSE_BYTES = 4 * 1024 * 1024;
|
|
5384
|
+
__name(isWebRouteBody, "isWebRouteBody");
|
|
5385
|
+
__name2(isWebRouteBody, "isWebRouteBody");
|
|
5386
|
+
__name(isWebRouteInput, "isWebRouteInput");
|
|
5387
|
+
__name2(isWebRouteInput, "isWebRouteInput");
|
|
5311
5388
|
}
|
|
5312
5389
|
});
|
|
5313
5390
|
|
|
@@ -30994,17 +31071,34 @@ var PersonaApi = class extends HttpClient {
|
|
|
30994
31071
|
return this.httpGet(`/developer/agents/${this.agentId}/persona/versions${statusParam}`, {});
|
|
30995
31072
|
}
|
|
30996
31073
|
/**
|
|
30997
|
-
* Creates a new persona version
|
|
31074
|
+
* Creates a new persona version.
|
|
31075
|
+
*
|
|
31076
|
+
* PRO-2170: the route STAGES by default — creating a version does not change
|
|
31077
|
+
* what the agent serves. `options.publish` is sent only when the caller
|
|
31078
|
+
* passes it, so an omitted flag means "whatever the server's default is" and
|
|
31079
|
+
* an explicit `false` pins the stage-only intent on the wire (what `lua push`
|
|
31080
|
+
* sends, so a server that ever flips its default cannot silently publish a
|
|
31081
|
+
* push again). Activation is `deployVersion`.
|
|
31082
|
+
*
|
|
30998
31083
|
* @param persona - The persona content (string or channel-aware object)
|
|
31084
|
+
* @param options.publish - `true` = create and serve in one call; `false` = stage only
|
|
30999
31085
|
* @returns Promise resolving to an ApiResponse with the created version
|
|
31000
31086
|
*/
|
|
31001
|
-
async createVersion(persona) {
|
|
31087
|
+
async createVersion(persona, options = {}) {
|
|
31002
31088
|
return this.httpPost(`/developer/agents/${this.agentId}/persona/version`, {
|
|
31003
|
-
persona
|
|
31089
|
+
persona,
|
|
31090
|
+
...options.publish === void 0 ? {} : {
|
|
31091
|
+
publish: options.publish
|
|
31092
|
+
}
|
|
31004
31093
|
}, {});
|
|
31005
31094
|
}
|
|
31006
31095
|
/**
|
|
31007
|
-
* Deploys/activates a persona version to production
|
|
31096
|
+
* Deploys/activates a persona version to production.
|
|
31097
|
+
*
|
|
31098
|
+
* PRO-2170: this is the ONLY path that changes the persona the agent serves.
|
|
31099
|
+
* It re-points the agent, marks the version `published` and demotes the
|
|
31100
|
+
* previously-published one to `staged`.
|
|
31101
|
+
*
|
|
31008
31102
|
* @param version - The version number to deploy
|
|
31009
31103
|
* @returns Promise resolving to an ApiResponse with confirmation
|
|
31010
31104
|
*/
|
|
@@ -31024,9 +31118,15 @@ var PersonaApi = class extends HttpClient {
|
|
|
31024
31118
|
return sorted[0];
|
|
31025
31119
|
}
|
|
31026
31120
|
/**
|
|
31027
|
-
* Gets the latest published persona version
|
|
31028
|
-
*
|
|
31029
|
-
*
|
|
31121
|
+
* Gets the latest published persona version.
|
|
31122
|
+
*
|
|
31123
|
+
* PRO-2170 changed what this means. It used to be "the most recently pushed
|
|
31124
|
+
* version", because a push published every version it created. Now a push
|
|
31125
|
+
* STAGES, so `published` is the version production SERVES, and a local
|
|
31126
|
+
* persona ahead of it is genuine drift (`checkPersonaDrift`) — the same
|
|
31127
|
+
* reading as a pushed-but-not-activated skill. Use `getLatestVersion` (all
|
|
31128
|
+
* statuses) when you want the most recent push instead.
|
|
31129
|
+
*
|
|
31030
31130
|
* @returns Promise resolving to the latest published PersonaVersion or null if none exist
|
|
31031
31131
|
*/
|
|
31032
31132
|
async getLatestPublishedVersion() {
|
|
@@ -31789,7 +31889,9 @@ var AgentHandler = class {
|
|
|
31789
31889
|
}
|
|
31790
31890
|
async pushPersona(ctx, persona) {
|
|
31791
31891
|
const personaApi = new PersonaApi(BASE_URLS.API, ctx.apiKey, ctx.agentId);
|
|
31792
|
-
const result = await personaApi.createVersion(persona
|
|
31892
|
+
const result = await personaApi.createVersion(persona, {
|
|
31893
|
+
publish: false
|
|
31894
|
+
});
|
|
31793
31895
|
return {
|
|
31794
31896
|
success: result.success,
|
|
31795
31897
|
version: result.data?.version
|
|
@@ -33536,6 +33638,7 @@ async function executePushMode(context, drift, primitiveDrift) {
|
|
|
33536
33638
|
const result = await agentHandler.pushPersona(context, drift.persona.localPersona);
|
|
33537
33639
|
if (result.success) {
|
|
33538
33640
|
writeSuccess(`\u2705 Persona version ${result.version} created on server`);
|
|
33641
|
+
writeInfo(` Staged, NOT activated \u2014 activate it with \`lua deploy persona --set-version ${result.version}\`.`);
|
|
33539
33642
|
} else {
|
|
33540
33643
|
console.error("\u274C Failed to push persona");
|
|
33541
33644
|
syncFullySucceeded = false;
|
|
@@ -33744,6 +33847,7 @@ async function handlePersonaDriftInteractive(context, drift) {
|
|
|
33744
33847
|
const result = await agentHandler.pushPersona(context, drift.localPersona);
|
|
33745
33848
|
if (result.success) {
|
|
33746
33849
|
writeSuccess(`\u2705 Persona version ${result.version} created on server`);
|
|
33850
|
+
writeInfo(` Staged, NOT activated \u2014 activate it with \`lua deploy persona --set-version ${result.version}\`.`);
|
|
33747
33851
|
} else {
|
|
33748
33852
|
console.error("\u274C Failed to push persona");
|
|
33749
33853
|
}
|
|
@@ -42574,11 +42678,11 @@ function getDeployHint(type) {
|
|
|
42574
42678
|
};
|
|
42575
42679
|
}
|
|
42576
42680
|
__name(getDeployHint, "getDeployHint");
|
|
42577
|
-
function
|
|
42578
|
-
writeInfo(`\u{1F4A1} Persona v${version}
|
|
42579
|
-
writeInfo(
|
|
42681
|
+
function writePersonaStagedHint(version) {
|
|
42682
|
+
writeInfo(`\u{1F4A1} Persona v${version} staged \u2014 NOT activated. What the agent serves is unchanged.`);
|
|
42683
|
+
writeInfo(` Activate it with \`lua deploy persona --set-version ${version}\` (asks for confirmation first).`);
|
|
42580
42684
|
}
|
|
42581
|
-
__name(
|
|
42685
|
+
__name(writePersonaStagedHint, "writePersonaStagedHint");
|
|
42582
42686
|
async function promptVersionConfirmOrUpdate(currentVersion) {
|
|
42583
42687
|
console.log(`
|
|
42584
42688
|
Current version: ${currentVersion || "(none - first push)"}`);
|
|
@@ -43164,7 +43268,7 @@ Model: ${model}`);
|
|
|
43164
43268
|
personaDeployWasAttempted = true;
|
|
43165
43269
|
productionDeployedWithAutoDeploy = await deployPersonaVersionAfterPush(apiKey, agentId, result.persona.version, options.autoDeploy || false);
|
|
43166
43270
|
} else {
|
|
43167
|
-
|
|
43271
|
+
writePersonaStagedHint(result.persona.version);
|
|
43168
43272
|
}
|
|
43169
43273
|
}
|
|
43170
43274
|
const personaAutoDeployFailed = Boolean(options.autoDeploy && personaDeployEligible && personaDeployWasAttempted && !productionDeployedWithAutoDeploy);
|
|
@@ -43478,7 +43582,7 @@ ${icon} Pushing ${items.length} ${handler.displayName}(s)...`);
|
|
|
43478
43582
|
};
|
|
43479
43583
|
}
|
|
43480
43584
|
if (personaPushResult && !options.autoDeploy) {
|
|
43481
|
-
|
|
43585
|
+
writePersonaStagedHint(personaPushResult.version);
|
|
43482
43586
|
}
|
|
43483
43587
|
if (toDeploy.length > 0) {
|
|
43484
43588
|
writeProgress("\n\u{1F680} Deploying all pushed versions to production...");
|
|
@@ -44124,7 +44228,9 @@ async function deployPersonaVersion(apiKey, agentId, options) {
|
|
|
44124
44228
|
name: "version",
|
|
44125
44229
|
message: "Select a persona version to deploy:",
|
|
44126
44230
|
choices: sortedVersions.map((v) => ({
|
|
44127
|
-
|
|
44231
|
+
// PRO-2170: a push stages, so the list now contains versions that are
|
|
44232
|
+
// NOT served. Mark them, or the only clue is the absence of (CURRENT).
|
|
44233
|
+
name: `v${v.version}${v.isCurrent ? " (CURRENT)" : ""}${v.status === "staged" ? " (STAGED)" : v.status === "draft" ? " (DRAFT)" : ""} \u2014 ${new Date(v.createdDate).toLocaleDateString()}`,
|
|
44128
44234
|
value: v.version
|
|
44129
44235
|
}))
|
|
44130
44236
|
}
|
|
@@ -46433,6 +46539,12 @@ init_compiler2();
|
|
|
46433
46539
|
init_artifact_loader();
|
|
46434
46540
|
init_analytics();
|
|
46435
46541
|
init_cli_error();
|
|
46542
|
+
function versionStatusMarker(status) {
|
|
46543
|
+
if (status === "draft") return "[DRAFT]";
|
|
46544
|
+
if (status === "staged") return "[STAGED]";
|
|
46545
|
+
return "";
|
|
46546
|
+
}
|
|
46547
|
+
__name(versionStatusMarker, "versionStatusMarker");
|
|
46436
46548
|
async function personaCommand(env, action, cmdObj) {
|
|
46437
46549
|
return withErrorHandling(async () => {
|
|
46438
46550
|
const options = {
|
|
@@ -46549,7 +46661,8 @@ function displayVersionsCore(versions) {
|
|
|
46549
46661
|
const dateStr = date.toLocaleDateString();
|
|
46550
46662
|
const timeStr = date.toLocaleTimeString();
|
|
46551
46663
|
const currentMark = v.isCurrent ? " \u2B50 CURRENT" : "";
|
|
46552
|
-
const
|
|
46664
|
+
const marker = versionStatusMarker(v.status);
|
|
46665
|
+
const status = marker ? ` ${marker}` : "";
|
|
46553
46666
|
console.log(` Version ${v.version}${status} - ${dateStr} ${timeStr}${currentMark}`);
|
|
46554
46667
|
});
|
|
46555
46668
|
console.log("\n" + "=".repeat(60));
|
|
@@ -46807,7 +46920,7 @@ async function listPersonaVersionsInteractive(context) {
|
|
|
46807
46920
|
const date = new Date(version.createdDate);
|
|
46808
46921
|
const dateStr = date.toLocaleDateString();
|
|
46809
46922
|
const timeStr = date.toLocaleTimeString();
|
|
46810
|
-
const status = version.status
|
|
46923
|
+
const status = versionStatusMarker(version.status);
|
|
46811
46924
|
const currentMark = version.isCurrent ? " \u2B50 CURRENT" : "";
|
|
46812
46925
|
return {
|
|
46813
46926
|
name: `Version ${version.version} ${status} - (${dateStr}) ${timeStr} ${currentMark}`,
|
|
@@ -46826,7 +46939,7 @@ async function viewVersionDetailsInteractive(version) {
|
|
|
46826
46939
|
console.log(`Persona Version ${version.version}`);
|
|
46827
46940
|
console.log("=".repeat(60));
|
|
46828
46941
|
console.log(`Created: ${date.toLocaleString()}`);
|
|
46829
|
-
const versionStatus = version.status === "draft" ? "\u{1F528} DRAFT" : "";
|
|
46942
|
+
const versionStatus = version.status === "draft" ? "\u{1F528} DRAFT" : version.status === "staged" ? "\u{1F4E4} STAGED (not served)" : "\u2B50 PUBLISHED";
|
|
46830
46943
|
console.log(`Version Status: ${versionStatus}`);
|
|
46831
46944
|
console.log(`Active Status: ${version.isCurrent ? "\u2B50 CURRENT" : "Available"}`);
|
|
46832
46945
|
if (version.createdBy) {
|
|
@@ -46909,7 +47022,7 @@ async function deployPersonaVersionInteractive(context) {
|
|
|
46909
47022
|
const dateStr = date.toLocaleDateString();
|
|
46910
47023
|
const timeStr = date.toLocaleTimeString();
|
|
46911
47024
|
const currentMark = v.isCurrent ? " \u2B50 CURRENTLY DEPLOYED" : "";
|
|
46912
|
-
const status = v.status
|
|
47025
|
+
const status = versionStatusMarker(v.status);
|
|
46913
47026
|
return {
|
|
46914
47027
|
name: `Version ${v.version} ${status} - (${dateStr}) ${timeStr} ${currentMark}`,
|
|
46915
47028
|
value: v.version
|
|
@@ -50379,7 +50492,7 @@ function wantsContent(options, sources) {
|
|
|
50379
50492
|
return (sources ?? []).some((source) => LOG_DRAIN_CONTENT_SOURCES.includes(source));
|
|
50380
50493
|
}
|
|
50381
50494
|
__name(wantsContent, "wantsContent");
|
|
50382
|
-
async function acknowledgeContent(options, becauseOfFlag = true) {
|
|
50495
|
+
async function acknowledgeContent(options, becauseOfFlag = true, nothingHint = "Nothing was created") {
|
|
50383
50496
|
emitAside("", options.json);
|
|
50384
50497
|
emitAside(CONTENT_WARNING_TEXT, options.json);
|
|
50385
50498
|
emitAside("", options.json);
|
|
@@ -50387,7 +50500,7 @@ async function acknowledgeContent(options, becauseOfFlag = true) {
|
|
|
50387
50500
|
emitAside("", options.json);
|
|
50388
50501
|
if (options.yes) return true;
|
|
50389
50502
|
if (isCiModeEnabled()) {
|
|
50390
|
-
throw CliError.usage(becauseOfFlag ? "--include-content needs the acknowledgement above; pass --yes to give it non-interactively." : "Selecting user_message or agent_response needs the acknowledgement above; pass --yes to give it non-interactively. (Content bodies stay OFF unless you also pass --include-content.)",
|
|
50503
|
+
throw CliError.usage(becauseOfFlag ? "--include-content needs the acknowledgement above; pass --yes to give it non-interactively." : "Selecting user_message or agent_response needs the acknowledgement above; pass --yes to give it non-interactively. (Content bodies stay OFF unless you also pass --include-content.)", nothingHint);
|
|
50391
50504
|
}
|
|
50392
50505
|
const answer = await safePrompt([
|
|
50393
50506
|
{
|
|
@@ -50398,7 +50511,7 @@ async function acknowledgeContent(options, becauseOfFlag = true) {
|
|
|
50398
50511
|
}
|
|
50399
50512
|
]);
|
|
50400
50513
|
if (!answer?.acknowledged) {
|
|
50401
|
-
throw CliError.usage("Content was not enabled: the acknowledgement was declined.",
|
|
50514
|
+
throw CliError.usage("Content was not enabled: the acknowledgement was declined.", nothingHint);
|
|
50402
50515
|
}
|
|
50403
50516
|
return true;
|
|
50404
50517
|
}
|
|
@@ -51710,6 +51823,8 @@ var LOG_EXPORT_DOWNLOAD = {
|
|
|
51710
51823
|
};
|
|
51711
51824
|
var ALREADY_RUNNING = "EXPORT_ALREADY_RUNNING";
|
|
51712
51825
|
var MISSING_EXPORT_SCOPE_MESSAGE = "Missing scope: logs:read. Create a key with that scope (lua auth key) or ask an org admin.";
|
|
51826
|
+
var EXPORT_CONTENT_FORBIDDEN = "EXPORT_CONTENT_FORBIDDEN";
|
|
51827
|
+
var MISSING_EXPORT_CONTENT_SCOPE_MESSAGE = "Missing scope: logs:manage. Create a key with that scope (lua auth key) or ask an org admin.";
|
|
51713
51828
|
var TERMINAL2 = /* @__PURE__ */ new Set([
|
|
51714
51829
|
"succeeded",
|
|
51715
51830
|
"failed",
|
|
@@ -51726,6 +51841,10 @@ async function logsExportCommand(cmdObj) {
|
|
|
51726
51841
|
}
|
|
51727
51842
|
const sources = parseTypeFlag(options.type);
|
|
51728
51843
|
const outDir = options.out ? resolveOutDir(String(options.out)) : void 0;
|
|
51844
|
+
const includeContent = options.includeContent === true;
|
|
51845
|
+
if (includeContent) {
|
|
51846
|
+
await acknowledgeContent(options, true, "Nothing was exported");
|
|
51847
|
+
}
|
|
51729
51848
|
const context = await resolveDrainsContext(options);
|
|
51730
51849
|
const api = new LogExportApi(BASE_URLS.API, context.apiKey, context.orgId);
|
|
51731
51850
|
const say = /* @__PURE__ */ __name((line) => {
|
|
@@ -51734,7 +51853,8 @@ async function logsExportCommand(cmdObj) {
|
|
|
51734
51853
|
const jobId = await startOrAttach(api, {
|
|
51735
51854
|
from: since,
|
|
51736
51855
|
to: until ?? (/* @__PURE__ */ new Date()).toISOString(),
|
|
51737
|
-
sources
|
|
51856
|
+
sources,
|
|
51857
|
+
includeContent
|
|
51738
51858
|
}, say);
|
|
51739
51859
|
if (options.noWait || options.wait === false) {
|
|
51740
51860
|
emit2(options, {
|
|
@@ -51745,7 +51865,8 @@ async function logsExportCommand(cmdObj) {
|
|
|
51745
51865
|
trackEvent("cli_logs_export", {
|
|
51746
51866
|
waited: false,
|
|
51747
51867
|
json_output: !!options.json,
|
|
51748
|
-
downloaded: 0
|
|
51868
|
+
downloaded: 0,
|
|
51869
|
+
include_content: includeContent
|
|
51749
51870
|
});
|
|
51750
51871
|
return;
|
|
51751
51872
|
}
|
|
@@ -51786,7 +51907,8 @@ async function logsExportCommand(cmdObj) {
|
|
|
51786
51907
|
waited: true,
|
|
51787
51908
|
json_output: !!options.json,
|
|
51788
51909
|
downloaded: written.length,
|
|
51789
|
-
truncated: !!job.truncated
|
|
51910
|
+
truncated: !!job.truncated,
|
|
51911
|
+
include_content: includeContent
|
|
51790
51912
|
});
|
|
51791
51913
|
},
|
|
51792
51914
|
"logs export",
|
|
@@ -51820,6 +51942,11 @@ async function startOrAttach(api, input, say) {
|
|
|
51820
51942
|
to: input.to,
|
|
51821
51943
|
...input.sources ? {
|
|
51822
51944
|
sources: input.sources
|
|
51945
|
+
} : {},
|
|
51946
|
+
// Only ever sent as `true` — PRO-2182. `false`/absent both mean "no content", and the
|
|
51947
|
+
// server's own default is `false`, so there is nothing an omitted key would lose.
|
|
51948
|
+
...input.includeContent ? {
|
|
51949
|
+
includeContent: true
|
|
51823
51950
|
} : {}
|
|
51824
51951
|
};
|
|
51825
51952
|
const started = await callExport(() => api.startExport(body));
|
|
@@ -51874,7 +52001,7 @@ async function callExport(call) {
|
|
|
51874
52001
|
return await call();
|
|
51875
52002
|
} catch (error) {
|
|
51876
52003
|
if (CliError.isCliError(error) && error.statusCode === 403) {
|
|
51877
|
-
throw CliError.forbidden(MISSING_EXPORT_SCOPE_MESSAGE);
|
|
52004
|
+
throw CliError.forbidden(error.serverCode === EXPORT_CONTENT_FORBIDDEN ? MISSING_EXPORT_CONTENT_SCOPE_MESSAGE : MISSING_EXPORT_SCOPE_MESSAGE);
|
|
51878
52005
|
}
|
|
51879
52006
|
throw error;
|
|
51880
52007
|
}
|
|
@@ -71704,7 +71831,7 @@ Notes:
|
|
|
71704
71831
|
shift the window. --type calls reads voice calls and ignores --since/--until/--environment
|
|
71705
71832
|
/--follow. --since is INCLUSIVE; the boundary row is de-duplicated by id while following.
|
|
71706
71833
|
`).action(logsCommand);
|
|
71707
|
-
logsGroup.command("export").description("\u{1F4E6} Export this organization's logs as gzip NDJSON (asynchronous job)").option("--since <when>", "Inclusive lower bound (REQUIRED): an ISO 8601 instant, or 24h | 7d").option("--until <when>", "Inclusive upper bound; same formats (default: now)").option("--type <type>", "Comma-separated log sources, or all (default: all)").option("--out <dir>", "Download the parts into this directory (created if missing)").option("--org <id>", "The organization to export (default: the project, or the key when it reaches one org)").option("--no-wait", "Start the export and print the job id without polling it").option("--json", "Output as JSON").addHelpText("after", `
|
|
71834
|
+
logsGroup.command("export").description("\u{1F4E6} Export this organization's logs as gzip NDJSON (asynchronous job)").option("--since <when>", "Inclusive lower bound (REQUIRED): an ISO 8601 instant, or 24h | 7d").option("--until <when>", "Inclusive upper bound; same formats (default: now)").option("--type <type>", "Comma-separated log sources, or all (default: all)").option("--out <dir>", "Download the parts into this directory (created if missing)").option("--org <id>", "The organization to export (default: the project, or the key when it reaches one org)").option("--no-wait", "Start the export and print the job id without polling it").option("--include-content", "Include user_message / agent_response bodies (requires logs:manage; prints an acknowledgement)").option("-y, --yes", "Give the --include-content acknowledgement non-interactively").option("--json", "Output as JSON").addHelpText("after", `
|
|
71708
71835
|
Options:
|
|
71709
71836
|
--since <when> REQUIRED. Inclusive lower bound: an ISO 8601 instant, or 24h | 7d
|
|
71710
71837
|
--until <when> Inclusive upper bound, same formats (default: now)
|
|
@@ -71712,19 +71839,26 @@ Options:
|
|
|
71712
71839
|
--out <dir> Download every part into this local directory
|
|
71713
71840
|
--org <id> The organization, when the key reaches more than one
|
|
71714
71841
|
--no-wait Start it and print the job id; poll later
|
|
71842
|
+
--include-content Include user_message / agent_response bodies. Requires logs:manage;
|
|
71843
|
+
prints the same content warning and acknowledgement as
|
|
71844
|
+
lua drains create --include-content
|
|
71845
|
+
-y, --yes Give that acknowledgement non-interactively
|
|
71715
71846
|
--json Output as JSON for scripting
|
|
71716
71847
|
|
|
71717
71848
|
Examples:
|
|
71718
71849
|
$ lua logs export --since 7d --out ./export A week, downloaded
|
|
71719
71850
|
$ lua logs export --since 30d --type skill,job A month, two sources
|
|
71720
71851
|
$ lua logs export --since 24h --no-wait --json Start it and return
|
|
71852
|
+
$ lua logs export --since 24h --include-content --yes Include message bodies (logs:manage)
|
|
71721
71853
|
|
|
71722
71854
|
Notes:
|
|
71723
71855
|
The window is at most 31 days and the job at most 10 000 000 records; narrow the window
|
|
71724
71856
|
or the sources rather than raising either. One export runs per organization at a time \u2014
|
|
71725
71857
|
a second invocation FOLLOWS the running one instead of refusing. Download links expire
|
|
71726
|
-
24 h after the export finishes and the files are removed after 7 days. Message bodies
|
|
71727
|
-
|
|
71858
|
+
24 h after the export finishes and the files are removed after 7 days. Message bodies are
|
|
71859
|
+
EXCLUDED BY DEFAULT and only ever included when --include-content is passed AND the
|
|
71860
|
+
acknowledgement is given AND the credential holds logs:manage \u2014 the scope alone is not
|
|
71861
|
+
enough, the flag is required too.
|
|
71728
71862
|
`).action((options, command) => logsExportCommand(withGroupOptions(options ?? {}, command)));
|
|
71729
71863
|
program2.command("skills [actionOrEnv] [action]").description("\u2699\uFE0F Manage and view skills").option("--skill-name <name>", "Skill name").option("--skill-version <version>", "Version for deploy action (or 'latest')").addHelpText("after", `
|
|
71730
71864
|
Arguments:
|