@kici-dev/shared 0.1.13 → 0.1.15

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.
Files changed (47) hide show
  1. package/README.md +13 -1
  2. package/dist/cold-store/chunk-encoder.js +1 -1
  3. package/dist/cold-store/chunk-id.js +1 -1
  4. package/dist/cold-store/cold-store.js +1 -1
  5. package/dist/db-admin.d.ts +39 -0
  6. package/dist/db-admin.js +60 -5
  7. package/dist/db.d.ts +20 -1
  8. package/dist/db.js +34 -2
  9. package/dist/db.test.d.ts +2 -0
  10. package/dist/env/define-env.js +27 -6
  11. package/dist/env/logger-env.d.ts +1 -1
  12. package/dist/graceful-shutdown.d.ts +13 -1
  13. package/dist/graceful-shutdown.js +24 -10
  14. package/dist/idempotency.d.ts +1 -67
  15. package/dist/idempotency.js +2 -48
  16. package/dist/index.d.ts +3 -9
  17. package/dist/index.js +3 -9
  18. package/dist/package-manager-types.d.ts +1 -21
  19. package/dist/package-manager-types.js +2 -34
  20. package/dist/package-manager.d.ts +1 -51
  21. package/dist/package-manager.js +2 -130
  22. package/dist/s3-client.js +4 -1
  23. package/dist/s3-client.test.d.ts +2 -0
  24. package/dist/ts-loader-hook.d.ts +1 -25
  25. package/dist/ts-loader-hook.js +2 -47
  26. package/package.json +12 -7
  27. package/sbom.spdx.json +60 -5
  28. package/dist/crypto.d.ts +0 -33
  29. package/dist/crypto.js +0 -67
  30. package/dist/error.d.ts +0 -16
  31. package/dist/error.js +0 -58
  32. package/dist/error.test.d.ts +0 -2
  33. package/dist/format-bytes.d.ts +0 -5
  34. package/dist/format-bytes.js +0 -15
  35. package/dist/format-bytes.test.d.ts +0 -2
  36. package/dist/format-duration.d.ts +0 -11
  37. package/dist/format-duration.js +0 -32
  38. package/dist/format-duration.test.d.ts +0 -2
  39. package/dist/idempotency.test.d.ts +0 -2
  40. package/dist/logger.d.ts +0 -60
  41. package/dist/logger.js +0 -181
  42. package/dist/logger.test.d.ts +0 -2
  43. package/dist/package-manager.test.d.ts +0 -2
  44. package/dist/request-context.d.ts +0 -42
  45. package/dist/request-context.js +0 -37
  46. package/dist/zx.d.ts +0 -8
  47. package/dist/zx.js +0 -78
package/dist/index.d.ts CHANGED
@@ -1,16 +1,10 @@
1
+ export * from '@kici-dev/core';
1
2
  export { RingBuffer } from './ring-buffer.js';
