@hcmai/sdk 0.26.2 → 0.27.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/index.d.ts +52 -2
- package/dist/index.js +146 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -201,9 +201,17 @@ interface ModelQueryDsl {
|
|
|
201
201
|
limit?: number;
|
|
202
202
|
offset?: number;
|
|
203
203
|
}
|
|
204
|
+
/** 服务端随查询结果返回的提示(`extra.warnings`),例如 match 纳入了哪些取值、是否降级为字面包含。 */
|
|
205
|
+
interface QueryWarning {
|
|
206
|
+
code: string;
|
|
207
|
+
message?: string;
|
|
208
|
+
suggestion?: string;
|
|
209
|
+
}
|
|
204
210
|
interface QueryResult<T = Record<string, unknown>> {
|
|
205
211
|
rows: T[];
|
|
206
212
|
total?: number;
|
|
213
|
+
/** 只在服务端真给了提示时出现。 */
|
|
214
|
+
warnings?: QueryWarning[];
|
|
207
215
|
}
|
|
208
216
|
interface ActionInput {
|
|
209
217
|
id?: string;
|
|
@@ -288,6 +296,12 @@ interface FieldMeta {
|
|
|
288
296
|
* 只是 CLI 这一跳把它丢了(hcm_nx_core#2034)。
|
|
289
297
|
*/
|
|
290
298
|
i18n?: boolean;
|
|
299
|
+
/**
|
|
300
|
+
* 字段声明了取值语义匹配(服务端 `ModelFieldMeta.valueMatch`,ADR-462):filter 里可以写
|
|
301
|
+
* `{"field":…,"op":"match","value":"简称或口语"}`,由服务端在真实取值里按语义纳入再改写成 `in`。
|
|
302
|
+
* 不打出来,顾问只会拿 `contains` 逐个换词试——那正是 match 要替掉的做法。
|
|
303
|
+
*/
|
|
304
|
+
valueMatch?: boolean;
|
|
291
305
|
}
|
|
292
306
|
interface ActionMeta {
|
|
293
307
|
name: string;
|
|
@@ -357,7 +371,7 @@ interface DescribeOpts {
|
|
|
357
371
|
* interface 加了键忘了登记、或清单里有 interface 没有的键,都在**编译期**红。
|
|
358
372
|
* 不这样做,它就是又一张「漏登永远不红」的手工登记表。
|
|
359
373
|
*/
|
|
360
|
-
declare const HCM_FIELD_RAW_KEYS: readonly ["key", "name", "type", "isRequired", "description", "isReadonly", "systemManaged", "jsonObject", "decimalNumber", "enums", "object", "objectLabel", "isI18n"];
|
|
374
|
+
declare const HCM_FIELD_RAW_KEYS: readonly ["key", "name", "type", "isRequired", "description", "isReadonly", "systemManaged", "jsonObject", "decimalNumber", "enums", "object", "objectLabel", "isI18n", "valueMatch"];
|
|
361
375
|
|
|
362
376
|
interface CreateResult {
|
|
363
377
|
id: string;
|
|
@@ -2786,6 +2800,7 @@ declare function validateWorkspaceFiles(http: AxiosInstance, workspaceKey: strin
|
|
|
2786
2800
|
content: string;
|
|
2787
2801
|
}[], deletedPaths?: string[]): Promise<WorkspacePreflightResult>;
|
|
2788
2802
|
declare function deleteWorkspaceFile(http: AxiosInstance, fileId: string): Promise<void>;
|
|
2803
|
+
declare function isWorkspaceRelativePath(value: unknown): value is string;
|
|
2789
2804
|
|
|
2790
2805
|
interface MiniInitArgs {
|
|
2791
2806
|
appCode: string;
|
|
@@ -2889,6 +2904,41 @@ declare function inferMiniWritableTemplateOptionsFromModel(description: ModelDes
|
|
|
2889
2904
|
todayDefaultFields: string[];
|
|
2890
2905
|
};
|
|
2891
2906
|
|
|
2907
|
+
declare const WORKSPACE_DELIVERY_PROTOCOL = 1;
|
|
2908
|
+
interface WorkspaceInspection {
|
|
2909
|
+
protocolVersion: 1;
|
|
2910
|
+
workspaceKey: string;
|
|
2911
|
+
complete: true;
|
|
2912
|
+
totalFiles: number;
|
|
2913
|
+
totalBytes: number;
|
|
2914
|
+
maxFilesPerRequest: number;
|
|
2915
|
+
capabilities: Record<string, unknown>;
|
|
2916
|
+
entries?: Array<WorkspaceFileItem & {
|
|
2917
|
+
protected?: boolean;
|
|
2918
|
+
}>;
|
|
2919
|
+
hashes?: Array<{
|
|
2920
|
+
relativePath: string;
|
|
2921
|
+
exists: boolean;
|
|
2922
|
+
contentHash?: string;
|
|
2923
|
+
}>;
|
|
2924
|
+
[key: string]: unknown;
|
|
2925
|
+
}
|
|
2926
|
+
declare function workspaceDeliveryError(reason: string, message: string): CliError;
|
|
2927
|
+
declare function workspaceActionPayload(value: unknown): Record<string, unknown>;
|
|
2928
|
+
declare function workspaceObjectActionBase(http: AxiosInstance, workspaceKey: string): Promise<string>;
|
|
2929
|
+
declare function inspectWorkspaceFiles(http: AxiosInstance, workspaceKey: string, options: {
|
|
2930
|
+
includeEntries: boolean;
|
|
2931
|
+
hashPaths: string[];
|
|
2932
|
+
}): Promise<WorkspaceInspection>;
|
|
2933
|
+
declare function readWorkspaceInspection(result: Record<string, unknown>, workspaceKey: string, options: {
|
|
2934
|
+
includeEntries: boolean;
|
|
2935
|
+
hashPaths: string[];
|
|
2936
|
+
}): WorkspaceInspection;
|
|
2937
|
+
declare function saveWorkspaceFileContentChecked(http: AxiosInstance, fileId: string, content: string, expectedContentHash: string): Promise<WorkspaceFileItem>;
|
|
2938
|
+
declare function deleteWorkspaceFileChecked(http: AxiosInstance, fileId: string, expectedContentHash: string): Promise<Record<string, unknown>>;
|
|
2939
|
+
declare function isSha256(value: unknown): value is string;
|
|
2940
|
+
declare function nonnegativeInteger(value: unknown): value is number;
|
|
2941
|
+
|
|
2892
2942
|
/**
|
|
2893
2943
|
* DataPackage 单文件制品打包(ADR-323 能力 B,`hcm datapackage pack`)。
|
|
2894
2944
|
*
|
|
@@ -7086,4 +7136,4 @@ type ParsedRef = {
|
|
|
7086
7136
|
declare function parseRef(raw: string, project: string, casesSlug?: string): ParsedRef | null;
|
|
7087
7137
|
declare const firstLine: (s: string) => string;
|
|
7088
7138
|
|
|
7089
|
-
export { ADVISORY_CODES, AGREEING_VERDICTS, APPLY_CAVEAT, APPLY_PROBLEM_CODES, PROBLEM_CODES as ARTIFACT_PROBLEM_CODES, AUTH_INFO_PATH, AUTH_SESSION_INFO_PATH, type ActionEffectClass, type ActionHttpMethod, type ActionInput, type ActionMeta, type ActionResult, type ActionScope, type AdminResetPasswordRequest, type AdminResetPasswordResult, type AnyStreamEvent, ApplyInvariantError, ApplyPremiseError, type ApplyReport, type ApprovalConfirmPayload, type ApprovalRejectPayload, type ArtifactInstallClient, type AttachmentMeta, type AuthScheme, BINDING_RESTORED, BINDING_STATES, BINDING_STILL_UNBOUND, BINDING_UNKNOWN, BINDING_UNTOUCHED, BINDING_WORDS, BLIND_SPOTS, BLOCKING_CODES, BUCKETS, type BaselineCandidate, type BindingState, type BootstrapReconcileResult, type BootstrapTenantRequest, type BootstrapTenantResult, type BrowserAuthorization, type BrowserAuthorizationWatch, type BrowserStatusProbe, CARRIER_BLIND, CARRIER_HIT, CARRIER_KEYS, CARRIER_LABELS, CARRIER_MISS, CARRIER_UNAVAILABLE, CARRIER_VERDICTS, CASES_REPO_SLUG, CASES_REPO_URL, CAUSE_INCOMPLETE_CURRENT, CHANGE_NOT_WRITTEN, CHANGE_STATES, CHANGE_UNKNOWN, CHANGE_WRITTEN, CHECK_GROUPS, CLI_AUTHORIZE_PATH, CLI_EXCHANGE_PATH, CLI_STATUS_PATH, CLI_VERIFICATION_PATH, CNB_FAVICON_URL, CNB_ORIGIN, CODE_BINDING_ELSEWHERE, CODE_BINDING_OFF, CODE_BINDING_UNREADABLE, CODE_COMMANDS, CODE_FIELDS_MISSING, CODE_FIELDS_UNREADABLE, CODE_NOT_ON_ACTIVE, CODE_NO_FIELDS_NAMED, CODE_PROBE_UNAUTHENTICATED, CODE_PROBE_UNREADABLE, CODE_RESTORE_NOT_EFFECTIVE, CODE_RESTORE_READBACK_UNREADABLE, CODE_RESTORE_REFUSED, CODE_STEP, CODE_UNBIND_NOT_EFFECTIVE, CODE_UNBIND_READBACK_UNREADABLE, CODE_UNBIND_REFUSED, CODE_WORDS, COLUMN_SLOT_REBIND_SQL_KEYS, COLUMN_SLOT_SQL_KEYS, CONTROL_BUFFER_LIMIT, CREDENTIAL_STORE_MODES, type CacheClearResult, type CacheStats, type CarrierKey, type CarrierResult, type CarrierVerdict, type CarryOver, type Catalog, type ChangePasswordInput, type ChangeState, type ChironCategory, type ChironManifest, type ChironSkill, type ChironSkillFile, type ChironStage, type ClearMetaCacheOpts, type CliAuthorizationRejection, type CliAuthorizationSession, CliError, CliErrorCode, type CliErrorInit, type ClientAuthContext, type ClientCredentialsInput, type ColumnSlotAvailability, type ColumnSlotRef, type ColumnSlotRequestOpts, type ColumnSlotSqlKey, type ColumnSlotSqlParams, type ColumnSlotSqlView, type ColumnSlotsView, type ConnectionMessage, type ControlChannelEnvelope, type ConversationListItem, type ConversationListResult, type ConversationState, type CreateResult, type CreatedConversation, type CredentialStoreMode, DATA_PACKAGE_FIXTURE_SCHEMA_V1, DATA_PACKAGE_MODELS, DEBT_PREFIX, DEBT_UNKNOWN, DEFAULT_AGENT_ID, DEFAULT_ARTIFACT_CATEGORY, DEFAULT_SESSION_TTL_SECONDS, PREMISE_CODES as DELIVERY_PREMISE_CODES, DEV_MODE_PATH, DIMENSION_LABELS, DRY_RUN_NOTE, DRY_RUN_TAIL, type DataPackageInstallRunView, type DataPackageInstallView, type Premise$1 as DeliveryPremise, type DeliveryRun, type DescribeOpts, type DeviceAuthorization, DriftDetected, EFFECT_ACCOUNTING_ONLY, EFFECT_READ_ONLY, EFFECT_UNKNOWN, EFFECT_WRITES, ENUM_SHOW, ENV_FILE, EXEMPTIBLE_CODES, EXEMPTION_CODES, EXEMPTION_REQUIRED_KEYS, EXTENSION_SOURCE_HEADER, type EndpointNormalization, type EnvConfig, type EnvSource, type EnvironmentSafety, ExitCode, FIND_LIMIT, MAX_BYTES as FIND_MAX_BYTES, FORCE_STALE_FLAG, FORCE_STALE_FLAG_TEXT, type FieldEnumValue, type FieldMeta, type Finding, type Fingerprint, type Fixture, type FormatOptions, GATE_COMPONENTS, type GlobalConfig, HANDSHAKE_AUTH_ERROR_HEADER, HANDSHAKE_CONVERSATION_QUERY_PARAM, HANDSHAKE_TOKEN_QUERY_PARAM, HCM_FIELD_RAW_KEYS, HCM_LANG_ENV, HcmClient, type HcmClientOpts, type HttpClientOptions, IMPERSONATION_ACTIVE_PATH, IMPERSONATION_START_PATH, IMPORT_PLAN_FILE, INIT_EXIT_CODES, type IdentityMeta, type ImportClient, type ImportOptions, type ImportPlan, type ImportResult, type InitExitName, type InstallAcceptedResult, type InstallArtifactResult, type InteractionAnswerPayload, type InteractionDecision, type InteractionOutcome, type InteractionRequest, type InteractionResolved, JIRA_BASE, JIRA_KEYCHAIN, JIRA_PROJECT, JIRA_TOKEN_FILE, JOURNAL_FILE, JOURNAL_STOP_KINDS, JOURNAL_STOP_UNKNOWN, type JiraAllowedValue, JiraClient, type JiraClientOptions, type JiraComment, type JiraFieldMeta, type JiraFields, type JiraHistory, JiraHttpError, type JiraIssue, type JiraIssueTypeMeta, type JiraNamed, JiraNonBmpContentError, type JiraProject, type JiraRemoteLink, type JiraStatusFlow, type JiraTokenLookup, type JiraTokenSource, type JiraTransition, type JiraTransitionField, type JiraUser, Journal, JournalError, KIT_CARRY_OVER_KEY, KIT_CRAWLED_AT_FILE, KIT_MATCHED_ON, type KeyResolution, LAYER_ACTIVE, LEASE_FILE, LEDGER_MISSING_WORD, LEDGER_ONLY_FLAG, type LastAssistantTarget, LayoutContainmentError, Lease, LeaseViolation, type LifecycleResult, type ListTenantMetaOpts, type LoginOutcome, MANIFEST_PATH, MAPPING_FILE, MAX_MANIFEST_PAGES, MAX_SOURCE_PROBES, META_CACHE_PATH, META_JOURNAL_FILE, META_PATH, META_SCHEMA_SOURCE_COMMIT, STEPS as META_VERIFY_STEPS, STEP_DIFF as META_VERIFY_STEP_DIFF, STEPS$1 as META_WRITE_STEPS, METHOD_REPO_DISPLAY, METHOD_REPO_SLUG, METHOD_REPO_URL, MINI_RUNTIME_SDK_VERSION as MINI_APP_RUNTIME_SDK_VERSION, MINI_CONTEXT_FILE, MINI_CONTEXT_KIND, MINI_CONTEXT_VERSION, MINI_PULL_MANIFEST_FILE, MINI_REMOTE_ROOT, MINI_RUNTIME_SDK_VERSION, MINI_STATE_DIR, MODELS_PATH, MODEL_META_PATH, MappingError, type MessageClass, type MessageCreatePayload, type MessageStreamHandle, type MetaClient, type MetaIssue, type MetaIssueSeverity, type StepResult as MetaStepResult, type MetaValidationResult, type MigrationSummary, type MiniFileSnapshot, type MiniInitArgs, type MiniLocalFile, type MiniLocalStatus, type MiniPreviewTarget, type MiniProjectContext, type MiniPullArgs, type MiniPullManifest, type MiniPullResult, type MiniPushArgs, type MiniPushConflict, type MiniPushOperation, type MiniPushPlanItem, type MiniPushResult, type MiniSmokeCheckArgs, type MiniSmokeFetch, type MiniSmokeFetchResponse, type MiniSmokeResult, type MiniSmokeTargetKind, type MiniSmokeTargetResult, type MiniStatusEntry, type MiniSurface, type MiniTemplateArgs, type MiniTemplateKind, type MiniValidationResult, type MiniVerifyAgentReport, type MiniVerifyBrowserAcceptance, type MiniVerifyChangedFile, type MiniVerifyNextAction, type MiniVerifyPlan, type MiniVerifyPreflight, type MiniVerifyPreviewUrl, type MiniVerifyReport, type MiniVerifySummary, type MiniWritableTemplateConfig, type ModelDescription, type ModelEntry, type ModelQueryDsl, NETWORK_GATES, NEXT_STEP, NON_BMP_RULE_NOTE, NOT_COVERED_LAYER1, NOT_COVERED_LAYER2, NOT_COVERED_SELF, type NonBmpHit, OFFLINE_COMMANDS, ON_EXISTING, type OccupiedColumnSlot, type OneShotOpts, type OneShotResult, type OneShotToolCall, type Outcome, type OutputFormat, PASSWORD_CHANGE_REQUIRED, PLAN_JSON_KEYS, PLAN_PROBLEM_CODES, PREMISES, PREMISE_CLIENT, PREMISE_IDENTITY, PREMISE_JOURNAL_HAS_ENTRIES, PREMISE_JOURNAL_ON_DISK, PREMISE_KEY_FIELDS, PREMISE_PLAN_READABLE, PREMISE_ROWS_TO_CHECK, PREMISE_UNMET, PREMISE_WORDS, PROACTIVE_REFRESH_MARGIN_SECONDS, PRODUCT_STATE_WORDS, type PackOptions, type PackResult, type PairingLoginInput, type ParsedPlaceholder, type ParsedRef, type PasswordChangeChallenge, type PasswordLoginInput, type PatLoginInput, type PendingInteraction, type PlanProblem, PlanReadError, type PlannedRow, type Principal, type ProfileConfig, type ProjectEnv, type ProjectEnvFile, type QueryResult, RC_DECIDING_FIELDS, RC_DECIDING_REPORT_FIELDS, REASON_BASELINE_ROUND_NOT_COMPLETE, VERDICTS$1 as RECONCILE_VERDICTS, RECOVERY_WORDS, REJECTED_BEFORE_ROUTING_CODE, REQUIRED_SECTIONS, RESPOND_TIMEOUT_MS, RESTORE_CODES, RISK_CODES, RISK_FILE, ROUND_ANCHORS, ROUND_EXIT_CODES, ROUND_STAMPED_PRODUCTS, ROUND_STATES, ROUND_SUBCOMMAND, ROUND_WARNINGS, ROUND_WARNING_FALLBACK, type ReconIdentity, ReconLayout, type ReconProbe, type ReconSummary, type Reconciliation, RefStore, type RefreshInput, type RelationMeta, type RemoveResult, type RepoRef, type ResolvedEnvContext, type ResolvedProjectEnvironment, type ResponseCompletedPayload, type ResponseFailedPayload, type ResponsePartDeltaPayload, type ResponseStartedPayload, RestoreFailed, type ResumeSummary, type ResumeTurn, type Risk, type RiskProblem, type RoundPremise, type RoundResult, type RoundState, type RowResult, type RowStatus, type RunMetaChangeArgs, SDK_VERSION, SERVER_ERROR_GRACE_MS, STATUSES, STEP_NOTHING, STEP_PROBE, STEP_REBIND, STEP_RECORD, STEP_STOP, STEP_UNBIND, SUPERSEDED_STATUS, SYNTH_FOOTNOTE, SYNTH_MARK, type SaveMetaResult, type ScriptDryRunRequest, type ScriptDryRunResult, type ScriptLogPage, type ScriptLogQuery, type ScriptManifestValidationResult, type ScriptTaskView, type SeedPathArgs, type SendMessageOpts, type ServerErrorFrame, type SessionPrincipal, type SettingItem, type SettingWrite, type StreamCancelPayload, type StreamCommand, type StreamCommandEnvelope, type StreamCommandType, type StreamEventEnvelope, type StreamEventType, TEMP_ENV_NAME, TENANT_META_FILE_PATH, CONFIG as TRIAGE_CONFIG, GAP as TRIAGE_GAP, VERDICTS as TRIAGE_VERDICTS, TargetModelNotFound, type TaskProgressPayload, type TenantMetaEntry, type TenantReconcileReceipt, type TenantResetReceipt, type TimelineItemLite, type TokenRecord, TokenStore, type ToolCallFailedPayload, type ToolCallResultPayload, type ToolCallStartedPayload, type TriageEntry, type TriageProblem, type TriageProblemRow, type TriageRoundResult, type TriageVerdict, USER_LOOKUP_PATH, type UndeterminedReason, type V4RenderSink, type V4StreamEventType, VALUE_CELL_MISSING, VALUE_FOOTNOTE, VALUE_STATE_DISABLED, VALUE_STATE_FOOTNOTE, VALUE_STATE_UNKNOWN, VERDICTS$2 as VERDICTS, VERDICT_DIVERGED, VERDICT_INCOMPARABLE, VERDICT_SAME, VERDICT_WORDS, CODES as VERIFY_ACTIVE_CODES, VERIFY_CODES, VERIFY_CRASHED, VERIFY_OK, VERIFY_WORDS, VERSION_PATH, ValueHints, type ValuesResult, type VerifyResult, WAIVER_REPLAY, WARNED_ROUND_STATES, WORKSPACES_PATH, WORKSPACE_KEY_HEADER, WORK_DIRNAME, WRITE_RECOVERY_WORDS, type WaitResult, WorkLayout, type WorkspaceFileContent, type WorkspaceFileItem, type WorkspaceFileListResult, type WorkspacePreflightIssue, type WorkspacePreflightResult, WsClient, type WsClientOpts, absoluteDownloadUrl, acquireLease, adminResetPassword, applyPlan, applyRc, applyReportText, applyReportToJson, archiveDir, askedTheDatabase, assertDangerWrite, assertExpectedTenant, assertNotReservedEnvName, assertSafeReferencePath, assertSafeSkillFilePath, assertSafeSkillId, assertUsableEndpoint, baselineRoundPremise, bootstrapTenant, buildAnswer, buildCarrierResult, buildConfirm, buildDeliveryRun, buildHandshakeUrl, buildInterrupt, buildMiniAppTemplateFiles, buildMiniPreviewTargets, buildMiniVerifyAgentReport, buildReconciliation, buildReject, buildResumeSummary, buildSteer, camelizeKeys, changePassword, checkCoherence, classifyEffect, classifyMessage, classifyStatus, clearMetaCache, clearModelCache, cliAuthorizationExpired, collectMiniPushWrites, commandsFor, compareFingerprint, computeFingerprint, computeReconSourceKey, contentHash, conversationStateFile, conversationWebSocketEndpoint, create, createConversation, createHttpClient, createJiraClient, createV4Reducer, createWorkspaceFile, credentialsFile, defaultDownloadDir, defaultMiniRequiredScopes, deleteDocument, deleteEnv, deleteIdentity, deleteTenantMeta, deleteWorkspaceFile, deliveryRunFields, deriveNamelessToolLabel, describeNonBmpHits, describePrincipal, describeWaiver, detectDelegationPause, detectDirectInteractionPending, detectPasswordChangeChallenge, diagnoseRejectedBeforeRouting, discardedColumnLines, discoverProjectEnv, displayWidth, downloadDocument, enforceDriftGate, ensureSessionFresh, envDir, envFile, envsDir, exchangeBrowserAuthorization, existingJournalStop, exitCodeFor, explainJacksonError, extractNextSteps, fetchConversationTimeline, fetchConversationTimelineStrict, fetchInstallRun, fetchRecentConversations, fetchReconIdentity, fetchSkillCatalog, fetchSkillFile, fetchSkillMarkdown, fetchSkillReference, fieldByName, filterByStage, find, findEnvByEndpoint, findLastAssistantSeq, findLastAssistantTarget, findNonBmpChars, firstLine, flattenSkills, formatMetaIssues, formatMiniVerifyReport, formatObject, formatRows, fromAxiosError, getCacheStats, getColumnSlotSql, getColumnSlots, getMiniStatus, getScriptTask, getSettingDomain, getTenantMeta, globalConfigFile, guessMimeType, handshakeRejectedError, hasPendingImpersonationSessions, hcmConfigDir, hitRank, httpProbe, identitiesDir, identityDir, identityKnown, identityMetaFile, inferMiniWritableTemplateOptionsFromModel, initMiniAppProject, inspectRound, installDataPackageArtifact, installDataPackageArtifactAsync, isDelegationToolName, isLocalName, isReadOnly, isServerSlidingSession, isSupersededItem, isTempEnv, isTerminalRunStatus, isZeroNetwork, jiraTokenHelp, jiraTokenSource, jiraTokenUnreadable, journalNote, judgeDrift, layerDetail, ledgerOnlySignpost, linkedRepoRefs, listEnvs, listIdentities, listModels, listPendingInteractions, listProfiles, listTenantMeta, listWorkspaceFiles, loadCatalog, loadConversationState, loadEnv, loadExemptions, loadGlobalConfig, loadIdentity, loadMapping, loadProfile, loadRecordedFingerprint, loadRows, loadWorkspaceFileContent, loginClientCredentials, loginPairing, loginPassword, loginPat, matchNote, matchSkills, matchedDimensions, metaFileUrl, metaKindFromPath, migrateLegacyProfiles, modelEntries, modelKeys, needsRefresh, newRoundId, nonBmpHitLines, normalizeAndAssertEndpoint, normalizeEndpoint, normalizeOrigin, normalizeReferences, notAsked, oneShot, packDataPackage, parseConfirmToolName, parseEnvYaml, parseFixture, parseInteractionRequest, parseInteractionResolved, parsePlaceholder, parseRef, parseSettingAssignment, parseSkillFrontmatter, parseSkillRequirements, patchSettingDomain, planFromArtifacts, planProblemLines, planRc, planSummaryLine, planVsBaselinePremise, pollDeviceAuthorization, printResolvedEnvironment, probeAll, probeConversationHandshake, probeDoctorEndpoint, probeDoctorLayer, probeExtensionSource, profileDir, profileFile, pullMiniAppProject, pushMiniAppProject, queryScriptLogs, readImportPlan, readMiniContext, readPullManifest, readSessionPrincipal, rebind, rebindPayload, reconcileTenant, refreshToken, releasePendingImpersonationSessions, remove, renameIdentity, renderEnvYaml, renderFind, renderRound, renderTriage, renderValues, replHistoryFile, repoIssueUrl, requestCliAuthorization, resetSettingItem, resetTenant, resolveActiveEnv, resolveActiveIdentity, resolveActiveProfile, resolveAllSkillsInstallOrder, resolveBaselineDir, resolveChironBase, resolveCredentialStoreMode, resolveEnvContext, resolveItemKeys, resolveProjectEnvironment, resolveRefs, resolveSkillInstallOrder, respondToInteraction, riskFromArtifacts, roundAge, roundWarning, runActiveVerify, runImport, runMetaChange, runMiniSmokeChecks, runRecon, runTriageRound, safeCliAuthorizationError, safeSegment, saveConversationState, saveEnv, saveGlobalConfig, saveIdentity, saveProfile, saveTenantMeta, saveWorkspaceFileContent, scriptDryRun, seedBaselines, seedMappingPath, seedWorkDir, sendMessageAndStream, shelfPartition, snakeToCamel, startImpersonation, tenantSegment, toAcceptLanguage, toJson, toOrigin, toPrincipal, toTable, toYaml, truncateDisplay, unbindPayload, update, uploadDocument, validateCliAuthorizationUrl, validateMetaContent, validateMiniProject, validateScriptManifest, validateWorkspaceFiles, valueState, valuesRoundCaveat, verifyAttention, verifyRc, verifyText, waitForInstallRun, watchBrowserAuthorization, workspaceLayer, writeChangeState, writeImportPlan, writeRisk };
|
|
7139
|
+
export { ADVISORY_CODES, AGREEING_VERDICTS, APPLY_CAVEAT, APPLY_PROBLEM_CODES, PROBLEM_CODES as ARTIFACT_PROBLEM_CODES, AUTH_INFO_PATH, AUTH_SESSION_INFO_PATH, type ActionEffectClass, type ActionHttpMethod, type ActionInput, type ActionMeta, type ActionResult, type ActionScope, type AdminResetPasswordRequest, type AdminResetPasswordResult, type AnyStreamEvent, ApplyInvariantError, ApplyPremiseError, type ApplyReport, type ApprovalConfirmPayload, type ApprovalRejectPayload, type ArtifactInstallClient, type AttachmentMeta, type AuthScheme, BINDING_RESTORED, BINDING_STATES, BINDING_STILL_UNBOUND, BINDING_UNKNOWN, BINDING_UNTOUCHED, BINDING_WORDS, BLIND_SPOTS, BLOCKING_CODES, BUCKETS, type BaselineCandidate, type BindingState, type BootstrapReconcileResult, type BootstrapTenantRequest, type BootstrapTenantResult, type BrowserAuthorization, type BrowserAuthorizationWatch, type BrowserStatusProbe, CARRIER_BLIND, CARRIER_HIT, CARRIER_KEYS, CARRIER_LABELS, CARRIER_MISS, CARRIER_UNAVAILABLE, CARRIER_VERDICTS, CASES_REPO_SLUG, CASES_REPO_URL, CAUSE_INCOMPLETE_CURRENT, CHANGE_NOT_WRITTEN, CHANGE_STATES, CHANGE_UNKNOWN, CHANGE_WRITTEN, CHECK_GROUPS, CLI_AUTHORIZE_PATH, CLI_EXCHANGE_PATH, CLI_STATUS_PATH, CLI_VERIFICATION_PATH, CNB_FAVICON_URL, CNB_ORIGIN, CODE_BINDING_ELSEWHERE, CODE_BINDING_OFF, CODE_BINDING_UNREADABLE, CODE_COMMANDS, CODE_FIELDS_MISSING, CODE_FIELDS_UNREADABLE, CODE_NOT_ON_ACTIVE, CODE_NO_FIELDS_NAMED, CODE_PROBE_UNAUTHENTICATED, CODE_PROBE_UNREADABLE, CODE_RESTORE_NOT_EFFECTIVE, CODE_RESTORE_READBACK_UNREADABLE, CODE_RESTORE_REFUSED, CODE_STEP, CODE_UNBIND_NOT_EFFECTIVE, CODE_UNBIND_READBACK_UNREADABLE, CODE_UNBIND_REFUSED, CODE_WORDS, COLUMN_SLOT_REBIND_SQL_KEYS, COLUMN_SLOT_SQL_KEYS, CONTROL_BUFFER_LIMIT, CREDENTIAL_STORE_MODES, type CacheClearResult, type CacheStats, type CarrierKey, type CarrierResult, type CarrierVerdict, type CarryOver, type Catalog, type ChangePasswordInput, type ChangeState, type ChironCategory, type ChironManifest, type ChironSkill, type ChironSkillFile, type ChironStage, type ClearMetaCacheOpts, type CliAuthorizationRejection, type CliAuthorizationSession, CliError, CliErrorCode, type CliErrorInit, type ClientAuthContext, type ClientCredentialsInput, type ColumnSlotAvailability, type ColumnSlotRef, type ColumnSlotRequestOpts, type ColumnSlotSqlKey, type ColumnSlotSqlParams, type ColumnSlotSqlView, type ColumnSlotsView, type ConnectionMessage, type ControlChannelEnvelope, type ConversationListItem, type ConversationListResult, type ConversationState, type CreateResult, type CreatedConversation, type CredentialStoreMode, DATA_PACKAGE_FIXTURE_SCHEMA_V1, DATA_PACKAGE_MODELS, DEBT_PREFIX, DEBT_UNKNOWN, DEFAULT_AGENT_ID, DEFAULT_ARTIFACT_CATEGORY, DEFAULT_SESSION_TTL_SECONDS, PREMISE_CODES as DELIVERY_PREMISE_CODES, DEV_MODE_PATH, DIMENSION_LABELS, DRY_RUN_NOTE, DRY_RUN_TAIL, type DataPackageInstallRunView, type DataPackageInstallView, type Premise$1 as DeliveryPremise, type DeliveryRun, type DescribeOpts, type DeviceAuthorization, DriftDetected, EFFECT_ACCOUNTING_ONLY, EFFECT_READ_ONLY, EFFECT_UNKNOWN, EFFECT_WRITES, ENUM_SHOW, ENV_FILE, EXEMPTIBLE_CODES, EXEMPTION_CODES, EXEMPTION_REQUIRED_KEYS, EXTENSION_SOURCE_HEADER, type EndpointNormalization, type EnvConfig, type EnvSource, type EnvironmentSafety, ExitCode, FIND_LIMIT, MAX_BYTES as FIND_MAX_BYTES, FORCE_STALE_FLAG, FORCE_STALE_FLAG_TEXT, type FieldEnumValue, type FieldMeta, type Finding, type Fingerprint, type Fixture, type FormatOptions, GATE_COMPONENTS, type GlobalConfig, HANDSHAKE_AUTH_ERROR_HEADER, HANDSHAKE_CONVERSATION_QUERY_PARAM, HANDSHAKE_TOKEN_QUERY_PARAM, HCM_FIELD_RAW_KEYS, HCM_LANG_ENV, HcmClient, type HcmClientOpts, type HttpClientOptions, IMPERSONATION_ACTIVE_PATH, IMPERSONATION_START_PATH, IMPORT_PLAN_FILE, INIT_EXIT_CODES, type IdentityMeta, type ImportClient, type ImportOptions, type ImportPlan, type ImportResult, type InitExitName, type InstallAcceptedResult, type InstallArtifactResult, type InteractionAnswerPayload, type InteractionDecision, type InteractionOutcome, type InteractionRequest, type InteractionResolved, JIRA_BASE, JIRA_KEYCHAIN, JIRA_PROJECT, JIRA_TOKEN_FILE, JOURNAL_FILE, JOURNAL_STOP_KINDS, JOURNAL_STOP_UNKNOWN, type JiraAllowedValue, JiraClient, type JiraClientOptions, type JiraComment, type JiraFieldMeta, type JiraFields, type JiraHistory, JiraHttpError, type JiraIssue, type JiraIssueTypeMeta, type JiraNamed, JiraNonBmpContentError, type JiraProject, type JiraRemoteLink, type JiraStatusFlow, type JiraTokenLookup, type JiraTokenSource, type JiraTransition, type JiraTransitionField, type JiraUser, Journal, JournalError, KIT_CARRY_OVER_KEY, KIT_CRAWLED_AT_FILE, KIT_MATCHED_ON, type KeyResolution, LAYER_ACTIVE, LEASE_FILE, LEDGER_MISSING_WORD, LEDGER_ONLY_FLAG, type LastAssistantTarget, LayoutContainmentError, Lease, LeaseViolation, type LifecycleResult, type ListTenantMetaOpts, type LoginOutcome, MANIFEST_PATH, MAPPING_FILE, MAX_MANIFEST_PAGES, MAX_SOURCE_PROBES, META_CACHE_PATH, META_JOURNAL_FILE, META_PATH, META_SCHEMA_SOURCE_COMMIT, STEPS as META_VERIFY_STEPS, STEP_DIFF as META_VERIFY_STEP_DIFF, STEPS$1 as META_WRITE_STEPS, METHOD_REPO_DISPLAY, METHOD_REPO_SLUG, METHOD_REPO_URL, MINI_RUNTIME_SDK_VERSION as MINI_APP_RUNTIME_SDK_VERSION, MINI_CONTEXT_FILE, MINI_CONTEXT_KIND, MINI_CONTEXT_VERSION, MINI_PULL_MANIFEST_FILE, MINI_REMOTE_ROOT, MINI_RUNTIME_SDK_VERSION, MINI_STATE_DIR, MODELS_PATH, MODEL_META_PATH, MappingError, type MessageClass, type MessageCreatePayload, type MessageStreamHandle, type MetaClient, type MetaIssue, type MetaIssueSeverity, type StepResult as MetaStepResult, type MetaValidationResult, type MigrationSummary, type MiniFileSnapshot, type MiniInitArgs, type MiniLocalFile, type MiniLocalStatus, type MiniPreviewTarget, type MiniProjectContext, type MiniPullArgs, type MiniPullManifest, type MiniPullResult, type MiniPushArgs, type MiniPushConflict, type MiniPushOperation, type MiniPushPlanItem, type MiniPushResult, type MiniSmokeCheckArgs, type MiniSmokeFetch, type MiniSmokeFetchResponse, type MiniSmokeResult, type MiniSmokeTargetKind, type MiniSmokeTargetResult, type MiniStatusEntry, type MiniSurface, type MiniTemplateArgs, type MiniTemplateKind, type MiniValidationResult, type MiniVerifyAgentReport, type MiniVerifyBrowserAcceptance, type MiniVerifyChangedFile, type MiniVerifyNextAction, type MiniVerifyPlan, type MiniVerifyPreflight, type MiniVerifyPreviewUrl, type MiniVerifyReport, type MiniVerifySummary, type MiniWritableTemplateConfig, type ModelDescription, type ModelEntry, type ModelQueryDsl, NETWORK_GATES, NEXT_STEP, NON_BMP_RULE_NOTE, NOT_COVERED_LAYER1, NOT_COVERED_LAYER2, NOT_COVERED_SELF, type NonBmpHit, OFFLINE_COMMANDS, ON_EXISTING, type OccupiedColumnSlot, type OneShotOpts, type OneShotResult, type OneShotToolCall, type Outcome, type OutputFormat, PASSWORD_CHANGE_REQUIRED, PLAN_JSON_KEYS, PLAN_PROBLEM_CODES, PREMISES, PREMISE_CLIENT, PREMISE_IDENTITY, PREMISE_JOURNAL_HAS_ENTRIES, PREMISE_JOURNAL_ON_DISK, PREMISE_KEY_FIELDS, PREMISE_PLAN_READABLE, PREMISE_ROWS_TO_CHECK, PREMISE_UNMET, PREMISE_WORDS, PROACTIVE_REFRESH_MARGIN_SECONDS, PRODUCT_STATE_WORDS, type PackOptions, type PackResult, type PairingLoginInput, type ParsedPlaceholder, type ParsedRef, type PasswordChangeChallenge, type PasswordLoginInput, type PatLoginInput, type PendingInteraction, type PlanProblem, PlanReadError, type PlannedRow, type Principal, type ProfileConfig, type ProjectEnv, type ProjectEnvFile, type QueryResult, type QueryWarning, RC_DECIDING_FIELDS, RC_DECIDING_REPORT_FIELDS, REASON_BASELINE_ROUND_NOT_COMPLETE, VERDICTS$1 as RECONCILE_VERDICTS, RECOVERY_WORDS, REJECTED_BEFORE_ROUTING_CODE, REQUIRED_SECTIONS, RESPOND_TIMEOUT_MS, RESTORE_CODES, RISK_CODES, RISK_FILE, ROUND_ANCHORS, ROUND_EXIT_CODES, ROUND_STAMPED_PRODUCTS, ROUND_STATES, ROUND_SUBCOMMAND, ROUND_WARNINGS, ROUND_WARNING_FALLBACK, type ReconIdentity, ReconLayout, type ReconProbe, type ReconSummary, type Reconciliation, RefStore, type RefreshInput, type RelationMeta, type RemoveResult, type RepoRef, type ResolvedEnvContext, type ResolvedProjectEnvironment, type ResponseCompletedPayload, type ResponseFailedPayload, type ResponsePartDeltaPayload, type ResponseStartedPayload, RestoreFailed, type ResumeSummary, type ResumeTurn, type Risk, type RiskProblem, type RoundPremise, type RoundResult, type RoundState, type RowResult, type RowStatus, type RunMetaChangeArgs, SDK_VERSION, SERVER_ERROR_GRACE_MS, STATUSES, STEP_NOTHING, STEP_PROBE, STEP_REBIND, STEP_RECORD, STEP_STOP, STEP_UNBIND, SUPERSEDED_STATUS, SYNTH_FOOTNOTE, SYNTH_MARK, type SaveMetaResult, type ScriptDryRunRequest, type ScriptDryRunResult, type ScriptLogPage, type ScriptLogQuery, type ScriptManifestValidationResult, type ScriptTaskView, type SeedPathArgs, type SendMessageOpts, type ServerErrorFrame, type SessionPrincipal, type SettingItem, type SettingWrite, type StreamCancelPayload, type StreamCommand, type StreamCommandEnvelope, type StreamCommandType, type StreamEventEnvelope, type StreamEventType, TEMP_ENV_NAME, TENANT_META_FILE_PATH, CONFIG as TRIAGE_CONFIG, GAP as TRIAGE_GAP, VERDICTS as TRIAGE_VERDICTS, TargetModelNotFound, type TaskProgressPayload, type TenantMetaEntry, type TenantReconcileReceipt, type TenantResetReceipt, type TimelineItemLite, type TokenRecord, TokenStore, type ToolCallFailedPayload, type ToolCallResultPayload, type ToolCallStartedPayload, type TriageEntry, type TriageProblem, type TriageProblemRow, type TriageRoundResult, type TriageVerdict, USER_LOOKUP_PATH, type UndeterminedReason, type V4RenderSink, type V4StreamEventType, VALUE_CELL_MISSING, VALUE_FOOTNOTE, VALUE_STATE_DISABLED, VALUE_STATE_FOOTNOTE, VALUE_STATE_UNKNOWN, VERDICTS$2 as VERDICTS, VERDICT_DIVERGED, VERDICT_INCOMPARABLE, VERDICT_SAME, VERDICT_WORDS, CODES as VERIFY_ACTIVE_CODES, VERIFY_CODES, VERIFY_CRASHED, VERIFY_OK, VERIFY_WORDS, VERSION_PATH, ValueHints, type ValuesResult, type VerifyResult, WAIVER_REPLAY, WARNED_ROUND_STATES, WORKSPACES_PATH, WORKSPACE_DELIVERY_PROTOCOL, WORKSPACE_KEY_HEADER, WORK_DIRNAME, WRITE_RECOVERY_WORDS, type WaitResult, WorkLayout, type WorkspaceFileContent, type WorkspaceFileItem, type WorkspaceFileListResult, type WorkspaceInspection, type WorkspacePreflightIssue, type WorkspacePreflightResult, WsClient, type WsClientOpts, absoluteDownloadUrl, acquireLease, adminResetPassword, applyPlan, applyRc, applyReportText, applyReportToJson, archiveDir, askedTheDatabase, assertDangerWrite, assertExpectedTenant, assertNotReservedEnvName, assertSafeReferencePath, assertSafeSkillFilePath, assertSafeSkillId, assertUsableEndpoint, baselineRoundPremise, bootstrapTenant, buildAnswer, buildCarrierResult, buildConfirm, buildDeliveryRun, buildHandshakeUrl, buildInterrupt, buildMiniAppTemplateFiles, buildMiniPreviewTargets, buildMiniVerifyAgentReport, buildReconciliation, buildReject, buildResumeSummary, buildSteer, camelizeKeys, changePassword, checkCoherence, classifyEffect, classifyMessage, classifyStatus, clearMetaCache, clearModelCache, cliAuthorizationExpired, collectMiniPushWrites, commandsFor, compareFingerprint, computeFingerprint, computeReconSourceKey, contentHash, conversationStateFile, conversationWebSocketEndpoint, create, createConversation, createHttpClient, createJiraClient, createV4Reducer, createWorkspaceFile, credentialsFile, defaultDownloadDir, defaultMiniRequiredScopes, deleteDocument, deleteEnv, deleteIdentity, deleteTenantMeta, deleteWorkspaceFile, deleteWorkspaceFileChecked, deliveryRunFields, deriveNamelessToolLabel, describeNonBmpHits, describePrincipal, describeWaiver, detectDelegationPause, detectDirectInteractionPending, detectPasswordChangeChallenge, diagnoseRejectedBeforeRouting, discardedColumnLines, discoverProjectEnv, displayWidth, downloadDocument, enforceDriftGate, ensureSessionFresh, envDir, envFile, envsDir, exchangeBrowserAuthorization, existingJournalStop, exitCodeFor, explainJacksonError, extractNextSteps, fetchConversationTimeline, fetchConversationTimelineStrict, fetchInstallRun, fetchRecentConversations, fetchReconIdentity, fetchSkillCatalog, fetchSkillFile, fetchSkillMarkdown, fetchSkillReference, fieldByName, filterByStage, find, findEnvByEndpoint, findLastAssistantSeq, findLastAssistantTarget, findNonBmpChars, firstLine, flattenSkills, formatMetaIssues, formatMiniVerifyReport, formatObject, formatRows, fromAxiosError, getCacheStats, getColumnSlotSql, getColumnSlots, getMiniStatus, getScriptTask, getSettingDomain, getTenantMeta, globalConfigFile, guessMimeType, handshakeRejectedError, hasPendingImpersonationSessions, hcmConfigDir, hitRank, httpProbe, identitiesDir, identityDir, identityKnown, identityMetaFile, inferMiniWritableTemplateOptionsFromModel, initMiniAppProject, inspectRound, inspectWorkspaceFiles, installDataPackageArtifact, installDataPackageArtifactAsync, isDelegationToolName, isLocalName, isReadOnly, isServerSlidingSession, isSha256, isSupersededItem, isTempEnv, isTerminalRunStatus, isWorkspaceRelativePath, isZeroNetwork, jiraTokenHelp, jiraTokenSource, jiraTokenUnreadable, journalNote, judgeDrift, layerDetail, ledgerOnlySignpost, linkedRepoRefs, listEnvs, listIdentities, listModels, listPendingInteractions, listProfiles, listTenantMeta, listWorkspaceFiles, loadCatalog, loadConversationState, loadEnv, loadExemptions, loadGlobalConfig, loadIdentity, loadMapping, loadProfile, loadRecordedFingerprint, loadRows, loadWorkspaceFileContent, loginClientCredentials, loginPairing, loginPassword, loginPat, matchNote, matchSkills, matchedDimensions, metaFileUrl, metaKindFromPath, migrateLegacyProfiles, modelEntries, modelKeys, needsRefresh, newRoundId, nonBmpHitLines, nonnegativeInteger, normalizeAndAssertEndpoint, normalizeEndpoint, normalizeOrigin, normalizeReferences, notAsked, oneShot, packDataPackage, parseConfirmToolName, parseEnvYaml, parseFixture, parseInteractionRequest, parseInteractionResolved, parsePlaceholder, parseRef, parseSettingAssignment, parseSkillFrontmatter, parseSkillRequirements, patchSettingDomain, planFromArtifacts, planProblemLines, planRc, planSummaryLine, planVsBaselinePremise, pollDeviceAuthorization, printResolvedEnvironment, probeAll, probeConversationHandshake, probeDoctorEndpoint, probeDoctorLayer, probeExtensionSource, profileDir, profileFile, pullMiniAppProject, pushMiniAppProject, queryScriptLogs, readImportPlan, readMiniContext, readPullManifest, readSessionPrincipal, readWorkspaceInspection, rebind, rebindPayload, reconcileTenant, refreshToken, releasePendingImpersonationSessions, remove, renameIdentity, renderEnvYaml, renderFind, renderRound, renderTriage, renderValues, replHistoryFile, repoIssueUrl, requestCliAuthorization, resetSettingItem, resetTenant, resolveActiveEnv, resolveActiveIdentity, resolveActiveProfile, resolveAllSkillsInstallOrder, resolveBaselineDir, resolveChironBase, resolveCredentialStoreMode, resolveEnvContext, resolveItemKeys, resolveProjectEnvironment, resolveRefs, resolveSkillInstallOrder, respondToInteraction, riskFromArtifacts, roundAge, roundWarning, runActiveVerify, runImport, runMetaChange, runMiniSmokeChecks, runRecon, runTriageRound, safeCliAuthorizationError, safeSegment, saveConversationState, saveEnv, saveGlobalConfig, saveIdentity, saveProfile, saveTenantMeta, saveWorkspaceFileContent, saveWorkspaceFileContentChecked, scriptDryRun, seedBaselines, seedMappingPath, seedWorkDir, sendMessageAndStream, shelfPartition, snakeToCamel, startImpersonation, tenantSegment, toAcceptLanguage, toJson, toOrigin, toPrincipal, toTable, toYaml, truncateDisplay, unbindPayload, update, uploadDocument, validateCliAuthorizationUrl, validateMetaContent, validateMiniProject, validateScriptManifest, validateWorkspaceFiles, valueState, valuesRoundCaveat, verifyAttention, verifyRc, verifyText, waitForInstallRun, watchBrowserAuthorization, workspaceActionPayload, workspaceDeliveryError, workspaceLayer, workspaceObjectActionBase, writeChangeState, writeImportPlan, writeRisk };
|
package/dist/index.js
CHANGED
|
@@ -374,7 +374,8 @@ var HCM_FIELD_RAW_KEYS = [
|
|
|
374
374
|
"enums",
|
|
375
375
|
"object",
|
|
376
376
|
"objectLabel",
|
|
377
|
-
"isI18n"
|
|
377
|
+
"isI18n",
|
|
378
|
+
"valueMatch"
|
|
378
379
|
];
|
|
379
380
|
function normalizeActionParams(action3) {
|
|
380
381
|
if (action3.parameters) return action3.parameters;
|
|
@@ -415,7 +416,9 @@ async function describe(http, model, _opts = {}) {
|
|
|
415
416
|
...f.objectLabel ? { objectLabel: f.objectLabel } : {},
|
|
416
417
|
// 只在为真时出这一位:false 与「这个服务端没有 i18n 这个概念」在下游没有区别,
|
|
417
418
|
// 出一个 `i18n: false` 只会让 --output json 的每个字段都多一行噪声。
|
|
418
|
-
...f.isI18n ? { i18n: true } : {}
|
|
419
|
+
...f.isI18n ? { i18n: true } : {},
|
|
420
|
+
// 同上,只在为真时出这一位。
|
|
421
|
+
...f.valueMatch ? { valueMatch: true } : {}
|
|
419
422
|
}));
|
|
420
423
|
const actions = (meta.actions ?? []).map((a) => ({
|
|
421
424
|
name: a.key ?? a.name ?? "",
|
|
@@ -1593,11 +1596,24 @@ async function query(http, model, dsl) {
|
|
|
1593
1596
|
body.size = size;
|
|
1594
1597
|
const url = `/api/models/${model}/list/dsl`;
|
|
1595
1598
|
const resp = dsl.plugin ? await http.post(url, body, { params: { plugin: dsl.plugin } }) : await http.post(url, body);
|
|
1599
|
+
const warnings = readWarnings(resp.data.extra?.warnings);
|
|
1596
1600
|
return {
|
|
1597
1601
|
rows: resp.data.content ?? [],
|
|
1598
|
-
total: resp.data.totalElements
|
|
1602
|
+
total: resp.data.totalElements,
|
|
1603
|
+
...warnings.length ? { warnings } : {}
|
|
1599
1604
|
};
|
|
1600
1605
|
}
|
|
1606
|
+
function readWarnings(raw) {
|
|
1607
|
+
if (!Array.isArray(raw)) return [];
|
|
1608
|
+
return raw.flatMap((w) => {
|
|
1609
|
+
if (!isPlainObject(w) || typeof w.code !== "string" || !w.code) return [];
|
|
1610
|
+
return [{
|
|
1611
|
+
code: w.code,
|
|
1612
|
+
...typeof w.message === "string" ? { message: w.message } : {},
|
|
1613
|
+
...typeof w.suggestion === "string" ? { suggestion: w.suggestion } : {}
|
|
1614
|
+
}];
|
|
1615
|
+
});
|
|
1616
|
+
}
|
|
1601
1617
|
var OPERATOR_ALIASES = {
|
|
1602
1618
|
$eq: "eq",
|
|
1603
1619
|
eq: "eq",
|
|
@@ -4552,8 +4568,31 @@ async function listWorkspaceFiles(http, workspaceKey, options = {}) {
|
|
|
4552
4568
|
}
|
|
4553
4569
|
});
|
|
4554
4570
|
}
|
|
4571
|
+
const data = content.map(toWorkspaceFileItem);
|
|
4572
|
+
if (total !== data.length || new Set(data.map((file) => file.relativePath)).size !== data.length || new Set(data.map((file) => file.id)).size !== data.length) {
|
|
4573
|
+
throw new CliError({
|
|
4574
|
+
code: "NETWORK_ERROR" /* NETWORK_ERROR */,
|
|
4575
|
+
message: `\u5DE5\u4F5C\u533A\u6587\u4EF6\u6E05\u5355\u4E0D\u5B8C\u6574\uFF1A\u6536\u5230 ${data.length} \u6761\uFF0C\u603B\u6570 ${total}\uFF1B\u672A\u6267\u884C\u5199\u5165\u6216\u91CD\u5EFA\u540C\u6B65\u57FA\u7EBF\u3002`,
|
|
4576
|
+
context: {
|
|
4577
|
+
reason: "INCOMPLETE_WORKSPACE_FILE_LIST",
|
|
4578
|
+
workspaceKey,
|
|
4579
|
+
nextStep: "\u5F53\u524D mini \u540C\u6B65\u4E0D\u652F\u6301\u5B8C\u6574\u5206\u9875\uFF1B\u7F29\u5C0F\u5DE5\u4F5C\u533A\u6216\u5347\u7EA7\u5177\u5907\u5B8C\u6574\u6E05\u5355\u80FD\u529B\u7684\u670D\u52A1\u4E0E CLI \u540E\u91CD\u8BD5\u3002\u4FDD\u7559\u672C\u5730\u76EE\u5F55\u548C\u57FA\u7EBF\u3002"
|
|
4580
|
+
}
|
|
4581
|
+
});
|
|
4582
|
+
}
|
|
4583
|
+
if (data.some((file) => !file.id.trim() || file.workspaceKey !== workspaceKey || !isWorkspaceRelativePath(file.relativePath))) {
|
|
4584
|
+
throw new CliError({
|
|
4585
|
+
code: "NETWORK_ERROR" /* NETWORK_ERROR */,
|
|
4586
|
+
message: "\u5DE5\u4F5C\u533A\u6587\u4EF6\u6E05\u5355\u5305\u542B\u65E0\u6548 ID\u3001\u5F52\u5C5E\u6216\u8DEF\u5F84\uFF1B\u4E0D\u80FD\u636E\u6B64\u5224\u5B9A\u6587\u4EF6\u4E0D\u5B58\u5728\u3002",
|
|
4587
|
+
context: {
|
|
4588
|
+
reason: "INVALID_WORKSPACE_FILE_LIST",
|
|
4589
|
+
workspaceKey,
|
|
4590
|
+
nextStep: "\u6838\u5BF9\u670D\u52A1\u7AEF\u5B8C\u6574\u6E05\u5355\u53CA\u6743\u9650\u540E\u91CD\u8BD5\uFF1B\u4FDD\u7559\u672C\u5730\u76EE\u5F55\u548C\u57FA\u7EBF\u3002"
|
|
4591
|
+
}
|
|
4592
|
+
});
|
|
4593
|
+
}
|
|
4555
4594
|
return {
|
|
4556
|
-
data
|
|
4595
|
+
data,
|
|
4557
4596
|
total
|
|
4558
4597
|
};
|
|
4559
4598
|
}
|
|
@@ -4598,7 +4637,7 @@ function toWorkspaceFileItem(value) {
|
|
|
4598
4637
|
workspaceKey: stringOr(obj.workspaceKey),
|
|
4599
4638
|
relativePath: stringOr(obj.relativePath),
|
|
4600
4639
|
fileType: stringOrUndefined(obj.fileType),
|
|
4601
|
-
fileSize:
|
|
4640
|
+
fileSize: typeof obj.fileSize === "number" && Number.isFinite(obj.fileSize) ? obj.fileSize : void 0,
|
|
4602
4641
|
content: typeof obj.content === "string" ? obj.content : void 0,
|
|
4603
4642
|
lastModified: primitiveOrNull(obj.lastModified)
|
|
4604
4643
|
};
|
|
@@ -4661,8 +4700,9 @@ function stringOr(value) {
|
|
|
4661
4700
|
function stringOrUndefined(value) {
|
|
4662
4701
|
return value == null ? void 0 : stringOr(value);
|
|
4663
4702
|
}
|
|
4664
|
-
function
|
|
4665
|
-
|
|
4703
|
+
function isWorkspaceRelativePath(value) {
|
|
4704
|
+
if (typeof value !== "string" || !value || value.startsWith("/") || value.includes("\\") || value.includes("\0")) return false;
|
|
4705
|
+
return value.replace(/\/$/, "").split("/").every((segment) => !!segment && segment !== "." && segment !== "..");
|
|
4666
4706
|
}
|
|
4667
4707
|
function primitiveOrNull(value) {
|
|
4668
4708
|
if (typeof value === "number" || typeof value === "string") return value;
|
|
@@ -7224,6 +7264,94 @@ function toPosix(value) {
|
|
|
7224
7264
|
return value.replace(/\\/g, "/");
|
|
7225
7265
|
}
|
|
7226
7266
|
|
|
7267
|
+
// src/mini/workspace-delivery.ts
|
|
7268
|
+
var WORKSPACE_DELIVERY_PROTOCOL = 1;
|
|
7269
|
+
var WORKSPACE = "/api/models/TenantExtensionWorkspace";
|
|
7270
|
+
var FILE = "/api/models/TenantExtensionWorkspaceFile";
|
|
7271
|
+
function workspaceDeliveryError(reason, message) {
|
|
7272
|
+
return new CliError({
|
|
7273
|
+
code: "NETWORK_ERROR" /* NETWORK_ERROR */,
|
|
7274
|
+
message,
|
|
7275
|
+
context: { reason, nextStep: "\u5347\u7EA7 Core \u81F3 workspace delivery \u534F\u8BAE 1\uFF0C\u6838\u5BF9\u670D\u52A1\u7AEF\u56DE\u6267\u540E\u91CD\u65B0\u9884\u68C0\uFF1B\u672C\u6B21\u4E0D\u964D\u7EA7\u4E3A\u65E0\u6761\u4EF6\u5199\u5165\uFF0C\u4FDD\u7559\u672C\u5730\u76EE\u5F55\u4E0E\u57FA\u7EBF\u3002" }
|
|
7276
|
+
});
|
|
7277
|
+
}
|
|
7278
|
+
function workspaceActionPayload(value) {
|
|
7279
|
+
const raw = value && typeof value === "object" ? value : {};
|
|
7280
|
+
const data = "data" in raw ? raw.data : raw;
|
|
7281
|
+
if (!data || typeof data !== "object" || Array.isArray(data)) {
|
|
7282
|
+
throw workspaceDeliveryError("INVALID_WORKSPACE_DELIVERY_RECEIPT", "\u5DE5\u4F5C\u533A\u64CD\u4F5C\u672A\u8FD4\u56DE\u6709\u6548\u56DE\u6267\uFF1B\u7ED3\u679C\u672A\u77E5\u3002");
|
|
7283
|
+
}
|
|
7284
|
+
return data;
|
|
7285
|
+
}
|
|
7286
|
+
async function workspaceObjectActionBase(http, workspaceKey) {
|
|
7287
|
+
const response = await http.get(WORKSPACE, { params: {
|
|
7288
|
+
filter: `workspaceKey:eq:${workspaceKey}`,
|
|
7289
|
+
page: 0,
|
|
7290
|
+
size: 2,
|
|
7291
|
+
fields: "id,workspaceKey"
|
|
7292
|
+
} });
|
|
7293
|
+
const rows = response.data?.content;
|
|
7294
|
+
if (!Array.isArray(rows) || response.data?.totalElements !== 1 || rows.length !== 1 || rows[0]?.workspaceKey !== workspaceKey || typeof rows[0]?.id !== "string" || !rows[0].id.trim()) {
|
|
7295
|
+
throw workspaceDeliveryError("INVALID_WORKSPACE_IDENTITY", `\u5F53\u524D\u79DF\u6237\u672A\u552F\u4E00\u786E\u8BA4\u5F00\u53D1\u7A7A\u95F4 ${workspaceKey}\uFF1B\u6CA1\u6709\u6267\u884C\u53D8\u66F4\u3002`);
|
|
7296
|
+
}
|
|
7297
|
+
return `${WORKSPACE}/${encodeURIComponent(rows[0].id)}/action`;
|
|
7298
|
+
}
|
|
7299
|
+
async function inspectWorkspaceFiles(http, workspaceKey, options) {
|
|
7300
|
+
const action3 = await workspaceObjectActionBase(http, workspaceKey);
|
|
7301
|
+
const response = await http.post(`${action3}/inspect-files`, { form: options });
|
|
7302
|
+
return readWorkspaceInspection(workspaceActionPayload(response.data), workspaceKey, options);
|
|
7303
|
+
}
|
|
7304
|
+
function readWorkspaceInspection(result, workspaceKey, options) {
|
|
7305
|
+
const capabilities = result.capabilities;
|
|
7306
|
+
if (result.protocolVersion !== 1 || result.workspaceKey !== workspaceKey || result.complete !== true || !nonnegativeInteger(result.totalFiles) || !nonnegativeInteger(result.totalBytes) || !nonnegativeInteger(result.maxFilesPerRequest) || result.maxFilesPerRequest === 0 || !capabilities || typeof capabilities !== "object" || Array.isArray(capabilities)) {
|
|
7307
|
+
throw workspaceDeliveryError("INVALID_WORKSPACE_INSPECTION", "inspect-files \u7F3A\u5C11\u534F\u8BAE\u3001\u5B8C\u6574\u6027\u3001\u89C4\u6A21\u6216\u80FD\u529B\u56DE\u6267\uFF1B\u4E0D\u80FD\u5C06\u672A\u77E5\u5F53\u4F5C\u7A7A\u7A7A\u95F4\u3002");
|
|
7308
|
+
}
|
|
7309
|
+
if (options.includeEntries) {
|
|
7310
|
+
const entries = result.entries;
|
|
7311
|
+
if (!Array.isArray(entries) || entries.length !== result.totalFiles || entries.length > Number(result.maxFilesPerRequest) || new Set(entries.map((item) => item?.relativePath)).size !== entries.length || new Set(entries.map((item) => item?.id)).size !== entries.length) {
|
|
7312
|
+
throw workspaceDeliveryError("INCOMPLETE_WORKSPACE_FILE_LIST", "inspect-files \u6E05\u5355\u7F3A\u5931\u3001\u622A\u65AD\u6216\u91CD\u590D\uFF1B\u672A\u6267\u884C\u53D8\u66F4\u3002");
|
|
7313
|
+
}
|
|
7314
|
+
if (entries.some((item) => !item || typeof item.id !== "string" || !item.id.trim() || item.workspaceKey !== workspaceKey || !isWorkspaceRelativePath(item.relativePath) || !nonnegativeInteger(item.fileSize))) {
|
|
7315
|
+
throw workspaceDeliveryError("INVALID_WORKSPACE_INSPECTION", "inspect-files \u6E05\u5355\u542B\u65E0\u6548\u5F52\u5C5E\u3001\u8DEF\u5F84\u3001ID \u6216\u5B57\u8282\u6570\u3002");
|
|
7316
|
+
}
|
|
7317
|
+
if (entries.reduce((total, item) => total + item.fileSize, 0) !== result.totalBytes) {
|
|
7318
|
+
throw workspaceDeliveryError("INVALID_WORKSPACE_INSPECTION", "inspect-files \u9010\u9879\u5B57\u8282\u6570\u4E0E\u603B\u5B57\u8282\u6570\u4E0D\u7B26\u3002");
|
|
7319
|
+
}
|
|
7320
|
+
}
|
|
7321
|
+
if (capabilities.contentHashes === true) {
|
|
7322
|
+
const hashes = result.hashes;
|
|
7323
|
+
const requested = new Set(options.hashPaths);
|
|
7324
|
+
if (!Array.isArray(hashes) || hashes.length !== requested.size || new Set(hashes.map((item) => item?.relativePath)).size !== hashes.length || hashes.some((item) => !item || !requested.has(item.relativePath) || typeof item.exists !== "boolean" || item.exists && !isSha256(item.contentHash) || !item.exists && item.contentHash != null)) {
|
|
7325
|
+
throw workspaceDeliveryError("INVALID_WORKSPACE_INSPECTION", "inspect-files \u5019\u9009\u54C8\u5E0C\u56DE\u6267\u672A\u5B8C\u6574\u8986\u76D6\u8BF7\u6C42\u8DEF\u5F84\uFF1B\u4E0D\u80FD\u63A8\u65AD\u8FDC\u7AEF\u5185\u5BB9\u3002");
|
|
7326
|
+
}
|
|
7327
|
+
if (options.includeEntries) {
|
|
7328
|
+
const present = new Set(result.entries.map((item) => item.relativePath));
|
|
7329
|
+
if (hashes.some((item) => item.exists !== present.has(item.relativePath))) {
|
|
7330
|
+
throw workspaceDeliveryError("INVALID_WORKSPACE_INSPECTION", "inspect-files \u5019\u9009\u5B58\u5728\u6027\u4E0E\u5B8C\u6574\u6E05\u5355\u4E0D\u4E00\u81F4\u3002");
|
|
7331
|
+
}
|
|
7332
|
+
}
|
|
7333
|
+
}
|
|
7334
|
+
return result;
|
|
7335
|
+
}
|
|
7336
|
+
async function saveWorkspaceFileContentChecked(http, fileId, content, expectedContentHash) {
|
|
7337
|
+
const response = await http.post(`${FILE}/${encodeURIComponent(fileId)}/action/save-content-checked`, {
|
|
7338
|
+
form: { content, expectedContentHash }
|
|
7339
|
+
}, { __skipRetry: true });
|
|
7340
|
+
return workspaceActionPayload(response.data);
|
|
7341
|
+
}
|
|
7342
|
+
async function deleteWorkspaceFileChecked(http, fileId, expectedContentHash) {
|
|
7343
|
+
const response = await http.post(`${FILE}/${encodeURIComponent(fileId)}/action/delete-checked`, {
|
|
7344
|
+
form: { expectedContentHash }
|
|
7345
|
+
}, { __skipRetry: true });
|
|
7346
|
+
return workspaceActionPayload(response.data);
|
|
7347
|
+
}
|
|
7348
|
+
function isSha256(value) {
|
|
7349
|
+
return typeof value === "string" && /^[a-f0-9]{64}$/.test(value);
|
|
7350
|
+
}
|
|
7351
|
+
function nonnegativeInteger(value) {
|
|
7352
|
+
return typeof value === "number" && Number.isSafeInteger(value) && value >= 0;
|
|
7353
|
+
}
|
|
7354
|
+
|
|
7227
7355
|
// src/datapackage/pack.ts
|
|
7228
7356
|
import * as fsp2 from "fs/promises";
|
|
7229
7357
|
import * as fs11 from "fs";
|
|
@@ -26912,6 +27040,7 @@ export {
|
|
|
26912
27040
|
WAIVER_REPLAY,
|
|
26913
27041
|
WARNED_ROUND_STATES,
|
|
26914
27042
|
WORKSPACES_PATH,
|
|
27043
|
+
WORKSPACE_DELIVERY_PROTOCOL,
|
|
26915
27044
|
WORKSPACE_KEY_HEADER,
|
|
26916
27045
|
WORK_DIRNAME,
|
|
26917
27046
|
WRITE_RECOVERY_WORDS,
|
|
@@ -26979,6 +27108,7 @@ export {
|
|
|
26979
27108
|
deleteIdentity,
|
|
26980
27109
|
deleteTenantMeta,
|
|
26981
27110
|
deleteWorkspaceFile,
|
|
27111
|
+
deleteWorkspaceFileChecked,
|
|
26982
27112
|
deliveryRunFields,
|
|
26983
27113
|
deriveNamelessToolLabel,
|
|
26984
27114
|
describeNonBmpHits,
|
|
@@ -27046,15 +27176,18 @@ export {
|
|
|
27046
27176
|
inferMiniWritableTemplateOptionsFromModel,
|
|
27047
27177
|
initMiniAppProject,
|
|
27048
27178
|
inspectRound,
|
|
27179
|
+
inspectWorkspaceFiles,
|
|
27049
27180
|
installDataPackageArtifact,
|
|
27050
27181
|
installDataPackageArtifactAsync,
|
|
27051
27182
|
isDelegationToolName,
|
|
27052
27183
|
isLocalName,
|
|
27053
27184
|
isReadOnly,
|
|
27054
27185
|
isServerSlidingSession,
|
|
27186
|
+
isSha256,
|
|
27055
27187
|
isSupersededItem,
|
|
27056
27188
|
isTempEnv,
|
|
27057
27189
|
isTerminalRunStatus,
|
|
27190
|
+
isWorkspaceRelativePath,
|
|
27058
27191
|
isZeroNetwork,
|
|
27059
27192
|
jiraTokenHelp,
|
|
27060
27193
|
jiraTokenSource,
|
|
@@ -27097,6 +27230,7 @@ export {
|
|
|
27097
27230
|
needsRefresh,
|
|
27098
27231
|
newRoundId,
|
|
27099
27232
|
nonBmpHitLines,
|
|
27233
|
+
nonnegativeInteger,
|
|
27100
27234
|
normalizeAndAssertEndpoint,
|
|
27101
27235
|
normalizeEndpoint,
|
|
27102
27236
|
normalizeOrigin,
|
|
@@ -27136,6 +27270,7 @@ export {
|
|
|
27136
27270
|
readMiniContext,
|
|
27137
27271
|
readPullManifest,
|
|
27138
27272
|
readSessionPrincipal,
|
|
27273
|
+
readWorkspaceInspection,
|
|
27139
27274
|
rebind,
|
|
27140
27275
|
rebindPayload,
|
|
27141
27276
|
reconcileTenant,
|
|
@@ -27184,6 +27319,7 @@ export {
|
|
|
27184
27319
|
saveProfile,
|
|
27185
27320
|
saveTenantMeta,
|
|
27186
27321
|
saveWorkspaceFileContent,
|
|
27322
|
+
saveWorkspaceFileContentChecked,
|
|
27187
27323
|
scriptDryRun,
|
|
27188
27324
|
seedBaselines,
|
|
27189
27325
|
seedMappingPath,
|
|
@@ -27215,7 +27351,10 @@ export {
|
|
|
27215
27351
|
verifyText,
|
|
27216
27352
|
waitForInstallRun,
|
|
27217
27353
|
watchBrowserAuthorization,
|
|
27354
|
+
workspaceActionPayload,
|
|
27355
|
+
workspaceDeliveryError,
|
|
27218
27356
|
workspaceLayer,
|
|
27357
|
+
workspaceObjectActionBase,
|
|
27219
27358
|
writeChangeState,
|
|
27220
27359
|
writeImportPlan,
|
|
27221
27360
|
writeRisk
|