@tiinex/core 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/NOTICE +31 -0
- package/README.md +45 -0
- package/package.json +176 -0
- package/src/actions/record.actions.js +312 -0
- package/src/adapters/adapter.contracts.js +143 -0
- package/src/adapters/archive/archive.adapter.js +502 -0
- package/src/adapters/archive/archive.portableChangeset.js +141 -0
- package/src/adapters/archive/archive.transport.js +124 -0
- package/src/artifacts/artifact.localDraft.js +27 -0
- package/src/artifacts/artifact.normalize.js +28 -0
- package/src/artifacts/artifact.parse.js +207 -0
- package/src/artifacts/artifact.record.js +83 -0
- package/src/audit/audit.run.js +103 -0
- package/src/audit/audit.summary.js +7 -0
- package/src/diagnostics/sourceBoundary.report.js +112 -0
- package/src/export/package.apply.js +349 -0
- package/src/export/package.builder.js +366 -0
- package/src/export/package.bytes.js +164 -0
- package/src/export/package.controlIntegrity.js +42 -0
- package/src/export/package.controlTopology.js +97 -0
- package/src/export/package.fileMap.js +174 -0
- package/src/export/package.manifest.js +401 -0
- package/src/export/package.preflight.js +204 -0
- package/src/export/package.sourceReference.js +81 -0
- package/src/export/package.workspaceContext.js +144 -0
- package/src/export/package.zip.js +128 -0
- package/src/export/tree.bundle.js +278 -0
- package/src/governance/governance.boundary.js +196 -0
- package/src/integrity/integrity.c14nV2.js +190 -0
- package/src/integrity/integrity.methodReference.js +73 -0
- package/src/integrity/integrity.validate.js +56 -0
- package/src/lineage/lineage.candidateResolution.js +46 -0
- package/src/lineage/lineage.githubIssueComment.js +106 -0
- package/src/lineage/lineage.githubIssueLocal.js +196 -0
- package/src/lineage/lineage.githubIssueTarget.js +89 -0
- package/src/lineage/lineage.integrity.js +133 -0
- package/src/lineage/lineage.materialPreference.js +26 -0
- package/src/lineage/lineage.model.js +63 -0
- package/src/lineage/lineage.parentAuthority.js +5 -0
- package/src/lineage/lineage.parentBinding.js +104 -0
- package/src/lineage/lineage.pathBasis.js +47 -0
- package/src/lineage/lineage.resolve.js +388 -0
- package/src/lineage/lineage.sourceScope.js +74 -0
- package/src/lineage/lineage.targetKeys.js +80 -0
- package/src/lineage/lineage.traverse.js +132 -0
- package/src/public/applicationProjection.js +236 -0
- package/src/public/companionResources.js +246 -0
- package/src/public/index.js +16 -0
- package/src/public/node.js +2 -0
- package/src/public/schemaAncestry.js +26 -0
- package/src/publication/publication.contract.js +196 -0
- package/src/publication/publication.preflight.js +159 -0
- package/src/publication/publication.targetContract.js +241 -0
- package/src/reingest/reingest.plan.js +162 -0
- package/src/release/plan.mjs +28 -0
- package/src/release/policy.mjs +100 -0
- package/src/release/run.mjs +74 -0
- package/src/schemas/capability.registry.js +226 -0
- package/src/schemas/companion.js +245 -0
- package/src/schemas/contracts.js +6 -0
- package/src/schemas/coordination/handoff/tiinex.handoff.v1.schema.js +14 -0
- package/src/schemas/coordination/handoff/tiinex.handoff.v1.schema.json +23 -0
- package/src/schemas/coordination/handoff/tiinex.handoff.v1.schema.runtime.json +4283 -0
- package/src/schemas/coordination/handoff/tiinex.handoff.v1.schema.source.js +9 -0
- package/src/schemas/coordination/project/tiinex.project.v1.schema.js +26 -0
- package/src/schemas/coordination/project/tiinex.project.v1.schema.json +23 -0
- package/src/schemas/coordination/project/tiinex.project.v1.schema.runtime.json +1985 -0
- package/src/schemas/coordination/project/tiinex.project.v1.schema.source.js +9 -0
- package/src/schemas/core/decision/tiinex.decision.v1.schema.js +14 -0
- package/src/schemas/core/decision/tiinex.decision.v1.schema.json +24 -0
- package/src/schemas/core/decision/tiinex.decision.v1.schema.runtime.json +1700 -0
- package/src/schemas/core/decision/tiinex.decision.v1.schema.source.js +9 -0
- package/src/schemas/core/evidence/tiinex.evidence.v1.capabilities.js +14 -0
- package/src/schemas/core/evidence/tiinex.evidence.v1.en.i18n.json +6 -0
- package/src/schemas/core/evidence/tiinex.evidence.v1.findings.js +9 -0
- package/src/schemas/core/evidence/tiinex.evidence.v1.presenter.js +1 -0
- package/src/schemas/core/evidence/tiinex.evidence.v1.schema.js +32 -0
- package/src/schemas/core/evidence/tiinex.evidence.v1.schema.json +24 -0
- package/src/schemas/core/evidence/tiinex.evidence.v1.schema.runtime.json +2184 -0
- package/src/schemas/core/evidence/tiinex.evidence.v1.schema.source.js +9 -0
- package/src/schemas/core/evidence/tiinex.evidence.v1.sv.i18n.json +6 -0
- package/src/schemas/core/evidence/tiinex.evidence.v1.transitions.js +1 -0
- package/src/schemas/core/evidence/tiinex.evidence.v1.validate.js +10 -0
- package/src/schemas/core/feedback/tiinex.feedback.v1.schema.js +14 -0
- package/src/schemas/core/feedback/tiinex.feedback.v1.schema.json +23 -0
- package/src/schemas/core/feedback/tiinex.feedback.v1.schema.runtime.json +1773 -0
- package/src/schemas/core/feedback/tiinex.feedback.v1.schema.source.js +9 -0
- package/src/schemas/core/interpretation/tiinex.interpretation.v1.capabilities.js +11 -0
- package/src/schemas/core/interpretation/tiinex.interpretation.v1.contract.js +40 -0
- package/src/schemas/core/interpretation/tiinex.interpretation.v1.en.i18n.json +9 -0
- package/src/schemas/core/interpretation/tiinex.interpretation.v1.findings.js +12 -0
- package/src/schemas/core/interpretation/tiinex.interpretation.v1.localMaterialization.js +89 -0
- package/src/schemas/core/interpretation/tiinex.interpretation.v1.presenter.js +8 -0
- package/src/schemas/core/interpretation/tiinex.interpretation.v1.schema.js +34 -0
- package/src/schemas/core/interpretation/tiinex.interpretation.v1.schema.json +23 -0
- package/src/schemas/core/interpretation/tiinex.interpretation.v1.schema.runtime.json +2029 -0
- package/src/schemas/core/interpretation/tiinex.interpretation.v1.schema.source.js +9 -0
- package/src/schemas/core/interpretation/tiinex.interpretation.v1.sv.i18n.json +9 -0
- package/src/schemas/core/interpretation/tiinex.interpretation.v1.transitions.js +1 -0
- package/src/schemas/core/interpretation/tiinex.interpretation.v1.validate.js +25 -0
- package/src/schemas/core/preservation/tiinex.preservation.v1.capabilities.js +14 -0
- package/src/schemas/core/preservation/tiinex.preservation.v1.en.i18n.json +6 -0
- package/src/schemas/core/preservation/tiinex.preservation.v1.findings.js +9 -0
- package/src/schemas/core/preservation/tiinex.preservation.v1.presenter.js +1 -0
- package/src/schemas/core/preservation/tiinex.preservation.v1.schema.js +31 -0
- package/src/schemas/core/preservation/tiinex.preservation.v1.schema.json +23 -0
- package/src/schemas/core/preservation/tiinex.preservation.v1.schema.runtime.json +2033 -0
- package/src/schemas/core/preservation/tiinex.preservation.v1.schema.source.js +9 -0
- package/src/schemas/core/preservation/tiinex.preservation.v1.sv.i18n.json +6 -0
- package/src/schemas/core/preservation/tiinex.preservation.v1.transitions.js +1 -0
- package/src/schemas/core/preservation/tiinex.preservation.v1.validate.js +10 -0
- package/src/schemas/core/relation/tiinex.relation.v1.capabilities.js +7 -0
- package/src/schemas/core/relation/tiinex.relation.v1.contract.js +3 -0
- package/src/schemas/core/relation/tiinex.relation.v1.en.i18n.json +4 -0
- package/src/schemas/core/relation/tiinex.relation.v1.findings.js +9 -0
- package/src/schemas/core/relation/tiinex.relation.v1.localMaterialization.js +153 -0
- package/src/schemas/core/relation/tiinex.relation.v1.presenter.js +3 -0
- package/src/schemas/core/relation/tiinex.relation.v1.schema.js +20 -0
- package/src/schemas/core/relation/tiinex.relation.v1.schema.json +23 -0
- package/src/schemas/core/relation/tiinex.relation.v1.schema.runtime.json +1668 -0
- package/src/schemas/core/relation/tiinex.relation.v1.schema.source.js +9 -0
- package/src/schemas/core/relation/tiinex.relation.v1.sv.i18n.json +4 -0
- package/src/schemas/core/relation/tiinex.relation.v1.transitions.js +1 -0
- package/src/schemas/core/relation/tiinex.relation.v1.validate.js +36 -0
- package/src/schemas/core/relation/workspace/representation/tiinex.workspace.representation.v1.capabilities.js +14 -0
- package/src/schemas/core/relation/workspace/representation/tiinex.workspace.representation.v1.contract.js +57 -0
- package/src/schemas/core/relation/workspace/representation/tiinex.workspace.representation.v1.en.i18n.json +4 -0
- package/src/schemas/core/relation/workspace/representation/tiinex.workspace.representation.v1.findings.js +13 -0
- package/src/schemas/core/relation/workspace/representation/tiinex.workspace.representation.v1.presenter.js +3 -0
- package/src/schemas/core/relation/workspace/representation/tiinex.workspace.representation.v1.schema.js +20 -0
- package/src/schemas/core/relation/workspace/representation/tiinex.workspace.representation.v1.schema.json +24 -0
- package/src/schemas/core/relation/workspace/representation/tiinex.workspace.representation.v1.schema.runtime.json +3315 -0
- package/src/schemas/core/relation/workspace/representation/tiinex.workspace.representation.v1.schema.source.js +9 -0
- package/src/schemas/core/relation/workspace/representation/tiinex.workspace.representation.v1.sv.i18n.json +4 -0
- package/src/schemas/core/relation/workspace/representation/tiinex.workspace.representation.v1.transitions.js +1 -0
- package/src/schemas/core/relation/workspace/representation/tiinex.workspace.representation.v1.validate.js +78 -0
- package/src/schemas/core/signal/tiinex.signal.v1.schema.js +14 -0
- package/src/schemas/core/signal/tiinex.signal.v1.schema.json +23 -0
- package/src/schemas/core/signal/tiinex.signal.v1.schema.runtime.json +1733 -0
- package/src/schemas/core/signal/tiinex.signal.v1.schema.source.js +9 -0
- package/src/schemas/core/task/tiinex.task.v1.capabilities.js +11 -0
- package/src/schemas/core/task/tiinex.task.v1.contract.js +3 -0
- package/src/schemas/core/task/tiinex.task.v1.en.i18n.json +15 -0
- package/src/schemas/core/task/tiinex.task.v1.findings.js +18 -0
- package/src/schemas/core/task/tiinex.task.v1.localMaterialization.js +148 -0
- package/src/schemas/core/task/tiinex.task.v1.presenter.js +8 -0
- package/src/schemas/core/task/tiinex.task.v1.schema.js +35 -0
- package/src/schemas/core/task/tiinex.task.v1.schema.json +23 -0
- package/src/schemas/core/task/tiinex.task.v1.schema.runtime.json +1708 -0
- package/src/schemas/core/task/tiinex.task.v1.schema.source.js +9 -0
- package/src/schemas/core/task/tiinex.task.v1.sv.i18n.json +15 -0
- package/src/schemas/core/task/tiinex.task.v1.transitions.js +3 -0
- package/src/schemas/core/task/tiinex.task.v1.validate.js +41 -0
- package/src/schemas/core/topic/tiinex.topic.v1.capabilities.js +14 -0
- package/src/schemas/core/topic/tiinex.topic.v1.creation.js +46 -0
- package/src/schemas/core/topic/tiinex.topic.v1.en.i18n.json +8 -0
- package/src/schemas/core/topic/tiinex.topic.v1.findings.js +11 -0
- package/src/schemas/core/topic/tiinex.topic.v1.localMaterialization.js +135 -0
- package/src/schemas/core/topic/tiinex.topic.v1.presenter.js +1 -0
- package/src/schemas/core/topic/tiinex.topic.v1.schema.js +34 -0
- package/src/schemas/core/topic/tiinex.topic.v1.schema.json +23 -0
- package/src/schemas/core/topic/tiinex.topic.v1.schema.runtime.json +1699 -0
- package/src/schemas/core/topic/tiinex.topic.v1.schema.source.js +9 -0
- package/src/schemas/core/topic/tiinex.topic.v1.sv.i18n.json +8 -0
- package/src/schemas/core/topic/tiinex.topic.v1.transitions.js +31 -0
- package/src/schemas/core/topic/tiinex.topic.v1.validate.js +11 -0
- package/src/schemas/creation.capability.js +289 -0
- package/src/schemas/creation.contracts.js +334 -0
- package/src/schemas/creation.executionSnapshot.js +79 -0
- package/src/schemas/creation.factoryQualification.js +73 -0
- package/src/schemas/creation.renderer.js +244 -0
- package/src/schemas/creation.representation.js +279 -0
- package/src/schemas/creation.rootMetadata.js +6 -0
- package/src/schemas/creation.schemaReferences.js +65 -0
- package/src/schemas/discovery/finding/tiinex.discovery.finding.v1.schema.js +14 -0
- package/src/schemas/discovery/finding/tiinex.discovery.finding.v1.schema.json +23 -0
- package/src/schemas/discovery/finding/tiinex.discovery.finding.v1.schema.runtime.json +1873 -0
- package/src/schemas/discovery/finding/tiinex.discovery.finding.v1.schema.source.js +9 -0
- package/src/schemas/discovery/tiinex.discovery.v1.schema.js +14 -0
- package/src/schemas/discovery/tiinex.discovery.v1.schema.json +23 -0
- package/src/schemas/discovery/tiinex.discovery.v1.schema.runtime.json +1839 -0
- package/src/schemas/discovery/tiinex.discovery.v1.schema.source.js +9 -0
- package/src/schemas/generic.artifact.module.js +25 -0
- package/src/schemas/party/organization/tiinex.party.organization.v1.schema.js +26 -0
- package/src/schemas/party/organization/tiinex.party.organization.v1.schema.json +23 -0
- package/src/schemas/party/organization/tiinex.party.organization.v1.schema.runtime.json +2249 -0
- package/src/schemas/party/organization/tiinex.party.organization.v1.schema.source.js +9 -0
- package/src/schemas/party/role/tiinex.party.role.v1.schema.js +26 -0
- package/src/schemas/party/role/tiinex.party.role.v1.schema.json +24 -0
- package/src/schemas/party/role/tiinex.party.role.v1.schema.runtime.json +2091 -0
- package/src/schemas/party/role/tiinex.party.role.v1.schema.source.js +9 -0
- package/src/schemas/presentation/surface/tiinex.presentation.surface.v1.capabilities.js +14 -0
- package/src/schemas/presentation/surface/tiinex.presentation.surface.v1.en.i18n.json +4 -0
- package/src/schemas/presentation/surface/tiinex.presentation.surface.v1.findings.js +1 -0
- package/src/schemas/presentation/surface/tiinex.presentation.surface.v1.presenter.js +1 -0
- package/src/schemas/presentation/surface/tiinex.presentation.surface.v1.schema.js +29 -0
- package/src/schemas/presentation/surface/tiinex.presentation.surface.v1.schema.json +21 -0
- package/src/schemas/presentation/surface/tiinex.presentation.surface.v1.schema.runtime.json +2180 -0
- package/src/schemas/presentation/surface/tiinex.presentation.surface.v1.schema.source.js +9 -0
- package/src/schemas/presentation/surface/tiinex.presentation.surface.v1.sv.i18n.json +4 -0
- package/src/schemas/presentation/surface/tiinex.presentation.surface.v1.transitions.js +1 -0
- package/src/schemas/presentation/surface/tiinex.presentation.surface.v1.validate.js +1 -0
- package/src/schemas/reduction/tiinex.reduction.v1.schema.js +26 -0
- package/src/schemas/reduction/tiinex.reduction.v1.schema.json +23 -0
- package/src/schemas/reduction/tiinex.reduction.v1.schema.runtime.json +1733 -0
- package/src/schemas/reduction/tiinex.reduction.v1.schema.source.js +9 -0
- package/src/schemas/reference.shapes.js +33 -0
- package/src/schemas/registry.js +36 -0
- package/src/schemas/resolver.js +13 -0
- package/src/schemas/schema/module/tiinex.schema.module.v1.capabilities.js +14 -0
- package/src/schemas/schema/module/tiinex.schema.module.v1.en.i18n.json +4 -0
- package/src/schemas/schema/module/tiinex.schema.module.v1.findings.js +1 -0
- package/src/schemas/schema/module/tiinex.schema.module.v1.presenter.js +1 -0
- package/src/schemas/schema/module/tiinex.schema.module.v1.schema.js +29 -0
- package/src/schemas/schema/module/tiinex.schema.module.v1.schema.json +21 -0
- package/src/schemas/schema/module/tiinex.schema.module.v1.schema.runtime.json +2093 -0
- package/src/schemas/schema/module/tiinex.schema.module.v1.schema.source.js +9 -0
- package/src/schemas/schema/module/tiinex.schema.module.v1.sv.i18n.json +4 -0
- package/src/schemas/schema/module/tiinex.schema.module.v1.transitions.js +1 -0
- package/src/schemas/schema/module/tiinex.schema.module.v1.validate.js +1 -0
- package/src/schemas/schema.factory.descriptor.js +104 -0
- package/src/schemas/schema.githubSourceTarget.js +131 -0
- package/src/schemas/schema.identity.js +10 -0
- package/src/schemas/schema.reference.js +133 -0
- package/src/schemas/schema.source.js +239 -0
- package/src/schemas/tiinex.root.v1.capabilities.js +14 -0
- package/src/schemas/tiinex.root.v1.classify.js +55 -0
- package/src/schemas/tiinex.root.v1.en.i18n.json +24 -0
- package/src/schemas/tiinex.root.v1.fallback.js +84 -0
- package/src/schemas/tiinex.root.v1.findings.js +19 -0
- package/src/schemas/tiinex.root.v1.presenter.js +5 -0
- package/src/schemas/tiinex.root.v1.schema.js +29 -0
- package/src/schemas/tiinex.root.v1.schema.json +24 -0
- package/src/schemas/tiinex.root.v1.schema.runtime.json +1574 -0
- package/src/schemas/tiinex.root.v1.schema.source.js +9 -0
- package/src/schemas/tiinex.root.v1.sv.i18n.json +24 -0
- package/src/schemas/tiinex.root.v1.transitions.js +1 -0
- package/src/schemas/tiinex.root.v1.validate.js +36 -0
- package/src/schemas/validation/finding/tiinex.validation.finding.v1.schema.js +14 -0
- package/src/schemas/validation/finding/tiinex.validation.finding.v1.schema.json +23 -0
- package/src/schemas/validation/finding/tiinex.validation.finding.v1.schema.runtime.json +2027 -0
- package/src/schemas/validation/finding/tiinex.validation.finding.v1.schema.source.js +9 -0
- package/src/schemas/validation/method/tiinex.validation.method.v1.schema.js +14 -0
- package/src/schemas/validation/method/tiinex.validation.method.v1.schema.json +23 -0
- package/src/schemas/validation/method/tiinex.validation.method.v1.schema.runtime.json +1848 -0
- package/src/schemas/validation/method/tiinex.validation.method.v1.schema.source.js +9 -0
- package/src/schemas/validation/report/tiinex.validation.report.v1.schema.js +14 -0
- package/src/schemas/validation/report/tiinex.validation.report.v1.schema.json +23 -0
- package/src/schemas/validation/report/tiinex.validation.report.v1.schema.runtime.json +2015 -0
- package/src/schemas/validation/report/tiinex.validation.report.v1.schema.source.js +9 -0
- package/src/schemas/workspace/tiinex.workspace.v1.capabilities.js +12 -0
- package/src/schemas/workspace/tiinex.workspace.v1.en.i18n.json +7 -0
- package/src/schemas/workspace/tiinex.workspace.v1.findings.js +5 -0
- package/src/schemas/workspace/tiinex.workspace.v1.presenter.js +27 -0
- package/src/schemas/workspace/tiinex.workspace.v1.schema.js +30 -0
- package/src/schemas/workspace/tiinex.workspace.v1.schema.json +23 -0
- package/src/schemas/workspace/tiinex.workspace.v1.schema.runtime.json +1596 -0
- package/src/schemas/workspace/tiinex.workspace.v1.schema.source.js +9 -0
- package/src/schemas/workspace/tiinex.workspace.v1.sv.i18n.json +7 -0
- package/src/schemas/workspace/tiinex.workspace.v1.transitions.js +10 -0
- package/src/schemas/workspace/tiinex.workspace.v1.validate.js +10 -0
- package/src/sources/github/github.issueTarget.js +127 -0
- package/src/sources/origin.references.js +249 -0
- package/src/sources/source.explicitTargets.js +49 -0
- package/src/sources/transport.levels.js +107 -0
- package/src/tooling/portable/adapters/cli/cli.cold-start-input.js +34 -0
- package/src/tooling/portable/adapters/cli/cli.command-input.js +455 -0
- package/src/tooling/portable/adapters/cli/cli.common-author.js +249 -0
- package/src/tooling/portable/adapters/cli/cli.common-output.js +330 -0
- package/src/tooling/portable/adapters/cli/cli.editor-assistance.js +13 -0
- package/src/tooling/portable/adapters/cli/cli.ground-materialize.js +96 -0
- package/src/tooling/portable/adapters/cli/cli.ground-recovery.js +99 -0
- package/src/tooling/portable/adapters/cli/cli.handoff-manufacture.js +345 -0
- package/src/tooling/portable/adapters/cli/cli.handoff-sibling-allocation.js +31 -0
- package/src/tooling/portable/adapters/cli/cli.help.js +80 -0
- package/src/tooling/portable/adapters/cli/cli.land.js +13 -0
- package/src/tooling/portable/adapters/cli/cli.local-output.js +72 -0
- package/src/tooling/portable/adapters/cli/cli.material-policy.js +6 -0
- package/src/tooling/portable/adapters/cli/cli.operator-bridge.js +18 -0
- package/src/tooling/portable/adapters/cli/cli.reduction-input.js +14 -0
- package/src/tooling/portable/adapters/cli/cli.run.js +434 -0
- package/src/tooling/portable/adapters/llm/llm.entrypoint.js +34 -0
- package/src/tooling/portable/adapters/node/checkpoint.verify.js +267 -0
- package/src/tooling/portable/adapters/node/handoff.manufacture.bootstrap.js +109 -0
- package/src/tooling/portable/adapters/node/handoff.manufacture.enumeration.js +94 -0
- package/src/tooling/portable/adapters/node/handoff.manufacture.js +193 -0
- package/src/tooling/portable/adapters/node/handoff.manufacture.multiRoot.js +49 -0
- package/src/tooling/portable/adapters/node/handoff.manufacture.packageParent.js +130 -0
- package/src/tooling/portable/adapters/node/handoff.manufacture.requirements.js +353 -0
- package/src/tooling/portable/adapters/node/handoff.manufacture.scope.js +147 -0
- package/src/tooling/portable/adapters/node/workspaceCarrier.manufacture.js +62 -0
- package/src/tooling/portable/assets/asset.operations.js +170 -0
- package/src/tooling/portable/audit/audit.capability.js +119 -0
- package/src/tooling/portable/bootstrap/artifact.result.selfverify.mjs +109 -0
- package/src/tooling/portable/bootstrap/bootstrap.case.mjs +43 -0
- package/src/tooling/portable/bootstrap/tiinex.llm.bootstrap.md +814 -0
- package/src/tooling/portable/bootstrap/tiinex.llm.bootstrap.pointer.json +25 -0
- package/src/tooling/portable/checkpoint/portable.checkpoint.js +89 -0
- package/src/tooling/portable/conformance/checkpoint.qualification.js +271 -0
- package/src/tooling/portable/draft/draft.create.js +389 -0
- package/src/tooling/portable/draft/draft.crud.js +175 -0
- package/src/tooling/portable/draft/draft.exact.js +173 -0
- package/src/tooling/portable/draft/draft.operations.js +265 -0
- package/src/tooling/portable/draft/draft.qualification.js +45 -0
- package/src/tooling/portable/draft/draft.set.js +193 -0
- package/src/tooling/portable/draft/draft.validation-context.js +7 -0
- package/src/tooling/portable/editor/authoring.parent.js +37 -0
- package/src/tooling/portable/editor/editor.assistance.js +221 -0
- package/src/tooling/portable/editor/staged.validation.js +96 -0
- package/src/tooling/portable/engine.facade.js +468 -0
- package/src/tooling/portable/findings.js +92 -0
- package/src/tooling/portable/grounding/grounding.capsule.js +128 -0
- package/src/tooling/portable/grounding/grounding.continuity.js +283 -0
- package/src/tooling/portable/grounding/grounding.participantAuthority.js +20 -0
- package/src/tooling/portable/grounding/grounding.planningContext.js +34 -0
- package/src/tooling/portable/grounding/grounding.readiness.authority.js +17 -0
- package/src/tooling/portable/grounding/grounding.readiness.js +316 -0
- package/src/tooling/portable/grounding/grounding.readiness.support.js +245 -0
- package/src/tooling/portable/grounding/grounding.sourceEvidence.js +71 -0
- package/src/tooling/portable/grounding/grounding.workContext.js +72 -0
- package/src/tooling/portable/grounding/grounding.workProvenance.js +153 -0
- package/src/tooling/portable/handoff/carrierLineage.js +214 -0
- package/src/tooling/portable/handoff/carrierProfile.js +54 -0
- package/src/tooling/portable/handoff/carrierProjection.js +193 -0
- package/src/tooling/portable/handoff/carrierProjection.routeQualification.js +228 -0
- package/src/tooling/portable/handoff/carrierProjection.shared.js +7 -0
- package/src/tooling/portable/handoff/carrierProjection.workspaces.js +54 -0
- package/src/tooling/portable/handoff/coldConsumerEntrypoint.js +185 -0
- package/src/tooling/portable/handoff/coldStartQualification.contract.js +184 -0
- package/src/tooling/portable/handoff/coldStartQualification.grounding.js +392 -0
- package/src/tooling/portable/handoff/coldStartQualification.js +22 -0
- package/src/tooling/portable/handoff/coldStartQualification.materials.js +364 -0
- package/src/tooling/portable/handoff/coldStartQualification.observation.js +220 -0
- package/src/tooling/portable/handoff/coldStartQualification.run.js +81 -0
- package/src/tooling/portable/handoff/coldStartQualification.shared.js +57 -0
- package/src/tooling/portable/handoff/coldStartRolePointers.js +39 -0
- package/src/tooling/portable/handoff/contextAudit.js +247 -0
- package/src/tooling/portable/handoff/contracts/tiinex.handoff.package.v1.schema.md +409 -0
- package/src/tooling/portable/handoff/handoffAuthoringPlan.js +35 -0
- package/src/tooling/portable/handoff/handoffEndpointProjection.js +61 -0
- package/src/tooling/portable/handoff/handoffLeafProjection.js +91 -0
- package/src/tooling/portable/handoff/humanOutputPresentation.js +21 -0
- package/src/tooling/portable/handoff/manufacture.js +84 -0
- package/src/tooling/portable/handoff/materialClosure.archiveV2.binding.js +72 -0
- package/src/tooling/portable/handoff/materialClosure.archiveV2.direct.js +160 -0
- package/src/tooling/portable/handoff/materialClosure.archiveV2.indexes.js +36 -0
- package/src/tooling/portable/handoff/materialClosure.archiveV2.js +247 -0
- package/src/tooling/portable/handoff/materialClosure.archiveV2.projectionProvider.js +44 -0
- package/src/tooling/portable/handoff/materialClosure.archiveV2.workspace.js +226 -0
- package/src/tooling/portable/handoff/materialClosure.descriptor.js +169 -0
- package/src/tooling/portable/handoff/materialClosure.inputBinding.js +372 -0
- package/src/tooling/portable/handoff/materialClosure.inputBinding.support.js +62 -0
- package/src/tooling/portable/handoff/materialClosure.materialized.js +143 -0
- package/src/tooling/portable/handoff/materialClosure.materials.js +116 -0
- package/src/tooling/portable/handoff/materialClosure.package.js +181 -0
- package/src/tooling/portable/handoff/materialClosure.plan.js +204 -0
- package/src/tooling/portable/handoff/materialClosure.readiness.js +36 -0
- package/src/tooling/portable/handoff/materialClosure.requirements.js +137 -0
- package/src/tooling/portable/handoff/operatorContextProjection.js +105 -0
- package/src/tooling/portable/handoff/pointerEntrypoint.js +138 -0
- package/src/tooling/portable/handoff/qualifiedHandoffFixture.js +34 -0
- package/src/tooling/portable/handoff/recipientV2.artifactFirst.build.js +321 -0
- package/src/tooling/portable/handoff/recipientV2.artifactFirst.closure.js +126 -0
- package/src/tooling/portable/handoff/recipientV2.artifactFirst.inspect.js +194 -0
- package/src/tooling/portable/handoff/recipientV2.artifactFirst.materials.js +207 -0
- package/src/tooling/portable/handoff/recipientV2.artifactFirst.projection.js +69 -0
- package/src/tooling/portable/handoff/recipientV2.artifactFirst.roles.js +166 -0
- package/src/tooling/portable/handoff/recipientV2.artifactFirst.routes.js +113 -0
- package/src/tooling/portable/handoff/recipientV2.artifactFirst.shared.js +87 -0
- package/src/tooling/portable/handoff/recipientV2.artifactFirst.workspaces.js +160 -0
- package/src/tooling/portable/handoff/recipientV2.artifactFirstPhase1.js +44 -0
- package/src/tooling/portable/handoff/recipientV2.artifactInspection.js +55 -0
- package/src/tooling/portable/handoff/recipientV2.artifacts.js +174 -0
- package/src/tooling/portable/handoff/recipientV2.coldProjection.js +24 -0
- package/src/tooling/portable/handoff/recipientV2.delivery.js +48 -0
- package/src/tooling/portable/handoff/recipientV2.endpointRolePointers.js +179 -0
- package/src/tooling/portable/handoff/recipientV2.entryContract.js +28 -0
- package/src/tooling/portable/handoff/recipientV2.humanOutput.js +78 -0
- package/src/tooling/portable/handoff/recipientV2.inspect.helpers.js +218 -0
- package/src/tooling/portable/handoff/recipientV2.inspect.js +194 -0
- package/src/tooling/portable/handoff/recipientV2.inspect.pathToken.js +9 -0
- package/src/tooling/portable/handoff/recipientV2.inspect.projection.js +58 -0
- package/src/tooling/portable/handoff/recipientV2.inspect.workspaces.js +177 -0
- package/src/tooling/portable/handoff/recipientV2.lineage.js +142 -0
- package/src/tooling/portable/handoff/recipientV2.packageV1.build.js +147 -0
- package/src/tooling/portable/handoff/recipientV2.packageV1.constants.js +4 -0
- package/src/tooling/portable/handoff/recipientV2.packageV1.contract.js +101 -0
- package/src/tooling/portable/handoff/recipientV2.packageV1.inspect.helpers.js +126 -0
- package/src/tooling/portable/handoff/recipientV2.packageV1.inspect.js +185 -0
- package/src/tooling/portable/handoff/recipientV2.packageV1.js +12 -0
- package/src/tooling/portable/handoff/recipientV2.packageV1.shared.js +24 -0
- package/src/tooling/portable/handoff/recipientV2.packageV1.workspaceProjection.js +22 -0
- package/src/tooling/portable/handoff/recipientV2.pointer.js +40 -0
- package/src/tooling/portable/handoff/recipientV2.routeSelection.js +16 -0
- package/src/tooling/portable/handoff/recipientV2.topology.helpers.js +20 -0
- package/src/tooling/portable/handoff/recipientV2.topology.js +320 -0
- package/src/tooling/portable/handoff/recipientV2.topology.materials.js +70 -0
- package/src/tooling/portable/handoff/recipientV2.topology.workspaces.js +193 -0
- package/src/tooling/portable/handoff/recipientV2.transportManifest.js +123 -0
- package/src/tooling/portable/handoff/recipientV2.workspaceRepresentation.js +163 -0
- package/src/tooling/portable/handoff/routeArtifactConformance.js +130 -0
- package/src/tooling/portable/handoff/toolingBootstrap.js +67 -0
- package/src/tooling/portable/handoff/transportCompanion.js +175 -0
- package/src/tooling/portable/handoff/workspaceByteProvider.archive.js +95 -0
- package/src/tooling/portable/handoff/workspaceByteProvider.js +271 -0
- package/src/tooling/portable/handoff/workspaceCarrier.manufacture.js +93 -0
- package/src/tooling/portable/handoff/workspaceLandingPlan.js +142 -0
- package/src/tooling/portable/handoff/workspacePackageSources.js +105 -0
- package/src/tooling/portable/handoff/workspaceQualifiedReference.js +10 -0
- package/src/tooling/portable/handoff/workspaceSourceIdentity.js +52 -0
- package/src/tooling/portable/handoff/workspaceTargetConformance.js +134 -0
- package/src/tooling/portable/host/host.capabilities.js +181 -0
- package/src/tooling/portable/host/tool.bindings.js +357 -0
- package/src/tooling/portable/host/tool.receiptNormalization.js +141 -0
- package/src/tooling/portable/index.js +52 -0
- package/src/tooling/portable/input/node.input.js +184 -0
- package/src/tooling/portable/input/portable.input.js +249 -0
- package/src/tooling/portable/lifecycle/lifecycle.action.js +11 -0
- package/src/tooling/portable/lifecycle/lifecycle.material.js +173 -0
- package/src/tooling/portable/lifecycle/lifecycle.operations.js +34 -0
- package/src/tooling/portable/lifecycle/lifecycle.readiness.js +247 -0
- package/src/tooling/portable/lineage/lineage.integrity.apply.audit.js +22 -0
- package/src/tooling/portable/lineage/lineage.integrity.apply.evidence.js +36 -0
- package/src/tooling/portable/lineage/lineage.integrity.apply.js +306 -0
- package/src/tooling/portable/lineage/lineage.integrity.apply.structure.js +178 -0
- package/src/tooling/portable/lineage/lineage.integrity.plan.js +377 -0
- package/src/tooling/portable/lineage/lineage.integrity.projection.human.js +82 -0
- package/src/tooling/portable/lineage/lineage.integrity.projection.js +349 -0
- package/src/tooling/portable/lineage/lineage.operations.js +32 -0
- package/src/tooling/portable/lineage/lineage.print.js +398 -0
- package/src/tooling/portable/lineage/lineage.print.render.js +88 -0
- package/src/tooling/portable/lineage/lineage.print.utils.js +58 -0
- package/src/tooling/portable/lineage/lineage.publicationProviderReceipts.js +141 -0
- package/src/tooling/portable/lineage/lineage.publicationQualification.js +183 -0
- package/src/tooling/portable/lineage/lineage.search.js +301 -0
- package/src/tooling/portable/live/live.artifact.js +192 -0
- package/src/tooling/portable/live/live.export.js +107 -0
- package/src/tooling/portable/live/live.lineage.closure.js +71 -0
- package/src/tooling/portable/live/live.lineage.js +338 -0
- package/src/tooling/portable/live/live.protocol.js +181 -0
- package/src/tooling/portable/materialization/durable.materialize.js +162 -0
- package/src/tooling/portable/materialization/epistemic.plan.js +239 -0
- package/src/tooling/portable/materialization/loaded.parent.js +54 -0
- package/src/tooling/portable/materialization/materialization.facade.js +30 -0
- package/src/tooling/portable/operation.catalog.js +393 -0
- package/src/tooling/portable/operation.catalog.package.js +183 -0
- package/src/tooling/portable/operation.result.js +25 -0
- package/src/tooling/portable/orchestration/task.prepare.js +191 -0
- package/src/tooling/portable/output/artifact.result.package.js +308 -0
- package/src/tooling/portable/output/deterministic.zip.js +88 -0
- package/src/tooling/portable/output/node.artifact-set.js +223 -0
- package/src/tooling/portable/output/node.draft.js +41 -0
- package/src/tooling/portable/output/node.zip.js +39 -0
- package/src/tooling/portable/output/recipientV2.zip.js +59 -0
- package/src/tooling/portable/overview/blockingCue.js +16 -0
- package/src/tooling/portable/overview/operatingOverview.js +413 -0
- package/src/tooling/portable/package/generation.binding.js +314 -0
- package/src/tooling/portable/package/generation.binding.projection.js +128 -0
- package/src/tooling/portable/package/material.graph.js +236 -0
- package/src/tooling/portable/package/runtime.package.js +321 -0
- package/src/tooling/portable/package/schema.transition.companion.js +196 -0
- package/src/tooling/portable/package/semantic.package.graph.js +272 -0
- package/src/tooling/portable/package/semantic.package.js +203 -0
- package/src/tooling/portable/package/semantic.package.schema-resolution.js +158 -0
- package/src/tooling/portable/package/semantic.package.transition-registry.js +189 -0
- package/src/tooling/portable/package/semantic.package.types.js +18 -0
- package/src/tooling/portable/providers/schema.bootstrap.provenance.js +10 -0
- package/src/tooling/portable/providers/schema.provider.qualification.js +52 -0
- package/src/tooling/portable/providers/schema.providers.js +458 -0
- package/src/tooling/portable/publication/runtime.publication.js +53 -0
- package/src/tooling/portable/qualification.js +150 -0
- package/src/tooling/portable/reduction/reduction.composition.js +229 -0
- package/src/tooling/portable/reduction/reduction.eligibility.helpers.js +258 -0
- package/src/tooling/portable/reduction/reduction.eligibility.js +191 -0
- package/src/tooling/portable/reduction/reduction.operations.js +30 -0
- package/src/tooling/portable/reduction/reduction.preflight.js +85 -0
- package/src/tooling/portable/reduction/reduction.shared.js +173 -0
- package/src/tooling/portable/schema/bootstrap/canonical.pack.js +24 -0
- package/src/tooling/portable/schema/bootstrap/docs-3988951208eb9a8926e84ab42625d4b42fa00c2d/party/role/tiinex.party.role.v1.schema.md +289 -0
- package/src/tooling/portable/schema/bootstrap/docs-3988951208eb9a8926e84ab42625d4b42fa00c2d/validation/report/tiinex.validation.report.v1.schema.md +300 -0
- package/src/tooling/portable/schema/bootstrap/qualified-local-root/tiinex.root.v1.runtime-projection.json +48 -0
- package/src/tooling/portable/schema/bootstrap/qualified-local-root/tiinex.root.v1.schema.md +865 -0
- package/src/tooling/portable/schema/contract.compile.js +406 -0
- package/src/tooling/portable/schema/contract.compile.utils.js +9 -0
- package/src/tooling/portable/schema/contract.constraints.js +117 -0
- package/src/tooling/portable/schema/contract.envelope.validate.js +177 -0
- package/src/tooling/portable/schema/contract.field-domain.compile.js +399 -0
- package/src/tooling/portable/schema/contract.field-domain.js +247 -0
- package/src/tooling/portable/schema/contract.field-shape.compile.js +34 -0
- package/src/tooling/portable/schema/contract.inheritance.inline.js +103 -0
- package/src/tooling/portable/schema/contract.inheritance.js +210 -0
- package/src/tooling/portable/schema/contract.inheritance.record.js +76 -0
- package/src/tooling/portable/schema/contract.machine-shape.js +309 -0
- package/src/tooling/portable/schema/contract.project.js +81 -0
- package/src/tooling/portable/schema/contract.semantic-resolution.js +82 -0
- package/src/tooling/portable/schema/contract.validate.js +0 -0
- package/src/tooling/portable/schema/lexical.shape.v1.js +338 -0
- package/src/tooling/portable/schema/llm.companion.js +108 -0
- package/src/tooling/portable/schema/named.declarations.js +162 -0
- package/src/tooling/portable/schema/ordinary.contract.js +193 -0
- package/src/tooling/portable/schema/ordinary.fields.js +205 -0
- package/src/tooling/portable/schema/qualifiedLocalRoot.projection.js +70 -0
- package/src/tooling/portable/schema/qualifiedLocalRoot.runtime.js +170 -0
- package/src/tooling/portable/schema/schema.contract.js +465 -0
- package/src/tooling/portable/schema/schema.guide.js +326 -0
- package/src/tooling/portable/schema/schema.snapshot.js +119 -0
- package/src/tooling/portable/session/portable.session.js +145 -0
- package/src/tooling/portable/transfer/transfer.plan.js +102 -0
- package/src/transitions/record.transitions.js +484 -0
- package/src/transitions/transition.validate.js +129 -0
- package/src/validation/findings.js +76 -0
- package/src/validation/validateArtifact.js +216 -0
- package/src/workspaces/workspace.entrypointCapability.js +44 -0
- package/src/workspaces/workspace.materialRole.js +242 -0
- package/src/workspaces/workspace.recordPaths.js +426 -0
- package/tools/tiinex-portable.mjs +6 -0
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
export const SOURCE_BOUNDARY_REPORT_SCHEMA_ID = 'tiinex.sourceBoundary.report.v1';
|
|
2
|
+
|
|
3
|
+
export function buildSourceBoundaryReport(workspace = {}, input = {}) {
|
|
4
|
+
const records = Array.isArray(input.records) ? input.records : (Array.isArray(workspace.records) ? workspace.records : []);
|
|
5
|
+
const assets = Array.isArray(input.assets) ? input.assets : (Array.isArray(workspace.assets) ? workspace.assets : []);
|
|
6
|
+
const sources = Array.isArray(workspace.sources) ? workspace.sources : [];
|
|
7
|
+
const findings = [];
|
|
8
|
+
|
|
9
|
+
for (const source of sources) inspectSourceRegistration(source, findings);
|
|
10
|
+
for (const record of records) inspectRecordBoundary(record, findings);
|
|
11
|
+
for (const asset of assets) inspectAssetBoundary(asset, findings);
|
|
12
|
+
|
|
13
|
+
const errors = findings.filter((finding) => finding.severity === 'error').length;
|
|
14
|
+
const warnings = findings.filter((finding) => finding.severity === 'warning').length;
|
|
15
|
+
const sourceBackedRecords = records.filter((record) => isSourceBacked(record.source)).length;
|
|
16
|
+
const localRecords = records.length - sourceBackedRecords;
|
|
17
|
+
const sourceBackedAssets = assets.filter((asset) => isSourceBacked(asset.source)).length;
|
|
18
|
+
const localAssets = assets.length - sourceBackedAssets;
|
|
19
|
+
const unpinnedGithubSources = sources.filter((source) => source?.adapterId === 'github' && !explicitRef(source)).length;
|
|
20
|
+
|
|
21
|
+
return Object.freeze({
|
|
22
|
+
schema: SOURCE_BOUNDARY_REPORT_SCHEMA_ID,
|
|
23
|
+
workspaceId: workspace.id || '',
|
|
24
|
+
status: errors ? 'blocked' : warnings ? 'degraded' : 'clean',
|
|
25
|
+
boundary: 'Source-boundary diagnostics are loaded/session scoped. Local material must not acquire guessed GitHub provenance; source-backed material must disclose explicit source boundaries.',
|
|
26
|
+
counts: Object.freeze({
|
|
27
|
+
sources: sources.length,
|
|
28
|
+
records: records.length,
|
|
29
|
+
localRecords,
|
|
30
|
+
sourceBackedRecords,
|
|
31
|
+
assets: assets.length,
|
|
32
|
+
localAssets,
|
|
33
|
+
sourceBackedAssets,
|
|
34
|
+
unpinnedGithubSources,
|
|
35
|
+
errors,
|
|
36
|
+
warnings,
|
|
37
|
+
findings: findings.length
|
|
38
|
+
}),
|
|
39
|
+
findings: Object.freeze(findings)
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function inspectSourceRegistration(source = {}, findings = []) {
|
|
44
|
+
const adapterId = String(source.adapterId || '').trim();
|
|
45
|
+
const id = String(source.id || '').trim() || adapterId || 'source';
|
|
46
|
+
if (!adapterId) {
|
|
47
|
+
findings.push(finding('warning', 'source.adapter.missing', 'Source registration is missing adapter id.', { sourceId: id }));
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
if (adapterId === 'local') {
|
|
51
|
+
if (source.repo || source.repository || source.permalink || source.config?.repo) {
|
|
52
|
+
findings.push(finding('error', 'source.local.github-provenance-leak', 'Local source carries GitHub-like provenance fields.', { sourceId: id }));
|
|
53
|
+
}
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
if (adapterId === 'github') {
|
|
57
|
+
const repo = explicitRepo(source);
|
|
58
|
+
if (!repo) findings.push(finding('error', 'source.github.repo.missing', 'GitHub source boundary must include an explicit repo.', { sourceId: id }));
|
|
59
|
+
if (!explicitRef(source)) findings.push(finding('warning', 'source.github.ref.unpinned', 'GitHub source has no explicit/resolved ref; source links and re-ingest stay degraded until pinned.', { sourceId: id, repo }));
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
findings.push(finding('info', 'source.adapter.explicit-non-github', `Source uses explicit ${adapterId} adapter boundary.`, { sourceId: id }));
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function inspectRecordBoundary(record = {}, findings = []) {
|
|
66
|
+
const source = record.source || {};
|
|
67
|
+
const id = record.id || record.path || record.title || 'record';
|
|
68
|
+
const adapterId = String(source.adapterId || '').trim();
|
|
69
|
+
const local = !isSourceBacked(source);
|
|
70
|
+
if (local) {
|
|
71
|
+
if (source.repo || source.repository || source.permalink || source.config?.repo) {
|
|
72
|
+
findings.push(finding('error', 'record.local.github-provenance-leak', 'Local/session record carries GitHub provenance fields.', { recordId: id, path: record.path || '' }));
|
|
73
|
+
}
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
if (adapterId === 'github') {
|
|
77
|
+
if (!explicitRepo(source)) findings.push(finding('error', 'record.github.repo.missing', 'GitHub-backed record is missing repo boundary.', { recordId: id, path: record.path || '' }));
|
|
78
|
+
if (!String(record.path || '').trim()) findings.push(finding('error', 'record.github.path.missing', 'GitHub-backed record is missing canonical path.', { recordId: id }));
|
|
79
|
+
if (!explicitRef(source)) findings.push(finding('warning', 'record.github.ref.unpinned', 'GitHub-backed record has no explicit/resolved ref; source link/re-ingest is degraded.', { recordId: id, path: record.path || '' }));
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
findings.push(finding('info', 'record.source-backed.non-github', `Record uses explicit ${adapterId || 'external'} source boundary.`, { recordId: id, path: record.path || '' }));
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function inspectAssetBoundary(asset = {}, findings = []) {
|
|
86
|
+
const source = asset.source || {};
|
|
87
|
+
const id = asset.id || asset.path || asset.name || 'asset';
|
|
88
|
+
if (!isSourceBacked(source)) {
|
|
89
|
+
if (source.repo || source.repository || source.permalink || source.config?.repo) {
|
|
90
|
+
findings.push(finding('error', 'asset.local.github-provenance-leak', 'Local/session asset carries GitHub provenance fields.', { assetId: id, path: asset.path || '' }));
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
if (asset.previewState === 'omitted-large' || asset.cacheState === 'preview-truncated-for-session-cache') {
|
|
94
|
+
findings.push(finding('warning', 'asset.preview.omitted', 'Asset preview/content is not fully cached; export/publish must treat it as local-unavailable or metadata-only.', { assetId: id, path: asset.path || '' }));
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function finding(severity, code, message, extra = {}) {
|
|
99
|
+
return Object.freeze(Object.assign({ severity, code, message }, extra));
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export function isSourceBacked(source = {}) {
|
|
103
|
+
return Boolean(source?.adapterId && source.adapterId !== 'local');
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function explicitRepo(source = {}) {
|
|
107
|
+
return String(source.repo || source.repository || source.config?.repo || '').trim();
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function explicitRef(source = {}) {
|
|
111
|
+
return String(source.ref || source.config?.ref || source.resolvedRef || source.commit || '').trim();
|
|
112
|
+
}
|
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
import { createRecordFromMarkdown } from '../artifacts/artifact.record.js';
|
|
2
|
+
import { makeAdapterResult } from '../adapters/adapter.contracts.js';
|
|
3
|
+
import { inspectExportPackageBundle } from './package.builder.js';
|
|
4
|
+
import { packageFileBytes, utf8Text } from './package.bytes.js';
|
|
5
|
+
import { EXPORT_PACKAGE_CONTROL_ROLES } from './package.controlTopology.js';
|
|
6
|
+
|
|
7
|
+
export const EXPORT_PACKAGE_IMPORT_PLAN_SCHEMA_ID = 'tiinex.export.package.import.plan.v1';
|
|
8
|
+
export const EXPORT_PACKAGE_APPLY_RESULT_SCHEMA_ID = 'tiinex.export.package.apply.result.v1';
|
|
9
|
+
export const EXPORT_PACKAGE_IMPORT_ADAPTER_ID = 'export-package';
|
|
10
|
+
|
|
11
|
+
export function buildExportPackageImportPlan(bundle = {}, input = {}) {
|
|
12
|
+
const files = Array.isArray(bundle.files) ? bundle.files : [];
|
|
13
|
+
const inspection = input.inspection || inspectExportPackageBundle(bundle);
|
|
14
|
+
const control = readControlFiles(files);
|
|
15
|
+
const manifest = control.manifest || bundle.manifest || {};
|
|
16
|
+
const receipt = control.receipt || bundle.receipt || {};
|
|
17
|
+
const contract = control.contract || bundle.contract || {};
|
|
18
|
+
const manifestIndex = indexManifestEntries(manifest);
|
|
19
|
+
const findings = [];
|
|
20
|
+
|
|
21
|
+
if (inspection.status !== 'valid') {
|
|
22
|
+
findings.push(...(inspection.findings || []).map((item) => importFinding(item.severity || 'error', `export.package.import.${item.code || 'inspection-finding'}`, item.message || 'Package inspection finding.', pickFindingExtra(item))));
|
|
23
|
+
}
|
|
24
|
+
if (!control.manifest) findings.push(importFinding('error', 'export.package.import.manifest-missing', 'Package import cannot be trusted without a manifest control file.'));
|
|
25
|
+
if (!control.fileMap) findings.push(importFinding('error', 'export.package.import.file-map-missing', 'Package import cannot be trusted without durable serialized file-map authority.'));
|
|
26
|
+
if (!control.receipt) findings.push(importFinding('warning', 'export.package.import.receipt-missing', 'Package import has no receipt control file.'));
|
|
27
|
+
if ((manifest.status || bundle.status) === 'blocked') findings.push(importFinding('error', 'export.package.import.manifest-blocked', 'Package manifest is blocked; material is not applied by default.', { packageId: manifest.packageId || bundle.packageId || '' }));
|
|
28
|
+
|
|
29
|
+
const records = [];
|
|
30
|
+
const sourceReferences = [];
|
|
31
|
+
const assets = [];
|
|
32
|
+
const workspaceCandidates = [];
|
|
33
|
+
const ignored = [];
|
|
34
|
+
let workspaceContext = null;
|
|
35
|
+
let workspaceMarkdown = '';
|
|
36
|
+
|
|
37
|
+
for (const file of files) {
|
|
38
|
+
const path = normalizePackagePath(file.path || '');
|
|
39
|
+
if (!path) {
|
|
40
|
+
findings.push(importFinding('error', 'export.package.import.file.path-unsafe', 'Unsafe package path was not imported.', { path: file.path || '' }));
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
if (isControlFile(path)) continue;
|
|
44
|
+
const entry = lookupManifestEntry(manifestIndex, file);
|
|
45
|
+
if (file.kind === 'artifact-markdown') records.push(recordFromArtifactFile(file, entry, findings));
|
|
46
|
+
else if (file.kind === 'source-reference') {
|
|
47
|
+
const reference = sourceReferenceFromFile(file, entry, findings, 'artifact');
|
|
48
|
+
if (reference) sourceReferences.push(reference);
|
|
49
|
+
} else if (file.kind === 'asset-source-reference') {
|
|
50
|
+
const reference = sourceReferenceFromFile(file, entry, findings, 'asset');
|
|
51
|
+
if (reference) sourceReferences.push(reference);
|
|
52
|
+
} else if (file.kind === 'asset-content') assets.push(assetFromContentFile(file, entry, findings));
|
|
53
|
+
else if (file.kind === 'asset-metadata') assets.push(assetFromMetadataFile(file, entry, findings));
|
|
54
|
+
else if (file.kind === 'workspace-candidate') workspaceCandidates.push(workspaceCandidateFromFile(file, entry, findings));
|
|
55
|
+
else if (file.kind === 'workspace-context') workspaceContext = parseJsonFile(file) || null;
|
|
56
|
+
else if (file.kind === 'workspace-context-markdown') workspaceMarkdown = utf8Text(packageFileBytes(file));
|
|
57
|
+
else {
|
|
58
|
+
ignored.push({ path, kind: file.kind || 'unknown' });
|
|
59
|
+
findings.push(importFinding('info', 'export.package.import.file.ignored', 'Package file kind is not materialized by the import contract.', { path, kind: file.kind || '' }));
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if (!workspaceContext) findings.push(importFinding('error', 'export.package.import.workspace-context.missing', 'Handoff package is missing canonical workspace context.'));
|
|
64
|
+
if (workspaceContext?.workspaceMarkdown?.available && !workspaceMarkdown) findings.push(importFinding('error', 'export.package.import.workspace-context.markdown-missing', 'Workspace context claims owned workspace Markdown but the governed Markdown file is missing or empty.'));
|
|
65
|
+
const workspaceEntries = workspaceContext?.workspaceMarkdown?.available && workspaceMarkdown
|
|
66
|
+
? [workspaceEntryFromContext(workspaceContext, workspaceMarkdown)]
|
|
67
|
+
: [];
|
|
68
|
+
|
|
69
|
+
const counts = Object.freeze({
|
|
70
|
+
files: files.length,
|
|
71
|
+
importedRecords: records.length,
|
|
72
|
+
sourceReferences: sourceReferences.length,
|
|
73
|
+
artifactSourceReferences: sourceReferences.filter((item) => item.materialKind === 'artifact').length,
|
|
74
|
+
assetSourceReferences: sourceReferences.filter((item) => item.materialKind === 'asset').length,
|
|
75
|
+
assets: assets.length,
|
|
76
|
+
metadataOnlyAssets: assets.filter((asset) => asset.previewState === 'metadata-only').length,
|
|
77
|
+
workspaceCandidates: workspaceCandidates.length,
|
|
78
|
+
workspaceContext: workspaceContext ? 1 : 0,
|
|
79
|
+
workspaceEntries: workspaceEntries.length,
|
|
80
|
+
ignored: ignored.length,
|
|
81
|
+
findings: findings.length,
|
|
82
|
+
errors: findings.filter((finding) => finding.severity === 'error').length,
|
|
83
|
+
warnings: findings.filter((finding) => finding.severity === 'warning').length
|
|
84
|
+
});
|
|
85
|
+
const status = counts.errors ? 'blocked' : (inspection.status !== 'valid' || counts.warnings || counts.metadataOnlyAssets || counts.workspaceCandidates ? 'degraded' : 'ready');
|
|
86
|
+
|
|
87
|
+
return deepFreeze({
|
|
88
|
+
schema: EXPORT_PACKAGE_IMPORT_PLAN_SCHEMA_ID,
|
|
89
|
+
packageId: manifest.packageId || bundle.packageId || receipt.packageId || '',
|
|
90
|
+
status,
|
|
91
|
+
boundary: 'Import plan reads only explicitly supplied governed package bytes. Local-owned artifacts/assets remain local, source-backed entries remain references, canonical workspace context remains context, and no network/source mutation occurs.',
|
|
92
|
+
importPolicy: 'Materialization follows durable file-map + manifest authority only; no repository/global/nearest-path recovery is permitted.',
|
|
93
|
+
manifest,
|
|
94
|
+
receipt,
|
|
95
|
+
contract,
|
|
96
|
+
fileMap: control.fileMap || bundle.fileMap || null,
|
|
97
|
+
inspection,
|
|
98
|
+
counts,
|
|
99
|
+
records: Object.freeze(records),
|
|
100
|
+
sourceReferences: Object.freeze(sourceReferences),
|
|
101
|
+
assets: Object.freeze(assets),
|
|
102
|
+
workspaceContext,
|
|
103
|
+
workspaceEntries: Object.freeze(workspaceEntries),
|
|
104
|
+
workspaceCandidates: Object.freeze(workspaceCandidates),
|
|
105
|
+
ignored: Object.freeze(ignored),
|
|
106
|
+
findings: Object.freeze(findings)
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export function buildExportPackageApplyResult(bundle = {}, input = {}) {
|
|
111
|
+
const importPlan = input.importPlan || buildExportPackageImportPlan(bundle, input);
|
|
112
|
+
const errors = importPlan.findings.filter((finding) => finding.severity === 'error').map(toAdapterFinding);
|
|
113
|
+
const warnings = importPlan.findings.filter((finding) => finding.severity === 'warning').map(toAdapterFinding);
|
|
114
|
+
const blocked = importPlan.status === 'blocked' && input.allowBlocked !== true;
|
|
115
|
+
const adapterResult = makeAdapterResult({
|
|
116
|
+
adapterId: EXPORT_PACKAGE_IMPORT_ADAPTER_ID,
|
|
117
|
+
sourceId: `package:${importPlan.packageId || 'unknown'}`,
|
|
118
|
+
records: blocked ? [] : importPlan.records,
|
|
119
|
+
assets: blocked ? [] : importPlan.assets,
|
|
120
|
+
workspaceEntries: blocked ? [] : importPlan.workspaceEntries,
|
|
121
|
+
errors,
|
|
122
|
+
warnings,
|
|
123
|
+
diagnostics: {
|
|
124
|
+
sourceBoundary: 'local-session-package-import',
|
|
125
|
+
packageId: importPlan.packageId || '',
|
|
126
|
+
sourceReferenceCount: importPlan.counts.sourceReferences,
|
|
127
|
+
workspaceContextCount: importPlan.counts.workspaceContext,
|
|
128
|
+
workspaceEntryCount: importPlan.counts.workspaceEntries,
|
|
129
|
+
workspaceCandidateCount: importPlan.counts.workspaceCandidates,
|
|
130
|
+
metadataOnlyAssetCount: importPlan.counts.metadataOnlyAssets,
|
|
131
|
+
noRemoteFetch: true,
|
|
132
|
+
noSourceMutation: true
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
return deepFreeze({
|
|
137
|
+
schema: EXPORT_PACKAGE_APPLY_RESULT_SCHEMA_ID,
|
|
138
|
+
packageId: importPlan.packageId || '',
|
|
139
|
+
status: importPlan.status,
|
|
140
|
+
boundary: 'Apply result is adapter-shaped for owned local records/assets/workspace entries only. Source references remain descriptors and are never converted into local leaves or guessed sources.',
|
|
141
|
+
importPlan,
|
|
142
|
+
adapterResult,
|
|
143
|
+
sourceReferences: importPlan.sourceReferences,
|
|
144
|
+
workspaceContext: importPlan.workspaceContext,
|
|
145
|
+
workspaceCandidates: importPlan.workspaceCandidates,
|
|
146
|
+
counts: Object.freeze({
|
|
147
|
+
records: adapterResult.records.length,
|
|
148
|
+
assets: adapterResult.assets.length,
|
|
149
|
+
workspaceEntries: adapterResult.workspaceEntries?.length || 0,
|
|
150
|
+
sourceReferences: importPlan.sourceReferences.length,
|
|
151
|
+
workspaceCandidates: importPlan.workspaceCandidates.length,
|
|
152
|
+
errors: errors.length,
|
|
153
|
+
warnings: warnings.length
|
|
154
|
+
})
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
function readControlFiles(files = []) {
|
|
159
|
+
const control = {};
|
|
160
|
+
for (const entry of EXPORT_PACKAGE_CONTROL_ROLES) {
|
|
161
|
+
const file = files.find((candidate) => String(candidate?.path || '') === entry.path);
|
|
162
|
+
control[entry.role] = file ? parseJsonFile(file) : null;
|
|
163
|
+
}
|
|
164
|
+
return control;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
function indexManifestEntries(manifest = {}) {
|
|
168
|
+
const index = new Map();
|
|
169
|
+
const material = manifest.material || {};
|
|
170
|
+
const entries = [
|
|
171
|
+
...(material.localDrafts || []),
|
|
172
|
+
...(material.sourceReferences || []),
|
|
173
|
+
...(material.assets || []),
|
|
174
|
+
...(material.workspaceContextCandidates || []),
|
|
175
|
+
...(material.blocked || []),
|
|
176
|
+
...(material.workspaceContext ? [material.workspaceContext] : [])
|
|
177
|
+
];
|
|
178
|
+
for (const entry of entries) {
|
|
179
|
+
const keys = [entry.id, entry.path, entry.packagePath, ...(Array.isArray(entry.packagePaths) ? entry.packagePaths : [])];
|
|
180
|
+
for (const key of keys) if (key) index.set(String(key), entry);
|
|
181
|
+
if (entry.id && material.workspaceContext === entry) index.set(`${entry.id}:markdown`, entry);
|
|
182
|
+
}
|
|
183
|
+
return index;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
function lookupManifestEntry(index, file = {}) {
|
|
187
|
+
for (const key of [file.entryId, file.path, stripKnownPackagePrefix(file.path || '')]) if (key && index.has(String(key))) return index.get(String(key));
|
|
188
|
+
return null;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
function recordFromArtifactFile(file = {}, entry = {}, findings = []) {
|
|
192
|
+
const markdown = typeof file.content === 'string' ? file.content : utf8Text(packageFileBytes(file));
|
|
193
|
+
const path = normalizeMaterialPath(entry?.path || stripKnownPackagePrefix(file.path || '') || file.path || 'artifact.md');
|
|
194
|
+
const record = createRecordFromMarkdown(markdown, { path, name: entry?.title || file.title || path, sourceMode: 'package-import' });
|
|
195
|
+
if (!markdown) findings.push(importFinding('error', 'export.package.import.artifact.content-missing', 'Artifact package entry had no Markdown content.', { path }));
|
|
196
|
+
return Object.assign({}, record, {
|
|
197
|
+
id: `package:local:${entry?.id || path}`,
|
|
198
|
+
path,
|
|
199
|
+
title: entry?.title || record.title,
|
|
200
|
+
sourceMode: 'package-import',
|
|
201
|
+
source: makePackageLocalSource(path),
|
|
202
|
+
packageEntryId: entry?.id || file.entryId || '',
|
|
203
|
+
packagePath: file.path || '',
|
|
204
|
+
packageImport: true
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
function sourceReferenceFromFile(file = {}, entry = {}, findings = [], materialKind = 'artifact') {
|
|
209
|
+
const parsed = parseJsonFile(file);
|
|
210
|
+
if (!parsed) {
|
|
211
|
+
findings.push(importFinding('error', 'export.package.import.source-reference.invalid-json', 'Source reference package entry could not be parsed.', { path: file.path || '' }));
|
|
212
|
+
return null;
|
|
213
|
+
}
|
|
214
|
+
const target = parsed.target || entry?.target || entry?.sourceReference || {};
|
|
215
|
+
const status = parsed.status || entry?.status || target.status || 'degraded-reference';
|
|
216
|
+
if (target.adapterId === 'github' && (!target.repo || (!target.path && !target.inputTarget) || !target.materializedCommit)) findings.push(importFinding('warning', 'export.package.import.source-reference.incomplete', 'GitHub source reference remains degraded because exact immutable source authority is incomplete.', { path: file.path || '', repo: target.repo || '' }));
|
|
217
|
+
if (target.adapterId !== 'github' && !target.inputTarget) findings.push(importFinding('warning', 'export.package.import.source-reference.incomplete', 'External source reference remains degraded because exact input target is unavailable.', { path: file.path || '' }));
|
|
218
|
+
return deepFreeze({
|
|
219
|
+
schema: 'tiinex.export.package.import.source-reference.v2',
|
|
220
|
+
materialKind,
|
|
221
|
+
id: parsed.id || entry?.id || file.entryId || file.path || '',
|
|
222
|
+
title: parsed.title || entry?.title || 'Source reference',
|
|
223
|
+
status,
|
|
224
|
+
boundary: parsed.boundary || entry?.boundary || 'Imported package source reference. It is not materialized as a local leaf.',
|
|
225
|
+
target: { ...target },
|
|
226
|
+
packagePath: file.path || ''
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
function assetFromContentFile(file = {}, entry = {}, findings = []) {
|
|
231
|
+
const path = normalizeMaterialPath(entry?.path || stripKnownPackagePrefix(file.path || '') || file.path || 'asset');
|
|
232
|
+
const data = packageFileBytes(file);
|
|
233
|
+
if (!data.byteLength) findings.push(importFinding('warning', 'export.package.import.asset.content-empty', 'Asset content entry was empty.', { path }));
|
|
234
|
+
const content = typeof file.content === 'string' ? file.content : (isTextMediaType(entry?.mediaType || file.mediaType) ? utf8Text(data) : '');
|
|
235
|
+
return deepFreeze({
|
|
236
|
+
schema: 'tiinex.local.asset.v1',
|
|
237
|
+
id: `asset:package:${entry?.id || path}`,
|
|
238
|
+
path,
|
|
239
|
+
name: fileName(path),
|
|
240
|
+
type: entry?.mediaType || file.mediaType || 'application/octet-stream',
|
|
241
|
+
size: data.byteLength,
|
|
242
|
+
bytes: data,
|
|
243
|
+
content,
|
|
244
|
+
dataUrl: '',
|
|
245
|
+
previewState: data.byteLength ? 'available' : 'metadata-only',
|
|
246
|
+
sourceMode: 'package-import-asset',
|
|
247
|
+
source: makePackageLocalSource(path),
|
|
248
|
+
packageEntryId: entry?.id || file.entryId || '',
|
|
249
|
+
packagePath: file.path || ''
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
function assetFromMetadataFile(file = {}, entry = {}, findings = []) {
|
|
254
|
+
const parsed = parseJsonFile(file) || {};
|
|
255
|
+
const path = normalizeMaterialPath(parsed.path || entry?.path || stripKnownPackagePrefix(file.path || '') || file.path || 'asset');
|
|
256
|
+
findings.push(importFinding('warning', 'export.package.import.asset.metadata-only', 'Local asset imported as metadata-only; content requires reselection.', { path }));
|
|
257
|
+
return deepFreeze({
|
|
258
|
+
schema: 'tiinex.local.asset.v1',
|
|
259
|
+
id: `asset:package:${parsed.id || entry?.id || path}`,
|
|
260
|
+
path,
|
|
261
|
+
name: parsed.title || fileName(path),
|
|
262
|
+
type: parsed.mediaType || entry?.mediaType || 'application/octet-stream',
|
|
263
|
+
size: Number(parsed.size || entry?.byteSize || 0),
|
|
264
|
+
content: '',
|
|
265
|
+
dataUrl: '',
|
|
266
|
+
previewState: 'metadata-only',
|
|
267
|
+
sourceMode: 'package-import-asset-metadata',
|
|
268
|
+
source: makePackageLocalSource(path),
|
|
269
|
+
packageEntryId: entry?.id || file.entryId || '',
|
|
270
|
+
packagePath: file.path || ''
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
function workspaceCandidateFromFile(file = {}, entry = {}, findings = []) {
|
|
275
|
+
const parsed = parseJsonFile(file) || {};
|
|
276
|
+
const path = normalizeMaterialPath(parsed.path || entry?.path || stripKnownPackagePrefix(file.path || '') || file.path || 'workspace.workspace.md');
|
|
277
|
+
findings.push(importFinding('info', 'export.package.import.workspace-candidate.descriptor-only', 'Compatibility workspace candidate imported as descriptor only; canonical workspace context is separate.', { path }));
|
|
278
|
+
return deepFreeze({
|
|
279
|
+
schema: 'tiinex.export.package.import.workspace-candidate.v1',
|
|
280
|
+
id: parsed.id || entry?.id || path,
|
|
281
|
+
title: parsed.title || entry?.title || fileName(path),
|
|
282
|
+
path,
|
|
283
|
+
status: parsed.status || entry?.status || 'open-or-merge-required',
|
|
284
|
+
boundary: parsed.boundary || entry?.boundary || 'Package workspace candidate descriptor; not opened/merged automatically.',
|
|
285
|
+
packagePath: file.path || ''
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
function workspaceEntryFromContext(context = {}, markdown = '') {
|
|
290
|
+
const workspaceImport = context.workspaceImport || {};
|
|
291
|
+
return deepFreeze({
|
|
292
|
+
schema: 'tiinex.workspace.import.v1',
|
|
293
|
+
path: workspaceImport.path || 'workspace.workspace.md',
|
|
294
|
+
title: context.title || context.name || 'Imported workspace',
|
|
295
|
+
markdown,
|
|
296
|
+
sourceMode: 'package-import-workspace-file',
|
|
297
|
+
boundary: 'Browser-local workspace context restored from exact handoff-package bytes; explicit workspace lifecycle still owns Open/Merge.'
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
function parseJsonFile(file = {}) {
|
|
302
|
+
try { return JSON.parse(utf8Text(packageFileBytes(file))); }
|
|
303
|
+
catch (_) { return null; }
|
|
304
|
+
}
|
|
305
|
+
function isControlFile(path = '') { return String(path || '').startsWith('tiinex.package/'); }
|
|
306
|
+
function stripKnownPackagePrefix(path = '') {
|
|
307
|
+
const clean = normalizePackagePath(path);
|
|
308
|
+
return clean.replace(/^artifacts\//, '').replace(/^assets\//, '').replace(/^sources\//, '').replace(/^metadata\//, '').replace(/^context\//, '').replace(/\.asset\.source\.json$/i, '').replace(/\.asset\.json$/i, '').replace(/\.source\.json$/i, '').replace(/\.json$/i, '');
|
|
309
|
+
}
|
|
310
|
+
function normalizePackagePath(path = '') {
|
|
311
|
+
const input = String(path || '').trim().replace(/\\/g, '/').replace(/^\/+/, '');
|
|
312
|
+
const parts = [];
|
|
313
|
+
for (const part of input.split('/')) {
|
|
314
|
+
const clean = part.trim();
|
|
315
|
+
if (!clean || clean === '.') continue;
|
|
316
|
+
if (clean === '..') continue;
|
|
317
|
+
parts.push(clean.replace(/[\u0000-\u001f<>:"|?*]/g, '_'));
|
|
318
|
+
}
|
|
319
|
+
return parts.join('/');
|
|
320
|
+
}
|
|
321
|
+
function normalizeMaterialPath(path = '') { return normalizePackagePath(path) || 'entry'; }
|
|
322
|
+
function fileName(path = '') { return String(path || '').split('/').filter(Boolean).pop() || 'entry'; }
|
|
323
|
+
function isTextMediaType(mediaType = '') { return /^text\//i.test(mediaType) || /(?:json|xml|javascript|markdown)/i.test(mediaType); }
|
|
324
|
+
function makePackageLocalSource(path = '') {
|
|
325
|
+
return Object.freeze({
|
|
326
|
+
kind: 'local-session',
|
|
327
|
+
adapterId: EXPORT_PACKAGE_IMPORT_ADAPTER_ID,
|
|
328
|
+
sourceKind: 'export.package.import',
|
|
329
|
+
label: 'package import',
|
|
330
|
+
boundary: 'Browser-local package import material; no GitHub provenance inferred.',
|
|
331
|
+
githubPolicy: 'not guessed',
|
|
332
|
+
sourceBacked: false,
|
|
333
|
+
writeCapability: 'session-local',
|
|
334
|
+
path
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
function toAdapterFinding(finding = {}) { return { code: finding.code || 'export.package.import.finding', message: finding.message || String(finding.code || 'Import finding'), ref: finding.path || finding.recordId || finding.assetId || '' }; }
|
|
338
|
+
function pickFindingExtra(item = {}) {
|
|
339
|
+
const out = {};
|
|
340
|
+
for (const key of ['path', 'kind', 'repo', 'recordId', 'assetId', 'packageId', 'entryId']) if (item[key] !== undefined && item[key] !== '') out[key] = item[key];
|
|
341
|
+
return out;
|
|
342
|
+
}
|
|
343
|
+
function importFinding(severity, code, message, extra = {}) { return Object.freeze(Object.assign({ severity, code, message }, extra)); }
|
|
344
|
+
function deepFreeze(value) {
|
|
345
|
+
if (!value || typeof value !== 'object' || Object.isFrozen(value)) return value;
|
|
346
|
+
if (ArrayBuffer.isView(value) || value instanceof ArrayBuffer) return value;
|
|
347
|
+
for (const item of Object.values(value)) deepFreeze(item);
|
|
348
|
+
return Object.freeze(value);
|
|
349
|
+
}
|