2
- export { toErrorMessage, serializeError } from './error.js';
3
- export { createPool, createDb } from './db.js';
4
- export { parseDatabaseUrl, maskDatabaseUrl, dropAndCreateDatabase, dropDatabaseDirect, ensureDatabase, type EnsureDatabaseOpts, createDbRole, createReadOnlyDbUser, computeMigrationsHash, storeMigrationContentHash, readStoredMigrationContentHash, isSchemaCurrent, clearDispatchQueueDirect, purgeStaleExecutionDirect, purgeStaleSourcesDirect, purgeScopedSecretsDirect, seedEnvironmentDirect, seedEnvironmentBindingDirect, setEnvironmentPolicyDirect, listEnvironmentsDirect, showEnvironmentDirect, createEnvironmentTemplateDirect, setEnvironmentSecretDirect, listQueueDirect, showQueueEntryDirect, listExecutionRunsDirect, showExecutionRunDirect, listExecutionJobsDirect, listRegistrationsDirect, showRegistrationDirect, registerWorkflowManualDirect, resetRaftStateDirect, emitKiciEventDirect, seedGenericWebhookSourceDirect, purgeSecretBackendsDirect, apiKeyExistsDirect, seedApiKeyInlineDirect, platformConnectionExistsDirect, countWebhookSourcesByConnectionIdDirect, getWebhookSourceByRoutingKeyDirect, findAnyUserApiKeyIdDirect, seedSyntheticGithubSourceDirect, seedWebhookSecretDirect, seedSourcePrivateKeyDirect, bumpRegistryVersionDirect, pollKiciEventsDirect, waitForPostgresDirect, waitForRunCompletionDirect, cleanupExecutionRowsDirect, isSchemaCurrentFromFilesDirect, storeMigrationContentHashInTableDirect, createJoinTokenDirect, updateSourceRoutingKeyDirect, prunePeerCredentialsDirect, waitForPlatformRegistrationsDirect, seedUniversalGitSourceDirect, seedCiSecurityFixturesDirect, waitForExecutionRunStatusSinceDirect, latestExecutionRunByStatusDirect, waitForLatestExecutionJobStatusDirect, describeTableColumnsDirect, tableExistsDirect, insertKiciEventRawDirect, showKiciEventDirect, listKiciEventsDirect, deleteKiciEventsDirect, verifyKiciEventNotifyDirect, seedCrossRepoTrustDirect, listCrossRepoTrustBySourceRoutingKeyDirect, deleteCrossRepoTrustDirect, insertCrossRepoTrustStrictDirect, deleteWorkflowRegistrationsDirect, getWorkflowRegistrationByIdDirect, listRegistrationsByRoutingKeyDirect, waitForRegistrationsByRoutingKeyDirect, waitForRegistrationsUpdatedAtAdvanceDirect, updateWorkflowRegistrationCommitShaDirect, insertWorkflowRegistrationRawDirect, insertWorkflowRegistrationStrictDirect, getRegistryVersionDirect, bumpRegistryVersionSimpleDirect, upsertCronLastFiredDirect, countCronLastFiredDirect, insertCronLastFiredNowDirect, deleteCronLastFiredDirect, deleteExecutionRunsByWorkflowNameDirect, getGenericWebhookSourceByRoutingKeyDirect, listActiveGenericWebhookSourcesDirect, updateGenericWebhookVerificationConfigDirect, deleteGenericWebhookSourcesByNameDirect, restoreSoftDeletedGenericWebhookSourceDirect, upsertOrgSettingsGlobalWorkflowsDirect, updateOrgSettingsDeniedReposDirect, deleteOrgSettingsByCustomerIdDirect, getExecutionRunSecurityDirect, getHeldRunByIdDirect, countHeldRunsByRunIdDirect, waitForPlatformExecutionRunStatusDirect, waitForPlatformEventLogDistinctRoutedDirect, waitForEventLogRowByDeliveryIdDirect, resolvePlatformWebhookSourceRoutingKeyDirect, ensureOrgOwnerMemberDirect, deletePeerCredentialsByInstanceIdLikeDirect, insertPeerCredentialExpiredDirect, getPeerCredentialRevokedAtDirect, listActivePeerCredentialsExcludingDirect, clearPeerCredentialsRevokedAtByIdsDirect, countActivePeerCredentialsByInstanceDirect, type ColumnInfo, type KiciEventRow, type CrossRepoTrustRow, type WorkflowRegistrationFullRow, type RegistrationsScopedResult, type LatestExecutionRunResult, type WaitForLatestJobResult, type ExecutionRunSecurityRow, type HeldRunSecurityRow, type EventLogRow as PlatformEventLogRow, type UpsertOrgSettingsOpts, type OrgSettingsRepoPatternEntry, type InsertKiciEventRawOpts, type EmitKiciEventOpts, type SeedGenericWebhookSourceOpts, REGISTERABLE_TRIGGER_TYPES, MIGRATION_HASH_TABLE, type PurgeStaleExecutionResult, type PurgeStaleSourcesResult, type SeedEnvironmentOpts, type SeedEnvironmentResult, type SeedEnvironmentBindingOpts, type SetEnvironmentPolicyOpts, type EnvironmentRow, type EnvironmentVariableRow, type EnvironmentBindingRow, type ShowEnvironmentResult, type CreateEnvironmentTemplateOpts, type SetEnvironmentSecretOpts, type DispatchQueueRow, type ListQueueOpts, type ExecutionRunRow, type ExecutionJobRow, type ListExecutionRunsOpts, type WorkflowRegistrationRow, type ListRegistrationsOpts, type ListRegistrationsResult, type ShowRegistrationResult, type RegisterWorkflowManualOpts, type RegisterWorkflowManualResult, } from './db-admin.js';
3
+ export { createPool, createDb, type CreatePoolOptions, type PgPoolErrorSource } from './db.js';
4
+ export { parseDatabaseUrl, maskDatabaseUrl, dropAndCreateDatabase, dropDatabaseDirect, ensureDatabase, type EnsureDatabaseOpts, createDbRole, createReadOnlyDbUser, computeMigrationsHash, storeMigrationContentHash, readStoredMigrationContentHash, isSchemaCurrent, clearDispatchQueueDirect, purgeStaleExecutionDirect, purgeStaleSourcesDirect, purgeScopedSecretsDirect, seedEnvironmentDirect, deleteEnvironmentDirect, seedEnvironmentBindingDirect, setEnvironmentPolicyDirect, listEnvironmentsDirect, showEnvironmentDirect, createEnvironmentTemplateDirect, setEnvironmentSecretDirect, listQueueDirect, showQueueEntryDirect, listExecutionRunsDirect, showExecutionRunDirect, listExecutionJobsDirect, listRegistrationsDirect, showRegistrationDirect, registerWorkflowManualDirect, resetRaftStateDirect, emitKiciEventDirect, seedGenericWebhookSourceDirect, purgeSecretBackendsDirect, apiKeyExistsDirect, seedApiKeyInlineDirect, platformConnectionExistsDirect, countWebhookSourcesByConnectionIdDirect, getWebhookSourceByRoutingKeyDirect, findAnyUserApiKeyIdDirect, seedSyntheticGithubSourceDirect, seedWebhookSecretDirect, seedSourcePrivateKeyDirect, bumpRegistryVersionDirect, pollKiciEventsDirect, waitForPostgresDirect, waitForRunCompletionDirect, cleanupExecutionRowsDirect, isSchemaCurrentFromFilesDirect, storeMigrationContentHashInTableDirect, createJoinTokenDirect, updateSourceRoutingKeyDirect, prunePeerCredentialsDirect, waitForPlatformRegistrationsDirect, seedUniversalGitSourceDirect, seedCiSecurityFixturesDirect, waitForExecutionRunStatusSinceDirect, latestExecutionRunByStatusDirect, waitForLatestExecutionJobStatusDirect, describeTableColumnsDirect, tableExistsDirect, insertKiciEventRawDirect, showKiciEventDirect, listKiciEventsDirect, deleteKiciEventsDirect, verifyKiciEventNotifyDirect, seedCrossRepoTrustDirect, listCrossRepoTrustBySourceRoutingKeyDirect, deleteCrossRepoTrustDirect, insertCrossRepoTrustStrictDirect, deleteWorkflowRegistrationsDirect, getWorkflowRegistrationByIdDirect, listRegistrationsByRoutingKeyDirect, waitForRegistrationsByRoutingKeyDirect, waitForRegistrationsUpdatedAtAdvanceDirect, updateWorkflowRegistrationCommitShaDirect, insertWorkflowRegistrationRawDirect, insertWorkflowRegistrationStrictDirect, getRegistryVersionDirect, bumpRegistryVersionSimpleDirect, upsertCronLastFiredDirect, countCronLastFiredDirect, insertCronLastFiredNowDirect, deleteCronLastFiredDirect, deleteExecutionRunsByWorkflowNameDirect, getGenericWebhookSourceByRoutingKeyDirect, listActiveGenericWebhookSourcesDirect, updateGenericWebhookVerificationConfigDirect, deleteGenericWebhookSourcesByNameDirect, restoreSoftDeletedGenericWebhookSourceDirect, upsertOrgSettingsGlobalWorkflowsDirect, updateOrgSettingsDeniedReposDirect, deleteOrgSettingsByCustomerIdDirect, getExecutionRunSecurityDirect, getHeldRunByIdDirect, countHeldRunsByRunIdDirect, waitForPlatformExecutionRunStatusDirect, waitForPlatformEventLogDistinctRoutedDirect, waitForEventLogRowByDeliveryIdDirect, resolvePlatformWebhookSourceRoutingKeyDirect, ensureOrgOwnerMemberDirect, deletePeerCredentialsByInstanceIdLikeDirect, insertPeerCredentialExpiredDirect, getPeerCredentialRevokedAtDirect, listActivePeerCredentialsExcludingDirect, clearPeerCredentialsRevokedAtByIdsDirect, countActivePeerCredentialsByInstanceDirect, terminateIdleDbBackendsDirect, type ColumnInfo, type KiciEventRow, type CrossRepoTrustRow, type WorkflowRegistrationFullRow, type RegistrationsScopedResult, type LatestExecutionRunResult, type WaitForLatestJobResult, type ExecutionRunSecurityRow, type HeldRunSecurityRow, type EventLogRow as PlatformEventLogRow, type UpsertOrgSettingsOpts, type OrgSettingsRepoPatternEntry, type InsertKiciEventRawOpts, type EmitKiciEventOpts, type SeedGenericWebhookSourceOpts, REGISTERABLE_TRIGGER_TYPES, MIGRATION_HASH_TABLE, type PurgeStaleExecutionResult, type PurgeStaleSourcesResult, type SeedEnvironmentOpts, type SeedEnvironmentResult, type SeedEnvironmentBindingOpts, type SetEnvironmentPolicyOpts, type EnvironmentRow, type EnvironmentVariableRow, type EnvironmentBindingRow, type ShowEnvironmentResult, type CreateEnvironmentTemplateOpts, type SetEnvironmentSecretOpts, type DispatchQueueRow, type ListQueueOpts, type ExecutionRunRow, type ExecutionJobRow, type ListExecutionRunsOpts, type WorkflowRegistrationRow, type ListRegistrationsOpts, type ListRegistrationsResult, type ShowRegistrationResult, type RegisterWorkflowManualOpts, type RegisterWorkflowManualResult, } from './db-admin.js';
5
5
  export { createMetricsRoutes, type MetricsRoutesDeps } from './routes/metrics.js';
6
6
  export { createHealthRoutes, type HealthRoutesDeps } from './routes/health.js';
7
- export { initZx } from './zx.js';
8
- export { createLogger, guardStartup, logger, setServiceName, type LogLevel, type Logger, } from './logger.js';
9
- export { requestContext, getRequestContext, enrichRequestContext, type RequestContext, } from './request-context.js';
10
7
  export { getReconnectDelay } from './reconnect-delay.js';
11
- export { formatBytes } from './format-bytes.js';
12
- export { formatDuration, formatUptime } from './format-duration.js';
13
- export { sha256, sha256File, deriveSharedSecret, normalizeLineEndings } from './crypto.js';
14
8
  export { initTelemetry, getPrometheusExporter, collectRuntimeMetricNames, createMeter, type TelemetryConfig, } from './telemetry/index.js';
15
9
  export { setupGracefulShutdown, type ShutdownStep, type ShutdownLogger, type ShutdownHandle, type GracefulShutdownOptions, } from './graceful-shutdown.js';
16
10
  export { validateRequiredTools, type ToolRequirement } from './tool-check.js';
package/dist/index.js CHANGED
@@ -1,17 +1,10 @@
1
1
  import "./chunk-gOLHoazu.js";
