@hcmai/sdk 0.15.11 → 0.15.13

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 CHANGED
@@ -396,6 +396,14 @@ interface RowResult {
396
396
  id?: string;
397
397
  error?: string;
398
398
  traceId?: string;
399
+ /**
400
+ * 这一行里**目标模型两种写法都不认**的键(原名)。只在非空时出现。
401
+ *
402
+ * 🔴 为什么它必须在行上:服务端对不认识的键连读都不读且不报错,`status: 'updated'`
403
+ * 只表示「这次请求被接受了」,不表示「值写进去了」。没有这一位,跑完全绿而数据是空的
404
+ * (hcm_nx_cli#277 · Jira HCMNX-111 现场:1024 行全绿、51200 格全空)。
405
+ */
406
+ unmappedFields?: string[];
399
407
  }
400
408
  interface ImportResult {
401
409
  created: number;
@@ -414,6 +422,14 @@ interface ImportResult {
414
422
  * 不区分就会让调用方以为整份数据都是自己造的,重跑或回滚时按错误的假设动手。
415
423
  */
416
424
  refsFromTarget: string[];
425
+ /**
426
+ * 字段清单**没读到**的那些 Model(旧后端 / 无权限 / 回空集)。这些 Model 的键按老规则
427
+ * 一律转驼峰发出,**没有做过校验**。
428
+ *
429
+ * 🔴 单列这一份,是为了不把「校验过、没问题」和「压根没校验」输出成同一个空的
430
+ * `unmappedFields` —— 后者下一步该做的是写后回读,前者不用。
431
+ */
432
+ fieldNamesUnverified: string[];
417
433
  }
418
434
  interface ImportOptions {
419
435
  dryRun?: boolean;
@@ -424,8 +440,33 @@ interface ImportOptions {
424
440
  /** snake_case → camelCase(单个 key)。 */
425
441
  declare function snakeToCamel(key: string): string;
426
442
  /** 转换 record 的**顶层** key:snake_case → camelCase。
427
- * 嵌套对象/数组的值(jsonb / i18n)原样透传,不转内部键名(对齐 schema §4)。 */
443
+ * 嵌套对象/数组的值(jsonb / i18n)原样透传,不转内部键名(对齐 schema §4)。
444
+ *
445
+ * 🔴 **写入路径别直接用它**,用 {@link resolveItemKeys}:无条件转会改掉真名本身带下划线的
446
+ * 字段名(见那边的说明)。这里留着是因为拿不到字段清单时仍要退回这条老规则。 */
428
447
  declare function camelizeKeys(obj: Record<string, unknown>): Record<string, unknown>;
448
+ /** 一行归一的结果:按什么名字发出去,以及哪些键目标模型两种写法都不认。 */
449
+ interface KeyResolution {
450
+ payload: Record<string, unknown>;
451
+ /** 原样写法与驼峰写法模型都不认的键(原名)。空数组表示没有这种键。 */
452
+ unmapped: string[];
453
+ }
454
+ /**
455
+ * 模型感知的顶层键归一:**目标模型认得原名就原样保留**,否则才 snake_case → camelCase。
456
+ *
457
+ * 🔴 为什么不能无条件转:真名本身带下划线的字段(租户扩展字段是典型,另有仓内 87 个
458
+ * `_metas` 字段)会被改成一个模型不认识的键;而服务端按元数据遍历字段,**不认识的键连读都不读**,
459
+ * 于是写入返 200 / 报告记 updated / 值一个没落。同一条规则在服务端那份载体上已经修过
460
+ * (hcm_nx_core#2023:模型认可原始下划线键时保留原名),客户端这份是第二个载体
461
+ * (hcm_nx_cli#277 · Jira HCMNX-111)。
462
+ *
463
+ * `knownKeys` 传 `null` 或空集表示**没拿到**字段清单(不是「这个模型没有字段」):那时退回
464
+ * 无条件转,并由调用方在整轮结果上留「未校验」标记 —— 兜底不禁止,不自陈的兜底才禁止。
465
+ *
466
+ * 两种写法都不认时发**原名**:我们没有任何证据说驼峰那个更对,发原名能让服务端的回执与
467
+ * 作者写下的键对得上。
468
+ */
469
+ declare function resolveItemKeys(obj: Record<string, unknown>, knownKeys: ReadonlySet<string> | null): KeyResolution;
429
470
 
430
471
  declare class RefStore {
431
472
  private map;
@@ -450,13 +491,21 @@ declare function resolveRefs(record: Record<string, unknown>, store: RefStore):
450
491
  /** 解析 + 校验单个 data fixture(对齐 spec §10 校验项 1–4)。 */
451
492
  declare function parseFixture(yamlText: string, sourcePath?: string): Fixture;
452
493
 
453
- /** runner 只依赖 client 的这三个方法,便于单测 stub。 */
494
+ /** runner 只依赖 client 的这四个方法,便于单测 stub。 */
454
495
  interface ImportClient {
455
496
  findIdByKey(model: string, keyField: string, keyValue: string): Promise<string | null>;
456
497
  create(model: string, data: Record<string, unknown>): Promise<{
457
498
  id: string;
458
499
  }>;
459
500
  update(model: string, id: string, data: Record<string, unknown>): Promise<unknown>;
501
+ /**
502
+ * 目标模型写入侧认得哪些字段键(含租户扩展字段)。字段名归一靠它才能不改错名字
503
+ * (见 {@link resolveItemKeys})。
504
+ *
505
+ * 读不到就**抛**或回空数组,runner 会退回老规则并在结果里留「未校验」标记 ——
506
+ * 不许在这里编一份猜的清单,那会让「校验过」与「猜的」同值。
507
+ */
508
+ fieldKeys(model: string): Promise<string[]>;
460
509
  }
461
510
  declare function runImport(client: ImportClient, fixtures: Fixture[], opts?: ImportOptions): Promise<ImportResult>;
462
511
 
@@ -545,6 +594,11 @@ declare class HcmClient {
545
594
  create(model: string, data: Record<string, unknown>, opts?: WriteOpts): Promise<CreateResult>;
546
595
  update(model: string, id: string, data: Record<string, unknown>, opts?: WriteOpts): Promise<CreateResult>;
547
596
  remove(model: string, id: string): Promise<RemoveResult>;
597
+ /**
598
+ * 目标模型写入侧认得哪些字段键(含租户扩展字段)—— import 的字段名归一靠它。
599
+ * 读不到就让异常上抛:runner 会退回老规则并在结果里留「未校验」标记。
600
+ */
601
+ fieldKeys(model: string): Promise<string[]>;
548
602
  /** 按业务键查已存在记录的 id(幂等用);命中返回 id,否则 null。 */
549
603
  findIdByKey(model: string, keyField: string, keyValue: string): Promise<string | null>;
550
604
  importPackage(fixtures: Fixture[], opts?: ImportOptions): Promise<ImportResult>;
@@ -6600,4 +6654,4 @@ type ParsedRef = {
6600
6654
  declare function parseRef(raw: string, project: string, casesSlug?: string): ParsedRef | null;
6601
6655
  declare const firstLine: (s: string) => string;
6602
6656
 
6603
- 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_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, DOCTOR_ANCHORS, DRY_RUN_NOTE, DRY_RUN_TAIL, type DataPackageInstallRunView, type DataPackageInstallView, type Premise$1 as DeliveryPremise, type DeliveryRun, type DescribeOpts, type DeviceAuthorization, type DoctorAnchor, type DoctorCheck, type DoctorReport, DriftDetected, 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, JiraHttpError, type JiraIssue, type JiraIssueTypeMeta, type JiraNamed, type JiraProject, type JiraRemoteLink, type JiraStatusFlow, type JiraTokenSource, type JiraTransition, type JiraTransitionField, type JiraUser, Journal, JournalError, KIT_CARRY_OVER_KEY, KIT_CRAWLED_AT_FILE, KIT_MATCHED_ON, 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, MINI_CONTEXT_FILE, MINI_CONTEXT_KIND, MINI_CONTEXT_VERSION, MINI_PULL_MANIFEST_FILE, MINI_REMOTE_ROOT, 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 MiniVerifyPreviewUrl, type MiniVerifyReport, type MiniVerifySummary, type MiniWritableTemplateConfig, type ModelDescription, type ModelEntry, type ModelQueryDsl, NETWORK_GATES, NEXT_STEP, NOT_COVERED_LAYER1, NOT_COVERED_LAYER2, NOT_COVERED_SELF, 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 TenantResetReceipt, type TimelineItemLite, type TokenRecord, TokenStore, type ToolCallFailedPayload, type ToolCallResultPayload, type ToolCallStartedPayload, type TriageEntry, type TriageProblem, type TriageProblemRow, type TriageRoundResult, type TriageVerdict, 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, 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, commandsFor, compareFingerprint, computeFingerprint, computeReconSourceKey, contentHash, conversationStateFile, conversationWebSocketEndpoint, create, createConversation, createHttpClient, createJiraClient, createV4Reducer, createWorkspaceFile, credentialsFile, defaultDownloadDir, defaultMiniRequiredScopes, deleteDocument, deleteEnv, deleteIdentity, deleteTenantMeta, deleteWorkspaceFile, deliveryRunFields, deriveNamelessToolLabel, 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, 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, journalNote, judgeDrift, 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, 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, probeExtensionSource, profileDir, profileFile, pullMiniAppProject, pushMiniAppProject, queryScriptLogs, readImportPlan, readMiniContext, readPullManifest, readSessionPrincipal, rebind, rebindPayload, refreshToken, releasePendingImpersonationSessions, remove, renameIdentity, renderEnvYaml, renderFind, renderRound, renderTriage, renderValues, replHistoryFile, repoIssueUrl, requestCliAuthorization, resetSettingItem, resetTenant, resolveActiveEnv, resolveActiveIdentity, resolveActiveProfile, resolveAllSkillsInstallOrder, resolveBaselineDir, resolveChironBase, resolveCredentialStoreMode, resolveEnvContext, resolveProjectEnvironment, resolveRefs, resolveSkillInstallOrder, respondToInteraction, riskFromArtifacts, roundAge, roundWarning, runActiveVerify, runDoctor, 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, valueState, valuesRoundCaveat, verifyAttention, verifyRc, verifyText, waitForInstallRun, watchBrowserAuthorization, workspaceLayer, writeChangeState, writeImportPlan, writeRisk };
6657
+ 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_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, DOCTOR_ANCHORS, DRY_RUN_NOTE, DRY_RUN_TAIL, type DataPackageInstallRunView, type DataPackageInstallView, type Premise$1 as DeliveryPremise, type DeliveryRun, type DescribeOpts, type DeviceAuthorization, type DoctorAnchor, type DoctorCheck, type DoctorReport, DriftDetected, 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, JiraHttpError, type JiraIssue, type JiraIssueTypeMeta, type JiraNamed, type JiraProject, type JiraRemoteLink, type JiraStatusFlow, 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, MINI_CONTEXT_FILE, MINI_CONTEXT_KIND, MINI_CONTEXT_VERSION, MINI_PULL_MANIFEST_FILE, MINI_REMOTE_ROOT, 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 MiniVerifyPreviewUrl, type MiniVerifyReport, type MiniVerifySummary, type MiniWritableTemplateConfig, type ModelDescription, type ModelEntry, type ModelQueryDsl, NETWORK_GATES, NEXT_STEP, NOT_COVERED_LAYER1, NOT_COVERED_LAYER2, NOT_COVERED_SELF, 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 TenantResetReceipt, type TimelineItemLite, type TokenRecord, TokenStore, type ToolCallFailedPayload, type ToolCallResultPayload, type ToolCallStartedPayload, type TriageEntry, type TriageProblem, type TriageProblemRow, type TriageRoundResult, type TriageVerdict, 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, 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, commandsFor, compareFingerprint, computeFingerprint, computeReconSourceKey, contentHash, conversationStateFile, conversationWebSocketEndpoint, create, createConversation, createHttpClient, createJiraClient, createV4Reducer, createWorkspaceFile, credentialsFile, defaultDownloadDir, defaultMiniRequiredScopes, deleteDocument, deleteEnv, deleteIdentity, deleteTenantMeta, deleteWorkspaceFile, deliveryRunFields, deriveNamelessToolLabel, 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, 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, journalNote, judgeDrift, 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, 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, probeExtensionSource, profileDir, profileFile, pullMiniAppProject, pushMiniAppProject, queryScriptLogs, readImportPlan, readMiniContext, readPullManifest, readSessionPrincipal, rebind, rebindPayload, 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, runDoctor, 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, valueState, valuesRoundCaveat, verifyAttention, verifyRc, verifyText, waitForInstallRun, watchBrowserAuthorization, workspaceLayer, writeChangeState, writeImportPlan, writeRisk };
package/dist/index.js CHANGED
@@ -317,6 +317,11 @@ function normalizeActionParams(action3) {
317
317
  type: action3.paramTypes?.[index] ?? "unknown"
318
318
  }));
319
319
  }
320
+ async function fetchModelFieldKeys(http, model) {
321
+ const resp = await http.get(`/api/models/${model}/meta`);
322
+ const fields = resp.data?.fields ?? [];
323
+ return fields.map((f) => f.key).filter((k) => typeof k === "string" && k.length > 0);
324
+ }
320
325
  async function describe(http, model, _opts = {}) {
321
326
  const [metaResp, effective] = await Promise.all([
322
327
  http.get(`/api/models/${model}/meta`),
@@ -1858,6 +1863,27 @@ function camelizeKeys(obj) {
1858
1863
  }
1859
1864
  return out;
1860
1865
  }
1866
+ function resolveItemKeys(obj, knownKeys) {
1867
+ if (knownKeys === null || knownKeys.size === 0) {
1868
+ return { payload: camelizeKeys(obj), unmapped: [] };
1869
+ }
1870
+ const payload = {};
1871
+ const unmapped = [];
1872
+ for (const [k, v] of Object.entries(obj)) {
1873
+ if (knownKeys.has(k)) {
1874
+ payload[k] = v;
1875
+ continue;
1876
+ }
1877
+ const camel = snakeToCamel(k);
1878
+ if (knownKeys.has(camel)) {
1879
+ payload[camel] = v;
1880
+ continue;
1881
+ }
1882
+ payload[k] = v;
1883
+ unmapped.push(k);
1884
+ }
1885
+ return { payload, unmapped };
1886
+ }
1861
1887
 
1862
1888
  // src/import/placeholder.ts
1863
1889
  var PLACEHOLDER_RE = /^\$\{([A-Za-z0-9_]+):([^}]+)\}$/;
@@ -1948,12 +1974,29 @@ async function runImport(client, fixtures, opts = {}) {
1948
1974
  const rows = [];
1949
1975
  const tally = { created: 0, updated: 0, skipped: 0, failed: 0 };
1950
1976
  const refsFromTarget = [];
1977
+ const knownKeysOf = /* @__PURE__ */ new Map();
1978
+ const fieldNamesUnverified = [];
1951
1979
  const result = () => ({
1952
1980
  ...tally,
1953
1981
  rows,
1954
1982
  refs: store.snapshot(),
1955
- refsFromTarget: [...refsFromTarget]
1983
+ refsFromTarget: [...refsFromTarget],
1984
+ fieldNamesUnverified: [...fieldNamesUnverified]
1956
1985
  });
1986
+ const knownKeysFor = async (model) => {
1987
+ if (!knownKeysOf.has(model)) {
1988
+ let resolved = null;
1989
+ try {
1990
+ const keys = await client.fieldKeys(model);
1991
+ resolved = keys.length > 0 ? new Set(keys) : null;
1992
+ } catch {
1993
+ resolved = null;
1994
+ }
1995
+ if (resolved === null) fieldNamesUnverified.push(model);
1996
+ knownKeysOf.set(model, resolved);
1997
+ }
1998
+ return knownKeysOf.get(model) ?? null;
1999
+ };
1957
2000
  const keyFieldOf = /* @__PURE__ */ new Map();
1958
2001
  for (const fx of fixtures) {
1959
2002
  if (fx?.model && fx.key_field) keyFieldOf.set(fx.model, fx.key_field);
@@ -1984,22 +2027,23 @@ async function runImport(client, fixtures, opts = {}) {
1984
2027
  tally.skipped++;
1985
2028
  continue;
1986
2029
  }
1987
- const payload = camelizeKeys(resolved);
2030
+ const { payload, unmapped } = resolveItemKeys(resolved, await knownKeysFor(fx.model));
2031
+ const unmappedNote = unmapped.length > 0 ? { unmappedFields: unmapped } : {};
1988
2032
  try {
1989
2033
  const existingId = await client.findIdByKey(fx.model, fx.key_field, key);
1990
2034
  if (existingId && !opts.updateOnly) {
1991
2035
  store.register(fx.model, key, existingId);
1992
- rows.push({ model: fx.model, key, status: "skipped", id: existingId });
2036
+ rows.push({ model: fx.model, key, status: "skipped", id: existingId, ...unmappedNote });
1993
2037
  tally.skipped++;
1994
2038
  } else if (existingId && opts.updateOnly) {
1995
2039
  await client.update(fx.model, existingId, payload);
1996
2040
  store.register(fx.model, key, existingId);
1997
- rows.push({ model: fx.model, key, status: "updated", id: existingId });
2041
+ rows.push({ model: fx.model, key, status: "updated", id: existingId, ...unmappedNote });
1998
2042
  tally.updated++;
1999
2043
  } else {
2000
2044
  const created = await client.create(fx.model, payload);
2001
2045
  store.register(fx.model, key, created.id);
2002
- rows.push({ model: fx.model, key, status: "created", id: created.id });
2046
+ rows.push({ model: fx.model, key, status: "created", id: created.id, ...unmappedNote });
2003
2047
  tally.created++;
2004
2048
  }
2005
2049
  } catch (e) {
@@ -2153,6 +2197,13 @@ var HcmClient = class _HcmClient {
2153
2197
  remove(model, id) {
2154
2198
  return remove(this.http, model, id);
2155
2199
  }
2200
+ /**
2201
+ * 目标模型写入侧认得哪些字段键(含租户扩展字段)—— import 的字段名归一靠它。
2202
+ * 读不到就让异常上抛:runner 会退回老规则并在结果里留「未校验」标记。
2203
+ */
2204
+ fieldKeys(model) {
2205
+ return fetchModelFieldKeys(this.http, model);
2206
+ }
2156
2207
  /** 按业务键查已存在记录的 id(幂等用);命中返回 id,否则 null。 */
2157
2208
  async findIdByKey(model, keyField, keyValue) {
2158
2209
  const res = await this.query(model, { filter: { [keyField]: keyValue }, limit: 1 });
@@ -22995,6 +23046,7 @@ export {
22995
23046
  resolveChironBase,
22996
23047
  resolveCredentialStoreMode,
22997
23048
  resolveEnvContext,
23049
+ resolveItemKeys,
22998
23050
  resolveProjectEnvironment,
22999
23051
  resolveRefs,
23000
23052
  resolveSkillInstallOrder,