@hcmai/sdk 0.25.3 → 0.26.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +86 -1
- package/dist/index.js +112 -54
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -3244,6 +3244,91 @@ interface SaveMetaResult {
|
|
|
3244
3244
|
declare function saveTenantMeta(http: AxiosInstance, path: string, content: string): Promise<SaveMetaResult>;
|
|
3245
3245
|
declare function deleteTenantMeta(http: AxiosInstance, path: string): Promise<SaveMetaResult>;
|
|
3246
3246
|
|
|
3247
|
+
/**
|
|
3248
|
+
* 物理列槽(core ADR-452)的**租户内只读**接口(`TenantExtensionWorkspaceController`)。
|
|
3249
|
+
*
|
|
3250
|
+
* - `GET /api/tenant-extension/column-slots?model=<Model>` —— 该模型宿主表上本租户可选 / 已占用 / 不可用的槽
|
|
3251
|
+
* - `GET /api/tenant-extension/column-slots/sql?model=&field=[&slot=][&fromSlot=]` —— 按本租户给出搬数据 / 清数据的
|
|
3252
|
+
* SQL 原句(服务端不执行;给不出的句子是 `null`,原因在 `unavailable`)
|
|
3253
|
+
*
|
|
3254
|
+
* 租户由 Bearer 令牌决定。来源(占用、字段按哪一层元数据算):带 `X-Workspace-Key` 时是那个开发空间叠加 active;
|
|
3255
|
+
* 不带时由服务端按当前用户的开发模式绑定决定,没绑定就是 active。响应的 `source` 说明这次实际用的是哪一层。
|
|
3256
|
+
*
|
|
3257
|
+
* 🔴 槽的登记 / 复核 / 摘除(`/api/bootstrap/column-slots`)是平台方持平台密钥做的**跨租户**操作,本 SDK 不提供。
|
|
3258
|
+
*/
|
|
3259
|
+
declare const WORKSPACE_KEY_HEADER = "X-Workspace-Key";
|
|
3260
|
+
/** 服务端会给的 SQL 句子键(后三句只在带 `fromSlot` 时出现),按执行流程里的先后排。 */
|
|
3261
|
+
declare const COLUMN_SLOT_SQL_KEYS: readonly ["countSlot", "flexToSlot", "verifyFlexToSlot", "slotToFlex", "removeFlexKey", "clearSlot", "moveFromSlot", "verifyMoveFromSlot", "clearFromSlot"];
|
|
3262
|
+
type ColumnSlotSqlKey = (typeof COLUMN_SLOT_SQL_KEYS)[number];
|
|
3263
|
+
/** 只在带 `fromSlot`(改绑)时才出现的三句。 */
|
|
3264
|
+
declare const COLUMN_SLOT_REBIND_SQL_KEYS: readonly ColumnSlotSqlKey[];
|
|
3265
|
+
interface ColumnSlotRef {
|
|
3266
|
+
column: string;
|
|
3267
|
+
type: string;
|
|
3268
|
+
}
|
|
3269
|
+
interface OccupiedColumnSlot extends ColumnSlotRef {
|
|
3270
|
+
model: string;
|
|
3271
|
+
field: string;
|
|
3272
|
+
}
|
|
3273
|
+
interface ColumnSlotsView {
|
|
3274
|
+
model: string;
|
|
3275
|
+
table: string;
|
|
3276
|
+
source: string;
|
|
3277
|
+
slots: ColumnSlotRef[];
|
|
3278
|
+
occupied: OccupiedColumnSlot[];
|
|
3279
|
+
unavailableByReason: Record<string, number>;
|
|
3280
|
+
sqlApi?: string;
|
|
3281
|
+
degraded?: boolean;
|
|
3282
|
+
reason?: string;
|
|
3283
|
+
nextStep?: string;
|
|
3284
|
+
[k: string]: unknown;
|
|
3285
|
+
}
|
|
3286
|
+
interface ColumnSlotAvailability {
|
|
3287
|
+
available: boolean;
|
|
3288
|
+
reason?: string;
|
|
3289
|
+
nextStep?: string;
|
|
3290
|
+
[k: string]: unknown;
|
|
3291
|
+
}
|
|
3292
|
+
interface ColumnSlotSqlView {
|
|
3293
|
+
tenantId: string;
|
|
3294
|
+
model: string;
|
|
3295
|
+
field: string;
|
|
3296
|
+
fieldType?: string;
|
|
3297
|
+
storage?: string;
|
|
3298
|
+
currentSlot?: string | null;
|
|
3299
|
+
source: string;
|
|
3300
|
+
table: string;
|
|
3301
|
+
slot: string;
|
|
3302
|
+
slotType?: string;
|
|
3303
|
+
fromSlot?: string;
|
|
3304
|
+
discriminator?: Record<string, string>;
|
|
3305
|
+
dialect?: string;
|
|
3306
|
+
availability?: Record<string, ColumnSlotAvailability>;
|
|
3307
|
+
/** 值为 `null` 表示这句给不出,原因在 {@link unavailable}。 */
|
|
3308
|
+
sql: Record<string, string | null>;
|
|
3309
|
+
unavailable?: Record<string, string>;
|
|
3310
|
+
jsonSqlUnavailable?: string;
|
|
3311
|
+
degraded?: boolean;
|
|
3312
|
+
reason?: string;
|
|
3313
|
+
steps?: Record<string, string>;
|
|
3314
|
+
nextStep?: string;
|
|
3315
|
+
[k: string]: unknown;
|
|
3316
|
+
}
|
|
3317
|
+
interface ColumnSlotRequestOpts {
|
|
3318
|
+
/** 开发空间 key;给了就带 `X-Workspace-Key`,不给由服务端按开发模式绑定决定来源。 */
|
|
3319
|
+
workspaceKey?: string;
|
|
3320
|
+
}
|
|
3321
|
+
interface ColumnSlotSqlParams {
|
|
3322
|
+
model: string;
|
|
3323
|
+
field: string;
|
|
3324
|
+
slot?: string;
|
|
3325
|
+
fromSlot?: string;
|
|
3326
|
+
}
|
|
3327
|
+
/** `GET /api/tenant-extension/column-slots?model=` —— 返回服务端 `data` 原样。 */
|
|
3328
|
+
declare function getColumnSlots(http: AxiosInstance, model: string, opts?: ColumnSlotRequestOpts): Promise<ColumnSlotsView>;
|
|
3329
|
+
/** `GET /api/tenant-extension/column-slots/sql?model=&field=[&slot=][&fromSlot=]` —— 返回服务端 `data` 原样。 */
|
|
3330
|
+
declare function getColumnSlotSql(http: AxiosInstance, params: ColumnSlotSqlParams, opts?: ColumnSlotRequestOpts): Promise<ColumnSlotSqlView>;
|
|
3331
|
+
|
|
3247
3332
|
declare const META_SCHEMA_SOURCE_COMMIT = "6b872a5b3749147cd4fed9dd1a1598e5876c8c76";
|
|
3248
3333
|
|
|
3249
3334
|
type MetaIssueSeverity = 'error' | 'warn';
|
|
@@ -7001,4 +7086,4 @@ type ParsedRef = {
|
|
|
7001
7086
|
declare function parseRef(raw: string, project: string, casesSlug?: string): ParsedRef | null;
|
|
7002
7087
|
declare const firstLine: (s: string) => string;
|
|
7003
7088
|
|
|
7004
|
-
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, 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 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 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, 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, 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 };
|
|
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 };
|
package/dist/index.js
CHANGED
|
@@ -285,7 +285,7 @@ function fromAxiosError(err, profile) {
|
|
|
285
285
|
const respDetails = body?.details;
|
|
286
286
|
const respReason = nonBlankString(body?.reason);
|
|
287
287
|
const respNote = nonBlankString(body?.note);
|
|
288
|
-
const respNextStep = nonBlankString(body?.next_step) ?? nonBlankString(body?.nextStep);
|
|
288
|
+
const respNextStep = nonBlankString(body?.next_step) ?? nonBlankString(body?.nextStep) ?? (isRecord(respDetails) ? nonBlankString(respDetails.nextStep) ?? nonBlankString(respDetails.next_step) : void 0);
|
|
289
289
|
const respRetryable = body?.retryable;
|
|
290
290
|
const conflictDiagnosis = status === 409 ? diagnoseWorkspaceConflict(respCode) : void 0;
|
|
291
291
|
const localDiagnosis = respCode === REJECTED_BEFORE_ROUTING_CODE ? diagnoseRejectedBeforeRouting(err.config?.url, err.config?.baseURL) : conflictDiagnosis;
|
|
@@ -6492,12 +6492,12 @@ async function checkMiniSmokeTarget(target, fetcher, timeoutMs, accessToken, wor
|
|
|
6492
6492
|
const controller = new AbortController();
|
|
6493
6493
|
const timeout = setTimeout(() => controller.abort(), timeoutMs);
|
|
6494
6494
|
try {
|
|
6495
|
-
const
|
|
6495
|
+
const headers2 = target.kind !== "preview" ? {
|
|
6496
6496
|
...accessToken ? { Authorization: `Bearer ${accessToken}` } : {},
|
|
6497
6497
|
...workspaceKey ? { "X-Workspace-Key": workspaceKey } : {}
|
|
6498
6498
|
} : void 0;
|
|
6499
6499
|
const response = await fetcher(target.url, {
|
|
6500
|
-
...
|
|
6500
|
+
...headers2 ? { headers: headers2 } : {},
|
|
6501
6501
|
method: "GET",
|
|
6502
6502
|
signal: controller.signal
|
|
6503
6503
|
});
|
|
@@ -7529,6 +7529,59 @@ async function deleteTenantMeta(http, path24) {
|
|
|
7529
7529
|
return resp.data?.data ?? resp.data;
|
|
7530
7530
|
}
|
|
7531
7531
|
|
|
7532
|
+
// src/meta/column-slots.ts
|
|
7533
|
+
var WORKSPACE_KEY_HEADER = "X-Workspace-Key";
|
|
7534
|
+
var COLUMN_SLOTS_PATH = "/api/tenant-extension/column-slots";
|
|
7535
|
+
var COLUMN_SLOT_SQL_PATH = "/api/tenant-extension/column-slots/sql";
|
|
7536
|
+
var COLUMN_SLOT_SQL_KEYS = [
|
|
7537
|
+
"countSlot",
|
|
7538
|
+
"flexToSlot",
|
|
7539
|
+
"verifyFlexToSlot",
|
|
7540
|
+
"slotToFlex",
|
|
7541
|
+
"removeFlexKey",
|
|
7542
|
+
"clearSlot",
|
|
7543
|
+
"moveFromSlot",
|
|
7544
|
+
"verifyMoveFromSlot",
|
|
7545
|
+
"clearFromSlot"
|
|
7546
|
+
];
|
|
7547
|
+
var COLUMN_SLOT_REBIND_SQL_KEYS = ["moveFromSlot", "verifyMoveFromSlot", "clearFromSlot"];
|
|
7548
|
+
function headers(opts) {
|
|
7549
|
+
return opts.workspaceKey ? { [WORKSPACE_KEY_HEADER]: opts.workspaceKey } : void 0;
|
|
7550
|
+
}
|
|
7551
|
+
function isRecord2(value) {
|
|
7552
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
7553
|
+
}
|
|
7554
|
+
function unexpected(path24, body) {
|
|
7555
|
+
return new CliError({
|
|
7556
|
+
code: "PROTOCOL_UNSUPPORTED" /* PROTOCOL_UNSUPPORTED */,
|
|
7557
|
+
message: `${path24} \u8FD4\u56DE\u4E86 2xx\uFF0C\u4F46\u54CD\u5E94\u91CC\u6CA1\u6709\u7EA6\u5B9A\u7684 data \u7ED3\u6784\uFF1B\u6CA1\u6709\u628A\u7F3A\u7684\u90E8\u5206\u8865\u6210\u7A7A\u5217\u8868`,
|
|
7558
|
+
context: {
|
|
7559
|
+
reasonCode: "COLUMN_SLOT_RESPONSE_UNRECOGNIZED",
|
|
7560
|
+
details: body,
|
|
7561
|
+
nextStep: "\u7528 `hcm version` \u6838\u5BF9\u540E\u7AEF\u7248\u672C\u662F\u5426\u542B\u5217\u69FD\u767B\u8BB0\u8868\uFF08ADR-452\uFF09\uFF1B\u7248\u672C\u5BF9\u5F97\u4E0A\u5C31\u628A\u8FD9\u6BB5\u54CD\u5E94\u62A5\u7ED9 CLI \u7EF4\u62A4\u8005"
|
|
7562
|
+
}
|
|
7563
|
+
});
|
|
7564
|
+
}
|
|
7565
|
+
async function getColumnSlots(http, model, opts = {}) {
|
|
7566
|
+
const resp = await http.get(COLUMN_SLOTS_PATH, { params: { model }, headers: headers(opts) });
|
|
7567
|
+
const data = resp.data?.data;
|
|
7568
|
+
if (!isRecord2(data) || !Array.isArray(data.slots) || !Array.isArray(data.occupied)) {
|
|
7569
|
+
throw unexpected(COLUMN_SLOTS_PATH, resp.data);
|
|
7570
|
+
}
|
|
7571
|
+
return data;
|
|
7572
|
+
}
|
|
7573
|
+
async function getColumnSlotSql(http, params, opts = {}) {
|
|
7574
|
+
const query2 = { model: params.model, field: params.field };
|
|
7575
|
+
if (params.slot) query2.slot = params.slot;
|
|
7576
|
+
if (params.fromSlot) query2.fromSlot = params.fromSlot;
|
|
7577
|
+
const resp = await http.get(COLUMN_SLOT_SQL_PATH, { params: query2, headers: headers(opts) });
|
|
7578
|
+
const data = resp.data?.data;
|
|
7579
|
+
if (!isRecord2(data) || !isRecord2(data.sql)) {
|
|
7580
|
+
throw unexpected(COLUMN_SLOT_SQL_PATH, resp.data);
|
|
7581
|
+
}
|
|
7582
|
+
return data;
|
|
7583
|
+
}
|
|
7584
|
+
|
|
7532
7585
|
// src/meta/validate-meta.ts
|
|
7533
7586
|
import yaml9 from "js-yaml";
|
|
7534
7587
|
|
|
@@ -15223,21 +15276,21 @@ async function runBatch(items, request) {
|
|
|
15223
15276
|
}));
|
|
15224
15277
|
return Object.fromEntries(pairs);
|
|
15225
15278
|
}
|
|
15226
|
-
function toOutcome(status, data,
|
|
15279
|
+
function toOutcome(status, data, headers2) {
|
|
15227
15280
|
const cls = classifyStatus(status);
|
|
15228
|
-
if (status === 204) return { status, body: null, error: "ok", headers };
|
|
15281
|
+
if (status === 204) return { status, body: null, error: "ok", headers: headers2 };
|
|
15229
15282
|
const empty = data === void 0 || data === null || typeof data === "string" && data.trim() === "";
|
|
15230
15283
|
if (empty) {
|
|
15231
|
-
return { status, body: null, error: cls === "ok" ? "bad-response" : cls, headers };
|
|
15284
|
+
return { status, body: null, error: cls === "ok" ? "bad-response" : cls, headers: headers2 };
|
|
15232
15285
|
}
|
|
15233
15286
|
if (typeof data === "string") {
|
|
15234
15287
|
try {
|
|
15235
|
-
return { status, body: JSON.parse(data), error: cls, headers };
|
|
15288
|
+
return { status, body: JSON.parse(data), error: cls, headers: headers2 };
|
|
15236
15289
|
} catch {
|
|
15237
|
-
return { status, body: null, error: cls === "ok" ? "bad-response" : cls, headers };
|
|
15290
|
+
return { status, body: null, error: cls === "ok" ? "bad-response" : cls, headers: headers2 };
|
|
15238
15291
|
}
|
|
15239
15292
|
}
|
|
15240
|
-
return { status, body: data, error: cls, headers };
|
|
15293
|
+
return { status, body: data, error: cls, headers: headers2 };
|
|
15241
15294
|
}
|
|
15242
15295
|
function httpProbe(http, capabilities) {
|
|
15243
15296
|
async function once(fn) {
|
|
@@ -15252,18 +15305,18 @@ function httpProbe(http, capabilities) {
|
|
|
15252
15305
|
return { status: -1, body: null, error: local ? "bad-response" : "network", headers: {}, ...detail ? { detail } : {} };
|
|
15253
15306
|
}
|
|
15254
15307
|
}
|
|
15255
|
-
const
|
|
15308
|
+
const headers2 = { [CAPABILITIES_HEADER]: capabilities };
|
|
15256
15309
|
const probe = {
|
|
15257
15310
|
capabilities,
|
|
15258
15311
|
get(path24, params) {
|
|
15259
15312
|
return once(
|
|
15260
|
-
() => http.get(buildUrl(path24, params), { headers, validateStatus: () => true })
|
|
15313
|
+
() => http.get(buildUrl(path24, params), { headers: headers2, validateStatus: () => true })
|
|
15261
15314
|
);
|
|
15262
15315
|
},
|
|
15263
15316
|
post(path24, body) {
|
|
15264
15317
|
return once(
|
|
15265
15318
|
() => http.post(path24, body, {
|
|
15266
|
-
headers: { ...
|
|
15319
|
+
headers: { ...headers2, "content-type": "application/json" },
|
|
15267
15320
|
validateStatus: () => true
|
|
15268
15321
|
})
|
|
15269
15322
|
);
|
|
@@ -15575,7 +15628,7 @@ function actionsPath(modelKey, state = "") {
|
|
|
15575
15628
|
if (!state) return base;
|
|
15576
15629
|
return `${base}?${new URLSearchParams({ state }).toString()}`;
|
|
15577
15630
|
}
|
|
15578
|
-
function
|
|
15631
|
+
function isRecord3(v) {
|
|
15579
15632
|
return Boolean(v) && typeof v === "object" && !Array.isArray(v);
|
|
15580
15633
|
}
|
|
15581
15634
|
function keyOrNull(key) {
|
|
@@ -15617,7 +15670,7 @@ async function collectActionGates(probe, modelKeys2, state = "") {
|
|
|
15617
15670
|
continue;
|
|
15618
15671
|
}
|
|
15619
15672
|
const body = out.body;
|
|
15620
|
-
if (!
|
|
15673
|
+
if (!isRecord3(body) || !Array.isArray(body.actions)) {
|
|
15621
15674
|
unavailable.push({
|
|
15622
15675
|
modelKey: model,
|
|
15623
15676
|
status: out.status,
|
|
@@ -15633,13 +15686,13 @@ async function collectActionGates(probe, modelKeys2, state = "") {
|
|
|
15633
15686
|
else statesEchoed.add(echoed);
|
|
15634
15687
|
for (const action3 of body.actions) {
|
|
15635
15688
|
actionsSeen += 1;
|
|
15636
|
-
if (!
|
|
15689
|
+
if (!isRecord3(action3)) {
|
|
15637
15690
|
reject(rejected, model, null, "malformed-action");
|
|
15638
15691
|
continue;
|
|
15639
15692
|
}
|
|
15640
15693
|
const cands = Array.isArray(action3.candidates) ? action3.candidates : [];
|
|
15641
15694
|
for (const c of cands) {
|
|
15642
|
-
if (
|
|
15695
|
+
if (isRecord3(c) && typeof c.source === "string" && c.source) sources.add(c.source);
|
|
15643
15696
|
}
|
|
15644
15697
|
const effectClass = classifyEffect(action3.effect);
|
|
15645
15698
|
if (effectClass !== "absent") actionsWithEffect += 1;
|
|
@@ -15683,7 +15736,7 @@ async function collectActionGates(probe, modelKeys2, state = "") {
|
|
|
15683
15736
|
reject(rejected, model, key, "no-candidates");
|
|
15684
15737
|
continue;
|
|
15685
15738
|
}
|
|
15686
|
-
if (!cands.every((c) =>
|
|
15739
|
+
if (!cands.every((c) => isRecord3(c))) {
|
|
15687
15740
|
reject(rejected, model, key, "malformed-candidate");
|
|
15688
15741
|
continue;
|
|
15689
15742
|
}
|
|
@@ -16006,7 +16059,7 @@ var badSection = (t) => `\u4F20\u5165\u7684 mutation \u6BB5\u4E0D\u662F\u5BF9\u8
|
|
|
16006
16059
|
var badCell = (op, t) => `\u4F20\u5165\u7684 mutation \u91CC ${op} \u8FD9\u4E00\u9879\u4E0D\u662F\u5BF9\u8C61\uFF08${t}\uFF09\uFF0C\u65E0\u6CD5\u5224\u8BFB`;
|
|
16007
16060
|
var missingCell = (op) => `\u4F20\u5165\u7684 mutation \u91CC\u6CA1\u6709 ${op} \u8FD9\u4E00\u9879`;
|
|
16008
16061
|
var WORDING3 = 'writable=false \u7684\u4E24\u79CD\u539F\u56E0\uFF1Aderived:<kind>\uFF08\u6D3E\u751F\u5B57\u6BB5\uFF0C\u670D\u52A1\u7AEF\u7B97\u51FA\u6765\u7684\uFF09\u3001readonly\uFF08\u5143\u6570\u636E\u58F0\u660E\u53EA\u8BFB\uFF09\u3002autoGenerate=true \u7684\u5B57\u6BB5\uFF08\u5DE5\u53F7 / \u7EC4\u7EC7 / \u5C97\u4F4D / \u6CD5\u4EBA\u7F16\u7801\u7B49\uFF09**\u4E0D\u662F**\u4E0D\u53EF\u5199\uFF1A\u670D\u52A1\u7AEF\u53EA\u5728\u5B57\u6BB5\u4E3A\u7A7A\u65F6\u751F\u6210\uFF0C\u8C03\u7528\u65B9\u624B\u5DE5\u6307\u5B9A\u7684\u503C\u4F18\u5148 \u2014\u2014 \u7531\u72EC\u7ACB\u6807\u8BB0 `autoGeneratedIfAbsent` \u70B9\u540D\uFF08\u4E0D\u9001\u5219\u751F\u6210\u3001\u9001\u5219\u91C7\u7EB3\uFF09\uFF0C\u4E0D\u518D\u8FDB notWritableReason\u3002\u{1F534} writable=true **\u53EA\u8868\u793A\u5143\u6570\u636E\u6CA1\u58F0\u660E\u8FD9\u4E24\u79CD\u4E0D\u53EF\u5199**\uFF0C\u4E0D\u8868\u793A\u8FD9\u4E2A\u5B57\u6BB5\u8BE5\u7531\u987E\u95EE\u586B \u2014\u2014 \u5B9E\u6D4B createById / updateById \u8FD9 1476 \u4E2A\u5BA1\u8BA1\u5B57\u6BB5\u56DB\u4E2A\u6807\u5FD7\u5168\u662F false\uFF0C\u7167\u6837\u662F writable=true\uFF0C\u5B83\u4EEC\u7531 ref.auditBackref=true \u70B9\u540D\uFF08topology \u628A\u540C\u4E00\u6279\u8FB9\u6392\u9664\u51FA\u4F9D\u8D56\u56FE\uFF0C\u8FD9\u91CC\u4E0D\u6392\u9664\uFF1Amapping \u662F\u5B57\u6BB5\u6E05\u5355\uFF0C\u4E0D\u662F\u4F9D\u8D56\u56FE\uFF09\u3002ref.valueDomain \u53EA\u5728\u76EE\u6807\u662F\u7801\u8868\uFF08DYNAMIC / CO_*\uFF09\u65F6\u7ED9\u51FA\uFF1B\u6307\u5411\u4E1A\u52A1\u6A21\u578B\u65F6\u4E3A null \u2014\u2014 \u5B9E\u6D4B 234 \u4E2A\u58F0\u660E\u51FA\u6765\u7684\u5F15\u7528\u76EE\u6807\u91CC\uFF0C230 \u4E2A\u5728\u540D\u518C\u4E2D\uFF1A\u5176\u4E2D 32 \u4E2A\u662F\u7801\u8868\u3001198 \u4E2A\u662F\u4E1A\u52A1\u6A21\u578B\uFF08User 1564 / OrgUnit 292 / Employee 199 \u2026\uFF09\u8981\u6309\u4E1A\u52A1\u952E\u73B0\u67E5\uFF1B\u53E6\u6709 4 \u4E2A\u60AC\u7A7A\u76EE\u6807\uFF08\u58F0\u660E\u4E86\u5F15\u7528\u4F46\u4E0D\u5728 /api/system/models \u540D\u518C\u91CC\uFF0C\u89C1 topology.json \u7684 dangling\uFF09\u3002valuedomain \u91CC\u6CA1\u6709\u4E1A\u52A1\u6A21\u578B\u7684\u5BF9\u7167\u8868\uFF0C\u6307\u4E00\u4E2A\u4E0D\u5B58\u5728\u7684\u6587\u4EF6\u6BD4\u4E0D\u6307\u66F4\u7CDF\uFF1A\u987E\u95EE\u4F1A\u4EE5\u4E3A\u90A3\u4EFD\u5BF9\u7167\u8868\u53EA\u662F\u8FD8\u6CA1\u751F\u6210\u3002ref.labelFieldSource=unknown \u8868\u793A\u4EA7\u54C1\u6CA1\u58F0\u660E\u663E\u793A\u5B57\u6BB5\u540D\uFF08\u5B9E\u6D4B\u8FDB\u56FE\u7684 2923 \u6761\u8FB9\u91CC 1366 \u6761\u6CA1\u58F0\u660E\uFF09\uFF0C**\u4E0D\u662F**\u300C\u9ED8\u8BA4\u7528 name\u300D\u2014\u2014 \u90A3 1366 \u6761\u6307\u5411 224 \u4E2A\u5728\u518C\u76EE\u6807\uFF0C\u5176\u4E2D 60 \u4E2A\uFF0827%\uFF0C\u76EE\u6807\u6A21\u578B\u53E3\u5F84\uFF09\u8FDE name \u5B57\u6BB5\u90FD\u6CA1\u6709\uFF0C\u6309\u8FB9\u7B97 152 \u6761\uFF0811%\uFF0C\u5B57\u6BB5\u53E3\u5F84\uFF09\u843D\u5728\u5B83\u4EEC\u8EAB\u4E0A\u3002mutation.allowed \u6052\u4E3A\u4E09\u4E2A\u503C\u4E4B\u4E00\uFF1Atrue / false / "unknown"\u3002"unknown" \u8868\u793A\u8BE5\u6A21\u578B\u8FD9\u4E00\u9879\u6CA1\u67E5\u5230\uFF0C**\u4E0D\u662F**\u300C\u5141\u8BB8\u300D\uFF1B\u5177\u4F53\u662F\u54EA\u4E00\u79CD\u6CA1\u67E5\u5230\u770B reason\uFF08\u670D\u52A1\u7AEF\u4FA7\uFF1A\u6CA1\u5E94\u7B54 / \u54CD\u5E94\u7F3A\u8FD9\u4E00\u9879 / allowed \u4E0D\u662F\u5E03\u5C14\uFF1B\u5DE5\u5177\u4FA7\uFF1A\u5E76\u53D1\u6279\u6B21\u91CC\u6CA1\u62FF\u5230\u8FD9\u4E2A\u6A21\u578B\u7684\u7ED3\u679C\uFF1B\u8C03\u7528\u65B9\u4FA7\uFF1A\u672C\u8F6E\u6CA1\u67E5 / \u4F20\u5165\u7684 mutation \u6BB5\u4E0D\u662F\u5BF9\u8C61 / \u4F20\u5165\u7684\u8FD9\u4E00\u9879\u4E0D\u662F\u5BF9\u8C61 / \u4F20\u5165\u7684\u91CC\u6CA1\u6709\u8FD9\u4E00\u9879 \u2014\u2014 \u516B\u79CD\u6210\u56E0\u63AA\u8F9E\u5404\u4E0D\u76F8\u540C\uFF0C\u300C\u4F20\u5165\u7684\u300D\u5F00\u5934\u7684\u662F\u62FC\u8FD9\u4EFD\u57FA\u7EBF\u7684\u4EBA\u641E\u9519\u4E86\uFF0C\u4E0D\u662F\u670D\u52A1\u7AEF\uFF09\u3002enumCount \u6570\u7684\u662F\u8BE5\u5B57\u6BB5\u5019\u9009\u503C\u7684**\u5143\u7D20\u4E2A\u6570**\uFF0C\u4E0E index/fields.jsonl \u91CC\u8BE5\u5B57\u6BB5\u7684 enums \u884C\u6570\u76F8\u7B49\u3002';
|
|
16009
|
-
function
|
|
16062
|
+
function isRecord4(v) {
|
|
16010
16063
|
return Boolean(v) && typeof v === "object" && !Array.isArray(v);
|
|
16011
16064
|
}
|
|
16012
16065
|
function typeName2(v) {
|
|
@@ -16031,7 +16084,7 @@ async function collectMutation(probe, modelKeys2) {
|
|
|
16031
16084
|
continue;
|
|
16032
16085
|
}
|
|
16033
16086
|
const body = out.error === "ok" ? out.body : null;
|
|
16034
|
-
if (!
|
|
16087
|
+
if (!isRecord4(body)) {
|
|
16035
16088
|
const reason = `\u672A\u5E94\u7B54\uFF08HTTP ${out.status} / ${out.error}\uFF09`;
|
|
16036
16089
|
problems.push(`${key}: mutation-capability ${reason}`);
|
|
16037
16090
|
mutation[key] = Object.fromEntries(MUTATION_OPS.map((op) => [op, { allowed: "unknown", reason }]));
|
|
@@ -16040,7 +16093,7 @@ async function collectMutation(probe, modelKeys2) {
|
|
|
16040
16093
|
const entry = {};
|
|
16041
16094
|
for (const op of MUTATION_OPS) {
|
|
16042
16095
|
const cell = body[op];
|
|
16043
|
-
if (!
|
|
16096
|
+
if (!isRecord4(cell) || !("allowed" in cell)) {
|
|
16044
16097
|
entry[op] = { allowed: "unknown", reason: `\u54CD\u5E94\u91CC\u6CA1\u6709 ${op} \u8FD9\u4E00\u9879` };
|
|
16045
16098
|
problems.push(`${key}: mutation-capability \u54CD\u5E94\u7F3A ${op}`);
|
|
16046
16099
|
continue;
|
|
@@ -16061,14 +16114,14 @@ function mutationSection(entry) {
|
|
|
16061
16114
|
if (entry === void 0 || entry === null) {
|
|
16062
16115
|
return Object.fromEntries(MUTATION_OPS.map((op) => [op, { allowed: "unknown", reason: NOT_QUERIED }]));
|
|
16063
16116
|
}
|
|
16064
|
-
if (!
|
|
16117
|
+
if (!isRecord4(entry)) {
|
|
16065
16118
|
const reason = badSection(typeName2(entry));
|
|
16066
16119
|
return Object.fromEntries(MUTATION_OPS.map((op) => [op, { allowed: "unknown", reason }]));
|
|
16067
16120
|
}
|
|
16068
16121
|
const section = {};
|
|
16069
16122
|
for (const op of MUTATION_OPS) {
|
|
16070
16123
|
const cell = entry[op];
|
|
16071
|
-
if (
|
|
16124
|
+
if (isRecord4(cell)) {
|
|
16072
16125
|
section[op] = cell;
|
|
16073
16126
|
} else if (op in entry) {
|
|
16074
16127
|
section[op] = { allowed: "unknown", reason: badCell(op, typeName2(cell)) };
|
|
@@ -16081,7 +16134,7 @@ function mutationSection(entry) {
|
|
|
16081
16134
|
function writability(field) {
|
|
16082
16135
|
const derived = field.derived;
|
|
16083
16136
|
if (derived) {
|
|
16084
|
-
const kind =
|
|
16137
|
+
const kind = isRecord4(derived) ? derived.kind : null;
|
|
16085
16138
|
return { writable: false, reason: `derived:${typeof kind === "string" && kind ? kind : "unknown"}` };
|
|
16086
16139
|
}
|
|
16087
16140
|
if (field.isReadonly) return { writable: false, reason: "readonly" };
|
|
@@ -16096,7 +16149,7 @@ function buildMapping(metas, edges, mutation, codeTables = []) {
|
|
|
16096
16149
|
const { fields, problem: problem6 } = metaFields(metas[modelKey]);
|
|
16097
16150
|
const rows = [];
|
|
16098
16151
|
for (const f of fields) {
|
|
16099
|
-
if (!
|
|
16152
|
+
if (!isRecord4(f)) continue;
|
|
16100
16153
|
const key = f.key;
|
|
16101
16154
|
if (typeof key !== "string" || !key) continue;
|
|
16102
16155
|
const { writable, reason } = writability(f);
|
|
@@ -16139,7 +16192,7 @@ function buildMapping(metas, edges, mutation, codeTables = []) {
|
|
|
16139
16192
|
// 「爬过且这个模型确实没有字段」必须与「没爬过」(文件不存在)区分开。
|
|
16140
16193
|
crawled: true,
|
|
16141
16194
|
wording: WORDING3,
|
|
16142
|
-
mutation: mutationSection(
|
|
16195
|
+
mutation: mutationSection(isRecord4(mutation) ? mutation[modelKey] : mutation),
|
|
16143
16196
|
fieldCount: rows.length,
|
|
16144
16197
|
// 🔴 `null` = 载荷判读正常(fieldCount=0 就是「这个模型确实没字段」);
|
|
16145
16198
|
// 非 null = **爬过、但判不出字段**,此时 fieldCount=0 不代表「没字段」。
|
|
@@ -16151,8 +16204,8 @@ function buildMapping(metas, edges, mutation, codeTables = []) {
|
|
|
16151
16204
|
}
|
|
16152
16205
|
function allowedIn(sheet, op) {
|
|
16153
16206
|
const section = sheet.mutation;
|
|
16154
|
-
const cell =
|
|
16155
|
-
return
|
|
16207
|
+
const cell = isRecord4(section) ? section[op] : void 0;
|
|
16208
|
+
return isRecord4(cell) ? cell.allowed : "unknown";
|
|
16156
16209
|
}
|
|
16157
16210
|
var PATH_SEPARATORS = ["/", String.fromCharCode(92)];
|
|
16158
16211
|
function unsafeKeyReason(modelKey) {
|
|
@@ -16334,7 +16387,7 @@ function writeModelsMd(layout, text3) {
|
|
|
16334
16387
|
// src/fde/recon/pointer-audit.ts
|
|
16335
16388
|
import { existsSync as existsSync4 } from "fs";
|
|
16336
16389
|
import * as path9 from "path";
|
|
16337
|
-
function
|
|
16390
|
+
function isRecord5(v) {
|
|
16338
16391
|
return Boolean(v) && typeof v === "object" && !Array.isArray(v);
|
|
16339
16392
|
}
|
|
16340
16393
|
function auditValueDomainPointers(layout, sheets) {
|
|
@@ -16343,7 +16396,7 @@ function auditValueDomainPointers(layout, sheets) {
|
|
|
16343
16396
|
for (const sheet of sheets) {
|
|
16344
16397
|
for (const field of sheet.fields) {
|
|
16345
16398
|
const ref = field.ref;
|
|
16346
|
-
const pointer =
|
|
16399
|
+
const pointer = isRecord5(ref) ? ref.valueDomain : null;
|
|
16347
16400
|
if (typeof pointer !== "string" || pointer === "") continue;
|
|
16348
16401
|
if (!seen.has(pointer)) {
|
|
16349
16402
|
seen.set(pointer, existsSync4(path9.join(layout.dir, pointer)));
|
|
@@ -16434,18 +16487,18 @@ var WORDING4 = "rows = \u672C\u8F6E\u4EE5\u5F53\u524D\u767B\u5F55\u8EAB\u4EFD\u8
|
|
|
16434
16487
|
function listPath(modelKey) {
|
|
16435
16488
|
return `/api/models/${modelKey}/list/dsl`;
|
|
16436
16489
|
}
|
|
16437
|
-
function
|
|
16490
|
+
function isRecord6(v) {
|
|
16438
16491
|
return Boolean(v) && typeof v === "object" && !Array.isArray(v);
|
|
16439
16492
|
}
|
|
16440
16493
|
function readContent(body) {
|
|
16441
|
-
if (!
|
|
16494
|
+
if (!isRecord6(body)) return { rows: null, total: null, nonDict: 0 };
|
|
16442
16495
|
const rows = body.content;
|
|
16443
16496
|
const total = body.totalElements;
|
|
16444
16497
|
if (!Array.isArray(rows)) return { rows: null, total: null, nonDict: 0 };
|
|
16445
16498
|
if (typeof total !== "number" || !Number.isInteger(total) || total < 0) {
|
|
16446
16499
|
return { rows: null, total: null, nonDict: 0 };
|
|
16447
16500
|
}
|
|
16448
|
-
const kept = rows.filter((r) =>
|
|
16501
|
+
const kept = rows.filter((r) => isRecord6(r));
|
|
16449
16502
|
return { rows: kept, total, nonDict: rows.length - kept.length };
|
|
16450
16503
|
}
|
|
16451
16504
|
async function collectCodeTables(probe, modelEntries2, opts = {}) {
|
|
@@ -16458,7 +16511,7 @@ async function collectCodeTables(probe, modelEntries2, opts = {}) {
|
|
|
16458
16511
|
const problems = [];
|
|
16459
16512
|
const keys = [];
|
|
16460
16513
|
for (const entry of modelEntries2) {
|
|
16461
|
-
if (!
|
|
16514
|
+
if (!isRecord6(entry) || entry.type !== DYNAMIC_TYPE) continue;
|
|
16462
16515
|
const key = entry.modelKey;
|
|
16463
16516
|
if (typeof key !== "string" || !key) {
|
|
16464
16517
|
problems.push(`\u540D\u518C\u91CC\u6709\u4E00\u6761 type=DYNAMIC \u7684\u6761\u76EE\u4F46 modelKey \u4E0D\u53EF\u7528\uFF08${JSON.stringify(key)}\uFF09\uFF0C\u5DF2\u8DF3\u8FC7`);
|
|
@@ -16592,12 +16645,12 @@ function collectEnumDomains(metas) {
|
|
|
16592
16645
|
for (const modelKey of Object.keys(metas).sort()) {
|
|
16593
16646
|
const { fields } = metaFields(metas[modelKey]);
|
|
16594
16647
|
for (const field of fields) {
|
|
16595
|
-
if (!
|
|
16648
|
+
if (!isRecord6(field)) continue;
|
|
16596
16649
|
const fieldKey = field.key;
|
|
16597
16650
|
if (typeof fieldKey !== "string" || !fieldKey) continue;
|
|
16598
16651
|
const enums = field.enums;
|
|
16599
16652
|
if (!Array.isArray(enums) || enums.length === 0) continue;
|
|
16600
|
-
const kept = enums.filter(
|
|
16653
|
+
const kept = enums.filter(isRecord6).map((e) => ({ ...e }));
|
|
16601
16654
|
rows.push({
|
|
16602
16655
|
model: modelKey,
|
|
16603
16656
|
field: fieldKey,
|
|
@@ -16608,7 +16661,7 @@ function collectEnumDomains(metas) {
|
|
|
16608
16661
|
// —— 否则「这个字段的枚举少了一项」这件事没有任何出处。
|
|
16609
16662
|
// 实测 3179 条全是对象,这一档从未观测到;**恒发空列表**而不是条件出键:
|
|
16610
16663
|
// 「有这一列且为空」与「没这一列」是两个值,后者读起来像「没检查过」。
|
|
16611
|
-
nonDictElements: enums.filter((e) => !
|
|
16664
|
+
nonDictElements: enums.filter((e) => !isRecord6(e)).map((e) => JSON.stringify(e) ?? String(e))
|
|
16612
16665
|
});
|
|
16613
16666
|
}
|
|
16614
16667
|
}
|
|
@@ -16653,7 +16706,7 @@ function writeValuedomain(layout, codeTables, enums, opts = {}) {
|
|
|
16653
16706
|
roundId: opts.roundId ?? null,
|
|
16654
16707
|
// 🔴 `identity || {}` 会把「调用方没传身份」和「身份是空的」压成同一个值,
|
|
16655
16708
|
// 而它们的下一步不同(前者去补工具的登录,后者去问服务端为什么不给 user)。
|
|
16656
|
-
identity:
|
|
16709
|
+
identity: isRecord6(opts.identity) ? opts.identity : null,
|
|
16657
16710
|
codeTableCount: Object.keys(codeTables).length,
|
|
16658
16711
|
enumFieldCount: enums.length,
|
|
16659
16712
|
// 🔴 名册里一共看到几条。上游名册加载失败给出空数组时,产物会与
|
|
@@ -16723,7 +16776,7 @@ function parseRoundStamp(stamp2) {
|
|
|
16723
16776
|
function newRoundId(started) {
|
|
16724
16777
|
return `${roundStamp(started)}-${randomBytes3(4).toString("hex")}`;
|
|
16725
16778
|
}
|
|
16726
|
-
function
|
|
16779
|
+
function isRecord7(v) {
|
|
16727
16780
|
return Boolean(v) && typeof v === "object" && !Array.isArray(v);
|
|
16728
16781
|
}
|
|
16729
16782
|
function readJsonSoft(file) {
|
|
@@ -16742,8 +16795,8 @@ function readJsonSoft(file) {
|
|
|
16742
16795
|
}
|
|
16743
16796
|
function readCrawledAt(layout) {
|
|
16744
16797
|
const body = readJsonSoft(path10.join(layout.dir, KIT_CRAWLED_AT_FILE));
|
|
16745
|
-
const models =
|
|
16746
|
-
return
|
|
16798
|
+
const models = isRecord7(body) ? body.models : null;
|
|
16799
|
+
return isRecord7(models) ? models : {};
|
|
16747
16800
|
}
|
|
16748
16801
|
function writeCrawledAt(layout, freshKeys, carriedKeys, roundId, started) {
|
|
16749
16802
|
const previous = readCrawledAt(layout);
|
|
@@ -16791,14 +16844,14 @@ function productRoundId(root, rel) {
|
|
|
16791
16844
|
const p = path10.join(root, rel);
|
|
16792
16845
|
if (!existsSync5(p)) return ["missing", null];
|
|
16793
16846
|
const body = readJsonSoft(p);
|
|
16794
|
-
if (body === void 0 || !
|
|
16847
|
+
if (body === void 0 || !isRecord7(body)) return ["unreadable", null];
|
|
16795
16848
|
const rid = body.roundId;
|
|
16796
16849
|
if (typeof rid !== "string" || !rid) return ["unstamped", null];
|
|
16797
16850
|
return ["stamped", rid];
|
|
16798
16851
|
}
|
|
16799
16852
|
function inspectRound(root) {
|
|
16800
16853
|
const raw = readJsonSoft(path10.join(root, KIT_CRAWLED_AT_FILE));
|
|
16801
|
-
const ledger =
|
|
16854
|
+
const ledger = isRecord7(raw) ? raw : {};
|
|
16802
16855
|
const rid = ledger.roundId;
|
|
16803
16856
|
const roundId = typeof rid === "string" && rid ? rid : null;
|
|
16804
16857
|
const rawWritten = ledger.productsWrittenThisRound;
|
|
@@ -16903,7 +16956,7 @@ function renderRound(result) {
|
|
|
16903
16956
|
}
|
|
16904
16957
|
var SCHEMA_RECRAWL_NEXT = "\u4E0B\u4E00\u6B65\uFF1A\u8DD1\u4E00\u6B21**\u5168\u91CF** `hcm chiron recon`\uFF08\u628A `--model` \u53BB\u6389\uFF09\uFF0C\u6574\u4EFD\u57FA\u7EBF\u624D\u90FD\u51FA\u81EA\u672C\u7248 kit\u3002";
|
|
16905
16958
|
function carriedGatesSchemaProblem(oldGates) {
|
|
16906
|
-
if (!
|
|
16959
|
+
if (!isRecord7(oldGates)) {
|
|
16907
16960
|
const shape = Array.isArray(oldGates) ? "list" : oldGates === null ? "null" : typeof oldGates;
|
|
16908
16961
|
return `gates.json: \u4E0A\u4E00\u8F6E\u7684\u95F8\u8868\u8F7D\u8377\u662F ${shape} \u4E0D\u662F\u5BF9\u8C61\uFF0C\u65E2\u8BFB\u4E0D\u51FA schema \u7248\u672C\u3001\u4E5F\u4E00\u6761\u95F8\u90FD\u6CBF\u7528\u4E0D\u4E86\uFF08\u672C\u8F6E\u7684 gates \u6570\u7EC4\u91CC\u53EA\u6709\u8FD9\u4E00\u8F6E\u771F\u722C\u5230\u7684\uFF09\u3002${SCHEMA_RECRAWL_NEXT}`;
|
|
16909
16962
|
}
|
|
@@ -16944,7 +16997,7 @@ function collectCarryOver(layout, freshMetas) {
|
|
|
16944
16997
|
problems.push(`${name}: \u8BFB\u4E0D\u56DE\u4E0A\u4E00\u8F6E\u7684 meta\uFF08${e.message}\uFF09\uFF0C\u8BE5\u6A21\u578B\u8FD9\u6B21\u4E0D\u8FDB\u7D22\u5F15`);
|
|
16945
16998
|
continue;
|
|
16946
16999
|
}
|
|
16947
|
-
if (
|
|
17000
|
+
if (isRecord7(body)) carriedMetas[key] = body;
|
|
16948
17001
|
else {
|
|
16949
17002
|
problems.push(
|
|
16950
17003
|
`${name}: \u4E0A\u4E00\u8F6E\u7684 meta \u8F7D\u8377\u662F ${Array.isArray(body) ? "list" : body === null ? "null" : typeof body} \u4E0D\u662F\u5BF9\u8C61\uFF0C\u8BE5\u6A21\u578B\u8FD9\u6B21\u4E0D\u8FDB\u7D22\u5F15`
|
|
@@ -16959,9 +17012,9 @@ function collectCarryOver(layout, freshMetas) {
|
|
|
16959
17012
|
const stale = carriedGatesSchemaProblem(oldGates);
|
|
16960
17013
|
if (stale) problems.push(stale);
|
|
16961
17014
|
}
|
|
16962
|
-
const oldList =
|
|
17015
|
+
const oldList = isRecord7(oldGates) && Array.isArray(oldGates.gates) ? oldGates.gates : [];
|
|
16963
17016
|
for (const g of oldList) {
|
|
16964
|
-
if (
|
|
17017
|
+
if (isRecord7(g) && !(String(g.model) in freshMetas)) carriedGates.push(g);
|
|
16965
17018
|
}
|
|
16966
17019
|
return { carriedMetas, carriedGates, problems };
|
|
16967
17020
|
}
|
|
@@ -17085,7 +17138,7 @@ async function runRecon(probe, layout, opts = {}) {
|
|
|
17085
17138
|
products.push(...mappingPaths.map((p) => relOf(layout, p)));
|
|
17086
17139
|
const sheetsWritten = Math.max(mappingPaths.length - 1, 0);
|
|
17087
17140
|
let previous = readJsonSoft(path10.join(layout.dir, "fingerprint.json"));
|
|
17088
|
-
if (!
|
|
17141
|
+
if (!isRecord7(previous)) previous = null;
|
|
17089
17142
|
const current = await computeFingerprint(probe);
|
|
17090
17143
|
products.push(relOf(layout, layout.writeJson("fingerprint.json", current)));
|
|
17091
17144
|
const drift = previous === null ? null : compareFingerprint(previous, current);
|
|
@@ -18950,7 +19003,7 @@ function stamp(note, model, file) {
|
|
|
18950
19003
|
async function scanSources(mapping, baseDir, options = {}) {
|
|
18951
19004
|
const read = options.readTableImpl ?? readTable;
|
|
18952
19005
|
const base = baseDir ?? path14.dirname(mapping.path);
|
|
18953
|
-
const
|
|
19006
|
+
const headers2 = /* @__PURE__ */ new Map();
|
|
18954
19007
|
const rows = /* @__PURE__ */ new Map();
|
|
18955
19008
|
const notes = [];
|
|
18956
19009
|
const problems = [];
|
|
@@ -18993,12 +19046,12 @@ async function scanSources(mapping, baseDir, options = {}) {
|
|
|
18993
19046
|
for (const note of rawNotes) notes.push(stamp(note, mm.model, file));
|
|
18994
19047
|
if (result === null) continue;
|
|
18995
19048
|
takenBy.set(mm.model, mm.source.file);
|
|
18996
|
-
|
|
19049
|
+
headers2.set(mm.model, result.header);
|
|
18997
19050
|
rows.set(mm.model, result.rows);
|
|
18998
19051
|
}
|
|
18999
|
-
return { headers, rows, notes, problems };
|
|
19052
|
+
return { headers: headers2, rows, notes, problems };
|
|
19000
19053
|
}
|
|
19001
|
-
function validateMapping(mapping,
|
|
19054
|
+
function validateMapping(mapping, headers2) {
|
|
19002
19055
|
const declaredKeys = /* @__PURE__ */ new Map();
|
|
19003
19056
|
for (const mm of mapping.models) {
|
|
19004
19057
|
const fields = mm.businessKey ? [...mm.businessKey.fields] : [];
|
|
@@ -19034,16 +19087,16 @@ function validateMapping(mapping, headers) {
|
|
|
19034
19087
|
);
|
|
19035
19088
|
}
|
|
19036
19089
|
mapping.models.forEach((mm, index) => {
|
|
19037
|
-
problems.push(...validateModel(mm,
|
|
19090
|
+
problems.push(...validateModel(mm, headers2, duplicated.has(mm.model), index, declaredKeys));
|
|
19038
19091
|
});
|
|
19039
19092
|
return problems;
|
|
19040
19093
|
}
|
|
19041
|
-
function validateModel(mm,
|
|
19094
|
+
function validateModel(mm, headers2, duplicated, index, declaredKeys) {
|
|
19042
19095
|
const out = [];
|
|
19043
19096
|
out.push(...checkOnExisting(mm));
|
|
19044
19097
|
out.push(...checkSourceRef(mm));
|
|
19045
19098
|
const keyState = checkBusinessKey(mm, out);
|
|
19046
|
-
const header =
|
|
19099
|
+
const header = headers2.get(mm.model);
|
|
19047
19100
|
const headerUsable = header !== void 0 && header.length > 0;
|
|
19048
19101
|
if (!headerUsable) {
|
|
19049
19102
|
out.push(
|
|
@@ -26682,6 +26735,8 @@ export {
|
|
|
26682
26735
|
CODE_UNBIND_READBACK_UNREADABLE,
|
|
26683
26736
|
CODE_UNBIND_REFUSED,
|
|
26684
26737
|
CODE_WORDS,
|
|
26738
|
+
COLUMN_SLOT_REBIND_SQL_KEYS,
|
|
26739
|
+
COLUMN_SLOT_SQL_KEYS,
|
|
26685
26740
|
CONTROL_BUFFER_LIMIT,
|
|
26686
26741
|
CREDENTIAL_STORE_MODES,
|
|
26687
26742
|
CliError,
|
|
@@ -26857,6 +26912,7 @@ export {
|
|
|
26857
26912
|
WAIVER_REPLAY,
|
|
26858
26913
|
WARNED_ROUND_STATES,
|
|
26859
26914
|
WORKSPACES_PATH,
|
|
26915
|
+
WORKSPACE_KEY_HEADER,
|
|
26860
26916
|
WORK_DIRNAME,
|
|
26861
26917
|
WRITE_RECOVERY_WORDS,
|
|
26862
26918
|
WorkLayout,
|
|
@@ -26970,6 +27026,8 @@ export {
|
|
|
26970
27026
|
formatRows,
|
|
26971
27027
|
fromAxiosError,
|
|
26972
27028
|
getCacheStats,
|
|
27029
|
+
getColumnSlotSql,
|
|
27030
|
+
getColumnSlots,
|
|
26973
27031
|
getMiniStatus,
|
|
26974
27032
|
getScriptTask,
|
|
26975
27033
|
getSettingDomain,
|