2
- import { deriveSharedSecret, normalizeLineEndings, sha256, sha256File } from "./crypto.js";
3
2
  import { createDb, createPool } from "./db.js";
4
- import { MIGRATION_HASH_TABLE, REGISTERABLE_TRIGGER_TYPES, apiKeyExistsDirect, bumpRegistryVersionDirect, bumpRegistryVersionSimpleDirect, cleanupExecutionRowsDirect, clearDispatchQueueDirect, clearPeerCredentialsRevokedAtByIdsDirect, computeMigrationsHash, countActivePeerCredentialsByInstanceDirect, countCronLastFiredDirect, countHeldRunsByRunIdDirect, countWebhookSourcesByConnectionIdDirect, createDbRole, createEnvironmentTemplateDirect, createJoinTokenDirect, createReadOnlyDbUser, deleteCronLastFiredDirect, deleteCrossRepoTrustDirect, deleteExecutionRunsByWorkflowNameDirect, deleteGenericWebhookSourcesByNameDirect, deleteKiciEventsDirect, deleteOrgSettingsByCustomerIdDirect, deletePeerCredentialsByInstanceIdLikeDirect, deleteWorkflowRegistrationsDirect, describeTableColumnsDirect, dropAndCreateDatabase, dropDatabaseDirect, emitKiciEventDirect, ensureDatabase, ensureOrgOwnerMemberDirect, findAnyUserApiKeyIdDirect, getExecutionRunSecurityDirect, getGenericWebhookSourceByRoutingKeyDirect, getHeldRunByIdDirect, getPeerCredentialRevokedAtDirect, getRegistryVersionDirect, getWebhookSourceByRoutingKeyDirect, getWorkflowRegistrationByIdDirect, insertCronLastFiredNowDirect, insertCrossRepoTrustStrictDirect, insertKiciEventRawDirect, insertPeerCredentialExpiredDirect, insertWorkflowRegistrationRawDirect, insertWorkflowRegistrationStrictDirect, isSchemaCurrent, isSchemaCurrentFromFilesDirect, latestExecutionRunByStatusDirect, listActiveGenericWebhookSourcesDirect, listActivePeerCredentialsExcludingDirect, listCrossRepoTrustBySourceRoutingKeyDirect, listEnvironmentsDirect, listExecutionJobsDirect, listExecutionRunsDirect, listKiciEventsDirect, listQueueDirect, listRegistrationsByRoutingKeyDirect, listRegistrationsDirect, maskDatabaseUrl, parseDatabaseUrl, platformConnectionExistsDirect, pollKiciEventsDirect, prunePeerCredentialsDirect, purgeScopedSecretsDirect, purgeSecretBackendsDirect, purgeStaleExecutionDirect, purgeStaleSourcesDirect, readStoredMigrationContentHash, registerWorkflowManualDirect, resetRaftStateDirect, resolvePlatformWebhookSourceRoutingKeyDirect, restoreSoftDeletedGenericWebhookSourceDirect, seedApiKeyInlineDirect, seedCiSecurityFixturesDirect, seedCrossRepoTrustDirect, seedEnvironmentBindingDirect, seedEnvironmentDirect, seedGenericWebhookSourceDirect, seedSourcePrivateKeyDirect, seedSyntheticGithubSourceDirect, seedUniversalGitSourceDirect, seedWebhookSecretDirect, setEnvironmentPolicyDirect, setEnvironmentSecretDirect, showEnvironmentDirect, showExecutionRunDirect, showKiciEventDirect, showQueueEntryDirect, showRegistrationDirect, storeMigrationContentHash, storeMigrationContentHashInTableDirect, tableExistsDirect, updateGenericWebhookVerificationConfigDirect, updateOrgSettingsDeniedReposDirect, updateSourceRoutingKeyDirect, updateWorkflowRegistrationCommitShaDirect, upsertCronLastFiredDirect, upsertOrgSettingsGlobalWorkflowsDirect, verifyKiciEventNotifyDirect, waitForEventLogRowByDeliveryIdDirect, waitForExecutionRunStatusSinceDirect, waitForLatestExecutionJobStatusDirect, waitForPlatformEventLogDistinctRoutedDirect, waitForPlatformExecutionRunStatusDirect, waitForPlatformRegistrationsDirect, waitForPostgresDirect, waitForRegistrationsByRoutingKeyDirect, waitForRegistrationsUpdatedAtAdvanceDirect, waitForRunCompletionDirect } from "./db-admin.js";
5
- import { serializeError, toErrorMessage } from "./error.js";
6
- import { formatBytes } from "./format-bytes.js";
7
- import { formatDuration, formatUptime } from "./format-duration.js";
3
+ import { MIGRATION_HASH_TABLE, REGISTERABLE_TRIGGER_TYPES, apiKeyExistsDirect, bumpRegistryVersionDirect, bumpRegistryVersionSimpleDirect, cleanupExecutionRowsDirect, clearDispatchQueueDirect, clearPeerCredentialsRevokedAtByIdsDirect, computeMigrationsHash, countActivePeerCredentialsByInstanceDirect, countCronLastFiredDirect, countHeldRunsByRunIdDirect, countWebhookSourcesByConnectionIdDirect, createDbRole, createEnvironmentTemplateDirect, createJoinTokenDirect, createReadOnlyDbUser, deleteCronLastFiredDirect, deleteCrossRepoTrustDirect, deleteEnvironmentDirect, deleteExecutionRunsByWorkflowNameDirect, deleteGenericWebhookSourcesByNameDirect, deleteKiciEventsDirect, deleteOrgSettingsByCustomerIdDirect, deletePeerCredentialsByInstanceIdLikeDirect, deleteWorkflowRegistrationsDirect, describeTableColumnsDirect, dropAndCreateDatabase, dropDatabaseDirect, emitKiciEventDirect, ensureDatabase, ensureOrgOwnerMemberDirect, findAnyUserApiKeyIdDirect, getExecutionRunSecurityDirect, getGenericWebhookSourceByRoutingKeyDirect, getHeldRunByIdDirect, getPeerCredentialRevokedAtDirect, getRegistryVersionDirect, getWebhookSourceByRoutingKeyDirect, getWorkflowRegistrationByIdDirect, insertCronLastFiredNowDirect, insertCrossRepoTrustStrictDirect, insertKiciEventRawDirect, insertPeerCredentialExpiredDirect, insertWorkflowRegistrationRawDirect, insertWorkflowRegistrationStrictDirect, isSchemaCurrent, isSchemaCurrentFromFilesDirect, latestExecutionRunByStatusDirect, listActiveGenericWebhookSourcesDirect, listActivePeerCredentialsExcludingDirect, listCrossRepoTrustBySourceRoutingKeyDirect, listEnvironmentsDirect, listExecutionJobsDirect, listExecutionRunsDirect, listKiciEventsDirect, listQueueDirect, listRegistrationsByRoutingKeyDirect, listRegistrationsDirect, maskDatabaseUrl, parseDatabaseUrl, platformConnectionExistsDirect, pollKiciEventsDirect, prunePeerCredentialsDirect, purgeScopedSecretsDirect, purgeSecretBackendsDirect, purgeStaleExecutionDirect, purgeStaleSourcesDirect, readStoredMigrationContentHash, registerWorkflowManualDirect, resetRaftStateDirect, resolvePlatformWebhookSourceRoutingKeyDirect, restoreSoftDeletedGenericWebhookSourceDirect, seedApiKeyInlineDirect, seedCiSecurityFixturesDirect, seedCrossRepoTrustDirect, seedEnvironmentBindingDirect, seedEnvironmentDirect, seedGenericWebhookSourceDirect, seedSourcePrivateKeyDirect, seedSyntheticGithubSourceDirect, seedUniversalGitSourceDirect, seedWebhookSecretDirect, setEnvironmentPolicyDirect, setEnvironmentSecretDirect, showEnvironmentDirect, showExecutionRunDirect, showKiciEventDirect, showQueueEntryDirect, showRegistrationDirect, storeMigrationContentHash, storeMigrationContentHashInTableDirect, tableExistsDirect, terminateIdleDbBackendsDirect, updateGenericWebhookVerificationConfigDirect, updateOrgSettingsDeniedReposDirect, updateSourceRoutingKeyDirect, updateWorkflowRegistrationCommitShaDirect, upsertCronLastFiredDirect, upsertOrgSettingsGlobalWorkflowsDirect, verifyKiciEventNotifyDirect, waitForEventLogRowByDeliveryIdDirect, waitForExecutionRunStatusSinceDirect, waitForLatestExecutionJobStatusDirect, waitForPlatformEventLogDistinctRoutedDirect, waitForPlatformExecutionRunStatusDirect, waitForPlatformRegistrationsDirect, waitForPostgresDirect, waitForRegistrationsByRoutingKeyDirect, waitForRegistrationsUpdatedAtAdvanceDirect, waitForRunCompletionDirect } from "./db-admin.js";
8
4
  import { setupGracefulShutdown } from "./graceful-shutdown.js";
