@gitroll/tacitt-cli 0.3.0 → 0.4.0

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.
@@ -1,5 +1,5 @@
1
1
  import "./locate-U3-nkird.mjs";
2
- import "./src-B4R5XMEP.mjs";
2
+ import "./src-DNn7SifS.mjs";
3
3
  import { z } from "zod";
4
4
  import { Worker } from "node:worker_threads";
5
5
  //#region apps/cli/src/agent-setup/index.ts
@@ -1,8 +1,8 @@
1
- import { q as listAgentSetup } from "./src-CPbdnGrk.mjs";
1
+ import { q as listAgentSetup } from "./src-CmP73EcD.mjs";
2
2
  import { rn as workspaceSchema, tn as sessionSchema, yn as createStaticProcessor } from "./locate-U3-nkird.mjs";
3
- import { l as createNativeAdapters, u as createGitNameSeedProvider } from "./src-qoLRvX-A.mjs";
4
- import { ai as effectiveTreatmentSchema, at as maximumAgentSetupSessions } from "./src-B4R5XMEP.mjs";
5
- import "./agent-setup-CLXdKr2I.mjs";
3
+ import { l as createNativeAdapters, u as createGitNameSeedProvider } from "./src-DES7hBAP.mjs";
4
+ import { at as maximumAgentSetupSessions, ci as effectiveTreatmentSchema } from "./src-DNn7SifS.mjs";
5
+ import "./agent-setup-CQRWVUWR.mjs";
6
6
  import { z } from "zod";
7
7
  import { parentPort, workerData } from "node:worker_threads";
8
8
  //#region apps/cli/src/agent-setup/worker.ts
package/dist/cli.mjs CHANGED
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
- import { _ as createExecutionPort, a as readAgentPresence, d as parseOptions, f as businessCommands, g as readStateDump, h as startupFailure, i as invoke, l as createRenderActivity, m as permissionDiagnostic, n as readOperation, o as createRuntime, p as longCommands, r as waitOperation, s as executorEventSchema, t as cancelOperation, u as helpText, v as startHost, y as traceStartup } from "./query-DN99jiRc.mjs";
3
- import { nt as openPrivateFile, tt as makePrivateDirectory } from "./src-CPbdnGrk.mjs";
2
+ import { _ as createExecutionPort, a as readAgentPresence, d as parseOptions, f as businessCommands, g as readStateDump, h as startupFailure, i as invoke, l as createRenderActivity, m as permissionDiagnostic, n as readOperation, o as createRuntime, p as longCommands, r as waitOperation, s as executorEventSchema, t as cancelOperation, u as helpText, v as startHost, y as traceStartup } from "./query-ByD0Rp_o.mjs";
3
+ import { nt as openPrivateFile, tt as makePrivateDirectory } from "./src-CmP73EcD.mjs";
4
4
  import { Gt as safeField, Ht as ApplicationError, Wt as safeCode } from "./locate-U3-nkird.mjs";
5
- import { et as readWorkspaceOutcomes, rr as reviewTransportBytes, st as resolveFailureLocation, ti as stateSchema } from "./src-B4R5XMEP.mjs";
6
- import { _t as isCoordinationBusy } from "./heap-eO_uWpD1.mjs";
5
+ import { Zn as reviewTransportBytes, et as readWorkspaceOutcomes, ii as stateSchema, st as resolveFailureLocation } from "./src-DNn7SifS.mjs";
6
+ import { _t as isCoordinationBusy } from "./heap-BaTNC9kf.mjs";
7
7
  import { constants, createReadStream, write } from "node:fs";
8
8
  import { z } from "zod";
9
9
  import { lstat, mkdir, mkdtemp, open, readFile, readdir, realpath, rename, rm, writeFile } from "node:fs/promises";
@@ -15,8 +15,8 @@ import { createHash, randomUUID } from "node:crypto";
15
15
  import { setTimeout as setTimeout$1 } from "node:timers/promises";
16
16
  import { monitorEventLoopDelay, performance as performance$1 } from "node:perf_hooks";
17
17
  import { homedir } from "node:os";
18
- import open$1 from "open";
19
18
  import { parse, patch } from "@decimalturn/toml-patch";
19
+ import open$1 from "open";
20
20
  import { applyEdits, modify } from "jsonc-parser";
21
21
  //#region apps/cli/src/host-timing.ts