9
5
  import { RingBuffer } from "./ring-buffer.js";
10
6
  import { createMetricsRoutes } from "./routes/metrics.js";
11
7
  import { createHealthRoutes } from "./routes/health.js";
12
- import { initZx } from "./zx.js";
13
- import { enrichRequestContext, getRequestContext, requestContext } from "./request-context.js";
14
- import { createLogger, guardStartup, logger, setServiceName } from "./logger.js";
15
8
  import { getReconnectDelay } from "./reconnect-delay.js";
16
9
  import { collectRuntimeMetricNames, getPrometheusExporter, initTelemetry } from "./telemetry/init.js";
17
10
  import { createMeter } from "./telemetry/metrics.js";
@@ -28,4 +21,5 @@ import { BaseColdStore } from "./cold-store/cold-store.js";
28
21
  import { ChunkLru } from "./cold-store/lru.js";
29
22
  import { DEFAULT_TABLE_CONFIG, resolveTableConfig } from "./cold-store/config.js";
30
23
  import "./cold-store/index.js";
31
- export { BaseColdStore, COLD_BUCKET_NAMES, ChunkLru, DEFAULT_TABLE_CONFIG, MIGRATION_HASH_TABLE, REGISTERABLE_TRIGGER_TYPES, RingBuffer, apiKeyExistsDirect, bumpRegistryVersionDirect, bumpRegistryVersionSimpleDirect, chunkObjectKey, cleanupExecutionRowsDirect, clearDispatchQueueDirect, clearPeerCredentialsRevokedAtByIdsDirect, coldDaysToBucket, coldStoreArchiveBytesTotal, coldStoreArchiveCyclesTotal, coldStoreArchiveDurationSeconds, coldStoreArchiveRowsTotal, coldStorePurgeBytesTotal, coldStorePurgeChunksTotal, coldStorePurgeDurationSeconds, coldStoreRehydrateBytesTotal, coldStoreRehydrateDurationSeconds, coldStoreRehydrateRequestsTotal, coldStoreReplayDurationSeconds, coldStoreReplayRowsTotal, coldStoreVerifyFailuresTotal, collectRuntimeMetricNames, computeChunkId, computeMigrationsHash, countActivePeerCredentialsByInstanceDirect, countCronLastFiredDirect, countHeldRunsByRunIdDirect, countWebhookSourcesByConnectionIdDirect, createDb, createDbRole, createEnvironmentTemplateDirect, createHealthRoutes, createJoinTokenDirect, createLogger, createMeter, createMetricsRoutes, createPool, createReadOnlyDbUser, createS3Client, decodeChunk, deleteCronLastFiredDirect, deleteCrossRepoTrustDirect, deleteExecutionRunsByWorkflowNameDirect, deleteGenericWebhookSourcesByNameDirect, deleteKiciEventsDirect, deleteOrgSettingsByCustomerIdDirect, deletePeerCredentialsByInstanceIdLikeDirect, deleteWorkflowRegistrationsDirect, deriveSharedSecret, describeTableColumnsDirect, dropAndCreateDatabase, dropDatabaseDirect, emitKiciEventDirect, encodeChunk, encodeKeySegment, enrichRequestContext, ensureDatabase, ensureOrgOwnerMemberDirect, findAnyUserApiKeyIdDirect, formatBytes, formatDuration, formatUptime, getExecutionRunSecurityDirect, getGenericWebhookSourceByRoutingKeyDirect, getHeldRunByIdDirect, getPeerCredentialRevokedAtDirect, getPrometheusExporter, getReconnectDelay, getRegistryVersionDirect, getRequestContext, getWebhookSourceByRoutingKeyDirect, getWorkflowRegistrationByIdDirect, guardStartup, initTelemetry, initZx, insertCronLastFiredNowDirect, insertCrossRepoTrustStrictDirect, insertKiciEventRawDirect, insertPeerCredentialExpiredDirect, insertWorkflowRegistrationRawDirect, insertWorkflowRegistrationStrictDirect, isLongerColdRetention, isSchemaCurrent, isSchemaCurrentFromFilesDirect, latestExecutionRunByStatusDirect, listActiveGenericWebhookSourcesDirect, listActivePeerCredentialsExcludingDirect, listCrossRepoTrustBySourceRoutingKeyDirect, listEnvironmentsDirect, listExecutionJobsDirect, listExecutionRunsDirect, listKiciEventsDirect, listQueueDirect, listRegistrationsByRoutingKeyDirect, listRegistrationsDirect, logger, maskDatabaseUrl, normalizeLineEndings, parseDatabaseUrl, parseManifest, platformConnectionExistsDirect, pollKiciEventsDirect, prunePeerCredentialsDirect, purgeScopedSecretsDirect, purgeSecretBackendsDirect, purgeStaleExecutionDirect, purgeStaleSourcesDirect, readStoredMigrationContentHash, registerWorkflowManualDirect, requestContext, resetRaftStateDirect, resolvePlatformWebhookSourceRoutingKeyDirect, resolveTableConfig, restoreSoftDeletedGenericWebhookSourceDirect, seedApiKeyInlineDirect, seedCiSecurityFixturesDirect, seedCrossRepoTrustDirect, seedEnvironmentBindingDirect, seedEnvironmentDirect, seedGenericWebhookSourceDirect, seedSourcePrivateKeyDirect, seedSyntheticGithubSourceDirect, seedUniversalGitSourceDirect, seedWebhookSecretDirect, serializeError, serializeManifest, setEnvironmentPolicyDirect, setEnvironmentSecretDirect, setServiceName, setupGracefulShutdown, sha256, sha256File, showEnvironmentDirect, showExecutionRunDirect, showKiciEventDirect, showQueueEntryDirect, showRegistrationDirect, storeMigrationContentHash, storeMigrationContentHashInTableDirect, tableExistsDirect, tablePrefix, tenantDayBucketPrefix, tenantDayPrefix, toErrorMessage, updateGenericWebhookVerificationConfigDirect, updateOrgSettingsDeniedReposDirect, updateSourceRoutingKeyDirect, updateWorkflowRegistrationCommitShaDirect, upsertCronLastFiredDirect, upsertOrgSettingsGlobalWorkflowsDirect, validateRequiredTools, verifyKiciEventNotifyDirect, waitForEventLogRowByDeliveryIdDirect, waitForExecutionRunStatusSinceDirect, waitForLatestExecutionJobStatusDirect, waitForPlatformEventLogDistinctRoutedDirect, waitForPlatformExecutionRunStatusDirect, waitForPlatformRegistrationsDirect, waitForPostgresDirect, waitForRegistrationsByRoutingKeyDirect, waitForRegistrationsUpdatedAtAdvanceDirect, waitForRunCompletionDirect };
24
+ export * from "@kici-dev/core";
25
+ export { BaseColdStore, COLD_BUCKET_NAMES, ChunkLru, DEFAULT_TABLE_CONFIG, MIGRATION_HASH_TABLE, REGISTERABLE_TRIGGER_TYPES, RingBuffer, apiKeyExistsDirect, bumpRegistryVersionDirect, bumpRegistryVersionSimpleDirect, chunkObjectKey, cleanupExecutionRowsDirect, clearDispatchQueueDirect, clearPeerCredentialsRevokedAtByIdsDirect, coldDaysToBucket, coldStoreArchiveBytesTotal, coldStoreArchiveCyclesTotal, coldStoreArchiveDurationSeconds, coldStoreArchiveRowsTotal, coldStorePurgeBytesTotal, coldStorePurgeChunksTotal, coldStorePurgeDurationSeconds, coldStoreRehydrateBytesTotal, coldStoreRehydrateDurationSeconds, coldStoreRehydrateRequestsTotal, coldStoreReplayDurationSeconds, coldStoreReplayRowsTotal, coldStoreVerifyFailuresTotal, collectRuntimeMetricNames, computeChunkId, computeMigrationsHash, countActivePeerCredentialsByInstanceDirect, countCronLastFiredDirect, countHeldRunsByRunIdDirect, countWebhookSourcesByConnectionIdDirect, createDb, createDbRole, createEnvironmentTemplateDirect, createHealthRoutes, createJoinTokenDirect, createMeter, createMetricsRoutes, createPool, createReadOnlyDbUser, createS3Client, decodeChunk, deleteCronLastFiredDirect, deleteCrossRepoTrustDirect, deleteEnvironmentDirect, deleteExecutionRunsByWorkflowNameDirect, deleteGenericWebhookSourcesByNameDirect, deleteKiciEventsDirect, deleteOrgSettingsByCustomerIdDirect, deletePeerCredentialsByInstanceIdLikeDirect, deleteWorkflowRegistrationsDirect, describeTableColumnsDirect, dropAndCreateDatabase, dropDatabaseDirect, emitKiciEventDirect, encodeChunk, encodeKeySegment, ensureDatabase, ensureOrgOwnerMemberDirect, findAnyUserApiKeyIdDirect, getExecutionRunSecurityDirect, getGenericWebhookSourceByRoutingKeyDirect, getHeldRunByIdDirect, getPeerCredentialRevokedAtDirect, getPrometheusExporter, getReconnectDelay, getRegistryVersionDirect, getWebhookSourceByRoutingKeyDirect, getWorkflowRegistrationByIdDirect, initTelemetry, insertCronLastFiredNowDirect, insertCrossRepoTrustStrictDirect, insertKiciEventRawDirect, insertPeerCredentialExpiredDirect, insertWorkflowRegistrationRawDirect, insertWorkflowRegistrationStrictDirect, isLongerColdRetention, isSchemaCurrent, isSchemaCurrentFromFilesDirect, latestExecutionRunByStatusDirect, listActiveGenericWebhookSourcesDirect, listActivePeerCredentialsExcludingDirect, listCrossRepoTrustBySourceRoutingKeyDirect, listEnvironmentsDirect, listExecutionJobsDirect, listExecutionRunsDirect, listKiciEventsDirect, listQueueDirect, listRegistrationsByRoutingKeyDirect, listRegistrationsDirect, maskDatabaseUrl, parseDatabaseUrl, parseManifest, platformConnectionExistsDirect, pollKiciEventsDirect, prunePeerCredentialsDirect, purgeScopedSecretsDirect, purgeSecretBackendsDirect, purgeStaleExecutionDirect, purgeStaleSourcesDirect, readStoredMigrationContentHash, registerWorkflowManualDirect, resetRaftStateDirect, resolvePlatformWebhookSourceRoutingKeyDirect, resolveTableConfig, restoreSoftDeletedGenericWebhookSourceDirect, seedApiKeyInlineDirect, seedCiSecurityFixturesDirect, seedCrossRepoTrustDirect, seedEnvironmentBindingDirect, seedEnvironmentDirect, seedGenericWebhookSourceDirect, seedSourcePrivateKeyDirect, seedSyntheticGithubSourceDirect, seedUniversalGitSourceDirect, seedWebhookSecretDirect, serializeManifest, setEnvironmentPolicyDirect, setEnvironmentSecretDirect, setupGracefulShutdown, showEnvironmentDirect, showExecutionRunDirect, showKiciEventDirect, showQueueEntryDirect, showRegistrationDirect, storeMigrationContentHash, storeMigrationContentHashInTableDirect, tableExistsDirect, tablePrefix, tenantDayBucketPrefix, tenantDayPrefix, terminateIdleDbBackendsDirect, updateGenericWebhookVerificationConfigDirect, updateOrgSettingsDeniedReposDirect, updateSourceRoutingKeyDirect, updateWorkflowRegistrationCommitShaDirect, upsertCronLastFiredDirect, upsertOrgSettingsGlobalWorkflowsDirect, validateRequiredTools, verifyKiciEventNotifyDirect, waitForEventLogRowByDeliveryIdDirect, waitForExecutionRunStatusSinceDirect, waitForLatestExecutionJobStatusDirect, waitForPlatformEventLogDistinctRoutedDirect, waitForPlatformExecutionRunStatusDirect, waitForPlatformRegistrationsDirect, waitForPostgresDirect, waitForRegistrationsByRoutingKeyDirect, waitForRegistrationsUpdatedAtAdvanceDirect, waitForRunCompletionDirect };
@@ -1,22 +1,2 @@
1
- /**
2
- * Package-manager identity — the enum and pure helpers, with no filesystem
3
- * dependency. Kept separate from `package-manager.ts` (which reads the disk to
4
- * detect the manager) so browser-safe consumers — the engine protocol schemas
5
- * and lock-file types the dashboard transitively imports — can reference the
6
- * enum without pulling `node:fs` into a browser bundle.
7
- */
8
- /** Supported package managers. */
9
- export declare enum PackageManager {
10
- Npm = "npm",
11
- Pnpm = "pnpm",
12
- Yarn = "yarn"
13
- }
14
- /** All package-manager identifiers, for flag/schema validation. */
15
- export declare const PACKAGE_MANAGERS: readonly PackageManager[];
16
- /**
17
- * Parse a raw string into a {@link PackageManager}, or `null` when it does not
18
- * name a supported manager. Accepts bare names (`pnpm`) used by the CLI flag
19
- * and the env-var / packageManager-field tiers.
20
- */
21
- export declare function parsePackageManager(value: string): PackageManager | null;
1
+ export * from '@kici-dev/core/package-manager-types';
22
2
  //# sourceMappingURL=package-manager-types.d.ts.map
@@ -1,35 +1,3 @@
1
1
  import "./chunk-gOLHoazu.js";
2
- //#region src/package-manager-types.ts
3
- /**
4
- * Package-manager identity — the enum and pure helpers, with no filesystem
5
- * dependency. Kept separate from `package-manager.ts` (which reads the disk to
6
- * detect the manager) so browser-safe consumers — the engine protocol schemas
7
- * and lock-file types the dashboard transitively imports — can reference the
8
- * enum without pulling `node:fs` into a browser bundle.
9
- */
10
- /** Supported package managers. */
11
- let PackageManager = /* @__PURE__ */ function(PackageManager) {
12
- PackageManager["Npm"] = "npm";
13
- PackageManager["Pnpm"] = "pnpm";
14
- PackageManager["Yarn"] = "yarn";
15
- return PackageManager;
16
- }({});
17
- /** All package-manager identifiers, for flag/schema validation. */
18
- const PACKAGE_MANAGERS = Object.values(PackageManager);
19
- /**
20
- * Parse a raw string into a {@link PackageManager}, or `null` when it does not
21
- * name a supported manager. Accepts bare names (`pnpm`) used by the CLI flag
22
- * and the env-var / packageManager-field tiers.
23
- */
24
- function parsePackageManager(value) {
25
- switch (value) {
26
- case "npm": return "npm";
27
- case "pnpm": return "pnpm";
28
- case "yarn": return "yarn";
29
- default: return null;
30
- }
31
- }
32
- //#endregion
33
- export { PACKAGE_MANAGERS, PackageManager, parsePackageManager };
34
-
35
- //# sourceMappingURL=package-manager-types.js.map
2
+ export * from "@kici-dev/core/package-manager-types";
3
+ export {};
@@ -1,52 +1,2 @@
1
- /**
2
- * Package-manager detection.
3
- *
4
- * Determines which package manager (npm / pnpm / yarn) a project relies on, so
5
- * dependency operations use the manager that matches the rest of the user's
6
- * repository instead of always assuming npm. Used by `kici init` (to generate a
7
- * lockfile that matches the user's repo) and by the agent (to install `.kici/`
8
- * dependencies with the manager that can resolve the repo's dependency graph,
9
- * including pnpm/yarn `workspace:` siblings).
10
- *
11
- * The {@link PackageManager} enum + pure helpers live in the node-free
12
- * `./package-manager-types.js` module and are re-exported here so existing
13
- * `@kici-dev/shared/package-manager` consumers keep one import site.
14
- */
15
- import { PackageManager } from './package-manager-types.js';
16
- export { PackageManager, PACKAGE_MANAGERS, parsePackageManager } from './package-manager-types.js';
17
- /** Map a detected manager to its install command argv (binary + args). */
18
- export declare function installCommand(pm: PackageManager): [string, 'install'];
19
- /**
20
- * Detect the package manager the user's project relies on.
21
- *
22
- * Priority order (first match wins):
23
- * 1. `packageManager` field in `<projectDir>/package.json` (Corepack
24
- * convention, e.g. `"packageManager": "pnpm@9.x"`). Only the name before
25
- * `@` is parsed; an unrecognized name falls through.
26
- * 2. A lockfile in the project root (`pnpm-lock.yaml` > `yarn.lock` >
27
- * `package-lock.json`).
28
- * 3. The `npm_config_user_agent` env var (set by `pnpm dlx` / `yarn dlx` /
29
- * `npx`); the leading `<name>/` segment names the manager.
30
- * 4. Default to npm when nothing matches, so we never guess wrong and emit a
31
- * lockfile the user did not ask for.
32
- *
33
- * @param projectDir - The project root to inspect.
34
- */
35
- export declare function detectPackageManager(projectDir: string): Promise<PackageManager>;
36
- /**
37
- * Detect the package manager from a directory's **committed manifests only** —
38
- * tiers 1 (`packageManager` field) and 2 (lockfile). Returns `null` when the
39
- * directory carries no package-manager signal, so callers can distinguish
40
- * "explicitly npm" from "no signal".
41
- *
42
- * This deliberately excludes the `npm_config_user_agent` tier: a consumer
43
- * inspecting a cloned repository (the agent) must key off the repo's own files,
44
- * not the ambient env of the process that happens to be reading them.
45
- */
46
- export declare function detectPackageManagerFromManifests(projectDir: string): Promise<PackageManager | null>;
47
- /**
48
- * Synchronous {@link detectPackageManager}. Used by the compiler's lock-file
49
- * generation, which is synchronous; identical tiering and precedence.
50
- */
51
- export declare function detectPackageManagerSync(projectDir: string): PackageManager;
1
+ export * from '@kici-dev/core/package-manager';
52
2
  //# sourceMappingURL=package-manager.d.ts.map