22
22
  function available(read) {
@@ -1,4 +1,4 @@
1
- import { i as errorCode } from "./model-BBAnsFAx.mjs";
1
+ import { i as errorCode } from "./model-D7UnGeag.mjs";
2
2
  import { a as titleHintLimits, i as encodeTitleError, o as titleInputSchema, t as assertTitleHeap } from "./heap-1FYhGds4.mjs";
3
3
  import { stat } from "node:fs/promises";
4
4
  import { isAbsolute, join } from "node:path";
@@ -1,8 +1,8 @@
1
- import { J as createConfiguredPreviewStream } from "./src-CPbdnGrk.mjs";
1
+ import { J as createConfiguredPreviewStream } from "./src-CmP73EcD.mjs";
2
2
  import { rn as workspaceSchema, tn as sessionSchema, yn as createStaticProcessor } from "./locate-U3-nkird.mjs";
3
- import { l as createNativeAdapters, u as createGitNameSeedProvider } from "./src-qoLRvX-A.mjs";
4
- import { ai as effectiveTreatmentSchema } from "./src-B4R5XMEP.mjs";
5
- import { a as classifyRecord, n as assertPreviewHeap, t as runPreview } from "./run-4G_CvdDj.mjs";
3
+ import { l as createNativeAdapters, u as createGitNameSeedProvider } from "./src-DES7hBAP.mjs";
4
+ import { ci as effectiveTreatmentSchema } from "./src-DNn7SifS.mjs";
5
+ import { a as classifyRecord, n as assertPreviewHeap, t as runPreview } from "./run-3UIkr7GZ.mjs";
6
6
  import { z } from "zod";
7
7
  import { parentPort, workerData } from "node:worker_threads";
8
8
  //#region apps/cli/src/preview/run.ts
@@ -1,8 +1,8 @@
1
- import { $ as safeError, A as runConfiguredSessionJob, R as gitSeedsProvider, m as captureConfiguredSessionJob, u as runConfiguredScanJob } from "./src-CPbdnGrk.mjs";
1
+ import { $ as safeError, A as runConfiguredSessionJob, R as gitSeedsProvider, m as captureConfiguredSessionJob, u as runConfiguredScanJob } from "./src-CmP73EcD.mjs";
2
2
  import { Wt as safeCode, yn as createStaticProcessor } from "./locate-U3-nkird.mjs";
3
- import { l as createNativeAdapters } from "./src-qoLRvX-A.mjs";
4
- import "./src-B4R5XMEP.mjs";
5
- import { d as runJourneyBaseJob, i as runJourneyOutputVerifyJob, n as runJourneyOutputJob, r as runJourneyOutputShardJob } from "./job-rK-Ho9OD.mjs";
3
+ import { l as createNativeAdapters } from "./src-DES7hBAP.mjs";
4
+ import "./src-DNn7SifS.mjs";
5
+ import { d as runJourneyBaseJob, i as runJourneyOutputVerifyJob, n as runJourneyOutputJob, r as runJourneyOutputShardJob } from "./job-DrcpSL_9.mjs";
6
6
  import { parentPort } from "node:worker_threads";
7
7
  //#region apps/cli/src/configured-session-worker.ts
8
8
  const port = parentPort;
@@ -1,6 +1,6 @@
1
- import { b as writePrivateReviewPayload, et as exclusiveLock, it as windowsOwnerOnly, nt as openPrivateFile, rt as restrictToOwner, x as readPrivateReviewPayload } from "./src-CPbdnGrk.mjs";
1
+ import { b as writePrivateReviewPayload, et as exclusiveLock, it as windowsOwnerOnly, nt as openPrivateFile, rt as restrictToOwner, x as readPrivateReviewPayload } from "./src-CmP73EcD.mjs";
2
2
  import { $t as fileIdentitySchema, At as journeyTermSchema, Ht as ApplicationError, It as termTypeSchema, Jt as reviewFamilies, Kn as isStaticCategory, Mt as reviewTermsResultSchema, _ as semanticFindingSchema, b as validateBReview, c as textDigest, d as reviewAlignmentAudit, dt as nativeJourneySchema, ft as journeyGuidanceSchema, g as validateReviewAlignment, gn as createDetectionSummary, gt as journeyWorkSuggestionSchema, ht as journeyDescribeSchema, i as reviewBatchSchema, it as journeyDigestSchema, jt as reviewTermsInputSchema, kt as privacyTermSchema, l as validateReview, m as reviewAlignmentSchema, o as reviewDigest, ot as journeyIdSchema, qn as staticCategories, qt as familySelected, r as reviewBatchChunks, s as reviewSubmitSchema, u as findingReferenceKey, v as bContextEvidence } from "./locate-U3-nkird.mjs";
3
- import { $t as journeySearchResultSchema, An as settleConfirmedHides, At as settleCorrections, B as validateInspectionBatch, Br as isSelectedWork, Bt as journeyReviewStorageQuerySchema, Cn as journeyCommitResultSchema, Cr as preparationSettlementSchema, Dn as confirmedHideDeltaSchema, Dr as applyCardAnswers, Fr as staticSessionId, Ft as attemptBudgetCodePoints, G as validateInspectionFence, Gn as dictionaryHides, Hn as confirmedHideKey, Hr as withReadingProgress, Ht as classificationCommitSchema, It as validateAttemptAppend, J as validateInspectionQuery, Jn as syncTermGroups, Jt as journeyContextQuerySchema, K as validateInspectionHead, Kt as newJourneyWork, Lt as journeyGuidance, Mt as obsoleteJourney, Qt as hidePublishSchema, Rn as bMaskedHits, Sn as sessionUsefulnessResourceSchema, Sr as preparationBeginSchema, Tn as journeyEventSchema, Tr as validatePreparationFacts, Ur as mergePrivacyTerms, V as validateInspectionBatches, Vn as confirmedHideGroupIds, Vr as selectedWorks, Vt as applyClassificationProposal, W as validateInspectionClaim, Wn as confirmedHideTerms, X as validateDetectionSummary, Xn as workDecisionDigest, Xt as hideBeginSchema, Y as validateInspectionContribution, Yn as retireWorkDescription, Yt as journeyContextSchema, Z as inspectionInputs, Zn as workPrivacyDecisions, Zt as hideFinishSchema, _ as projectJourneyInventory, an as journeyResourceSchema, ar as mergeBRepair, b as bReviewScope, bn as sessionReviewStatusSchema, br as journeyPreparationProgressSchema, c as reconstructBFields, cn as sortingApplySchema, cr as scanCanonicalResourceSchema, dn as reviewAttemptsResultSchema, dr as scanGitSeedsId, en as journeySearchSaveSchema, er as reviewCandidateResourceSchema, gn as sessionRereadResourceSchema, h as semanticGroupKey, hr as validateScanExclusion, ht as candidateSortAvailable, in as journeyResourceQuerySchema, ir as bReviewDigest, l as reviseGroupMembership, ln as reviewAttemptResourceSchema, m as hideScopeDigest, mn as sessionReconciliationResourceSchema, nn as journeyPolicyRespondSchema, nr as reviewRepairResourceSchema, o as bRereadDigest, on as journeyIsolateSchema, pn as sessionReconcileResultSchema, pt as manualUploadSchema, q as validateInspectionInputs, qn as maskedHitsStale, rn as projectPreparationProgress, s as reconcileBSession, sn as journeyPlaceSchema, sr as scanAliasResourceSchema, t as scanBatchContextDigest, ti as stateSchema, tn as searchScopeDigest, u as resolveGroupSplit, un as reviewAttemptsQuerySchema, ur as scanSessionResourceSchema, ut as manualUploadBindingSchema, v as preparationScope, vn as sessionReviewQuerySchema, vr as journeyInventoryReadSchema, wn as journeyCommitSchema, wr as preparationStartSchema, wt as journeySendSchema, xn as sessionUsefulnessInputSchema, yn as sessionReviewResourceSchema, yr as journeyInventorySchema, zr as isReadingComplete, zt as journeyBatchReadSchema } from "./src-B4R5XMEP.mjs";
3
+ import { $n as mergeBRepair, $t as journeyResourceSchema, At as validateAttemptAppend, B as validateInspectionBatch, Bt as newJourneyWork, Et as obsoleteJourney, Fn as confirmedHideGroupIds, Ft as applyClassificationProposal, G as validateInspectionFence, Gn as workPrivacyDecisions, Gr as withReadingProgress, Gt as hideFinishSchema, Hn as syncTermGroups, Hr as isReadingComplete, Ht as journeyContextQuerySchema, In as confirmedHideKey, It as classificationCommitSchema, J as validateInspectionQuery, Jn as reviewCandidateResourceSchema, Jt as journeySearchSaveSchema, K as validateInspectionHead, Kr as mergePrivacyTerms, Kt as hidePublishSchema, Mn as bMaskedHits, Nt as journeyBatchReadSchema, Pr as journeySendSchema, Pt as journeyReviewStorageQuerySchema, Qn as bReviewDigest, Qt as journeyResourceQuerySchema, Rn as confirmedHideTerms, Un as retireWorkDescription, Ur as isSelectedWork, Ut as journeyContextSchema, V as validateInspectionBatches, Vn as maskedHitsStale, W as validateInspectionClaim, Wn as workDecisionDigest, Wr as selectedWorks, Wt as hideBeginSchema, X as validateDetectionSummary, Xn as reviewRepairResourceSchema, Xt as journeyPolicyRespondSchema, Y as validateInspectionContribution, Yt as searchScopeDigest, Z as inspectionInputs, Zt as projectPreparationProgress, _ as projectJourneyInventory, _n as journeyCommitResultSchema, _r as preparationSettlementSchema, an as reviewAttemptsResultSchema, ar as scanGitSeedsId, b as bReviewScope, c as reconstructBFields, cn as sessionReconciliationResourceSchema, en as journeyIsolateSchema, fn as sessionReviewQuerySchema, fr as journeyInventoryReadSchema, gn as sessionUsefulnessResourceSchema, gr as preparationBeginSchema, h as semanticGroupKey, hn as sessionUsefulnessInputSchema, ht as candidateSortAvailable, ii as stateSchema, in as reviewAttemptsQuerySchema, ir as scanSessionResourceSchema, jt as journeyGuidance, kr as staticSessionId, kt as attemptBudgetCodePoints, l as reviseGroupMembership, lr as validateScanExclusion, m as hideScopeDigest, mn as sessionReviewStatusSchema, mr as journeyPreparationProgressSchema, nn as sortingApplySchema, nr as scanCanonicalResourceSchema, o as bRereadDigest, pn as sessionReviewResourceSchema, pr as journeyInventorySchema, pt as manualUploadSchema, q as validateInspectionInputs, qt as journeySearchResultSchema, rn as reviewAttemptResourceSchema, s as reconcileBSession, sn as sessionReconcileResultSchema, t as scanBatchContextDigest, tn as journeyPlaceSchema, tr as scanAliasResourceSchema, u as resolveGroupSplit, un as sessionRereadResourceSchema, ut as manualUploadBindingSchema, v as preparationScope, vn as journeyCommitSchema, vr as preparationStartSchema, wn as settleConfirmedHides, wt as settleCorrections, xn as confirmedHideDeltaSchema, xr as applyCardAnswers, yn as journeyEventSchema, yr as validatePreparationFacts, zn as dictionaryHides } from "./src-DNn7SifS.mjs";
4
4
  import { constants } from "node:fs";
5
5
  import { z } from "zod";
6
6
  import { copyFile, link, lstat, mkdir, mkdtemp, open, readFile, realpath, rm, unlink } from "node:fs/promises";
@@ -1,7 +1,7 @@
1
- import { Y as createInspectionProcessor } from "./src-CPbdnGrk.mjs";
1
+ import { Y as createInspectionProcessor } from "./src-CmP73EcD.mjs";
2
2
  import { yn as createStaticProcessor } from "./locate-U3-nkird.mjs";
3
- import { l as createNativeAdapters, u as createGitNameSeedProvider } from "./src-qoLRvX-A.mjs";
4
- import { H as validateInspectionRequest } from "./src-B4R5XMEP.mjs";
3
+ import { l as createNativeAdapters, u as createGitNameSeedProvider } from "./src-DES7hBAP.mjs";
4
+ import { H as validateInspectionRequest } from "./src-DNn7SifS.mjs";
5
5
  import "./messages-D3m3bhva.mjs";
6
6
  import { z } from "zod";
7
7
  import { parentPort, workerData } from "node:worker_threads";
@@ -1,6 +1,6 @@
1
- import { B as writeLogicalJourneyOutput, C as readConfiguredSearchFields, E as prepareCollectionProduction, R as gitSeedsProvider, U as readConfiguredOutputInfo, d as verifyOutputShard, f as writeOutputShard, k as renderJobDigest, y as writeLogicalJourneyBase } from "./src-CPbdnGrk.mjs";
1
+ import { B as writeLogicalJourneyOutput, C as readConfiguredSearchFields, E as prepareCollectionProduction, R as gitSeedsProvider, U as readConfiguredOutputInfo, d as verifyOutputShard, f as writeOutputShard, k as renderJobDigest, y as writeLogicalJourneyBase } from "./src-CmP73EcD.mjs";
2
2
  import { Ht as ApplicationError, Jt as reviewFamilies, zt as filterInventoryByPeriod } from "./locate-U3-nkird.mjs";
3
- import { Fn as packHideIndex, Ir as staticSessionResourceSchema, Mn as addHideIndexTokens, Nn as hideKeyId, ci as selectFrozenConfiguration, kn as renderedHideValue, oi as defaultScopedSettings, si as freezeConfiguration } from "./src-B4R5XMEP.mjs";
3
+ import { Ar as staticSessionResourceSchema, Cn as renderedHideValue, Dn as hideKeyId, En as addHideIndexTokens, di as selectFrozenConfiguration, kn as packHideIndex, li as defaultScopedSettings, ui as freezeConfiguration } from "./src-DNn7SifS.mjs";
4
4
  import { constants } from "node:fs";
5
5
  import { link, lstat, open, unlink } from "node:fs/promises";
6
6
  import { join } from "node:path";
@@ -244,7 +244,8 @@ async function saveStaticSession(storage, binding, item, result, signal) {
244
244
  metadata: result.metadata,
245
245
  parts: result.parts,
246
246
  entries: result.entries,
247
- agentSetup: result.agentSetup
247
+ agentSetup: result.agentSetup,
248
+ ...result.agentSources === void 0 ? {} : { agentSources: result.agentSources }
248
249
  };
249
250
  const file = await open(resultPath, constants.O_CREAT | constants.O_EXCL | constants.O_WRONLY | constants.O_NOFOLLOW, 384);
250
251
  owned.push(resultPath);
@@ -256,6 +257,7 @@ async function saveStaticSession(storage, binding, item, result, signal) {
256
257
  }
257
258
  const resource = staticSessionResourceSchema.parse({
258
259
  kind: "static-session",
260
+ ...result.agentSources === void 0 ? {} : { agentSources: result.agentSources },
259
261
  journeyId: binding.journeyId,
260
262
  workId: binding.work.id,
261
263
  inputRevision: binding.work.inputRevision,
@@ -1,4 +1,4 @@
1
- import "./src-B4R5XMEP.mjs";
1
+ import "./src-DNn7SifS.mjs";
2
2
  //#region packages/harnesses/src/discovery/model.ts
3
3
  const discoveryBounds = {
4
4
  entries: 1e5,
@@ -1,6 +1,6 @@
1
- import { c as executorRequestSchema, d as parseOptions, h as startupFailure, i as invoke, n as readOperation, o as createRuntime, p as longCommands, r as waitOperation } from "./query-DN99jiRc.mjs";
1
+ import { c as executorRequestSchema, d as parseOptions, h as startupFailure, i as invoke, n as readOperation, o as createRuntime, p as longCommands, r as waitOperation } from "./query-ByD0Rp_o.mjs";
2
2
  import { Gt as safeField, Ht as ApplicationError, Wt as safeCode } from "./locate-U3-nkird.mjs";
3
- import "./src-B4R5XMEP.mjs";
3
+ import "./src-DNn7SifS.mjs";
4
4
  import { z } from "zod";
5
5
  import { setTimeout } from "node:timers/promises";
6
6
  //#region apps/cli/src/operation/executor.ts
@@ -1,4 +1,4 @@
1
- import { n as assertPreviewHeap, o as previewInputSchema, t as runPreview } from "./run-4G_CvdDj.mjs";
1
+ import { n as assertPreviewHeap, o as previewInputSchema, t as runPreview } from "./run-3UIkr7GZ.mjs";
2
2
  import { parentPort, workerData } from "node:worker_threads";
3
3
  //#region packages/harnesses/src/preview/worker/index.ts
4
4
  function notify(message) {
@@ -1,10 +1,10 @@
1
- import { A as runConfiguredSessionJob, C as readConfiguredSearchFields, D as captureLogicalJourneySources, F as sessionWorkerFailure, G as staticMaskCategory, H as readLogicalJourneyFinalMasks, I as privateCollectionDirectory, K as readWorkspacePair, L as defaultParallelism, M as parseCollectionWorkspaceSummary, N as createSharedSessionPool, O as capturedJourneyScope, P as SessionWorkerError, Q as createCleanup, R as gitSeedsProvider, S as readOriginalSearchFields, T as checkReusableBundle, U as readConfiguredOutputInfo, V as privateJourneyDirectory, W as processJourneyMetadataFields, X as createTemporary, Z as removeNamedTemporarySpools, _ as readStaticSessionMasks, a as scanReviewFields, at as isWindowsAclFailure, c as readSessionScanRecords, g as processJourneyMetadata, h as readCapturedOriginalRows, i as buildWorkScanBatches, it as windowsOwnerOnly, j as readCollectionIndex, l as scanPreparedSession, n as verifyPreparedSessionSources, nt as openPrivateFile, o as createWorkPieces, ot as windowsAclCodes, p as openConfiguredUpload, r as prepareSessionScans, rt as restrictToOwner, s as readSessionScanFields, t as preparedScanConfiguration, tt as makePrivateDirectory, v as staticSessionJobs, w as createCollectionArtifacts, z as parallelismLimits } from "./src-CPbdnGrk.mjs";
1
+ import { A as runConfiguredSessionJob, C as readConfiguredSearchFields, D as captureLogicalJourneySources, F as sessionWorkerFailure, G as staticMaskCategory, H as readLogicalJourneyFinalMasks, I as privateCollectionDirectory, K as readWorkspacePair, L as defaultParallelism, M as parseCollectionWorkspaceSummary, N as createSharedSessionPool, O as capturedJourneyScope, P as SessionWorkerError, Q as createCleanup, R as gitSeedsProvider, S as readOriginalSearchFields, T as checkReusableBundle, U as readConfiguredOutputInfo, V as privateJourneyDirectory, W as processJourneyMetadataFields, X as createTemporary, Z as removeNamedTemporarySpools, _ as readStaticSessionMasks, a as scanReviewFields, at as isWindowsAclFailure, c as readSessionScanRecords, g as processJourneyMetadata, h as readCapturedOriginalRows, i as buildWorkScanBatches, it as windowsOwnerOnly, j as readCollectionIndex, l as scanPreparedSession, n as verifyPreparedSessionSources, nt as openPrivateFile, o as createWorkPieces, ot as windowsAclCodes, p as openConfiguredUpload, r as prepareSessionScans, rt as restrictToOwner, s as readSessionScanFields, t as preparedScanConfiguration, tt as makePrivateDirectory, v as staticSessionJobs, w as createCollectionArtifacts, z as parallelismLimits } from "./src-CmP73EcD.mjs";
2
2
  import { Bt as sessionPeriodSchema, Dn as entityDictionaryVersion, F as bClassificationKey, Fn as frameRecords, Ft as termTypeInfo, Gt as safeField, H as codePointLength, Ht as ApplicationError, Jt as reviewFamilies, K as utf16Offset, N as bUnitFragments, Ot as privacyTermKey, Qn as admitGitName, T as bLiteralTerms, Ut as UnfinishedJourneyError, V as bDigest, Wt as safeCode, Xn as createEntityMatcher, Zn as admitCustomTerm, Zt as observeSource, b as validateBReview, c as textDigest, h as reviewFindingsDigest, ht as journeyDescribeSchema, jt as reviewTermsInputSchema, l as validateReview, mn as currentDetectorVersion, n as compileBFindings, r as reviewBatchChunks, s as reviewSubmitSchema, t as locateTerms, yn as createStaticProcessor, z as bAnchorKey } from "./locate-U3-nkird.mjs";
3
- import { a as mainTextChunks, c as previewInWorker, i as nearestSortingRepository, l as createNativeAdapters, n as createProjectEvidenceCollector, o as mainTextFields, r as sortingRepositoryId, s as textChunks, t as createHarnesses, u as createGitNameSeedProvider } from "./src-qoLRvX-A.mjs";
4
- import { $ as settingsQuerySchema, $n as reviewCandidateInputSchema, $t as journeySearchResultSchema, A as deviceProfileScopeSchema, Ar as nativeEventsSchema, B as validateInspectionBatch, Br as isSelectedWork, Bt as journeyReviewStorageQuerySchema, C as rebindReviewSubmit, Ct as sendStartSchema, D as createAccount, Dt as sendReplaceResultSchema, E as staticallyHiddenFindings, En as confirmedHideAdditions, Er as journeyClassificationSessionsSchema, Et as sendReceiptSchema, Gr as journeyFindingsSchema, Gt as retireScanGeneration, Hr as withReadingProgress, Jr as journeyRenderSchema, Jt as journeyContextQuerySchema, Kn as journeyConfirmedHides, Kr as journeyPreviewSchema, Kt as newJourneyWork, L as createApplication, Lr as hasCompleteWorkDescription, M as readAccountAvatarUrl, Mr as nativeRespondSchema, Mt as obsoleteJourney, N as storedCredentialSchema, Nr as hasCurrentStaticReview, O as accountProfileSchema, On as readConfirmedHideChange, Or as assertJourneyPrivacyReady, Ot as sendResolutionSchema, Pr as staticReviewDigest, Q as settingsBatchSchema, Qn as workCorrectionBinding, Qr as selectionSchema, R as inspectionCancelSchema, Rr as isClassifying, Rt as applyClassification, S as rebindReviewOverlay, St as sendPrepareSchema, T as guardedFindingText, Tt as sendArtifactSchema, U as inspectionQuerySchema, Un as confirmedHideKinds, Ut as classificationPartition, Vn as confirmedHideGroupIds, Wr as journeyFindingImpactSchema, Wt as classificationWorks, Xn as workDecisionDigest, Xr as packageCommandSchema, Yn as retireWorkDescription, Yr as commandSchema, Zr as selectionBatchSchema, _n as sessionReviewInputSchema, _r as journeyInventoryQuerySchema, _t as maximumTermsFileBytes, a as bCrossSegmentReviewSchema, b as bReviewScope, bt as sendActionSchema, c as reconstructBFields, ct as validateFailureLocation, d as selectedValueMembers, dr as scanGitSeedsId, dt as manualUploadChoiceSchema, ei as producerVersion, er as reviewCandidateResourceSchema, et as readWorkspaceOutcomes, f as splitSelectorValues, fn as sessionReconcileInputSchema, fr as scanGitSeedsResource, ft as manualUploadPrepareSchema, g as changeJourney, gt as emptyTermsRevision, hn as sessionRereadInputSchema, i as validateBCrossSegmentReview, in as journeyResourceQuerySchema, ir as bReviewDigest, j as profileUrlMatchesIdentity, jn as termHideAdditions, jr as nativeGetSchema, jt as currentJourneyAdapters, k as deviceAuthorizationSchema, kr as privacyDecisionDigest, kt as sendSettingsSchema, ln as reviewAttemptResourceSchema, lr as scanPreparationDigest, lt as manualUploadActionSchema, m as hideScopeDigest, mr as scanExclusionResourceSchema, mt as manualUploadStartSchema, n as scanBatchEquivalenceDigest, nn as journeyPolicyRespondSchema, nr as reviewRepairResourceSchema, nt as appendSensitiveTerms, o as bRereadDigest, or as planBRepair, ot as artifactFailureDetailSchema, p as activeJourneyTerms, pr as verifiedScanGitSeeds, pt as manualUploadSchema, qn as maskedHitsStale, qr as journeyRenderInputSchema, qt as reviewCompileSchema, r as locateTermEvidence, ri as recommendParallelism, s as reconcileBSession, sn as journeyPlaceSchema, st as resolveFailureLocation, t as scanBatchContextDigest, ti as stateSchema, tn as searchScopeDigest, tr as reviewRepairInputSchema, ur as scanSessionResourceSchema, vn as sessionReviewQuerySchema, vt as normalizeSensitiveTerms, w as reviewBatchReuse, wt as journeySendSchema, x as rebindReviewAlignment, xn as sessionUsefulnessInputSchema, xr as emptyPreparationFacts, xt as sendChoiceSchema, y as isGenericPublicTerm, yt as replaceSensitiveTermsSchema, z as inspectionStartSchema, zn as bTermMatcher, zr as isReadingComplete } from "./src-B4R5XMEP.mjs";
5
- import { $ as checkVersion, A as resourceSelectionQuerySchema, B as termReuseQuerySchema, C as loadAcceptedReview, D as aggregateUsefulness, E as loadPrivateResource, F as validateUnitCandidate, G as requireActiveBatch, H as batchHeader, I as reuseQuerySchema, J as validateDatabase, K as initializeAndClaim, L as batchQuery, M as evaluateUnitEvidence, N as sameCandidateRequest, O as sessionUsefulnessRecommendation, P as validateCandidateAttempt, Q as validateState, R as isPrivateResourceKind, S as validateSessionBindings, T as loadBatch, U as createJourneyPayloadFiles, V as privateReviewHash, W as validateBatchBody, X as readBundleDirectory, Y as withDatabase, Z as readStoredState, _ as loadReconciliation, _t as isCoordinationBusy, a as decodeError, at as hasResetMarker, b as validatePreparationSelection, c as dropsAnchor, ct as privatePath, d as parseDelivery, dt as stateDirectory, et as schemaVersion, f as validateCandidate, ft as syncDirectory, g as loadPreparedBodies, gt as errorCode$1, h as loadPreparation, ht as StoreError, i as createExecutor, it as finishReset, j as inspectionQuerySchema$1, k as sessionQuery, l as replySchema, lt as readResetMarker, m as loadStatus, mt as withFileCheckTimings, n as releaseInheritedHeapFlags, nt as createDatabaseFile, o as ProtocolError, ot as inspectStateFiles, p as classificationJourneyCommit, pt as withStateSnapshot, q as ownership, r as storeHeapLimits, rt as databaseName, s as allowedReplies, st as present, tt as beginReset, u as operations, ut as recheckPrivatePath, v as loadRereadBodies, vt as isSqliteCorruption, w as loadAuthenticatedReview, x as validateSessionReconciliation, y as loadSessionBodies, z as privateResourceHeader } from "./heap-eO_uWpD1.mjs";
6
- import { _ as staticBaseProduction, a as writeJourneyOutput, c as mergeHideIndexTokens, f as writeJourneyBase, g as staticBaseInputs, h as staticSessions, l as packRenderHideIndex, m as saveStaticSession, o as createHideIndexTokens, p as readStaticResult, s as hideIndexTexts, t as journeyOutputJob, u as journeyBaseJob, v as prepareSourcePlan, y as workApproval } from "./job-rK-Ho9OD.mjs";
7
- import { t as createAgentSetupPort } from "./agent-setup-CLXdKr2I.mjs";
3
+ import { a as mainTextChunks, c as previewInWorker, i as nearestSortingRepository, l as createNativeAdapters, n as createProjectEvidenceCollector, o as mainTextFields, r as sortingRepositoryId, s as textChunks, t as createHarnesses, u as createGitNameSeedProvider } from "./src-DES7hBAP.mjs";
4
+ import { $ as settingsQuerySchema, $r as packageCommandSchema, A as deviceProfileScopeSchema, B as validateInspectionBatch, Bn as journeyConfirmedHides, Br as hasCompleteWorkDescription, Bt as newJourneyWork, C as rebindReviewSubmit, Cr as privacyDecisionDigest, Ct as sendStartSchema, D as createAccount, Dr as hasCurrentStaticReview, E as staticallyHiddenFindings, Er as nativeRespondSchema, Et as obsoleteJourney, Fn as confirmedHideGroupIds, Fr as sendArtifactSchema, Gr as withReadingProgress, Hr as isReadingComplete, Ht as journeyContextQuerySchema, Ir as sendReceiptSchema, Jn as reviewCandidateResourceSchema, Jr as journeyFindingsSchema, Kn as workCorrectionBinding, L as createApplication, Ln as confirmedHideKinds, Lr as sendReplaceResultSchema, Lt as classificationPartition, M as readAccountAvatarUrl, Mr as agentSourceSchema, Mt as applyClassification, N as storedCredentialSchema, Nn as bTermMatcher, Nr as agentSourcesSchema, O as accountProfileSchema, Or as staticReviewDigest, Pr as journeySendSchema, Pt as journeyReviewStorageQuerySchema, Q as settingsBatchSchema, Qn as bReviewDigest, Qr as commandSchema, Qt as journeyResourceQuerySchema, R as inspectionCancelSchema, Rr as sendResolutionSchema, Rt as classificationWorks, S as rebindReviewOverlay, Sn as readConfirmedHideChange, Sr as assertJourneyPrivacyReady, St as sendPrepareSchema, T as guardedFindingText, Tn as termHideAdditions, Tr as nativeGetSchema, Tt as currentJourneyAdapters, U as inspectionQuerySchema, Un as retireWorkDescription, Ur as isSelectedWork, Vn as maskedHitsStale, Vr as isClassifying, Vt as reviewCompileSchema, Wn as workDecisionDigest, Xn as reviewRepairResourceSchema, Xr as journeyRenderInputSchema, Xt as journeyPolicyRespondSchema, Yn as reviewRepairInputSchema, Yr as journeyPreviewSchema, Yt as searchScopeDigest, Zr as journeyRenderSchema, _t as maximumTermsFileBytes, a as bCrossSegmentReviewSchema, ar as scanGitSeedsId, b as bReviewScope, bn as confirmedHideAdditions, br as journeyClassificationSessionsSchema, bt as sendActionSchema, c as reconstructBFields, cr as scanExclusionResourceSchema, ct as validateFailureLocation, d as selectedValueMembers, dn as sessionReviewInputSchema, dr as journeyInventoryQuerySchema, dt as manualUploadChoiceSchema, ei as selectionBatchSchema, er as planBRepair, et as readWorkspaceOutcomes, f as splitSelectorValues, fn as sessionReviewQuerySchema, ft as manualUploadPrepareSchema, g as changeJourney, gt as emptyTermsRevision, hn as sessionUsefulnessInputSchema, hr as emptyPreparationFacts, i as validateBCrossSegmentReview, ii as stateSchema, ir as scanSessionResourceSchema, j as profileUrlMatchesIdentity, k as deviceAuthorizationSchema, ln as sessionRereadInputSchema, lt as manualUploadActionSchema, m as hideScopeDigest, mt as manualUploadStartSchema, n as scanBatchEquivalenceDigest, nt as appendSensitiveTerms, o as bRereadDigest, oi as recommendParallelism, on as sessionReconcileInputSchema, or as scanGitSeedsResource, ot as artifactFailureDetailSchema, p as activeJourneyTerms, pt as manualUploadSchema, qn as reviewCandidateInputSchema, qr as journeyFindingImpactSchema, qt as journeySearchResultSchema, r as locateTermEvidence, ri as producerVersion, rn as reviewAttemptResourceSchema, rr as scanPreparationDigest, s as reconcileBSession, sr as verifiedScanGitSeeds, st as resolveFailureLocation, t as scanBatchContextDigest, ti as selectionSchema, tn as journeyPlaceSchema, vt as normalizeSensitiveTerms, w as reviewBatchReuse, wr as nativeEventsSchema, x as rebindReviewAlignment, xt as sendChoiceSchema, y as isGenericPublicTerm, yt as replaceSensitiveTermsSchema, z as inspectionStartSchema, zr as sendSettingsSchema, zt as retireScanGeneration } from "./src-DNn7SifS.mjs";
5
+ import { $ as checkVersion, A as resourceSelectionQuerySchema, B as termReuseQuerySchema, C as loadAcceptedReview, D as aggregateUsefulness, E as loadPrivateResource, F as validateUnitCandidate, G as requireActiveBatch, H as batchHeader, I as reuseQuerySchema, J as validateDatabase, K as initializeAndClaim, L as batchQuery, M as evaluateUnitEvidence, N as sameCandidateRequest, O as sessionUsefulnessRecommendation, P as validateCandidateAttempt, Q as validateState, R as isPrivateResourceKind, S as validateSessionBindings, T as loadBatch, U as createJourneyPayloadFiles, V as privateReviewHash, W as validateBatchBody, X as readBundleDirectory, Y as withDatabase, Z as readStoredState, _ as loadReconciliation, _t as isCoordinationBusy, a as decodeError, at as hasResetMarker, b as validatePreparationSelection, c as dropsAnchor, ct as privatePath, d as parseDelivery, dt as stateDirectory, et as schemaVersion, f as validateCandidate, ft as syncDirectory, g as loadPreparedBodies, gt as errorCode$1, h as loadPreparation, ht as StoreError, i as createExecutor, it as finishReset, j as inspectionQuerySchema$1, k as sessionQuery, l as replySchema, lt as readResetMarker, m as loadStatus, mt as withFileCheckTimings, n as releaseInheritedHeapFlags, nt as createDatabaseFile, o as ProtocolError, ot as inspectStateFiles, p as classificationJourneyCommit, pt as withStateSnapshot, q as ownership, r as storeHeapLimits, rt as databaseName, s as allowedReplies, st as present, tt as beginReset, u as operations, ut as recheckPrivatePath, v as loadRereadBodies, vt as isSqliteCorruption, w as loadAuthenticatedReview, x as validateSessionReconciliation, y as loadSessionBodies, z as privateResourceHeader } from "./heap-BaTNC9kf.mjs";
6
+ import { _ as staticBaseProduction, a as writeJourneyOutput, c as mergeHideIndexTokens, f as writeJourneyBase, g as staticBaseInputs, h as staticSessions, l as packRenderHideIndex, m as saveStaticSession, o as createHideIndexTokens, p as readStaticResult, s as hideIndexTexts, t as journeyOutputJob, u as journeyBaseJob, v as prepareSourcePlan, y as workApproval } from "./job-DrcpSL_9.mjs";
7
+ import { t as createAgentSetupPort } from "./agent-setup-CQRWVUWR.mjs";
8
8
  import { t as workerMessageSchema } from "./messages-D3m3bhva.mjs";
9
9
  import { constants, write } from "node:fs";
10
10
  import { z } from "zod";
@@ -9792,7 +9792,33 @@ function createJourneySendArtifacts(storage) {
9792
9792
  const output = await find(journey.journeyId, work.id, work.revision);
9793
9793
  const info = await readConfiguredOutputInfo(output.primary, signal);
9794
9794
  if (info.work.id !== work.id || info.work.access !== work.access) throw new ApplicationError("ARTIFACT_IDENTITY_MISMATCH");
9795
+ let agentSources = [];
9796
+ try {
9797
+ const base = (await storage.resources({
9798
+ journeyId: journey.journeyId,
9799
+ kind: "base"
9800
+ })).find((item) => item.kind === "base" && item.workId === work.id && item.inputRevision === output.finalMaskLedger.inputRevision && item.primary.sha256 === output.finalMaskLedger.basePrimarySha256);
9801
+ if (base?.kind === "base") {
9802
+ const included = new Set(base.sessions.map((item) => item.applicationSessionId));
9803
+ const resources = await storage.resources({
9804
+ journeyId: journey.journeyId,
9805
+ kind: "static-session"
9806
+ });
9807
+ const unique = /* @__PURE__ */ new Map();
9808
+ for (const resource of resources) {
9809
+ if (resource.kind !== "static-session" || resource.workId !== work.id || resource.inputRevision !== base.inputRevision || !included.has(resource.sessionId)) continue;
9810
+ for (const candidate of resource.agentSources ?? []) {
9811
+ const parsed = agentSourceSchema.safeParse(candidate);
9812
+ if (parsed.success && unique.size < 500) unique.set(JSON.stringify(parsed.data), parsed.data);
9813
+ }
9814
+ }
9815
+ agentSources = [...unique.values()];
9816
+ }
9817
+ } catch {
9818
+ console.error("AGENT_SOURCES_METADATA_UNAVAILABLE");
9819
+ }
9795
9820
  return sendArtifactSchema.parse({
9821
+ ...agentSources.length === 0 ? {} : { agentSources },
9796
9822
  workId: work.id,
9797
9823
  revision: work.revision,
9798
9824
  bundleId: info.manifest.bundleId,
@@ -9952,6 +9978,85 @@ async function readOwnerJson(response) {
9952
9978
  return JSON.parse(Buffer.concat(chunks, bytes).toString("utf8"));
9953
9979
  }
9954
9980
  //#endregion
9981
+ //#region apps/cli/src/account/journey/public-sources.ts
9982
+ /** Anonymous evidence only. Expected absence, refusal and lookup failure all omit enrichment. */
9983
+ async function publicSource(source, requestFetch, signal) {
9984
+ const controller = new AbortController();
9985
+ let onAbort = () => {};
9986
+ const cancelled = new Promise((resolve) => {
9987
+ onAbort = () => {
9988
+ controller.abort();
9989
+ resolve(false);
9990
+ };
9991
+ signal?.addEventListener("abort", onAbort, { once: true });
9992
+ if (signal?.aborted) onAbort();
9993
+ });
9994
+ let timer;
9995
+ const expired = new Promise((resolve) => {
9996
+ timer = setTimeout(() => {
9997
+ controller.abort();
9998
+ resolve(false);
9999
+ }, 3e3);
10000
+ });
10001
+ const check = async () => {
10002
+ const response = await requestFetch(source.type === "github" ? `https://api.github.com/repos/${source.repo}` : `https://registry.npmjs.org/${encodeURIComponent(source.package)}`, {
10003
+ method: "GET",
10004
+ credentials: "omit",
10005
+ redirect: "error",
10006
+ referrerPolicy: "no-referrer",
10007
+ cache: "no-store",
10008
+ signal: controller.signal
10009
+ });
10010
+ if (response.status !== 200 || source.type === "npm") {
10011
+ await response.body?.cancel();
10012
+ return response.status === 200;
10013
+ }
10014
+ const value = await readOwnerJson(response);
10015
+ return typeof value === "object" && value !== null && "private" in value && value.private === false;
10016
+ };
10017
+ try {
10018
+ return await Promise.race([
10019
+ check(),
10020
+ expired,
10021
+ cancelled
10022
+ ]);
10023
+ } catch {
10024
+ return false;
10025
+ } finally {
10026
+ signal?.removeEventListener("abort", onAbort);
10027
+ clearTimeout(timer);
10028
+ controller.abort();
10029
+ }
10030
+ }
10031
+ /** One upload, at most twenty distinct checks in parallel and a three-second I/O deadline. */
10032
+ async function checkPublicAgentSources(candidates, requestFetch = fetch, signal) {
10033
+ signal?.throwIfAborted();
10034
+ if (!Array.isArray(candidates) || candidates.length > 500) return [];
10035
+ const admittedShape = candidates.flatMap((item) => {
10036
+ const parsed = agentSourcesSchema.element.safeParse(item);
10037
+ return parsed.success ? [parsed.data] : [];
10038
+ });
10039
+ const cache = /* @__PURE__ */ new Map();
10040
+ const selected = [];
10041
+ for (const item of admittedShape) {
10042
+ const source = item.source;
10043
+ const key = source.type === "github" ? `github:${source.repo.toLowerCase()}` : `npm:${source.package}`;
10044
+ let result = cache.get(key);
10045
+ if (!result) {
10046
+ if (cache.size === 20) continue;
10047
+ result = publicSource(source, requestFetch, signal);
10048
+ cache.set(key, result);
10049
+ }
10050
+ selected.push({
10051
+ item,
10052
+ result
10053
+ });
10054
+ }
10055
+ const results = await Promise.all(selected.map(async ({ item, result }) => await result ? item : null));
10056
+ signal?.throwIfAborted();
10057
+ return results.filter((item) => item !== null);
10058
+ }
10059
+ //#endregion
9955
10060
  //#region apps/cli/src/account/journey/client.ts
9956
10061
  const refusalSchema = z.object({
9957
10062
  error: z.string(),
@@ -10041,6 +10146,9 @@ function createJourneyOwnerClient(options) {
10041
10146
  const receipt = (id) => sendReceiptSchema.refine((value) => value.receiptId === id);
10042
10147
  return {
10043
10148
  subject: options.subject,
10149
+ checkAgentSources(candidates, signal) {
10150
+ return checkPublicAgentSources(candidates, requestFetch, signal);
10151
+ },
10044
10152
  async assertCurrent(signal) {
10045
10153
  await options.authorize();
10046
10154
  signal.throwIfAborted();
@@ -10065,8 +10173,15 @@ function createJourneyOwnerClient(options) {
10065
10173
  membersDigest: preview.membersDigest
10066
10174
  }, "PUT");
10067
10175
  },
10068
- reserve(key, input, signal, checksumUpload = true) {
10069
- return request("/me/work-bundles/uploads", sendReceiptSchema.refine((value) => receiptMatches(input, value)), signal, input, "POST", key, requestTimeoutMs$2, checksumUpload);
10176
+ async reserve(key, input, signal, checksumUpload = true) {
10177
+ const reserve = (body) => request("/me/work-bundles/uploads", sendReceiptSchema.refine((value) => receiptMatches(input, value)), signal, body, "POST", key, requestTimeoutMs$2, checksumUpload);
10178
+ try {
10179
+ return await reserve(input);
10180
+ } catch (error) {
10181
+ if (!(error instanceof JourneyRemoteError) || error.status !== 400 || error.code !== "invalid_request" || input.agentSources === void 0) throw error;
10182
+ const { agentSources: _, ...withoutSources } = input;
10183
+ return reserve(withoutSources);
10184
+ }
10070
10185
  },
10071
10186
  complete(id, signal) {
10072
10187
  return request(`/me/work-bundles/uploads/${encodeURIComponent(id)}/complete`, receipt(id), signal, {}, "POST", void 0, completeTimeoutMs);
@@ -10219,6 +10334,8 @@ async function resolveItem(item, bindingId, connection, signal, snapshot = false
10219
10334
  resolution
10220
10335
  }, settings, null, snapshot);
10221
10336
  }
10337
+ const agentSources = await connection.checkAgentSources?.(item.artifact.agentSources, signal);
10338
+ signal.throwIfAborted();
10222
10339
  return {
10223
10340
  ...item,
10224
10341
  target,
@@ -10226,6 +10343,7 @@ async function resolveItem(item, bindingId, connection, signal, snapshot = false
10226
10343
  status: "uploading",
10227
10344
  error: null,
10228
10345
  reservation: {
10346
+ ...agentSources?.length ? { agentSources } : {},
10229
10347
  work,
10230
10348
  target,
10231
10349
  bundleId: item.artifact.bundleId,
@@ -1,7 +1,7 @@
1
1
  import { tn as sessionSchema } from "./locate-U3-nkird.mjs";
2
2
  import { t as createZstdFrameCheck$1 } from "./frame-waS5FnN5.mjs";
3
- import "./src-B4R5XMEP.mjs";
4
- import { a as isRecord } from "./model-BBAnsFAx.mjs";
3
+ import "./src-DNn7SifS.mjs";
4
+ import { a as isRecord } from "./model-D7UnGeag.mjs";
5
5
  import { constants } from "node:fs";
6
6
  import { z } from "zod";
7
7
  import { lstat, open, stat } from "node:fs/promises";