@@ -1,131 +1,3 @@
1
1
  import "./chunk-gOLHoazu.js";
2
- import { PACKAGE_MANAGERS, PackageManager, parsePackageManager } from "./package-manager-types.js";
3
- import { access, readFile } from "node:fs/promises";
4
- import { accessSync, readFileSync } from "node:fs";
5
- import path from "node:path";
6
- //#region src/package-manager.ts
7
- /**
8
- * Package-manager detection.
9
- *
10
- * Determines which package manager (npm / pnpm / yarn) a project relies on, so
11
- * dependency operations use the manager that matches the rest of the user's
12
- * repository instead of always assuming npm. Used by `kici init` (to generate a
13
- * lockfile that matches the user's repo) and by the agent (to install `.kici/`
14
- * dependencies with the manager that can resolve the repo's dependency graph,
15
- * including pnpm/yarn `workspace:` siblings).
16
- *
17
- * The {@link PackageManager} enum + pure helpers live in the node-free
18
- * `./package-manager-types.js` module and are re-exported here so existing
19
- * `@kici-dev/shared/package-manager` consumers keep one import site.
20
- */
21
- /** Map a detected manager to its install command argv (binary + args). */
22
- function installCommand(pm) {
23
- return [pm, "install"];
24
- }
25
- /** Lockfile basenames mapped to the manager that produces them, in priority order. */
26
- const LOCKFILES = [
27
- ["pnpm-lock.yaml", "pnpm"],
28
- ["yarn.lock", "yarn"],
29
- ["package-lock.json", "npm"]
30
- ];
31
- /**
32
- * Detect the package manager the user's project relies on.
33
- *
34
- * Priority order (first match wins):
35
- * 1. `packageManager` field in `<projectDir>/package.json` (Corepack
36
- * convention, e.g. `"packageManager": "pnpm@9.x"`). Only the name before
37
- * `@` is parsed; an unrecognized name falls through.
38
- * 2. A lockfile in the project root (`pnpm-lock.yaml` > `yarn.lock` >
39
- * `package-lock.json`).
40
- * 3. The `npm_config_user_agent` env var (set by `pnpm dlx` / `yarn dlx` /
41
- * `npx`); the leading `<name>/` segment names the manager.
42
- * 4. Default to npm when nothing matches, so we never guess wrong and emit a
43
- * lockfile the user did not ask for.
44
- *
45
- * @param projectDir - The project root to inspect.
46
- */
47
- async function detectPackageManager(projectDir) {
48
- const fromManifests = await detectPackageManagerFromManifests(projectDir);
49
- if (fromManifests) return fromManifests;
50
- const fromUserAgent = parseUserAgent(process.env.npm_config_user_agent);
51
- if (fromUserAgent) return fromUserAgent;
52
- return "npm";
53
- }
54
- /**
55
- * Detect the package manager from a directory's **committed manifests only** —
56
- * tiers 1 (`packageManager` field) and 2 (lockfile). Returns `null` when the
57
- * directory carries no package-manager signal, so callers can distinguish
58
- * "explicitly npm" from "no signal".
59
- *
60
- * This deliberately excludes the `npm_config_user_agent` tier: a consumer
61
- * inspecting a cloned repository (the agent) must key off the repo's own files,
62
- * not the ambient env of the process that happens to be reading them.
63
- */
64
- async function detectPackageManagerFromManifests(projectDir) {
65
- const fromField = parsePackageManagerField(await readPackageJson(projectDir));
66
- if (fromField) return fromField;
67
- for (const [file, pm] of LOCKFILES) if (await fileExists(path.join(projectDir, file))) return pm;
68
- return null;
69
- }
70
- /**
71
- * Synchronous {@link detectPackageManager}. Used by the compiler's lock-file
72
- * generation, which is synchronous; identical tiering and precedence.
73
- */
74
- function detectPackageManagerSync(projectDir) {
75
- const fromField = parsePackageManagerField(readPackageJsonSync(projectDir));
76
- if (fromField) return fromField;
77
- for (const [file, pm] of LOCKFILES) if (fileExistsSync(path.join(projectDir, file))) return pm;
78
- const fromUserAgent = parseUserAgent(process.env.npm_config_user_agent);
79
- if (fromUserAgent) return fromUserAgent;
80
- return "npm";
81
- }
82
- /** Tier 1: parse the Corepack `packageManager` field, if present. */
83
- function parsePackageManagerField(content) {
84
- if (content === null) return null;
85
- try {
86
- const pkg = JSON.parse(content);
87
- if (typeof pkg.packageManager !== "string") return null;
88
- return parsePackageManager(pkg.packageManager.split("@", 1)[0]);
89
- } catch {
90
- return null;
91
- }
92
- }
93
- /** Tier 3: the `npm_config_user_agent` env var, whose leading segment names the manager. */
94
- function parseUserAgent(userAgent) {
95
- if (!userAgent) return null;
96
- return parsePackageManager(userAgent.split("/", 1)[0]);
97
- }
98
- async function readPackageJson(projectDir) {
99
- try {
100
- return await readFile(path.join(projectDir, "package.json"), "utf-8");
101
- } catch {
102
- return null;
103
- }
104
- }
105
- function readPackageJsonSync(projectDir) {
106
- try {
107
- return readFileSync(path.join(projectDir, "package.json"), "utf-8");
108
- } catch {
109
- return null;
110
- }
111
- }
112
- async function fileExists(target) {
113
- try {
114
- await access(target);
115
- return true;
116
- } catch {
117
- return false;
118
- }
119
- }
120
- function fileExistsSync(target) {
121
- try {
122
- accessSync(target);
123
- return true;
124
- } catch {
125
- return false;
126
- }
127
- }
128
- //#endregion
129
- export { PACKAGE_MANAGERS, PackageManager, detectPackageManager, detectPackageManagerFromManifests, detectPackageManagerSync, installCommand, parsePackageManager };
130
-
131
- //# sourceMappingURL=package-manager.js.map
2
+ export * from "@kici-dev/core/package-manager";
3
+ export {};
package/dist/s3-client.js CHANGED
@@ -13,7 +13,10 @@ import { S3Client } from "@aws-sdk/client-s3";
13
13
  * for cache-storage variants).
14
14
  */
15
15
  function createS3Client(options) {
16
- const config = {};
16
+ const config = {
17
+ requestChecksumCalculation: "WHEN_REQUIRED",
18
+ responseChecksumValidation: "WHEN_REQUIRED"
19
+ };
17
20
  if (options.region) config.region = options.region;
18
21
  if (options.endpoint) config.endpoint = options.endpoint;
19
22
  if (options.forcePathStyle !== void 0) config.forcePathStyle = options.forcePathStyle;
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=s3-client.test.d.ts.map
@@ -1,26 +1,2 @@
1
- type ResolveContext = {
2
- parentURL?: string;
3
- conditions: string[];
4
- importAttributes: Record<string, string>;
5
- };
6
- type ResolveResult = {
7
- url: string;
8
- shortCircuit?: boolean;
9
- format?: string | null;
10
- };
11
- type NextResolve = (specifier: string, context?: ResolveContext) => ResolveResult | Promise<ResolveResult>;
12
- type LoadContext = {
13
- format?: string | null;
14
- importAttributes: Record<string, string>;
15
- conditions: string[];
16
- };
17
- type LoadResult = {
18
- format: string;
19
- source?: string | ArrayBuffer | Uint8Array;
20
- shortCircuit?: boolean;
21
- };
22
- type NextLoad = (url: string, context?: LoadContext) => LoadResult | Promise<LoadResult>;
23
- export declare function resolve(specifier: string, context: ResolveContext, nextResolve: NextResolve): ResolveResult | Promise<ResolveResult>;
24
- export declare function load(url: string, context: LoadContext, nextLoad: NextLoad): Promise<LoadResult>;
25
- export {};
1
+ export * from '@kici-dev/core/ts-loader-hook';
26
2
  //# sourceMappingURL=ts-loader-hook.d.ts.map
@@ -1,48 +1,3 @@
1
1
  import "./chunk-gOLHoazu.js";
2
- import { readFile } from "node:fs/promises";
3
- import { existsSync } from "node:fs";
4
- import { fileURLToPath } from "node:url";
5
- import { transformSync } from "oxc-transform";
6
- //#region src/ts-loader-hook.ts
7
- function resolve(specifier, context, nextResolve) {
8
- if (specifier.endsWith(".js") && (specifier.startsWith("./") || specifier.startsWith("../"))) try {
9
- if (context.parentURL) {
10
- if (!existsSync(fileURLToPath(new URL(specifier, context.parentURL)))) {
11
- const tsSpecifier = specifier.slice(0, -3) + ".ts";
12
- if (existsSync(fileURLToPath(new URL(tsSpecifier, context.parentURL)))) return nextResolve(tsSpecifier, context);
13
- }
14
- }
15
- } catch {}
16
- return nextResolve(specifier, context);
17
- }
18
- async function load(url, context, nextLoad) {
19
- if (!url.startsWith("file:")) return nextLoad(url, context);
20
- const bareUrl = url.split("?")[0].split("#")[0];
21
- const isTs = bareUrl.endsWith(".ts");
22
- const isTsx = bareUrl.endsWith(".tsx");
23
- if (!isTs && !isTsx) return nextLoad(url, context);
24
- const filePath = fileURLToPath(bareUrl);
25
- const result = transformSync(filePath, await readFile(filePath, "utf8"), {
26
- lang: isTsx ? "tsx" : "ts",
27
- sourcemap: true,
28
- typescript: { allowNamespaces: true }
29
- });
30
- if (result.errors.length) {
31
- const msg = result.errors.map((e) => e.message).join("\n");
32
- throw new Error(`oxc-transform failed for ${filePath}:\n${msg}`);
33
- }
34
- let code = result.code;
35
- if (result.map) {
36
- const b64 = Buffer.from(JSON.stringify(result.map)).toString("base64");
37
- code += `\n//# sourceMappingURL=data:application/json;base64,${b64}\n`;
38
- }
39
- return {
40
- format: "module",
41
- source: code,
42
- shortCircuit: true
43
- };
44
- }
45
- //#endregion
46
- export { load, resolve };
47
-
48
- //# sourceMappingURL=ts-loader-hook.js.map
2
+ export * from "@kici-dev/core/ts-loader-hook";
3
+ export {};
package/package.json CHANGED
@@ -1,17 +1,21 @@
1
1
  {
2
2
  "name": "@kici-dev/shared",
3
- "version": "0.1.13",
3
+ "version": "0.1.15",
4
4
  "description": "Shared utilities for the KiCI CI/CD stack — logging, zx setup, crypto, telemetry, health and metrics routes. No business logic.",
5
5
  "keywords": [
6
- "kici",
7
6
  "ci",
8
- "cd",
9
- "ci-cd",
7
+ "cicd",
8
+ "continuous-integration",
10
9
  "typescript",
11
- "workflows",
12
- "devops",
10
+ "workflow",
13
11
  "utilities"
14
12
  ],
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "git+https://github.com/kici-dev/kici-public.git",
16
+ "directory": "packages/shared"
17
+ },
18
+ "bugs": "https://github.com/kici-dev/kici-public/issues",
15
19
  "homepage": "https://kici.dev",
16
20
  "author": {
17
21
  "name": "KiCI",
@@ -95,7 +99,8 @@
95
99
  "winston-daily-rotate-file": "^5.0.0",
96
100
  "yaml": "^2.8.3",
97
101
  "zod": "^4.3.6",
98
- "zx": "^8.8.5"
102
+ "zx": "^8.8.5",
103
+ "@kici-dev/core": "0.1.15"
99
104
  },
100
105
  "devDependencies": {
101
106
  "@opentelemetry/sdk-trace-base": "^2.7.0",
package/sbom.spdx.json CHANGED
@@ -2,10 +2,10 @@
2
2
  "spdxVersion": "SPDX-2.3",
3
3
  "dataLicense": "CC0-1.0",
4
4
  "SPDXID": "SPDXRef-DOCUMENT",
5
- "name": "@kici-dev/shared@0.1.13",
6
- "documentNamespace": "https://kici.dev/sbom/%40kici-dev%2Fshared/0.1.13/3de29b01-3471-40bf-a600-aea4e6277238",
5
+ "name": "@kici-dev/shared@0.1.15",
6
+ "documentNamespace": "https://kici.dev/sbom/%40kici-dev%2Fshared/0.1.15/16314d47-0e1a-4be8-bddc-5605b523d24d",
7
7
  "creationInfo": {
8
- "created": "2026-05-28T10:37:30Z",
8
+ "created": "2026-06-11T03:03:13Z",
9
9
  "creators": [
10
10
  "Tool: kici-sbom-generator"
11
11
  ]
@@ -944,10 +944,30 @@
944
944
  "description": "javascript standard data structure library which benchmark against C++ STL",
945
945
  "homepage": "https://js-sdsl.org"
946
946
  },
947
+ {
948
+ "SPDXID": "SPDXRef-Package--kici-dev-core-0.1.15",
949
+ "name": "@kici-dev/core",
950
+ "versionInfo": "0.1.15",
951
+ "downloadLocation": "NOASSERTION",
952
+ "filesAnalyzed": false,
953
+ "licenseConcluded": "NOASSERTION",
954
+ "licenseDeclared": "Apache-2.0",
955
+ "copyrightText": "NOASSERTION",
956
+ "supplier": "NOASSERTION",
957
+ "externalRefs": [
958
+ {
959
+ "referenceCategory": "PACKAGE-MANAGER",
960
+ "referenceType": "purl",
961
+ "referenceLocator": "pkg:npm/%40kici-dev/core@0.1.15"
962
+ }
963
+ ],
964
+ "description": "Light shared utilities for the KiCI stack (logging, errors, formatting, crypto, zx init, the TypeScript ESM loader hook). No server-side dependencies.",
965
+ "homepage": "https://kici.dev"
966
+ },
947
967
  {
948
968
  "SPDXID": "SPDXRef-RootPackage",
949
969
  "name": "@kici-dev/shared",
950
- "versionInfo": "0.1.13",
970
+ "versionInfo": "0.1.15",
951
971
  "downloadLocation": "NOASSERTION",
952
972
  "filesAnalyzed": false,
953
973
  "licenseConcluded": "NOASSERTION",
@@ -958,7 +978,7 @@
958
978
  {
959
979
  "referenceCategory": "PACKAGE-MANAGER",
960
980
  "referenceType": "purl",
961
- "referenceLocator": "pkg:npm/%40kici-dev/shared@0.1.13"
981
+ "referenceLocator": "pkg:npm/%40kici-dev/shared@0.1.15"
962
982
  }
963
983
  ],
964
984
  "description": "Shared utilities for the KiCI CI/CD stack — logging, zx setup, crypto, telemetry, health and metrics routes. No business logic.",
@@ -6421,11 +6441,46 @@
6421
6441
  "relatedSpdxElement": "SPDXRef-Package-yargs-17.7.2",
6422
6442
  "relationshipType": "DEPENDS_ON"
6423
6443
  },
6444
+ {
6445
+ "spdxElementId": "SPDXRef-Package--kici-dev-core-0.1.15",
6446
+ "relatedSpdxElement": "SPDXRef-Package-oxc-transform-0.128.0",
6447
+ "relationshipType": "DEPENDS_ON"
6448
+ },
6449
+ {
6450
+ "spdxElementId": "SPDXRef-Package--kici-dev-core-0.1.15",
6451
+ "relatedSpdxElement": "SPDXRef-Package-picocolors-1.1.1",
6452
+ "relationshipType": "DEPENDS_ON"
6453
+ },
6454
+ {
6455
+ "spdxElementId": "SPDXRef-Package--kici-dev-core-0.1.15",
6456
+ "relatedSpdxElement": "SPDXRef-Package-winston-daily-rotate-file-5.0.0",
6457
+ "relationshipType": "DEPENDS_ON"
6458
+ },
6459
+ {
6460
+ "spdxElementId": "SPDXRef-Package--kici-dev-core-0.1.15",
6461
+ "relatedSpdxElement": "SPDXRef-Package-winston-3.19.0",
6462
+ "relationshipType": "DEPENDS_ON"
6463
+ },
6464
+ {
6465
+ "spdxElementId": "SPDXRef-Package--kici-dev-core-0.1.15",
6466
+ "relatedSpdxElement": "SPDXRef-Package-zod-4.3.6",
6467
+ "relationshipType": "DEPENDS_ON"
6468
+ },
6469
+ {
6470
+ "spdxElementId": "SPDXRef-Package--kici-dev-core-0.1.15",
6471
+ "relatedSpdxElement": "SPDXRef-Package-zx-8.8.5",
6472
+ "relationshipType": "DEPENDS_ON"
6473
+ },
6424
6474
  {
6425
6475
  "spdxElementId": "SPDXRef-RootPackage",
6426
6476
  "relatedSpdxElement": "SPDXRef-Package--aws-sdk-client-s3-3.1038.0",
6427
6477
  "relationshipType": "DEPENDS_ON"
6428
6478
  },
6479
+ {
6480
+ "spdxElementId": "SPDXRef-RootPackage",
6481
+ "relatedSpdxElement": "SPDXRef-Package--kici-dev-core-0.1.15",
6482
+ "relationshipType": "DEPENDS_ON"
6483
+ },
6429
6484
  {
6430
6485
  "spdxElementId": "SPDXRef-RootPackage",
6431
6486
  "relatedSpdxElement": "SPDXRef-Package--opentelemetry-api-1.9.1",
package/dist/crypto.d.ts DELETED
@@ -1,33 +0,0 @@
1
- /** Compute SHA-256 hex digest of a string or Buffer. */
2
- export declare function sha256(input: string | Buffer): string;
3
- /** Compute SHA-256 hex digest of a file's contents. */
4
- export declare function sha256File(filePath: string): Promise<string>;
5
- /**
6
- * Normalize line endings to LF so hashes computed on different platforms agree.
7
- *
8
- * Git for Windows ships with `core.autocrlf=true` in the system gitconfig, so a
9
- * `git clone` of a Linux-authored repo on a Windows host checks out text files
10
- * with CRLF in the working tree. The compiler hashed the LF source on Linux,
11
- * but the agent on Windows reads CRLF and computes a different hash — every
12
- * dispatch fails with a "lock file is out of date" error even though the
13
- * semantic content is identical.
14
- *
15
- * Applied at the boundaries where source / asset content enters the hash:
16
- * - raw workflow source (`.kici/workflows/*.ts`) at hash time, in both the
17
- * compiler (lockfile generation) and the agent (drift verification).
18
- * - file content portions of the asset digest (`hashFiles` resolution) on
19
- * both sides.
20
- *
21
- * Standalone `\r` is also collapsed to `\n` for safety against legacy
22
- * Mac-style endings, though TypeScript source files essentially never carry
23
- * those in practice.
24
- */
25
- export declare function normalizeLineEndings(input: string): string;
26
- /**
27
- * Derive an AES-256 key from an X25519 ECDH shared secret using HKDF.
28
- *
29
- * Used by the compiler (encrypt) and agent (decrypt) for tarball uploads.
30
- * Keys must be DER-encoded (PKCS8 for private, SPKI for public).
31
- */
32
- export declare function deriveSharedSecret(ourPrivateKey: Buffer, theirPublicKey: Buffer): Buffer;
33
- //# sourceMappingURL=crypto.d.ts.map